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 vstinner
Recipients Rosuav, pkt, python-dev, vstinner
Date 2015-09-11.10:45:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441968332.23.0.388393327585.issue24684@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, I fixed the bug in Python 2.7, 3.4, 3.5 and 3.6. (Python 2.7 was also impacted for custom *unicode* strings.)

Thanks for your bug report paul!

> ISTM this is a case where Python's core shouldn't be using assert. It's possible for userland code to trigger an assertion failure, which means it should be a regular if(..) raise.

Right, this check is implemented in PyUnicode_AsEncodedString(). Moreover, PyUnicode_AsEncodedString() calls directly the codec, it doesn't call the encode() method of the input string.

(Sorry, I wrote PyUnicode_AsEncodedObject() which has a different purpose.)

> @haypo, what do you mean by "fuzzing"?

This: https://en.wikipedia.org/wiki/Fuzz_testing
History
Date User Action Args
2015-09-11 10:45:32vstinnersetrecipients: + vstinner, python-dev, Rosuav, pkt
2015-09-11 10:45:32vstinnersetmessageid: <1441968332.23.0.388393327585.issue24684@psf.upfronthosting.co.za>
2015-09-11 10:45:32vstinnerlinkissue24684 messages
2015-09-11 10:45:31vstinnercreate