A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-June/066171.html below:

[Python-Dev] PEP 338 vs PEP 328

[Python-Dev] PEP 338 vs PEP 328 - a limitation of the -m switch [Python-Dev] PEP 338 vs PEP 328 - a limitation of the -m switchPhillip J. Eby pje at telecommunity.com
Sun Jun 18 22:14:05 CEST 2006
At 11:18 AM 6/18/2006 -0700, Guido van Rossum wrote:
>On 6/18/06, Nick Coghlan <ncoghlan at iinet.net.au> wrote:
> > The 'bug fix' solution would be:
> >
> >    1. Change main.c and PySys_SetPath so that '' is NOT prepended to 
> sys.path
> > when the -m switch is used
> >    2. Change runpy.run_module to add a __pkg_name__ attribute if the module
> > being executed is inside a package
> >    3. Change import.c to check for __pkg_name__ if (and only if) 
> __name__ ==
> > '__main__' and use __pkg_name__ if it is found.
>
>That's pretty heavy-handed for a pretty esoteric use case. (Except #1,
>which I think should be done regardless as otherwise we'd get a
>messed-up sys.path.)

Since the -m module is being run as a script, shouldn't it put the module's 
directory as the first entry on sys.path?  I don't think we should change 
the fact that *some* directory is always inserted at the beginning of 
sys.path -- and all the precedents at the moment say "script directory", if 
you consider -c and the interactive interpreter to be scripts in the 
current directory.  :)

More information about the Python-Dev mailing list

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