pygooglevoice
pygooglevoice copied to clipboard
AssertionError: Message ID not a SHA1 hash.
The code crashes in certain cases, on a normal google voice mailbox.
Message ID not a SHA1 hash
~pygooglevoice/examples # python voicemail.py
Traceback (most recent call last):
File "voicemail.py", line 6, in <module>
for message in voice.voicemail().messages:
File "/usr/lib/python2.7/site-packages/googlevoice/util.py", line 242, in messages
return [Message(self, *i) for i in self['messages'].items()]
File "/usr/lib/python2.7/site-packages/googlevoice/util.py", line 181, in __init__
assert is_sha1(id), 'Message id not a SHA1 hash'
AssertionError: Message id not a SHA1 hash
The examples which crash are:
download-mp3.pyfolders.pyvoicemail.py
Working example:
parse_sms.py , it's using BeautifulSoup to handle the html page processing, instead of simple regular expression text search.
I get this problem, too. I just commented out assert is_sha1(id), 'Message id not a SHA1 hash' (line 181 in util.py). Google changed the format of the IDs to things like this: "#PXQKZLLYITXJMRHUISINUKJPVZTGOVOTXVJISJWT_0" (which isn't even a SHA1 hash, as it's purely non-numeric).
This ticket is a duplicate of #4 and is now fixed in the master.