[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

Christian Heimes report at bugs.python.org
Thu Oct 30 15:15:55 CET 2008


Christian Heimes <lists at cheimes.de> added the comment:

The new patch fixes the problem and adds a unit test, too.

The bug was caused by a design flaw -- which was partly my fault. Some
elements of the PyFileIOObject struct were initialized in __new__ while
other parts were initialized in __init__. I've moved the initialization
to __new__.

We should add a rule that all struct members must be properly
initialized in __new__. In the past Victor's fuzzying tool has revealed
several crashers related to similar design flaws.

I'm raising the severity of the bug to release blocker because I can't
predict if the problem can be abused to crash the interpreter. We should
also review all __new__ and __init__ methods of objects and extension
modules for similar issues.

----------
assignee:  -> barry
components: +Interpreter Core
nosy: +barry, haypo
priority: normal -> release blocker
type:  -> resource usage
versions: +Python 2.7
Added file: http://bugs.python.org/file11909/issue_4237.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4237>
_______________________________________


More information about the Python-bugs-list mailing list