Message170550
| 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:16 | lars.gustaebel | set | recipients:
+ lars.gustaebel |
| 2012年09月16日 10:15:16 | lars.gustaebel | set | messageid: <1347790516.11.0.86834770042.issue15950@psf.upfronthosting.co.za> |
| 2012年09月16日 10:15:15 | lars.gustaebel | link | issue15950 messages |
| 2012年09月16日 10:15:15 | lars.gustaebel | create |
|