[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-25 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Indeed, there is no pure-Python FileIO: _pyio.py imports it from C:
from _io import FileIO

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-24 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I don’t know; Antoine is the io expert.  I just remember that io used to be in 
C and was moved to _pyio for documentation and experimentation purposes, so I 
was sure it was a fully standalone lib but I could be mistaken.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 981ad5254d07 by Hynek Schlawack in branch '2.7':
#10053: Don't close FDs when FileIO.__init__ fails
http://hg.python.org/cpython/rev/981ad5254d07

New changeset d042bd8625f3 by Hynek Schlawack in branch '3.2':
#10053: Don't close FDs when FileIO.__init__ fails
http://hg.python.org/cpython/rev/d042bd8625f3

New changeset 464cf523485e by Hynek Schlawack in branch 'default':
#10053: Don't close FDs when FileIO.__init__ fails
http://hg.python.org/cpython/rev/464cf523485e

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Should be fixed now.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Shouldn’t the fix be ported to _pyio?

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Hmmm, I thought Lib/_pyio.py actually uses Lib/_io/_fileio.c? At least I can't 
find the logic inside. There's no error handling at all.

It just uses the FileIO object in Lib/_pyio.py:189 which it seems to get from 
Lib/_pyio.py:585 which I presumed was from Lib/_io/_fileio.c.

What am I missing and how would I be supposed to port that?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-20 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

In the test, assertNone is superfluous. Just call os.close().
However, you should probably use assertRaises to check that MyException is 
raised.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-09 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Anyone?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-05-30 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-05-29 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I think this issue is still valid. However, I’d favor the attached (simpler) 
patch that keeps track whether self-fd is our own (i.e. a result of an open() 
operation) or from outside.

A couple of notes:

 - I'm not sure why your test skipped if the Exception wasn't raised, I'd say 
that's a valid test fail.
 - The fd has been closed explicitly when seeking for append mode failed, so I 
removed it.
 - I'm not convinced it's worth/sensible to be back ported as it's a change in 
behavior.

Tests succeed on OS X  Linux.

Opinions? Win32 tests results?

--
type:  - behavior
Added file: http://bugs.python.org/file25753/fileio-do-not-close-on-fail.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-05-26 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +hynek
versions: +Python 3.3 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10053
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com