On 9/12/07, Nick Coghlan <ncoghlan at gmail.com> wrote: > Guido van Rossum wrote: > > I could use a refresher on how PJE's patch solves Andy's problem. > > I'm not sure if you're asking about how you would execute a zip file > after the patch has been applied, or about the mechanics of how the > patch works. PJE's last post covered the former question, so I'll cover > the gist of the latter. > > The patch works by passing the script argument to the import machinery > to see if it is recognised as a valid sys.path entry (i.e. either a > directory or a zip file in a default Python installation). Ah, this is the crux! I didn't understand Phillips wording of "an importable path". I still didn't understand your wording "recognised as a valid sys.path entry"; both wordings suggest a link between sys.argv[0] and the current value of sys.path, which isn't the case -- it is whether they are recognized by the "meta import hook"! This only became clear after I re-read the patch with Phillip's and your words in the back of my head. I now like and approve of the patch, and said so on the tracker. --Guido > If it is, > then add that location to the front of sys.path and use the -m switch > support to execute the "__main__" module directly. > > If the filename passed in isn't recognised as a sys.path entry, then it > is executed as a script as normal. > > Cheers, > Nick. > > -- > Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia > --------------------------------------------------------------- > http://www.boredomandlaziness.org > -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4