Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. image_file = StringIO(open("test.gif",'rb').read())
  2. imghdr.what(image_file.getvalue())
  3.  
  4. print imghdr.what(image_file.getvalue())
  5. File "/usr/lib/python2.7/imghdr.py", line 12, in what
  6. f = open(file, 'rb')
  7. TypeError: file() argument 1 must be encoded string without NULL bytes, not str
  8.  
  9. print imghdr.what(image_file.getvalue())
  10.  
  11. print imghdr.what(None, image_file.getvalue())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement