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.

Author siming85
Recipients ned.deily, ronaldoussoren, siming85
Date 2019-05-27.16:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558973327.05.0.558912294588.issue37067@roundup.psfhosted.org>
In-reply-to
Content
the following works in Linux

import os
os.execl('/bin/bash', '')

doesn't in mac:
>>> import os
>>> os.execl('/bin/bash', '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/me/.pyenv/versions/3.6.4/lib/python3.6/os.py", line 527, in execl
    execv(file, args)
ValueError: execv() arg 2 first element cannot be empty

works if you add a space
>>> os.execl('/bin/bash', ' ')

notice the space in 2nd argument.

technically it is also possible to run a command without arguments - why not allow for the case where *args is []?

>>> os.execl('/bin/bash')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/siyuan/.pyenv/versions/3.6.4/lib/python3.6/os.py", line 527, in execl
    execv(file, args)
ValueError: execv() arg 2 must not be empty
>>>
History
Date User Action Args
2019-05-27 16:08:47siming85setrecipients: + siming85, ronaldoussoren, ned.deily
2019-05-27 16:08:47siming85setmessageid: <1558973327.05.0.558912294588.issue37067@roundup.psfhosted.org>
2019-05-27 16:08:47siming85linkissue37067 messages
2019-05-27 16:08:46siming85create