This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Oren Milman
Recipients Oren Milman
Date 2017-09-24.06:53:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506236021.0.0.982819081718.issue31566@psf.upfronthosting.co.za>
In-reply-to
Content
The following code causes an assertion failure:
__name__ = b'foo'
__file__ = None
import _warnings
_warnings.warn('bar')

This is because setup_context() (in Python/_warnings.c) assumes that __name__
is a string, and so it passes it to _PyUnicode_EqualToASCIIString(), which
asserts it is a string.
History
Date User Action Args
2017-09-24 06:53:41Oren Milmansetrecipients: + Oren Milman
2017-09-24 06:53:40Oren Milmansetmessageid: <1506236021.0.0.982819081718.issue31566@psf.upfronthosting.co.za>
2017-09-24 06:53:40Oren Milmanlinkissue31566 messages
2017-09-24 06:53:40Oren Milmancreate