#3738 closed defect (fixed)

`tahoe cp` upload with Unicode name fails on Python 2

Reported by: itamarst Owned by: itamarst
Priority: normal Milestone: Support Python 3
Component: unknown Version: n/a
Keywords: Cc:
Launchpad Bug:

Description

$ tahoe cp ~/.tmux.conf tahoe:foo/mdash—→

This works on Python 3, fails on Python 2. In both cases the local tahoe run and the tahoe cp were done with Python 3 or 2, respectively, but all the nodes and introducers were on Python 3 in both cases.

This is Linux, LANG=en_US.UTF-8.

Change History (3)

comment:1 Changed at 2021-06-15T17:09:50Z by itamarst

The errors are somewhat interleaved, unfortunately, but looks like there were errors in both the web code _and_ tahoe cp:

/home/itamarst/Devel/tahoe-lafs/src/allmydata/scripts/runner.py:207: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal  if '--coverage' not in sys.argv:
2021-06-15T13:01:23-0400 [allmydata.webish.TahoeLAFSRequest#critical] 
        Traceback (most recent call last):
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/internet/base.py", line 913, in runUntilCurrent
            call.func(*call.args, **call.kw)
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib/python2.7/site-packages/foolscap/eventual.py", line 26, in _turn
            cb(*args, **kwargs)
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/internet/defer.py", line 460, in callback
            self._startRunCallbacks(result)
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib/python2.7/site-packages/eliot/twisted.py", line 96, in errbackWithContext
            return self._action.run(errback, *args, **kwargs)
          File "/home/itamarst/Devel/tahoe-lafs/venv27/lib/python2.7/site-packages/eliot/_action.py", line 467, in run
            return f(*args, **kwargs)
          File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/web/common.py", line 504, in _getChild_failed
            text, code = humanize_failure(reason)
          File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/web/common.py", line 411, in humanize_failure
            return humanize_exception(f.value)
          File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/web/common.py", line 328, in humanize_exception
            return ("No such child: %s" % quoted_name, http.NOT_FOUND)
        exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in range(128)

2021-06-15T13:01:23-0400 [twisted.python.log#info] web: 127.0.0.1 GET /uri/[CENSORED]?t=json 500 95
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 804, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 757, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
  File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/itamarst/Devel/tahoe-lafs/venv27/lib64/python2.7/site-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/scripts/cli.py", line 542, in cp
    rc = tahoe_cp.copy(options)
  File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 888, in copy
    return Copier().do_copy(options)
  File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 508, in do_copy
    status = self.try_copy()
  File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 527, in try_copy
    target = self.get_target_info(destination_spec)
  File "/home/itamarst/Devel/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 648, in get_target_info
    % quote_output(destination_spec), resp)
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 16: ordinal not in range(128)
Last edited at 2021-06-15T17:10:10Z by itamarst (previous) (diff)

comment:2 Changed at 2021-06-15T17:18:06Z by itamarst

Downloads appear to work.

comment:3 Changed at 2021-06-23T13:04:35Z by GitHub <noreply@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 83b4fb8/trunk:

Merge pull request #1085 from tahoe-lafs/3738.failing-unicode-upload-regression-python-2

Fix bug where uploading files with Unicode filenames failed on Python 2

Fixes ticket:3738

Note: See TracTickets for help on using tickets.