librelist archives

« back to archive

UnicodeEncodeError in archiver.py line 42

UnicodeEncodeError in archiver.py line 42

From:
Date:
2014-02-25 @ 07:31
Hello again,

just a little one - it's probably due to settings on my side, but just to 
be sure - i just got this during testing:

I was running attic with sudo so LANG should be set to C or unset.

Traceback (most recent call last):
  File "/home/hel/tmp/attictest/bin/attic", line 5, in <module>
    pkg_resources.run_script('Attic==0.10', 'attic')
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py",

line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py",

line 1236, in run_script
    exec(compile(open(script_filename).read(), script_filename, 'exec'), 
namespace, namespace)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/EGG-INFO/scripts/attic",

line 3, in <module>
    main()
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 479, in main
    exit_code = archiver.run(sys.argv[1:])
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 473, in run
    return args.func(args)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 104, in do_create
    self._process(archive, cache, args.excludes, skip_inodes, path, 
restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 150, in _process
    os.path.join(path, filename), restrict_dev)
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 135, in _process
    self.print_verbose(remove_surrogates(path))
  File 

"/home/hel/tmp/attictest/lib/python3.2/site-packages/Attic-0.10-py3.2-linux-x86_64.egg/attic/archiver.py",

line 42, in print_verbose
    print(msg)

Re: [attic] UnicodeEncodeError in archiver.py line 42

From:
Jonas Borgström
Date:
2014-02-25 @ 11:41
On 2014-02-25 08:31 , heiko.helmle@horiba.com wrote:
> Hello again,
> 
> just a little one - it's probably due to settings on my side, but just
> to be sure - i just got this during testing:
> 
> I was running attic with sudo so LANG should be set to C or unset.

That's a bug. We can't assume the stdout encoding is not less
restrictive than the filesystem encoding.
I've just pushed a change to address this.

Thanks!

/ Jonas