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 ncoghlan
Recipients larry, ncoghlan, pitrou, serhiy.storchaka, vstinner
Date 2014-01-27.12:29:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390825757.7.0.260021011732.issue20404@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch checks the requested encoding is a valid text encoding in TextIOWrapper.__init__.

Two additional test changes were needed:

- the one that checks handling of non-text-encodings at runtime now tweaks quopri to lie about being a text encoding when creating the stream

- the one that checks the interpreter doesn't crash at shutdown needed to be adjusted to handle the fact that _pyio now also fails in that situation, but with a different error (it can't find the ascii codec because the codec machinery is mostly gone)

Currently, this adds a third lookup of the encoding name to the process of creating a TextIOWrapper instance. This could be reduced to just one by changing the retrieval of the encoder and decoder to look in the retrieved codec info tuple, rather than doing the lookup by name again.
History
Date User Action Args
2014-01-27 12:29:17ncoghlansetrecipients: + ncoghlan, pitrou, vstinner, larry, serhiy.storchaka
2014-01-27 12:29:17ncoghlansetmessageid: <1390825757.7.0.260021011732.issue20404@psf.upfronthosting.co.za>
2014-01-27 12:29:17ncoghlanlinkissue20404 messages
2014-01-27 12:29:17ncoghlancreate