Message343655
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
>>> |
|
Date |
User |
Action |
Args |
2019-05-27 16:08:47 | siming85 | set | recipients:
+ siming85, ronaldoussoren, ned.deily |
2019-05-27 16:08:47 | siming85 | set | messageid: <1558973327.05.0.558912294588.issue37067@roundup.psfhosted.org> |
2019-05-27 16:08:47 | siming85 | link | issue37067 messages |
2019-05-27 16:08:46 | siming85 | create | |
|