mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
Back out Windows-specific Unicode argument support for v1.7.
This commit is contained in:
parent
59b493f6d3
commit
32d9deace3
@ -27,7 +27,7 @@ if __name__ == "__main__":
|
||||
print " platform = '%s'" % sys.platform
|
||||
print " filesystem_encoding = '%s'" % sys.getfilesystemencoding()
|
||||
print " output_encoding = '%s'" % sys.stdout.encoding
|
||||
print " argv_encoding = '%s'" % (sys.platform == "win32" and 'utf-8' or sys.stdout.encoding)
|
||||
print " argv_encoding = '%s'" % (sys.platform == "win32" and 'ascii' or sys.stdout.encoding)
|
||||
|
||||
try:
|
||||
tmpdir = tempfile.mkdtemp()
|
||||
@ -272,31 +272,28 @@ class UbuntuKarmicLatin1(StringUtils, unittest.TestCase):
|
||||
class WindowsXP(StringUtils, unittest.TestCase):
|
||||
uname = 'Windows XP 5.1.2600 x86 x86 Family 15 Model 75 Step ping 2, AuthenticAMD'
|
||||
output = 'lumi\x8are'
|
||||
argv = 'lumi\xc3\xa8re'
|
||||
platform = 'win32'
|
||||
filesystem_encoding = 'mbcs'
|
||||
output_encoding = 'cp850'
|
||||
argv_encoding = 'utf-8'
|
||||
argv_encoding = 'ascii'
|
||||
dirlist = [u'Blah blah.txt', u'test_file', u'\xc4rtonwall.mp3']
|
||||
|
||||
class WindowsXP_UTF8(StringUtils, unittest.TestCase):
|
||||
uname = 'Windows XP 5.1.2600 x86 x86 Family 15 Model 75 Step ping 2, AuthenticAMD'
|
||||
output = 'lumi\xc3\xa8re'
|
||||
argv = 'lumi\xc3\xa8re'
|
||||
platform = 'win32'
|
||||
filesystem_encoding = 'mbcs'
|
||||
output_encoding = 'cp65001'
|
||||
argv_encoding = 'utf-8'
|
||||
argv_encoding = 'ascii'
|
||||
dirlist = [u'Blah blah.txt', u'test_file', u'\xc4rtonwall.mp3']
|
||||
|
||||
class WindowsVista(StringUtils, unittest.TestCase):
|
||||
uname = 'Windows Vista 6.0.6000 x86 x86 Family 6 Model 15 Stepping 11, GenuineIntel'
|
||||
output = 'lumi\x8are'
|
||||
argv = 'lumi\xc3\xa8re'
|
||||
platform = 'win32'
|
||||
filesystem_encoding = 'mbcs'
|
||||
output_encoding = 'cp850'
|
||||
argv_encoding = 'utf-8'
|
||||
argv_encoding = 'ascii'
|
||||
dirlist = [u'Blah blah.txt', u'test_file', u'\xc4rtonwall.mp3']
|
||||
|
||||
class MacOSXLeopard(StringUtils, unittest.TestCase):
|
||||
|
@ -41,8 +41,8 @@ def _reload():
|
||||
filesystem_encoding = _canonical_encoding(sys.getfilesystemencoding())
|
||||
output_encoding = _canonical_encoding(sys.stdout.encoding or locale.getpreferredencoding())
|
||||
if sys.platform == 'win32':
|
||||
# arguments are converted to utf-8 in windows/tahoe.py
|
||||
argv_encoding = 'utf-8'
|
||||
# Unicode arguments are not supported on Windows yet; see #565 and #1074.
|
||||
argv_encoding = 'ascii'
|
||||
else:
|
||||
argv_encoding = output_encoding
|
||||
is_unicode_platform = sys.platform in ["win32", "darwin"]
|
||||
|
@ -4,16 +4,6 @@ import depends # import dependencies so that py2exe finds them
|
||||
_junk = depends # appease pyflakes
|
||||
|
||||
import sys
|
||||
from ctypes import WINFUNCTYPE, POINTER, byref, c_wchar_p, c_int, windll
|
||||
from allmydata.scripts import runner
|
||||
|
||||
GetCommandLineW = WINFUNCTYPE(c_wchar_p)(("GetCommandLineW", windll.kernel32))
|
||||
CommandLineToArgvW = WINFUNCTYPE(POINTER(c_wchar_p), c_wchar_p, POINTER(c_int)) \
|
||||
(("CommandLineToArgvW", windll.shell32))
|
||||
|
||||
argc = c_int(0)
|
||||
argv = CommandLineToArgvW(GetCommandLineW(), byref(argc))
|
||||
argv_utf8 = [argv[i].encode('utf-8') for i in xrange(1, argc.value)]
|
||||
|
||||
rc = runner(argv_utf8, install_node_control=False)
|
||||
sys.exit(rc)
|
||||
sys.exit(runner(install_node_control=False))
|
Loading…
x
Reference in New Issue
Block a user