Issue 19015: Too long command returns 32512 (original) (raw)

Issue19015

Created on 2013-09-14 02:01 by deleted250130, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.sh deleted250130,2013-09-14 02:01 Example command which fails on os.system()
Messages (3)
msg197680 - (view) Author: (deleted250130) Date: 2013-09-14 02:01
If a command gets too long os.system() will return 32512. As I have figured out from Google this normally happens if the command can't be found. In the attachments is an example command which will fail on os.system() (it was generated as test during development - it is nearly 600.000 characters long). Executing the file with bash works fine but using os.system() makes troubles.
msg197682 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-09-14 02:16
Python simply delegates to the system() C function: http://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html I don't think it's a Python-specific issue here.
msg197872 - (view) Author: (deleted250130) Date: 2013-09-16 06:38
I have figured out that system() in C can only take up to 65533 arguments after a command (so it is a 16 bit issue). Giving one more argument will result in the return code 32512 (which implies the exit code 127).
History
Date User Action Args
2022-04-11 14:57:50 admin set github: 63215
2013-09-16 06:38:54 deleted250130 set status: open -> closedresolution: not a bugmessages: +
2013-09-14 02:16:53 pitrou set nosy: + pitroumessages: +
2013-09-14 02:01:11 deleted250130 create