[Python-3000] close() on open(fd, closefd=False)

2008-10-31 Thread Christian Heimes
Amaury has found an issue with open and closefd, http://bugs.python.org/issue4233 The additional warnings aren't critical. But in retrospection I think that I made a small error during the design of the closefd feature. With a file descriptor number as first argument and closefd set to false,

Re: [Python-3000] close() on open(fd, closefd=False)

2008-10-31 Thread Benjamin Peterson
On Fri, Oct 31, 2008 at 4:50 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Amaury has found an issue with open and closefd, > http://bugs.python.org/issue4233 > > The additional warnings aren't critical. But in retrospection I think that I > made a small error during the design of the closefd f

Re: [Python-3000] close() on open(fd, closefd=False)

2008-10-31 Thread Victor Stinner
> Rightnow close() doesn't do anything and you can still write > or read after close(). This behavior is surprising to the user. > I like to change close() to set the internal fd attribute > to -1 (meaning close) but keep the fd open. Let take an example: --- passwd = open('/etc/