This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lars.gustaebel
Recipients lars.gustaebel
Date 2012-09-16.10:15:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347790516.11.0.86834770042.issue15950@psf.upfronthosting.co.za>
In-reply-to
Content
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 my linux box. On windows I get an EBADF at least.

Wouldn't it be better if open() checked explicitly for a bool argument and raises a TypeError?
History
Date User Action Args
2012-09-16 10:15:16lars.gustaebelsetrecipients: + lars.gustaebel
2012-09-16 10:15:16lars.gustaebelsetmessageid: <1347790516.11.0.86834770042.issue15950@psf.upfronthosting.co.za>
2012-09-16 10:15:15lars.gustaebellinkissue15950 messages
2012-09-16 10:15:15lars.gustaebelcreate