[issue15972] wrong error message for os.path.getsize

STINNER Victor report at bugs.python.org
Thu Sep 20 14:08:18 CEST 2012


STINNER Victor added the comment:

It looks like os.stat() and os.path.getsize() converts the list into a byte string. It does something like:

>>> x=[]; y=bytes(x); print(y.decode("ascii"))

>>> x=[65, 66, 67]; y=bytes(x); print(y.decode("ascii"))
ABC
>>> x=[None]; y=bytes(x); print(y.decode("ascii"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object cannot be interpreted as an integer

----------
nosy: +haypo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15972>
_______________________________________


More information about the Python-bugs-list mailing list