| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
* calling it with non-ASCII string format will now raise a ValueError instead of UnicodeEncodeError * calling it with non-ASCII bytes format will now raise a UnicodeDecodeError instead of struct.error * getting the format attribute of uninitialized object will now raise an AttributeError instead of RuntimeError.
There was a problem hiding this comment.
If we change exceptions, I would prefer a ValueError than an UnicodeDecodeError.
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for your review, @vstinner.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Raising ValueError if the format is invalid makes more sense than UnicodeEncodeError or struct.error.
Replacing RuntimeError with AttributeError is more surprising, but I'm fine with AttributeError.
If a project is impacted by this change, it's possible to become compatible with old and new Python versions by catching old and new exceptions. For example, except (UnicodeEncodeError, ValueError):. But I don't expect any project to catch exceptions since they're not supposed to pass invalid format string anyway :-)
Sorry, something went wrong.
|
CIFuzz found a bug, and it seems related to the changes! To download the testcase, see https://github.com/python/cpython/actions/runs/23007198595/artifacts/5892860339. |
Sorry, something went wrong.
|
Oh, it is just incompatible with these changes, since they add a ValueError to the list of possible exceptions. Can you please update: cpython/Modules/_xxtestfuzz/fuzzer.c Line 136 in d4cc553 |
Sorry, something went wrong.
|
Thank you, @StanFromIreland. It is difficult to read the fuzzer output, I suspected that this is some random unrelated failure. |
Sorry, something went wrong.
…nto struct-format
There was a problem hiding this comment.
Fuzzer changes LGTM
Sorry, something went wrong.
|
The 3 "Tests / CIFuzz / cpython3" jobs are back to green, good :-) |
Sorry, something went wrong.
…ythonGH-145851) * calling it with non-ASCII string format will now raise a ValueError instead of UnicodeEncodeError * calling it with non-ASCII bytes format will now raise a ValueError instead of struct.error * getting the format attribute of uninitialized object will now raise an AttributeError instead of RuntimeError.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.