mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-20 17:52:50 +00:00
Address review comments.
This commit is contained in:
parent
3c8e18f0fc
commit
2eba96de61
@ -1,6 +1,7 @@
|
||||
# coding: utf-8
|
||||
|
||||
from __future__ import print_function
|
||||
from six import ensure_str
|
||||
|
||||
import os, sys, textwrap
|
||||
import codecs
|
||||
@ -286,7 +287,5 @@ def escape_path(path):
|
||||
"""
|
||||
segments = path.split("/")
|
||||
result = "/".join([urllib.parse.quote(unicode_to_url(s)) for s in segments])
|
||||
# fixme: test.cli.test_create_alias fails if it gets Unicode on Python 2
|
||||
if PY2 and isinstance(result, type(u'')):
|
||||
result = result.encode('ascii')
|
||||
result = ensure_str(result, "ascii")
|
||||
return result
|
||||
|
@ -174,8 +174,9 @@ def _maybe_enable_eliot_logging(options, reactor):
|
||||
return options
|
||||
|
||||
def run():
|
||||
if not six.PY2:
|
||||
warnings.warn("Support for Python 3 is experimental. Use at your own risk.")
|
||||
if six.PY3:
|
||||
warnings.warn("Support for Python 3 is an incomplete work-in-progress."
|
||||
" Use at your own risk.")
|
||||
|
||||
if sys.platform == "win32":
|
||||
from allmydata.windows.fixups import initialize
|
||||
|
@ -12,6 +12,9 @@ from __future__ import unicode_literals
|
||||
from future.utils import PY2
|
||||
if PY2:
|
||||
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
||||
|
||||
from six import ensure_text
|
||||
|
||||
import os.path, re, sys
|
||||
from os import linesep
|
||||
|
||||
@ -19,8 +22,6 @@ from eliot import (
|
||||
log_call,
|
||||
)
|
||||
|
||||
import six
|
||||
|
||||
from twisted.trial import unittest
|
||||
|
||||
from twisted.internet import reactor
|
||||
@ -83,9 +84,7 @@ def run_bintahoe(extra_argv, python_options=None):
|
||||
:return: A three-tuple of stdout (unicode), stderr (unicode), and the
|
||||
child process "returncode" (int).
|
||||
"""
|
||||
# fixme: below, 'unicode_to_argv' is called so ensure that
|
||||
# executable is unicode to support that expectation.
|
||||
executable = sys.executable.decode('utf-8') if six.PY2 else sys.executable
|
||||
executable = ensure_text(sys.executable)
|
||||
argv = [executable]
|
||||
if python_options is not None:
|
||||
argv.extend(python_options)
|
||||
|
Loading…
x
Reference in New Issue
Block a user