UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
Issue #19
wontfix
Using the pyrescene.py script, fails whne trying to add the attached file.
Traceback (most recent call last):
File "/usr/local/bin/pyrescene.py", line 1039, in <module>
sys.exit(main())
File "/usr/local/bin/pyrescene.py", line 965, in main
result = generate_srr(release_dir, working_dir, options)
File "/usr/local/bin/pyrescene.py", line 691, in generate_srr
rescene.add_stored_files(srr, copied_files, working_dir, True, False)
File "/usr/local/lib/python2.7/dist-packages/rescene/main.py", line 277, in add_stored_files
_store(f, tmpfile, save_paths, in_folder)
File "/usr/local/lib/python2.7/dist-packages/rescene/main.py", line 1354, in _store
_fire(MsgCode.STORING, message="Storing file: %s" % file_name)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 5: ordinal not in range(128)
Comments (3)
-
-
repo owner - changed status to wontfix
It will work with Python 3 and won't be an issue for people still using Python 2 in the future.
-
repo owner - changed version to 0.5
- Log in to comment
For what it’s worth, these ASCII decoding issues do not happen in Python 3. My code in Pull Request #8 does not have this issue, nor Issue
#22(as long as you run it with Python 3).This particular issue is caused by os.walk() returning undecoded byte strings in pyrescene.get_files(). You might be able to fix it by decoding the strings using sys.getfilesystemencoding(), but I suspect similar issues would just crop up in other places. It might be easier to just use Python 3 instead :P