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

Authentication and MD5 with non-ASCII characters #9

Closed
hugovk opened this issue Mar 1, 2014 · 1 comment
Closed

Authentication and MD5 with non-ASCII characters #9

hugovk opened this issue Mar 1, 2014 · 1 comment
Labels
bug Something isn't working imported Priority-Medium

Comments

@hugovk
Copy link
Member

hugovk commented Mar 1, 2014

From claud...@gmail.com on October 19, 2008 19:27:42

Please type example code that produces the issue: user = User('Zazhigalo4ka', API_KEY, API_SECRET, SESSION_KEY)
p = user.getPlaylistIDs()
pid = p[0]
playlist = Playlist('lastfm://playlist/%s' % pid, API_KEY, API_SECRET, SESSION_KEY)
tracks = playlist.fetch()
t1 = tracks[1]
t1.getTitle()
t1.getTags() What is the expected output? What do you see instead? I expect the title (which is printed) and the tags (which are not printed). The following error is
reported:

Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
pylast.py", line 514, in getTags
doc = Request(self, self.ws_prefix + '.getTags', self.api_key, params, True, self.secret).execute
()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
pylast.py", line 285, in execute
self.params['api_sig'] = self._getSignature()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
pylast.py", line 275, in _getSignature
hash.update(string)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 52-54: ordinal not in range
(128) What version of pyLast is this? pyLast-0.2b13 Please provide any additional information below. This happens both with Python 2.5 and Python 2.6, and I guess the problem is related to the
creation of the MD5 hash with a track that contains non-ASCII characters. The last.fm page http://www.last.fm/api/authspec reminds to "Ensure your parameters are utf8 encoded.", so the
problem might be there.

(Thanks again for this package, by the way!!)

Original issue: http://code.google.com/p/pylast/issues/detail?id=7

@hugovk
Copy link
Member Author

hugovk commented Mar 1, 2014

From amr.has...@gmail.com on October 19, 2008 15:51:01

Fixed in 0.2.14, available in svn.
Check out the new UserPlaylist class as well.

Thank you for taking the time to report this.

Status: Fixed

@hugovk hugovk closed this as completed Mar 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working imported Priority-Medium
Projects
None yet
Development

No branches or pull requests

1 participant