Message285644
Python3 open(), read(), or write()doesn't check argument type before action causing a hang. Would like to catch exceptions but not without an exception to return. See below.
Python3.6:
Python 3.6.0 (default, Dec 24 2016, 08:01:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> test = False
>>> with open(str(test)) as f:
... fail = f.read()
...
python2.7:
╰─λ python2 0 < 09:35:31
Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> test = False
>>> with open(test) as f:
... fail = f.read()
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: coercing to Unicode: need string or buffer, bool found |
|
Date |
User |
Action |
Args |
2017-01-17 14:43:36 | Mo Ali | set | recipients:
+ Mo Ali |
2017-01-17 14:43:36 | Mo Ali | set | messageid: <1484664216.19.0.300485907535.issue29297@psf.upfronthosting.co.za> |
2017-01-17 14:43:36 | Mo Ali | link | issue29297 messages |
2017-01-17 14:43:35 | Mo Ali | create | |
|