Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue29337

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:BytesWarning at compile time
Type:behaviorStage:resolved
Components:Interpreter CoreVersions:Python 3.7, Python 3.6, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: brett.cannon, methane, python-dev, serhiy.storchaka, vstinner
Priority:normalKeywords:patch

Created on2017-01-21 07:09 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
constant-key-bytes-warning.patchserhiy.storchaka,2017-01-21 08:06review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (6)
msg285940 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)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)*(Python committer)Date: 2017-01-21 08:06
Proposed patch fixes the issue.
msg286107 -(view)Author: Brett Cannon (brett.cannon)*(Python committer)Date: 2017-01-23 19:03
LGTM
msg286150 -(view)Author: Inada Naoki (methane)*(Python committer)Date: 2017-01-24 08:21
LGTM
msg286205 -(view)Author: Roundup Robot (python-dev)(Python triager)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)*(Python committer)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
DateUserActionArgs
2022-04-11 14:58:42adminsetgithub: 73523
2017-03-31 16:36:17dstufftsetpull_requests: +pull_request915
2017-01-24 19:34:00vstinnersetmessages: +msg286208
2017-01-24 18:55:22serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-01-24 18:54:49python-devsetnosy: +python-dev
messages: +msg286205
2017-01-24 08:21:07methanesetmessages: +msg286150
2017-01-23 19:03:43brett.cannonsetnosy: +brett.cannon
messages: +msg286107
2017-01-21 08:06:43serhiy.storchakasetfiles: +constant-key-bytes-warning.patch
keywords: +patch
messages: +msg285943

stage: patch review
2017-01-21 07:09:46serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp