Message226914
IMO test_codecs_fix1.patch is still needed.
Review of Nick's change:
+ interp = PyThreadState_GET()->interp;
+ if (interp->codec_search_path == NULL) {
+ return -1;
+ }
I don't think that this line raises an exception. You should use an assertion here (or raises an exception, but it would be overkill).
+ encodings._cache.pop(self.codec_name, None)
+ try:
+ _forget_codec(self.codec_name)
+ except KeyError:
+ pass
You may move these lines to a private encoding._forget() function.
By the way, codecs._forget() should maybe catch and ignore KeyError?
> _TEST_CODECS.pop(self.codec_name, None)
This line may be moved to set_codec() using self.addCleanup(). (Well, it's not directly related to your change.) |
|
Date |
User |
Action |
Args |
2014-09-15 13:19:10 | vstinner | set | recipients:
+ vstinner, lemburg, brett.cannon, ncoghlan, pitrou, python-dev, zach.ware, serhiy.storchaka |
2014-09-15 13:19:10 | vstinner | set | messageid: <1410787150.57.0.644026653048.issue22166@psf.upfronthosting.co.za> |
2014-09-15 13:19:10 | vstinner | link | issue22166 messages |
2014-09-15 13:19:10 | vstinner | create | |
|