[tahoe-dev] [tahoe-lafs] #565: unicode arguments on the command-line

tahoe-lafs trac at allmydata.org
Sun Dec 6 20:57:53 PST 2009


#565: unicode arguments on the command-line
-------------------------------+--------------------------------------------
 Reporter:  zooko              |           Owner:           
     Type:  defect             |          Status:  new      
 Priority:  major              |       Milestone:  undecided
Component:  code-frontend-cli  |         Version:  1.2.0    
 Keywords:  unicode windows    |   Launchpad_bug:           
-------------------------------+--------------------------------------------
Changes (by davidsarah):

  * keywords:  unicode => unicode windows


Comment:

 [Windows-only]

 http://bugs.python.org/issue2128 suggests that on Python 2.6.x for
 Windows, any non-ASCII characters will have been irretrievably mangled to
 question-marks in {{{sys.argv}}}. Unfortunately
 {{{win32api.GetCommandLine}}} seems to call {{{GetCommandLineA}}}, not
 {{{GetCommandLineW}}}. The bzr project solved this problem by using
 {{{ctypes}}} to call {{{GetCommandLineW}}}:
 https://bugs.launchpad.net/bzr/+bug/375934 . (bzr is GPL'd, so we can use
 that code.)

 Note that this would require passing the correct unicode argv into
 {{{twisted.python.usage.Options.parseOptions}}} from
 source:src/allmydata/scripts/runner.py , i.e. change
 source:windows/tahoe.py to do
 {{{
 argv = get_cmdline_unicode()  # from bzr patch
 rc = runner(argv[1:], install_node_control=False)
 sys.exit(rc)
 }}}

 (assuming that {{{twisted.python.usage.Options}}} handles Unicode
 correctly, which I haven't tested).

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/565#comment:2>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list