New submission from Jeffrey Finkelstein <jeffrey.finkelst...@gmail.com>:

Currently imghdr.what() accepts two parameters. The first is a file or filename 
and the second is a byte stream. If the second is not None, the first is 
ignored. This is clunky. It would be simpler to accept just one argument, which 
can be either an open file or a byte stream.

I have attached a patch which implements this one argument approach as private 
function imghdr_what(). I have left imghdr.what() as a wrapper around this new 
function for backwards compatibility (in the hopes that it will eventually be 
replaced).

In addition, there did not seem to be any tests for the imghdr module, so I 
added a few simple tests.

----------
components: Library (Lib)
files: imghdr.patch
keywords: patch
messages: 139993
nosy: jfinkels
priority: normal
severity: normal
status: open
title: imghdr.what should take one argument
type: feature request
versions: Python 3.4
Added file: http://bugs.python.org/file22608/imghdr.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12516>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to