Message170550
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? |
|
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 | |
|