[issue6361] I/O object wrappers shouldn't close their underlying file when deleted.

2010-08-05 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

OK I am convinced, the current behavior is fine. Let's close this one.

--
resolution:  -> wont fix
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue6361] I/O object wrappers shouldn't close their underlying file when deleted.

2009-06-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

You can call the detach() method if you don't want to the underlying
stream to be closed.
We could also add a close_parent attribute defaulting to True.

--
components: +IO
nosy: +benjamin.peterson, pitrou
type: behavior -> feature request

___
Python tracker 

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



[issue6361] I/O object wrappers shouldn't close their underlying file when deleted.

2009-06-28 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti :

Here's an example of the behaviour:

import io

def test(buf):
   textio = io.TextIOWrapper(buf)

buf = io.BytesIO()
test(buf)
print(buf.closed)  # This prints True currently


The problem here is TextIOWrapper closes its buffer when deleted.
BufferedRWPair behalves similarly. The solution is simply to override
the __del__ method of TextIOWrapper inherited from IOBase.

--
messages: 89803
nosy: alexandre.vassalotti
priority: normal
severity: normal
stage: needs patch
status: open
title: I/O object wrappers shouldn't close their underlying file when deleted.
type: behavior
versions: Python 3.2

___
Python tracker 

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