Patches item #1576313, was opened at 2006-10-12 19:57
Message generated for change (Comment added) made by mcmahon_m
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1576313&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: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alexey Borzenkov (snaury)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.execvp[e] on win32 fails for current directory
Initial Comment:
By convention when program is executed by searching
path, the first directory to be searched should be the
current directory. However on python this is not true:
1.c:
int main() { return 1; }
test.py:
import os
os.execvp('1', ('1',))
result:
Traceback (most recent call last):
File "C:\1\test.py", line 2, in <module>
os.execvp('1',('1',))
File "D:\Programs\ActiveState\Python25\lib\os.py",
line 348, in execvp
_execvpe(file, args)
File "D:\Programs\ActiveState\Python25\lib\os.py",
line 386, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
Attached patch fixes this.
----------------------------------------------------------------------
Comment By: Mark Mc Mahon (mcmahon_m)
Date: 2007-03-07 13:55
Message:
Logged In: YES
user_id=1424947
Originator: NO
I don't know about OS/2 but standard windows definitely looks in the
current folder first.
Should the patch insert "." rather then ""?
>>> import os.path
>>> os.path.join("", "test")
'test'
>>> os.path.join(".", "test")
'.\\test'
>>>
----------------------------------------------------------------------
Comment By: Alexey Borzenkov (snaury)
Date: 2006-10-14 15:15
Message:
Logged In: YES
user_id=1197042
On win32 it is not so, execlp() in msvcrt, for example, will
always looks in current directory before looking on PATH
(and if I remember correctly OS/2 has the same rules, I
don't remember PATH on OS/2 ever needing . in the PATH), so
does CreateFile, so on win32 it's just what is expected.
Sorry if I'm wrong though...
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2006-10-14 14:51
Message:
Logged In: YES
user_id=21627
What convention are you referring to? By convention, you
have to specify executables in the current directory with
./<program> if you don't have "." in your path.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1576313&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches