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

UnicodeEncodeError: 'ascii' codec can't encode character '\u011f' #382

Closed
ovizii opened this issue Nov 7, 2015 · 8 comments
Closed

UnicodeEncodeError: 'ascii' codec can't encode character '\u011f' #382

ovizii opened this issue Nov 7, 2015 · 8 comments
Milestone

Comments

@ovizii
Copy link

ovizii commented Nov 7, 2015

Hi there,

I am taking my first baby steps. I installed borg on 2 different debian machines, both running Jessie.
Made a backup from one to the other.
tried restoring the backup on the target machine.

root@alfred:~/borg extract /root/stratobckp/::07.11.2015
Warning: File system encoding is "ascii", extracting non-ascii filenames will not be supported.
borg: Error: Local Exception.
Traceback (most recent call last):
  File "/vagrant/borg/borg/borg/archiver.py", line 1030, in main
  File "/vagrant/borg/borg/borg/archiver.py", line 986, in run
  File "/vagrant/borg/borg/borg/archiver.py", line 283, in do_extract
  File "/vagrant/borg/borg/borg/archive.py", line 312, in extract_item
UnicodeEncodeError: 'ascii' codec can't encode character '\u011f' in position 34: ordinal not in range(128)
borg: Exiting with failure status due to previous errors

File system encoding is "ascii", extracting non-ascii filenames will not be supported
*Now what? *

any pointers please?

@ThomasWaldmann
Copy link
Member

if sys.getfilesystemencoding() == 'ascii':
            logger.warning('Warning: File system encoding is "ascii", extracting non-ascii filenames will not be supported.')

This is the code. I haven't seen the warning yet on my machines / test setups.

https://docs.python.org/3/library/sys.html#sys.getfilesystemencoding

    CODESET (LC_CTYPE)
              Return a string with the name of the character encoding used
              in the selected locale, such as "UTF-8", "ISO-8859-1", or
              "ANSI_X3.4-1968" (better known as US-ASCII).  This is the same
              string that you get with "locale charmap".  For a list of
              character encoding names, try "locale -m", cf. locale(1).

@ovizii
Copy link
Author

ovizii commented Nov 7, 2015

sorry, I'm not a coder. just wanted to report it.
will do further tests, this was jsut a silly test, backing up from A => B then trying to restore on B

@ThomasWaldmann
Copy link
Member

Guess the short version of that is "your locale setup is wrong".

@ThomasWaldmann
Copy link
Member

Can you try if that helps?:

LANG=en_US.UTF-8

@ovizii
Copy link
Author

ovizii commented Nov 7, 2015

ah, yes, that is fixed then.
I had meanwhile realized my locales where misconfigured and fixed them.
didn't realize these 2 issues were connected.

Thanks!

@ovizii ovizii closed this as completed Nov 7, 2015
@ThomasWaldmann
Copy link
Member

guess I'll either put that into faq or improve that not-that-much-helping error msg.

@ThomasWaldmann
Copy link
Member

5595d56

Hah, you found a missing exception handler! :)

@ovizii
Copy link
Author

ovizii commented Nov 8, 2015

:-) trust me to do that. I'm excellent at finding the most obscure constellations, its like Murphy is my middle name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants