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

issue with unicode #12

Open
martinbarlow opened this issue Mar 2, 2015 · 1 comment
Open

issue with unicode #12

martinbarlow opened this issue Mar 2, 2015 · 1 comment

Comments

@martinbarlow
Copy link

Hi
Smugpy does not seem to handle unicode well. When i use str it passes the api, but it makes the rest of the code more difficult as i am not working with unicode characters directly.
Perhaps you cant accept unicode, or i am doing this wrong...

smugmug.albums_create arg Title=Dürrnberg(<type 'unicode'>), CategoryID=115028007(<type 'int'>)
Traceback (most recent call last):
  File "/home/mbarlow/bin/smugsync.py", line 224, in <module>
    smugmug.albums_create(Title=local_album_name, CategoryID=category)
  File "/usr/local/lib/python2.7/dist-packages/smugpy/__init__.py", line 190, in api_request
    oauth = self._get_oauth_request_params(url, all_args, "POST")
  File "/usr/local/lib/python2.7/dist-packages/smugpy/__init__.py", line 246, in _get_oauth_request_params
    signature = self._oauth_signature(method, url, args)
  File "/usr/local/lib/python2.7/dist-packages/smugpy/__init__.py", line 260, in _oauth_signature
    for k, v in sorted(parameters.items())))
  File "/usr/local/lib/python2.7/dist-packages/smugpy/__init__.py", line 260, in <genexpr>
    for k, v in sorted(parameters.items())))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)
@chrishoffman
Copy link
Owner

I have to write some tests to do some proper tests on unicode. I will do that and see what that shows me. Thanks for the report!

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

2 participants