[Patches] [ python-Patches-1231336 ] Add unicode for sys.argv, os.environ, os.system

SourceForge.net noreply at sourceforge.net
Tue Jul 5 06:27:31 CEST 2005


Patches item #1231336, was opened at 2005-07-02 11:55
Message generated for change (Comment added) made by nyamatongwe
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1231336&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Modules
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Neil Hodgson (nyamatongwe)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add unicode for sys.argv, os.environ, os.system

Initial Comment:
Most installations of Windows (2000, XP) are unicode
native with narrow character APIs only providing a
distorted view of the system. Python does not currently
provide access to some basic features through wide
character calls and so may see distorted values. This
patch adds unicode compatibility for sys.argv,
os.environ, and os.system. os.system accepts a unicode
argument in the same way as described in PEP 277 for
file APIs. For sys.argv and os.environ, new parallel
unicode attributes sys.argvu and os.environu are added
as it would cause too many problems to use unicode
values for the existing attributes or to use unicode
only for non-ASCII values. The features are only
enabled on unicode native versions of Windows.
The three features are demonstrated at
http://www.scintilla.org/pyunicode.png
The patch contains some documentation additions for
sys.argvu and os.environu. 
There are no test cases as test cases involving running
extra processes can be messy and fail for uninteresting
reasons.

----------------------------------------------------------------------

>Comment By: Neil Hodgson (nyamatongwe)
Date: 2005-07-05 14:27

Message:
Logged In: YES 
user_id=12579

Added a description to diff file.

----------------------------------------------------------------------

Comment By: Neil Hodgson (nyamatongwe)
Date: 2005-07-05 14:25

Message:
Logged In: YES 
user_id=12579

There are problems in sys.argvu as the current argument
processing code removes some option arguments where these
are processed by python. This can be almost fixed by storing
the argc last elements into sys.argvu. However, when using
[-c command], the command is removed from sys.argv as this
allows the Python code to determine that it is either
running with a command line command ("-c") or the name of
the file.
Attached patch fixes these problems.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1231336&group_id=5470


More information about the Patches mailing list