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

STINNER Victor report at bugs.python.org
Wed Dec 18 16:40:05 CET 2013


STINNER Victor added the comment:

imghdr_bytes.patch should use os.fsencode() to encode the filename, not filename.encode().

(You may use a valid sound file of the Python suite test instead of generating an invalid sounf file.)

imghdr_files.patch looks overkill. I don't think that it's useful to support integer file descriptor. Being able to pass an open file is enough. imghdr_bytes.patch is fine.

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

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


More information about the Python-bugs-list mailing list