[ python-Bugs-1508833 ] os.spawnv fails when argv is a length 1 tuple

SourceForge.net noreply at sourceforge.net
Mon Jun 19 22:54:35 CEST 2006


Bugs item #1508833, was opened at 2006-06-19 18:48
Message generated for change (Settings changed) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1508833&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.4
>Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: ncloud (ncloud)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.spawnv fails when argv is a length 1 tuple

Initial Comment:
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

----

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

Comment By: ncloud (ncloud)
Date: 2006-06-19 20:00

Message:
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.

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

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


More information about the Python-bugs-list mailing list