[issue37067] os.execl doesn't allow for empty string in mac

2019-05-28 Thread Ned Deily


Ned Deily  added the comment:

The behavior was changed in Python 3.6 for all platforms to catch this error; 
see Issue28732.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37067] os.execl doesn't allow for empty string in mac

2019-05-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Which exact python version did you test?  The current codebase raises this 
exception on all platforms, not just macOS (see os_execv_impl in 
Modules/posixmodule.c)

The behaviour of raising an exception was introduced in issue 28732 for 
Windows, not sure when that code was refactored to raise the exception on all 
platforms.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37067] os.execl doesn't allow for empty string in mac

2019-05-27 Thread Siming Yuan


Siming Yuan  added the comment:

actually just learned that argv0 is program name.

in that case is that because of a platform difference where in macOS it doesn't 
allow for program name to be '' and in linux it does?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37067] os.execl doesn't allow for empty string in mac

2019-05-27 Thread Siming Yuan


New submission from Siming Yuan :

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 "", line 1, in 
  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 "", line 1, in 
  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
>>>

--
components: macOS
messages: 343655
nosy: ned.deily, ronaldoussoren, siming85
priority: normal
severity: normal
status: open
title: os.execl doesn't allow for empty string in mac
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com