Message243328
Catching TypeError or AttributeError on len() is a hack, but it is compatible with Python 3 and older code. We could handle this in issue23740.
Changing TemporaryFile would solve this issue, but only for TemporaryFile. len() raises AttributeError for other file-like classic classes. So I committed slightly modified Atsuo's patch (extended test as Victor suggested).
As for converting classic classes to new-style classes, see for example issue14399. It is not so harmless, as expected, unfortunately. But perhaps it was done multiple times in bug-fix releases. |
|
Date |
User |
Action |
Args |
2015-05-16 16:07:44 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ishimoto, orsenthil, vstinner, tim.golden, r.david.murray, python-dev, Ramchandra Apte, martin.panter, tzs, lemanyk1, demian.brecht |
2015-05-16 16:07:44 | serhiy.storchaka | set | messageid: <1431792464.83.0.353325592508.issue15267@psf.upfronthosting.co.za> |
2015-05-16 16:07:44 | serhiy.storchaka | link | issue15267 messages |
2015-05-16 16:07:44 | serhiy.storchaka | create | |
|