[issue19997] imghdr.what doesn't accept bytes paths

Vajrasky Kok report at bugs.python.org
Tue Dec 17 03:17:19 CET 2013


Vajrasky Kok added the comment:

Why limit to str and bytes. Open can accept integer as well. I am asking not suggesting.

>>> with open('/tmp/cutecat.txt', 'wb') as f:
...   f.write(b'cutecat')
... 
7
>>> a = open('/tmp/cutecat.txt')
>>> a.fileno()
3
>>> b = open(3)
>>> b.read()
'cutecat'

----------
nosy: +vajrasky

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


More information about the Python-bugs-list mailing list