[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2018-03-21 Thread Jakub Wilk
Change by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: Over in https://bugs.python.org/issue33053#msg314192, I came up with `--basepath ` as another possible spelling (`--no-basepath` would then be an option for turning it off. The main argument *against* that name is that we use "base" to mean

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: This question recently came up again over in https://bugs.python.org/issue33053#msg314040. With the assorted startup refactorings that were landed for 3.7, it likely makes sense to take another run at this for 3.8. --

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2014-04-18 Thread Matthew Woodcraft
Matthew Woodcraft added the comment: For the record: the '-I' option (#16499) in Python 3.4 disables sys.path[0] initialisation (among other things). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: before or after running site.py? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___ ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-28 Thread Nick Coghlan
Nick Coghlan added the comment: I'd suggest this would be applied at the same time as when sys.path[0] gets set now, but that kind of messy complication is why I decided we really needed to step back and start trying to clean up what we already have before we started layering yet *more*

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Absolutely, Nick. Perhaps we ought to start gathering a list of real world requirements, i.e. how do people run, or want to run, python? -- ___ Python tracker rep...@bugs.python.org

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-27 Thread Eric Snow
Eric Snow added the comment: This proposal only affects the initialization of sys.path[0], and not any of the other sys.path entries made by site.py or otherwise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-23 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___ ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-23 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Butting in here: Early on in the startup, a search is made for site.py using automatic sys.path settings. Do the suggestions here propose to override this? I know there is a -s flag, but all these flags start to be confusing. I have been looking for

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-08-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'd also like a command line flag to override PYTHONPATH (which could also be used in combination with -E so that you could still set the PYTHONPATH while ignoring everything else). I'll file a separate feature request for that. -- nosy:

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-07-09 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: Your plan sounds good, Nick. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-06-16 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: ncoghlan - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___ ___ Python-bugs-list

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-06-13 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I was tempted to just add this (perhaps as a -X option) but, on reflection, I'm going to go with No, not for 3.3. I want to take a long hard look at the whole sys.path[0] initialisation process when I update PEP 395 to account for namespace

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-06-12 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: any chance on this for 3.3? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-29 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: here's an updated patch with long options only. I'm only 95% confident about my changes to getopt.c...there's probably a better way to do it. However, the patch stands on its own two feet. -- Added file:

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-27 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: FWIW, I now think this should *only* be a long option. Short options are precious, and this is an unusual enough use case that I'm not yet sure it deserves one. In particular, we may decide to use -p later for adding directories to sys.path,

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-27 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: FWIW, I now think this should *only* be a long option. Short options are precious, and this is an unusual enough use case that I'm not yet sure it deserves one. In particular, we may decide to use -p later for adding directories to sys.path,

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-27 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: Long options only would be fine with me. So --path0 and --nopath0? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: Here's a stab at implementing -p/-P. There are a couple warnings that I'm not sure about and I've undoubtedly missed some detail, but it should be pretty close. -- keywords: +patch Added file:

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: Removed file: http://bugs.python.org/file25721/issue13475_1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: Added file: http://bugs.python.org/file25722/issue13475_1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: Removed file: http://bugs.python.org/file25722/issue13475_1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: Added file: http://bugs.python.org/file25723/issue13475_1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Before this is assigned a short option form, I would like to ask whether anybody but experts will be able to make a proper use of this option. (I also don't understand what it adds over PYTHONPATH) As for the patch, it lacks error checking when

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: Before this is assigned a short option form, I would like to ask whether anybody but experts will be able to make a proper use of this option. Do you mean relative to a long form? And what would constitute improper use for the

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-05-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- title: Add '-p'/'--path0' command line option to override sys.path - Add '-p'/'--path0' command line option to override sys.path[0] initialisation ___ Python tracker rep...@bugs.python.org

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-29 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I realised -P is available for use as the short form of the suppress sys.path[0] initialisation option. So -p would override the calculation of sys.path[0], while -P would switch it off completely (similar to the way -S and -E switch off

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-27 Thread Matthew Woodcraft
Matthew Woodcraft matt...@woodcraft.me.uk added the comment: The proposed --nopath0 option is something I've wished I had in the past. If this is added, it would be good if it could be given a single-letter form too, because it's an option that would be useful in #! lines (they don't reliably

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-26 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Eric: Actually I posted my comments after reading only Nick’s message, not yours, so no worry :) Nick: the just do the right thing aspect is covered by PEP 395. This is great. Thanks for clarifying. This is an orthogonal proposal that allows

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-26 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Zbigniew posted a nice summary of some of the issues sys.path[0] autoinitialisation can cause to python-dev: http://mail.python.org/pipermail/python-dev/2011-November/114668.html -- ___ Python

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-25 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: The current behavior is an implicit -p ., which causes all sorts of hard-to-figure-out problems, most of which PEP 395 is rightly trying to fix. I'm suggesting that the next step would be to make --nopath0 the default (rendering the

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-25 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I don’t understand all the issues and it’s too late for me to read all the thread, but I hope these comments are helpful: - If our goal is to help naïve users, then one or two new options wouldn’t help (people want to run “python

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-25 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: First of all, I don't want Nick's proposal in this issue (the -p and --nopath0 flags) to be misunderstood because of me. His is a great idea that will make a really useful shortcut available and will _not_ change any current behavior.

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-25 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, sorry Eric (Snow), you're trying to bite off *way* more than is reasonable by proposing to removing sys.path[0] auto-initialisation. While it has its problems, it's also far too entrenched in people's expections of Python's behaviour to

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-25 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: Yeah, the more I think about it, the more I agree it's Python 4 fodder. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-24 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: PEP 395 spends a lot of time discussing ways that the current automatic initialisation of sys.path[0] can go wrong, and even the proposed improvements in that PEP don't claim to fix the default behaviour for every possible scenario (just

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-24 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13475 ___ ___ Python-bugs-list

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2011-11-24 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: +1 Both the -p and --nopath0 would be great additions and a good match for PEP 395. So -p . would be equivalent to the current implicit sys.path[0] initialization, right? Would any other effects happen with -p than sys.path[0]