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

Error message downloading from flickr #44

Open
susanLBcanada opened this issue Mar 17, 2014 · 1 comment
Open

Error message downloading from flickr #44

susanLBcanada opened this issue Mar 17, 2014 · 1 comment

Comments

@susanLBcanada
Copy link

tag: Easter
sort: interesting
'ascii' codec can't encode character u'\xf3' in position 28: ordinal not in range(128)
on the 7th image

tag: saint, patricks
sort: interesting
'ascii' codec can't encode character u'\u2667' in position 21: ordinal not in range(128)

with the following from terminal
...Snip
url = http://api.flickr.com/services/rest/?api_key=045379bc5368502f749af23d95a17c83&photo_id=13199372033&method=flickr.photos.getSizes
Thread done
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/webilder/progress_dialog.py", line 48, in newfunc
func(self, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/webilder/DownloadDialog.py", line 51, in run
raise exc
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2667' in position 21: ordinal not in range(128)

made from source directions on your site on Debian: Jessy

Hopefully it isn't a problem to give you headaches!
Susan

@Corin-EU
Copy link

This problem of not being able to encode Unicode characters in image file names is still present in the latest Webilder 0.7.3

Traceback (most recent call last):
File "/usr/local/bin/webilder_downloader", line 9, in
load_entry_point('Webilder==0.7.3', 'console_scripts', 'webilder_downloader')()
File "/usr/local/lib/python2.7/dist-packages/webilder/downloader.py", line 195, in main
download_all(notify)
File "/usr/local/lib/python2.7/dist-packages/webilder/downloader.py", line 154, in download_all
filter_photos(config, photos)
File "/usr/local/lib/python2.7/dist-packages/webilder/downloader.py", line 66, in filter_photos
print _("Skipping already existing photo '%s'") % photo['title']
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 74: ordinal not in range(128)

If you do not intend to add Unicode support for file names, why not just convert any character which is out of range to a string of characters eg for u'\u2667', make it the six ASCII characters Xu266X and for u'\xfc' make it the six ASCII charactters XuxfcX where X could be X or underline or dash.

Although the filenames would look strange, at least it would not break the download.

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