Re: open(False) in python3

2010-05-12 Thread Terry Reedy
On 5/12/2010 7:07 PM, Jan Kaliszewski wrote: Terry Reedy dixit (2010-05-12, 14:26): On 5/12/2010 1:26 PM, Giampaolo Rodolà wrote: 2010/5/12 Gabriel Genellina: open() in Python 3 does a lot of things; it's like a mix of codecs.open() + builtin open() + os.fdopen() from 2.x all merged together.

Re: open(False) in python3

2010-05-12 Thread Jan Kaliszewski
Terry Reedy dixit (2010-05-12, 14:26): > On 5/12/2010 1:26 PM, Giampaolo Rodolà wrote: > >2010/5/12 Gabriel Genellina: > >>open() in Python 3 does a lot of things; it's like a mix of codecs.open() + > >>builtin open() + os.fdopen() from 2.x all merged together. It does different > >>things dependi

Re: open(False) in python3

2010-05-12 Thread Martin v. Loewis
geremy condra wrote: > On Wed, May 12, 2010 at 1:36 AM, Stefan Behnel wrote: >> Johan Förberg, 12.05.2010 10:05: >>> On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: >>> so open(False) is the same as open(0), and 0 is the file descriptor associated to standard input. The prog

Re: open(False) in python3

2010-05-12 Thread Dave Angel
Giampaolo Rodolà wrote: 2010/5/12 Gabriel Genellina : open() in Python 3 does a lot of things; it's like a mix of codecs.open() + builtin open() + os.fdopen() from 2.x all merged together. It does different things depending on the type and quantity of its arguments, and even returns objects

Re: open(False) in python3

2010-05-12 Thread Terry Reedy
On 5/12/2010 1:26 PM, Giampaolo Rodolà wrote: 2010/5/12 Gabriel Genellina: open() in Python 3 does a lot of things; it's like a mix of codecs.open() + builtin open() + os.fdopen() from 2.x all merged together. It does different things depending on the type and quantity of its arguments, and even

Re: open(False) in python3

2010-05-12 Thread Kushal Kumaran
On Wed, May 12, 2010 at 10:56 PM, Giampaolo Rodolà wrote: > 2010/5/12 Gabriel Genellina : >> open() in Python 3 does a lot of things; it's like a mix of codecs.open() + >> builtin open() + os.fdopen() from 2.x all merged together. It does different >> things depending on the type and quantity of i

Re: open(False) in python3

2010-05-12 Thread Giampaolo Rodolà
2010/5/12 Gabriel Genellina : > open() in Python 3 does a lot of things; it's like a mix of codecs.open() + > builtin open() + os.fdopen() from 2.x all merged together. It does different > things depending on the type and quantity of its arguments, and even returns > objects of different types. > >

Re: open(False) in python3

2010-05-12 Thread geremy condra
On Wed, May 12, 2010 at 1:36 AM, Stefan Behnel wrote: > Johan Förberg, 12.05.2010 10:05: >> >> On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: >> >>> so open(False) is the same as open(0), and 0 is the file descriptor >>> associated to standard input. The program isn't hung, it's just

Re: open(False) in python3

2010-05-12 Thread Christian Heimes
Johan Förberg every: That's interesting. Are there any more numbered pseudofiles? I suppose its mainly an excellent way to confuse people when you open(0).read(), but it would be interesting to know. All opened files (and on Unix even network sockets, epoll queues, inotify handlers etc) have a

Re: open(False) in python3

2010-05-12 Thread Stefan Behnel
Johan Förberg, 12.05.2010 10:05: On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: so open(False) is the same as open(0), and 0 is the file descriptor associated to standard input. The program isn't hung, it's just waiting for you to type some text That's interesting. Are there any

Re: open(False) in python3

2010-05-12 Thread Johan Förberg
On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: > so open(False) is the same as open(0), and 0 is the file descriptor > associated to standard input. The program isn't hung, it's just waiting > for you to type some text That's interesting. Are there any more numbered pseudofiles? I s

Re: open(False) in python3

2010-05-11 Thread Gabriel Genellina
En Tue, 11 May 2010 18:40:36 -0300, geremy condra escribió: I'm unsure if this qualifies as a bug (it is also clearly user error) but I just ran into a situation where open() was inadvertantly called on a False, and I was somewhat surprised to see that this didn't bail horribly, but rather

open(False) in python3

2010-05-11 Thread geremy condra
I'm unsure if this qualifies as a bug (it is also clearly user error) but I just ran into a situation where open() was inadvertantly called on a False, and I was somewhat surprised to see that this didn't bail horribly, but rather hung forever. Here's some example sessions for python3.x and python2