Message209438
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. |
|
Date |
User |
Action |
Args |
2014-01-27 12:29:17 | ncoghlan | set | recipients:
+ ncoghlan, pitrou, vstinner, larry, serhiy.storchaka |
2014-01-27 12:29:17 | ncoghlan | set | messageid: <1390825757.7.0.260021011732.issue20404@psf.upfronthosting.co.za> |
2014-01-27 12:29:17 | ncoghlan | link | issue20404 messages |
2014-01-27 12:29:17 | ncoghlan | create | |
|