STINNER Victor victor.stin...@haypocalc.com added the comment:
This issue has been fixed in py3k, release30-maint and trunk. I think
that 2.6.x doesn't need this API change, so I prefer to close this
issue. Reopen the issue if I'm wrong.
--
status: open - closed
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Backported to trunk in r67307.
But -- do we really want to backport to 2.6? This changes the semantics
of closefd, adds a new closefd attribute...
Did the rules change for 2.6.1?
___
Python tracker
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Can this change be backported to 2.6 and 2.7?
r67106 says that it Changed semantic of close() on file objects with
closefd=False.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
Christian Heimes [EMAIL PROTECTED] added the comment:
Yes, it should. I've lefted the bug open for this very reason.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
___
Barry A. Warsaw [EMAIL PROTECTED] added the comment:
Small typo, conveyed to Crys_ in irc.
--
nosy: +barry
resolution: - accepted
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
___
Christian Heimes [EMAIL PROTECTED] added the comment:
Applied in r67106 (py3k)
The patch must be backported to 2.6 and 2.7.
--
assignee: - christian.heimes
resolution: accepted - fixed
type: - behavior
___
Python tracker [EMAIL PROTECTED]
Changes by Christian Heimes [EMAIL PROTECTED]:
--
priority: release blocker - high
versions: +Python 2.6, Python 2.7 -Python 3.0
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
___
Christian Heimes [EMAIL PROTECTED] added the comment:
Here is a new patch with doc and NEWS updates.
Added file: http://bugs.python.org/file11944/fileio_closefd4.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
Christian Heimes [EMAIL PROTECTED] added the comment:
I don't see a good 'n easy way to fix the issue. close() is called in
too many places and I don't wanna add more checks in Python code.
This patch reduces the mass of warnings to one, but it also changes the
semantic of close() a bit.
STINNER Victor [EMAIL PROTECTED] added the comment:
@christian: Your patch doesn't work: if close() if called twice, the
file is really closed :-/
Here is a new patch:
- _FileIO.close() sets self-fd to -1 but don't show a warning anymore
because the operation is valid: it does really close
STINNER Victor [EMAIL PROTECTED] added the comment:
christian just told me that my svn repos was old. Here is an updated
version of my patch. I now use io.open() instead of io.BufferedReader()
in the tests.
Added file: http://bugs.python.org/file11922/fileio_closefd-2.patch
Changes by STINNER Victor [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11921/fileio_closefd.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
___
Christian Heimes [EMAIL PROTECTED] added the comment:
Another patch based on Victor's patch. It adds some additional tests and
exposes the internal attribute closefd.
Added file: http://bugs.python.org/file11923/fileio_closefd3.patch
___
Python tracker
New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]:
This happens with a recent py3k build:
x = open(0, closefd=False)
del x
C:\dev\python\py3k\lib\io.py:1461: RuntimeWarning: Trying to close
unclosable fd!
self.buffer.close()
C:\dev\python\py3k\lib\io.py:389: RuntimeWarning: Trying
14 matches
Mail list logo