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: Make arg0 required argument in os.execl* functions
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Alexander.Belopolsky, Arfrever, doko, r.david.murray
Priority: normal Keywords: patch

Created on 2010-03-21 18:18 by Alexander.Belopolsky, last changed 2022-04-11 14:56 by admin.

Files
File name Uploaded Description Edit
execl.diff Alexander.Belopolsky, 2010-03-21 18:18
execlp.log doko, 2010-04-18 22:23
Messages (9)
msg101437 - (view) Author: Alexander Belopolsky (Alexander.Belopolsky) Date: 2010-03-21 18:18
Since issue1039 made it illegal to pass empty argument list to execv*, I suggest to change signature of os.execl* functions and make arg0 a required positional argument.

This is not a backward compatible change because os.execlp('true'),  for example will now raise TypeError instead of ValueError.  However since issue1039 change has not been released yet, I think this can be done.
msg101442 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2010-03-21 18:52
> However since issue1039 change has not been released yet

os.execlp('true') does raise ValueError on released 3.x versions. sorry if I do misunderstand something.
msg101444 - (view) Author: Alexander Belopolsky (Alexander.Belopolsky) Date: 2010-03-21 19:03
On Sun, Mar 21, 2010 at 2:52 PM, Matthias Klose <report@bugs.python.org> wrote:
..
> os.execlp('true') does raise ValueError on released 3.x versions. sorry if I do misunderstand something.

My bad.  I thought it was a more recent change.  However as far as I
can tell it was never documented or announced in the NEWS or "What's
new in" files, so it is unlikely that there is code in the wild that
would rely on it.
msg103539 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2010-04-18 22:23
attached is a search for execlp for all files found in Ubuntu lucid, there's one package which uses just one argument to execlp.
msg103603 - (view) Author: Alexander Belopolsky (Alexander.Belopolsky) Date: 2010-04-19 14:26
Google code search for

os.execlp\([^*,]+\) lang:python

returns 15 hits, two of which are the same as Matthias found.  I am not sure what these results mean for the issue (and Matthias does not reach a conclusion either.)

Note that the status quo in 3.x is that os.execlp(single_arg) is invalid, so all these examples will stop working in 3.x and will not be fixed by 2to3.  My patch will only make failure happen sooner and reason for it more obvious.

I am not very happy about issue1039 (r57731) to begin with.  (See my comments at issue8154.)  It was rather hastily applied 3.x feature without a corresponding -3 warning and not even a mention in the NEWS file.  However if r57731 stays as a strict POSIX compliance feature, I think it will be cleaner to enforce >1 argument to os.execl* functions in their signatures rather than in a run-time check.
msg103666 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-04-20 03:03
Alexander, do you think it would be worthwhile to write up a summary of all the issues involved in these three releated bugs and post it to python-dev?  Alternatively we could ask for a decision on what should be done in python 2.7 from Benjamin.
msg103667 - (view) Author: Alexander Belopolsky (Alexander.Belopolsky) Date: 2010-04-20 03:21
On Mon, Apr 19, 2010 at 11:03 PM, R. David Murray
<report@bugs.python.org> wrote:
>
> Alexander, do you think it would be worthwhile to write up a summary of all the issues
> involved in these three releated bugs and post it to python-dev?

Sure.  I ranted about a related issue8154 on python-dev in a not so
relevant message:

http://mail.python.org/pipermail/python-dev/2010-March/098600.html

and can follow up with a more on-topic post unless you beat me to it.

>  Alternatively we could ask for a decision on what should be done in python 2.7 from
> Benjamin.

I would much rather see os.exec* functions left unchanged in both 2.x
and 3.x series except possibly for Windows where  issue8154 is a bona
fide crash.  Lets see what python-dev has to say about this feature in
general first.
msg190080 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2013-05-26 12:05
What conclusions were drawn on python-dev about this issue?
msg190096 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-05-26 16:07
Mark, just asking that question doesn't really move the issue forward.  Doing some research to see if there was any discussion on python-dev, and if not summarizing the issues and starting one, would be what could move the issue forward.
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52438
2014-02-03 17:11:37BreamoreBoysetnosy: - BreamoreBoy
2013-05-26 16:07:39r.david.murraysetmessages: + msg190096
2013-05-26 12:05:53BreamoreBoysetnosy: + BreamoreBoy
messages: + msg190080
2010-04-20 03:21:36Alexander.Belopolskysetmessages: + msg103667
2010-04-20 03:03:17r.david.murraysetnosy: + r.david.murray
messages: + msg103666
2010-04-19 14:26:18Alexander.Belopolskysetmessages: + msg103603
2010-04-18 22:23:02dokosetfiles: + execlp.log

messages: + msg103539
2010-03-21 19:14:19Arfreversetnosy: + Arfrever
2010-03-21 19:03:05Alexander.Belopolskysetmessages: + msg101444
2010-03-21 18:52:15dokosetnosy: + doko
messages: + msg101442
2010-03-21 18:18:53Alexander.Belopolskycreate