This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jfinkels
Recipients jfinkels
Date 2011-07-07.19:56:44
SpamBayes Score 0.00022428397
Marked as misclassified No
Message-id <1310068606.02.0.0739859897948.issue12516@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-07-07 19:56:46jfinkelssetrecipients: + jfinkels
2011-07-07 19:56:46jfinkelssetmessageid: <1310068606.02.0.0739859897948.issue12516@psf.upfronthosting.co.za>
2011-07-07 19:56:45jfinkelslinkissue12516 messages
2011-07-07 19:56:45jfinkelscreate