New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemError in bytes.__rmod__ #70951
Comments
>>> [] % b''
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: Objects/bytesobject.c:2975: bad argument to internal function Proposed patch fixes bytes.__rmod__ and tests for bytes formatting. |
bytes_rmod.patch LGTM (maybe just a minor PEP-7 issue, see my review). |
Surprisingly the implementation in 3.5 is correct. But backporting tests exposed behavior change in bytearray formatting in 3.6. In 3.5 bytearray.__mod__ returns bytearray, in 3.6 it returns bytes. Is this intentional? |
New changeset ebece99c0bb6 by Serhiy Storchaka in branch 'default': New changeset 8dee0c09b46e by Serhiy Storchaka in branch '3.5': |
Buildbots are unhappy. ====================================================================== Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_bytes.py", line 507, in test_imod
self.assertIs(type(b), bytes)
AssertionError: <class 'bytearray'> is not <class 'bytes'> ====================================================================== Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_bytes.py", line 495, in test_mod
self.assertIs(type(a), bytes)
AssertionError: <class 'bytearray'> is not <class 'bytes'> |
There is a bug in bytearray formatting. See bpo-26766. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: