elodie icon indicating copy to clipboard operation
elodie copied to clipboard

Eastern European locations unicode cause a crash.

Open Prosatanos opened this issue 8 years ago • 8 comments

Some locations cause the following crash.

Traceback (most recent call last): File "./elodie.py", line 345, in main() File "C:\Python27\lib\site-packages\click\core.py", line 716, in call return self.main(*args, **kwargs) File "C:\Python27\lib\site-packages\click\core.py", line 696, in main rv = self.invoke(ctx) File "C:\Python27\lib\site-packages\click\core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Python27\lib\site-packages\click\core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Python27\lib\site-packages\click\core.py", line 534, in invoke return callback(*args, **kwargs) File "./elodie.py", line 115, in _import trash, allow_duplicates) File "./elodie.py", line 66, in import_file print('%s -> %s' % (_file, dest_path)) UnicodeEncodeError: 'ascii' codec can't encode character u'\u015b' in position 88: ordinal not in range(128)

Location.json

[{"lat": 49.7838611111111, "name": {"default": "Przemy\u015bl", "city": "Przemy\u015bl", "state": "podkarpackie", "country": "Polska"}, "long": 22.7677916666667}]

Prosatanos avatar Feb 23 '18 11:02 Prosatanos

Thanks for reporting. Could you email the photo to jaisen (at) github username (dot) come?

jmathai avatar Feb 24 '18 08:02 jmathai

Sent! Thanks for all the help.

Prosatanos avatar Feb 24 '18 09:02 Prosatanos

Hi, I have the same bug - cant process pictures - getting the same error message as OP.

Traceback (most recent call last): File "./elodie.py", line 345, in main() File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in call return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "./elodie.py", line 115, in _import trash, allow_duplicates) File "./elodie.py", line 64, in import_file media, allowDuplicate=allow_duplicates, move=False) File "/root/elodie/elodie/filesystem.py", line 376, in process_file self.create_directory(dest_directory) File "/root/elodie/elodie/filesystem.py", line 45, in create_directory if os.path.exists(directory_path): File "/usr/lib/python2.7/genericpath.py", line 26, in exists os.stat(path) UnicodeEncodeError: 'ascii' codec can't encode character u'\u0144' in position 32: ordinal not in range(128)

Can You help please! kind regards, Piotr

PiotrEsse avatar Aug 28 '18 07:08 PiotrEsse

I get the same error except in the end it's like that return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 34-38: character maps to

ghost avatar Sep 01 '18 19:09 ghost

Had the same problem with Python 2.7 on Win 10. Switching to Python 3.6 environment solved it.

Looks like the problem is on line 63 of elodie.py, FILESYSTEM.process_file, when it creates the dest_path with unicode characters.

the-lay avatar Oct 20 '18 16:10 the-lay

Had the same problem with Python 2.7 on Win 10. Switching to Python 3.6 environment solved it.

Looks like the problem is on line 63 of elodie.py, FILESYSTEM.process_file, when it creates the dest_path with unicode characters.

Could you please share how you switched to Python 3.6? Installing it does not seem to be enough. I tried to run it on a system without Python2 and create a symlink but it wont run.

LaurensBot avatar Nov 10 '19 17:11 LaurensBot

Could you please share how you switched to Python 3.6?

I've meant that I've downloaded elodie and ran it with a separate python3 installation, instead of running it with python2.

Installing it does not seem to be enough. I tried to run it on a system without Python2 and create a symlink but it wont run.

What is the error you are getting? Did you do pip3 install -r requirements.txt on the cloned repository before running it?

the-lay avatar Nov 10 '19 23:11 the-lay

Thanks @the-lay

Another thing I had to do was change "python" in the Elodie.py to "python3" and works fine.

LaurensBot avatar Nov 11 '19 20:11 LaurensBot