[issue14605] Make import machinery explicit

2012-04-27 Thread Brett Cannon
Changes by Brett Cannon : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue14605] Make import machinery explicit

2012-04-27 Thread Brett Cannon
Brett Cannon added the comment: OK, so the todo of this issue is now finished. I am just waiting for the buildbots to come back green before I close this issue fully. -- stage: commit review -> committed/rejected status: open -> pending ___ Python t

[issue14605] Make import machinery explicit

2012-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 141ed4b426e1 by Brett Cannon in branch 'default': Issue #14605: Don't error out if get_importer() returns None. http://hg.python.org/cpython/rev/141ed4b426e1 -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7025ee00dbf6 by Brett Cannon in branch 'default': Issue #14605: Use None in sys.path_importer_cache to represent no http://hg.python.org/cpython/rev/7025ee00dbf6 -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset c18256de00bb by Brett Cannon in branch 'default': Issue #14605: Insert to the front of sys.meta_path, don't append. http://hg.python.org/cpython/rev/c18256de00bb New changeset 3bd60cc27664 by Brett Cannon in branch 'default': Issue #14605: Stop hav

[issue14605] Make import machinery explicit

2012-04-25 Thread Brett Cannon
Brett Cannon added the comment: Just to document why my explicit sys.path_hooks patch didn't quite change the meaning of None in sys.path_importer_cache, I found a bunch of places in the stdlib and in Modules/main.c where NullImporter is explicitly expected to be returned, so I wanted to get

[issue14605] Make import machinery explicit

2012-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 57d558f1904d by Brett Cannon in branch 'default': Issue #14605: Make explicit the entries on sys.path_hooks that used to http://hg.python.org/cpython/rev/57d558f1904d -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8dab93ec19de by Brett Cannon in branch 'default': Issue #14605: Insert to the front of sys.path_hooks instead of appending. http://hg.python.org/cpython/rev/8dab93ec19de -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-25 Thread Brett Cannon
Brett Cannon added the comment: importlib.find_module() (or get_loader() as it would replace pkgutil.get_loader() as well) is definitely planned. So is importlib.util.resolve_name() (although maybe that is basic enough to want top-level?). -- ___

[issue14605] Make import machinery explicit

2012-04-25 Thread Eric Snow
Eric Snow added the comment: While not in the initial list, _find_module() would be really handy. Perhaps we could call it "get_loader" instead. "find_module" is a misleading name and I don't see any parallel with imp.find_module as something to aspire to. -- __

[issue14605] Make import machinery explicit

2012-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5fea362b92fc by Marc-Andre Lemburg in branch 'default': Issue #14605 and #14642: Issue a warning in case Python\importlib.h needs to http://hg.python.org/cpython/rev/5fea362b92fc -- ___ Python tracker <

[issue14605] Make import machinery explicit

2012-04-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > > You can see a little discussion in http://bugs.python.org/issue14642, but it > has been discussed elsewhere and the automatic rebuilding was preferred (but > it is not a requirement to build as importlib.h is in hg). An automatic

[issue14605] Make import machinery explicit

2012-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset acfdf46b8de1 by Marc-Andre Lemburg in branch 'default': Issue #14605 and #14642: http://hg.python.org/cpython/rev/acfdf46b8de1 -- ___ Python tracker _

[issue14605] Make import machinery explicit

2012-04-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: ncoghlan -> brett.cannon stage: patch review -> commit review ___ Python tracker ___ ___ Python

[issue14605] Make import machinery explicit

2012-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I was actually going to suggest forcing an absolute path for __main__.__file__ in runpy if you didn't want to do it in importlib itself. I'm much happier with that approach than changing the tests, so the updated patch looks good to me. -- _

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: brett.cannon -> ncoghlan stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list ma

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: I found out why runpy was giving back an absolute file path for __file__; because pkgutil was doing that through its ImpLoader, unlike what import does by default which is just taking what path it has and appending file names (and thus not making anything absol

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: You can see a little discussion in http://bugs.python.org/issue14642, but it has been discussed elsewhere and the automatic rebuilding was preferred (but it is not a requirement to build as importlib.h is in hg). --

[issue14605] Make import machinery explicit

2012-04-24 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Marc-Andre Lemburg wrote: > Looking further I found this line in the Makefile: > > > # Importlib > > Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py > $(srcdir)/Python/

[issue14605] Make import machinery explicit

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset a2cf07135e4f by Marc-Andre Lemburg in branch 'default': Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader. http://hg.python.org/cpython/rev/a2cf07135e4f -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: R. David Murray wrote: > > R. David Murray added the comment: > > Hmm. Some at least of the buildbots have failed to build after that patch: > > ./python ./Python/freeze_importlib.py \ > ./Lib/importlib/_bootstrap.py Python/importlib.h > make: ./pyt

[issue14605] Make import machinery explicit

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset e30196bfc11d by Marc-Andre Lemburg in branch 'default': Issue #14605: Revert renaming of _SourcelessFileLoader, since it caused http://hg.python.org/cpython/rev/e30196bfc11d -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-24 Thread R. David Murray
R. David Murray added the comment: Hmm. Some at least of the buildbots have failed to build after that patch: ./python ./Python/freeze_importlib.py \ ./Lib/importlib/_bootstrap.py Python/importlib.h make: ./python: Command not found make: *** [Python/importlib.h] Error 127 program finished

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > > I documented it explicitly so people can use it if they so choose (e.g. look > at sys._getframe()). If you want to change this that's fine, but I am > personally not going to put the effort in to rename the class, update the > tes

[issue14605] Make import machinery explicit

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8aa4737d67d2 by Marc-Andre Lemburg in branch 'default': Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader http://hg.python.org/cpython/rev/8aa4737d67d2 -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: I documented it explicitly so people can use it if they so choose (e.g. look at sys._getframe()). If you want to change this that's fine, but I am personally not going to put the effort in to rename the class, update the tests, and change the docs for this (we

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > > That initial comment is out-of-date. If you look that the commit I made I > documented importlib.machinery._SourcelessFileLoader. I am continuing the > discouragement of using bytecode files as an obfuscation technique (because >

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: That initial comment is out-of-date. If you look that the commit I made I documented importlib.machinery._SourcelessFileLoader. I am continuing the discouragement of using bytecode files as an obfuscation technique (because it's a bad one), but I decided to at

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > I am not exposing SourcelessFileLoader because importlib publicly tries to > discourage the shipping of .pyc files w/o their corresponding source files. > Otherwise all objects as used by importlib for performing imports will become

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: Of course you did because you just like making my life a living hell when it comes to the __file__ attribute. =) OK, I will have another look when I get home, but last time I dealt with this the issue is some tests expect a relative path while others expect an

[issue14605] Make import machinery explicit

2012-04-23 Thread Nick Coghlan
Nick Coghlan added the comment: Oops: s/sensitive to sys.path changes/sensitive to current working directory changes/ -- ___ Python tracker ___

[issue14605] Make import machinery explicit

2012-04-23 Thread Nick Coghlan
Nick Coghlan added the comment: I put those explicit path checks in there deliberately. I really don't want to go back to having any __file__ attributes that are sensitive to sys.path changes. -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-23 Thread Brett Cannon
Brett Cannon added the comment: Updated patch for an explicit sys.path_hooks that simply tweaks the test_cmd_line_script tests to stop requiring an absolute path on the files and instead verifies that the relative paths are legit. It also adds warnings when None is found in sys.path_importer_

[issue14605] Make import machinery explicit

2012-04-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1da623513b26 by Brett Cannon in branch 'default': Issue #14605: Expose importlib.abc.FileLoader and http://hg.python.org/cpython/rev/1da623513b26 -- nosy: +python-dev ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-22 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue14605] Make import machinery explicit

2012-04-22 Thread Brett Cannon
Changes by Brett Cannon : -- keywords: +patch Added file: http://bugs.python.org/file25307/explicit.diff ___ Python tracker ___ ___ Py

[issue14605] Make import machinery explicit

2012-04-22 Thread Brett Cannon
Brett Cannon added the comment: Attached is my (failing) attempt at making import explicit. Unfortunately I have four failing tests, 3 of which revolve around __main__ (which is why I added Nick to see if he had any ideas): test_cmd_line_script test_runpy test_threaded_import test_zipimport_s

[issue14605] Make import machinery explicit

2012-04-22 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue14605] Make import machinery explicit

2012-04-17 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue14605] Make import machinery explicit

2012-04-17 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue14605] Make import machinery explicit

2012-04-17 Thread Brett Cannon
New submission from Brett Cannon : There should no longer be any implicit part of import when there doesn't have to be. To make import fully explicit, some things need to happen (in context to importlib): * Expose FileLoader * Expose SourceFileLoader * Expose PathFinder * Expose the extension