Fix missing f-string prefix in msh2obj texcoord error message#3302
Open
Nas01010101 wants to merge 1 commit into
Open
Fix missing f-string prefix in msh2obj texcoord error message#3302Nas01010101 wants to merge 1 commit into
msh2obj texcoord error message#3302Nas01010101 wants to merge 1 commit into
Conversation
The texcoord-count check in `Msh.create` spans two string literals, but only
the first has an `f` prefix, so the second emits the literal `2*{ntexcoord}`
instead of the expected count: `texcoords: 2 != 2*{ntexcoord}.` rather than
`texcoords: 2 != 2*5.`. The sibling vertex, normal, and face messages
interpolate correctly; only this one was missed.
Add the `f` prefix, and a regression test that feeds a `.msh` with a mismatched
texcoord count; it fails before this change and passes after.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
msh2obj.py, the texcoord-count validation inMsh.createspans two string literals, but only the first has anfprefix:So the message emits the literal text
2*{ntexcoord}instead of the expected count, e.g.:rather than the intended
... != 2*5.. The siblingvertices,normals, andfacesmessages interpolate correctly; only this one was missed.Fix
Add the
fprefix to the continuation literal.Tests
Adds
test_texcoord_size_mismatch_error_reports_expected_count, which feeds a.mshdeclaringntexcoord=5but only 2 texcoord floats and asserts the error reports the computed count (2 != 2*5.). It fails before this change (the message contains the literal{ntexcoord}) and passes after; the rest ofmsh2obj_test.pyremains green.