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

2008-10-30 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Merged into the release26 branch, too. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> __

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

2008-10-30 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Fixed in r67051 (py3k), r67052 (trunk) -- assignee: barry -> christian.heimes resolution: -> accepted versions: -Python 2.7, Python 3.0 ___ Python tracker <[EMAIL PROTECTED]>

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

2008-10-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: The patch looks fine to me ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs

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

2008-10-30 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> 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

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

2008-10-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: 'rt' is a valid mode for open() or io.open(). But io.FileIO is the unbuffered raw binary file... Python 2.6 has exactly the same problem and displays the same RuntimeWarning. Christian, the change you propose does not fix another case:

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

2008-10-29 Thread David W. Lambert
David W. Lambert <[EMAIL PROTECTED]> added the comment: >>> print(io.read.__doc__) ... The default mode is 'rt' (open for reading text). ... ___ Python tracker <[EMAIL PROTECTED]> _

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

2008-10-29 Thread David W. Lambert
Changes by David W. Lambert <[EMAIL PROTECTED]>: -- nosy: +LambertDW ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mai

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

2008-10-29 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: I propose to move self->closefd closer to the top of the function: Index: Modules/_fileio.c === --- Modules/_fileio.c (Revision 67040) +++ Modules/_fileio.c (Arbeitskopie)

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

2008-10-29 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Verified. The issue should be easy to fix. I wonder why 'rt' is an invalid mode. Python 2.x supports 'rt'. -- nosy: +christian.heimes priority: -> normal ___ Python tracker <[EMAIL PROTECTED]>

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

2008-10-29 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc <[EMAIL PROTECTED]>: >>> import io >>> io.FileIO('foo', 'rt') __main__:1: RuntimeWarning: Trying to close unclosable fd! Traceback (most recent call last): File "", line 1, in ValueError: invalid mode: rt The ValueError is expected, but the warning is