[issue41615] sys.argv may be None or an empty list

Guido van Rossum report at bugs.python.org
Sun Aug 30 20:02:18 EDT 2020


Guido van Rossum <guido at python.org> added the comment:

Got it.

On Sun, Aug 30, 2020 at 15:28 Terry J. Reedy <report at bugs.python.org> wrote:

>
>
> Terry J. Reedy <tjreedy at udel.edu> added the comment:
>
>
>
> sys.argv cannot be set until sys exists.  As I mentioned above, subsequent
> calls before finalization must continue to be no-ops.
>
>
>
> Code that depends on a bug, in this case of sys.argv not existing, is
> always vulnerable.  In this case, I would expect that people who want
> sys.argv to have a particular value would unconditionally set it.  If it
> were conditionally set, the program would likely exit or otherwise fail a
> test.  I intentionally have not suggested backporting a code change.
>
>
>
> ----------
>
>
>
> _______________________________________
>
> Python tracker <report at bugs.python.org>
>
> <https://bugs.python.org/issue41615>
>
> _______________________________________
>
> --
--Guido (mobile)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41615>
_______________________________________


More information about the Python-bugs-list mailing list