[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-16202 "sys.path[0] security issues".

--

___
Python tracker 

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



[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor


STINNER Victor  added the comment:

The problem of long option names is that they cannot be used in a Unix shebang: 
"#!/usr/bin/python3 --long-option".

I propose to add the -P option to not add sys.path[0]: I wrote GH-31542.

--

___
Python tracker 

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



[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29665
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31542

___
Python tracker 

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



[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

See also "Python flag/envvar not to put current directory to sys.path (but 
don’t ignore PYTHONPATH)" discussion:
https://discuss.python.org/t/python-flag-envvar-not-to-put-current-directory-to-sys-path-but-dont-ignore-pythonpath/4235/2

--
nosy: +vstinner

___
Python tracker 

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



[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2021-11-26 Thread Neil Isaac


Change by Neil Isaac :


--
nosy: +nisaac

___
Python tracker 

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



[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2019-04-08 Thread Nick Coghlan


Nick Coghlan  added the comment:

Retitled the issue using the `--mainpath` spelling, as I wanted to link to it 
from the PEP 582 discussion, and that's my current favourite from the various 
ideas I've had since first filing the issue.

(I decided I didn't like `--basepath` because we already have `sys.base_prefix` 
that refers to something entirely different)

--
title: Add '-p'/'--path0' command line option to override sys.path[0] 
initialisation -> Add '--mainpath'/'--nomainpath' command line options to 
override sys.path[0] initialisation
type:  -> enhancement
versions: +Python 3.9 -Python 3.4

___
Python tracker 

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