tahoe cp upload with Unicode name fails on Python 2 #3738

Closed
opened 2021-06-15 17:03:46 +00:00 by itamarst · 3 comments
itamarst commented 2021-06-15 17:03:46 +00:00
Owner
$ 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.

``` $ 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`.
tahoe-lafs added the
unknown
normal
defect
n/a
labels 2021-06-15 17:03:46 +00:00
tahoe-lafs added this to the Support Python 3 milestone 2021-06-15 17:03:46 +00:00
itamarst commented 2021-06-15 17:09:50 +00:00
Author
Owner

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)
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) ```
itamarst commented 2021-06-15 17:18:06 +00:00
Author
Owner

Downloads appear to work.

Downloads appear to work.
GitHub <noreply@github.com> commented 2021-06-23 13:04:35 +00:00
Author
Owner

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
In [83b4fb8/trunk](/tahoe-lafs/trac-2024-07-25/commit/83b4fb88f407421e4f68b1dbe1c293d386340f4f): ``` 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 ```
tahoe-lafs added the
fixed
label 2021-06-23 13:04:35 +00:00
GitHub <noreply@github.com> closed this issue 2021-06-23 13:04:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#3738
No description provided.