[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2912: UnicodeEncodeError in test_client.Basic.test_absolute_storage_dir on linux when LANG= is not set

Tahoe-LAFS trac at tahoe-lafs.org
Wed Mar 28 18:07:57 UTC 2018


#2912: UnicodeEncodeError in test_client.Basic.test_absolute_storage_dir on linux
when LANG= is not set
--------------------+------------------------
 Reporter:  warner  |          Owner:
     Type:  defect  |         Status:  new
 Priority:  normal  |      Milestone:  1.13.0
Component:  code    |        Version:  1.12.1
 Keywords:          |  Launchpad Bug:
--------------------+------------------------
 In 1f92879 we got a new test,
 `test_client.Basic.test_absolute_storage_dir`, which exercises the new
 `[storage] storage_dir=` control in tahoe.cfg . Apparently this fails on
 linux systems where LANG= is not set (usually it's set to something like
 `en_US.UTF-8`), which makes one of the system encodings to be "ascii"
 instead of "utf-8", which is causing a !UnicodeEncodeError inside an
 `os.makedirs()` call in the test:

 {{{
 [ERROR]
 Traceback (most recent call last):
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/test/test_client.py",
 line 330, in test_absolute_storage_dir
     expected_path,
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/test/test_client.py",
 line 270, in _storage_dir_test
     c = client.create_client(basedir)
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/client.py", line 163,
 in create_client
     basedir=basedir
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/client.py", line 202,
 in __init__
     self.init_storage()
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/client.py", line 401,
 in init_storage
     expiration_sharetypes=expiration_sharetypes)
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/storage/server.py",
 line 55, in __init__
     fileutil.make_dirs(sharedir)
   File "/home/warner/stuff/tahoe/tahoe/src/allmydata/util/fileutil.py",
 line 183, in make_dirs
     os.makedirs(dirname, mode)
   File "/home/warner/stuff/tahoe/tahoe/.tox/py27/lib/python2.7/os.py",
 line 148, in makedirs
     if head and tail and not path.exists(head):
   File
 "/home/warner/stuff/tahoe/tahoe/.tox/py27/lib/python2.7/genericpath.py",
 line 26, in exists
     os.stat(path)
 exceptions.UnicodeEncodeError: 'ascii' codec can't encode character
 u'\u2603' in position 91: ordinal not in range(128)

 allmydata.test.test_client.Basic.test_absolute_storage_dir
 }}}

 This is affecting a couple of the buildbot builders (Centos 7, Fedora 24,
 and Slackware).

 We might want to add an additional Travis test, with `LANG=`, to try and
 catch this on pull-requests (since the buildbot currently only runs after-
 the-fact on trunk).

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2912>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list