When I try to list my galleries, which contain non standard 'ascii' characters (german umlauts: äöüß and so on) I get the following message:
Traceback (most recent call last):
File "/usr/local/bin/sm_photo_tool.py", line 746, in <module>
main()
File "/usr/local/bin/sm_photo_tool.py", line 734, in main
listgalleries(Options(argv[3:]))
File "/usr/local/bin/sm_photo_tool.py", line 709, in listgalleries
smugmug.list_galleries(opts, rest)
File "/usr/local/bin/sm_photo_tool.py", line 376, in list_galleries
message(opts, "%9d: %s\n" % (alb['id'], alb['Title']))
File "/usr/local/bin/sm_photo_tool.py", line 77, in message
stdout.write(string)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)
I can change the line 77 to
stdout.write(string.encode("utf-8"))
and it works, but the character is still not displayed in the correct way, like "ä" for "ä" (terminal encoding is utf-8). Maybe there is already before a conversion problem.
I'm running Ubuntu 8.10 amd64.
Best,
André
I get the same error. In my case, my galleries have Chinese characters in their name.
Traceback (most recent call last):
File "/usr/bin/sm-photo-tool", line 746, in <module>
main()
File "/usr/bin/sm-photo-tool", line 734, in main
listgalleries(Options(argv[3:]))
File "/usr/bin/sm-photo-tool", line 709, in listgalleries
smugmug.list_galleries(opts, rest)
File "/usr/bin/sm-photo-tool", line 376, in list_galleries
message(opts, "%9d: %s\n" % (alb['id'], alb['Title']))
File "/usr/bin/sm-photo-tool", line 77, in message
stdout.write(string)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-39: ordinal not in range(128)
David Fong