[ python-Bugs-1759845 ] subprocess.call fails with unicode strings in command line
Bugs item #1759845, was opened at 2007-07-25 04:24
Message generated for change (Comment added) made by brotch
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1759845&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: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matt (mclausch)
Assigned to: Nobody/Anonymous (nobody)
Summary: subprocess.call fails with unicode strings in command line
Initial Comment:
On Windows, subprocess.call() fails with an exception if either the executable
or any of the arguments contain upper level characters. See below:
>>> cmd = [ u'test_\xc5_exec.bat', u'arg1', u'arg2' ]
>>> subprocess.call(cmd)
Traceback (most recent call last):
File "", line 1, in
File "C:\Python25\lib\subprocess.py", line 443, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python25\lib\subprocess.py", line 593, in __init__
errread, errwrite)
File "C:\Python25\lib\subprocess.py", line 815, in _execute_child
startupinfo)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc5' in position 5:
ordinal not in range(128)
--
Comment By: brotchie (brotch)
Date: 2007-08-05 18:36
Message:
Logged In: YES
user_id=1860608
Originator: NO
Python's default character coding is 'ascii' which can't convert unicode >
127 into chars.
Forcing the unicode string to encode as 'iso-8859-1'
eg.
subprocess.call(cmd.encode('iso-8859-1'))
resolves the problem and runs the correct command.
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1759845&group_id=5470
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1767933 ] Badly formed XML using etree and utf-16
Bugs item #1767933, was opened at 2007-08-05 18:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1767933&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: Windows
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: BugoK (bugok)
Assigned to: Nobody/Anonymous (nobody)
Summary: Badly formed XML using etree and utf-16
Initial Comment:
Hello,
The bug occurs when writing an XML file using the UTF-16 encoding.
The problem is that the etree encodes every string to utf-16 by itself -
meaning, inserting the 0xfffe BOM before every string (tag, text, attribute
name, etc.), causing a badly formed utf=16 strings.
A possible solution, which was offered by a co-worker of mine, was to use a
utf-16 writer (from codecs.getwriter('utf-16') to write the file.
Best,
BugoK.
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1767933&group_id=5470
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1767933 ] Badly formed XML using etree and utf-16
Bugs item #1767933, was opened at 2007-08-05 18:01
Message generated for change (Settings changed) made by bugok
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1767933&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: XML
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: BugoK (bugok)
Assigned to: Nobody/Anonymous (nobody)
Summary: Badly formed XML using etree and utf-16
Initial Comment:
Hello,
The bug occurs when writing an XML file using the UTF-16 encoding.
The problem is that the etree encodes every string to utf-16 by itself -
meaning, inserting the 0xfffe BOM before every string (tag, text, attribute
name, etc.), causing a badly formed utf=16 strings.
A possible solution, which was offered by a co-worker of mine, was to use a
utf-16 writer (from codecs.getwriter('utf-16') to write the file.
Best,
BugoK.
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1767933&group_id=5470
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1768121 ] Byte code WITH_CLEANUP missing, MAKE_CLOSURE wrong
Bugs item #1768121, was opened at 2007-08-05 22:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1768121&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: Documentation Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: L. Peter Deutsch (lpd) Assigned to: Nobody/Anonymous (nobody) Summary: Byte code WITH_CLEANUP missing, MAKE_CLOSURE wrong Initial Comment: In section 30.10.1, WITH_CLEANUP is missing. The description of MAKE_CLOSURE is wrong: it says that the closure cells are the next N items on the stack below TOS, but in fact the closure cells are an N-element tuple at TOS1. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1768121&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
