
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-01-21 07:09 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| constant-key-bytes-warning.patch | serhiy.storchaka,2017-01-21 08:06 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft,2017-03-31 16:36 | |
| Messages (6) | |||
|---|---|---|---|
| msg285940 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-01-21 07:09 | |
BytesWarning can be raised during compilation.$ ./python -Wa -b -c "lambda: 'a'; lambda: b'a'"sys:1: BytesWarning: Comparison between bytes and stringsys:1: BytesWarning: Comparison between bytes and stringsys:1: BytesWarning: Comparison between bytes and stringsys:1: BytesWarning: Comparison between bytes and string_PyCode_ConstantKey() should produce keys that don't allow comparing bytes with strings nested in tuples or frozensets. Currently it returns (tuple, ('a',), ((str, 'a'),)) for ('a',) and (tuple, (b'a',), ((bytes, b'a'),)) for (b'a',). Key tuples have the same size and the same first element. Comparing second elements emits a BytesWarning. | |||
| msg285943 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-01-21 08:06 | |
Proposed patch fixes the issue. | |||
| msg286107 -(view) | Author: Brett Cannon (brett.cannon)*![]() | Date: 2017-01-23 19:03 | |
LGTM | |||
| msg286150 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2017-01-24 08:21 | |
LGTM | |||
| msg286205 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2017-01-24 18:54 | |
New changeset2bd2ef1696cf by Serhiy Storchaka in branch '3.5':Issue#29337: Fixed possible BytesWarning when compare the code objects.https://hg.python.org/cpython/rev/2bd2ef1696cfNew changesetf6c327f2daa6 by Serhiy Storchaka in branch '3.6':Issue#29337: Fixed possible BytesWarning when compare the code objects.https://hg.python.org/cpython/rev/f6c327f2daa6New changeset00fb30d4905d by Serhiy Storchaka in branch 'default':Issue#29337: Fixed possible BytesWarning when compare the code objects.https://hg.python.org/cpython/rev/00fb30d4905d | |||
| msg286208 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-01-24 19:34 | |
I'm surprised that removing the type from the key works. Since tests pass,it's ok for me :-)I'm happy that I spent time to write these tests, I'm now more confidentwhen this code is modified. Serhiy asked me to write these tests if Irecall correctly ;-) | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:42 | admin | set | github: 73523 |
| 2017-03-31 16:36:17 | dstufft | set | pull_requests: +pull_request915 |
| 2017-01-24 19:34:00 | vstinner | set | messages: +msg286208 |
| 2017-01-24 18:55:22 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-01-24 18:54:49 | python-dev | set | nosy: +python-dev messages: +msg286205 |
| 2017-01-24 08:21:07 | methane | set | messages: +msg286150 |
| 2017-01-23 19:03:43 | brett.cannon | set | nosy: +brett.cannon messages: +msg286107 |
| 2017-01-21 08:06:43 | serhiy.storchaka | set | files: +constant-key-bytes-warning.patch keywords: +patch messages: +msg285943 stage: patch review |
| 2017-01-21 07:09:46 | serhiy.storchaka | create | |