This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.system() doesn't support surrogates nor bytes
Type: Stage:
Components: Library (Lib), Unicode Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2010-04-16 01:10 by vstinner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
os_system_surrogates.patch vstinner, 2010-04-16 01:10
Messages (4)
msg103280 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-16 01:10
os.system() doesn't support bytes, bytearray not str containing surrogates.

Attached patch uses PyUnicode_FSConverter, bytes2str and release_bytes in (the non-Windows version of) os.system() to support all of this. It locks the buffer because os.system() releases the GIL when calling system().
msg103281 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-16 01:12
See also #8391 (os.execvpe env) and #8393 (subprocess cwd).
msg103314 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-16 11:45
Commited to py3k as r80105. Let see if buildbots are happy or not :-)
msg103318 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-16 12:48
> Commited to py3k as r80105

The buildbots look happy: backported to 3.1 as r80110.
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52659
2010-04-16 12:48:34vstinnersetstatus: open -> closed
resolution: fixed
2010-04-16 12:48:23vstinnersetmessages: + msg103318
2010-04-16 11:45:38vstinnersetmessages: + msg103314
2010-04-16 01:12:19vstinnersetmessages: + msg103281
2010-04-16 01:10:46vstinnerlinkissue8242 dependencies
2010-04-16 01:10:20vstinnercreate