Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 decoding error parsing protobuf #36

Open
niallsmart opened this issue Mar 28, 2013 · 3 comments
Open

UTF-8 decoding error parsing protobuf #36

niallsmart opened this issue Mar 28, 2013 · 3 comments

Comments

@niallsmart
Copy link
Contributor

I've started to see UTF-8 decoding exceptions being thrown by the google protobuf library when parsing Spotify responses:

Example stack trace below:

  File "../spotify_web/spotify.py", line 249, in parse_metadata
    header.ParseFromString(base64.decodestring(resp[0]))
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/google/protobuf/message.py", line 179, in ParseFromString
    self.MergeFromString(serialized)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 755, in MergeFromString
    if self._InternalParse(serialized, 0, length) != length:
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 782, in InternalParse
    pos = field_decoder(buffer, new_pos, end, self, field_dict)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/google/protobuf/internal/decoder.py", line 410, in DecodeField
    field_dict[key] = local_unicode(buffer[pos:new_pos], 'utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8d in position 13: invalid start byte
@Hexxeh
Copy link
Owner

Hexxeh commented Mar 28, 2013

This should now be fixed, please confirm.

@niallsmart
Copy link
Contributor Author

Yep, that fixed it – though I am now seeing an error on process exit, not sure if this is related:

Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 505, in run
  File "/home/pi/local/lib/python2.7/site-packages/SpotifyWebsocketAPI-0.2-py2.7.egg/spotify_web/spotify.py", line 740, in heartbeat_handler
  File "/home/pi/local/lib/python2.7/site-packages/SpotifyWebsocketAPI-0.2-py2.7.egg/spotify_web/spotify.py", line 594, in heartbeat
  File "/home/pi/local/lib/python2.7/site-packages/SpotifyWebsocketAPI-0.2-py2.7.egg/spotify_web/spotify.py", line 643, in send_command
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

@adammw
Copy link

adammw commented Jun 19, 2013

FYI, I think the Reply to a MercuryRequest is also another MercuryRequest. Updating to the latest MercuryRequest format and using it for decoding replies works for me with node-spotify-web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants