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.spawnv fails when argv is a length 1 tuple
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ncloud
Priority: normal Keywords:

Created on 2006-06-19 18:48 by ncloud, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28837 - (view) Author: ncloud (ncloud) Date: 2006-06-19 18:48
os.spawnv fails when argv is a length 1 tuple.


For example, this will fail:
os.spawnv (os.P_WAIT, '/bin/pwd', ('/bin/pwd'))


Bug exists on Python 2.4.3 on FreeBSD.
Bug exists on Python 2.3.5 on Gentoo Linux.


Longer example:
----
$ cat test.py
import os

path = '/bin/pwd'

print

print 'calling os.spawnv with length 1 tuple...'
print 'exit code:', os.spawnv ( os.P_WAIT, path, ( path ) )

print

print 'calling os.spawnv with length 1 list...'
print 'exit code:', os.spawnv ( os.P_WAIT, path, [ path ] )

print
----



----
$ python test.py

calling os.spawnv with length 1 tuple...
exit code: 127

calling os.spawnv with length 1 list...
/home/private
exit code: 0

----
msg28838 - (view) Author: ncloud (ncloud) Date: 2006-06-19 20:00
Logged In: YES 
user_id=1542556

My apologies.  I'm new to python and had not realize that

( x )

is not a tuple, while

( x, ) 

is a tuple.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43524
2006-06-19 18:48:41ncloudcreate