Decoding PNG DataURL urlopen vs base64decode

495 Views Asked by At

I have PNG image coded to DataURL representation. It starts regularly:
u'data:image/png;base64,... but it has no == ending. base64.b64decode raises TypeError: Incorrect padding, but urllib.urlopen returns proper value - an image which successfully opens by image viewer.
Here is that encoded string:
http://www.sendspace.com/file/8l61im

Its difficult to formulate actual question here - I just wonder what is the reason of that issue - is it particular buggy string, and urlopen just has more 'tolerant' algorithm, or something else? Kindly help!

upd
Tried urlsafe_b64decode - and with it I got:
TypeError: character mapping must return integer, None or unicode

0

There are 0 best solutions below