[issue15950] open() should not accept bool argument

2012-09-17 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15950 ___ ___ Python-bugs-list mailing list

[issue15950] open() should not accept bool argument

2012-09-16 Thread Lars Gustäbel
New submission from Lars Gustäbel: Today I accidentally did this: open(True).read() Passing True as a file argument to open() does not fail, because a bool value is treated like an integer file descriptor (stdout in this case). Even worse is that the read() call hangs in an endless loop on

[issue15950] open() should not accept bool argument

2012-09-16 Thread R. David Murray
R. David Murray added the comment: I don't think so. We don't try to protect people from all their mistakes, and a file descriptor of 1 is valid, and True == 1. -- nosy: +r.david.murray resolution: - wont fix stage: - committed/rejected status: open - closed