[issue19700] Update runpy for PEP 451

2013-12-18 Thread Eric Snow
Eric Snow added the comment: Thanks for working this out, Nick! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19700 ___ ___ Python-bugs-list

[issue19700] Update runpy for PEP 451

2013-12-17 Thread Nick Coghlan
Nick Coghlan added the comment: On second thoughts, I'm going to close this one - if further runpy changes are needed to resolve issue 19702 (using __spec__.name for pickle when appropriate), let's deal with them there. -- resolution: - fixed stage: test needed - committed/rejected

[issue19700] Update runpy for PEP 451

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Final patch that reflects the version I'm about to commit. It includes appropriate docs updates, and ensures __main__.__spec__ is None in the cases where the import system isn't involved in initialising main. -- Added file:

[issue19700] Update runpy for PEP 451

2013-12-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 51dddfead80a by Nick Coghlan in branch 'default': Issue #19700: set __spec__ appropriately in runpy http://hg.python.org/cpython/rev/51dddfead80a -- nosy: +python-dev ___ Python tracker

[issue19700] Update runpy for PEP 451

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Final review of the patch showed it *wasn't* quite done, it's still missing the both __name__ and __spec__.name are configured in sys.modules change that is needed to get more pickle friendly behaviour from __main__. However, I wanted to commit this version to

[issue19700] Update runpy for PEP 451

2013-12-14 Thread Nick Coghlan
Nick Coghlan added the comment: I added some unit tests for the interactions between runpy and namespace packages, which showed that I was doing the check for __main__ submodules and the check for no loader in the wrong order. Last missing piece is to ensure that __spec__ is being populated

[issue19700] Update runpy for PEP 451

2013-12-14 Thread Nick Coghlan
Nick Coghlan added the comment: So close! importlib.util.spec_from_file_location failed me (unsurprisingly) when it came to the zipfile execution tests. I'm thinking I'll just hack in a way to avoid checking the loader when the expected loader is set to None. -- Added file:

[issue19700] Update runpy for PEP 451

2013-12-14 Thread Nick Coghlan
Nick Coghlan added the comment: Latest version simply doesn't check the loader type for the zipimport tests. (Note that just using find_spec doesn't work, since the directory and zipfile execution tests include implicit sys.path manipulation) I also removed the separated precompiled flag that

[issue19700] Update runpy for PEP 451

2013-12-14 Thread Nick Coghlan
Nick Coghlan added the comment: Working on the docs updates made me realise the test cases didn't cover the no suffix case that is causing grief in issue 19946. So I've added a test case for that now, but haven't fixed it yet (will need to deal with the __spec__ = None case for such scripts)

[issue19700] Update runpy for PEP 451

2013-12-10 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 19944 now covers moving the current importlib.find_spec to importlib.find_spec_on_path and having importlib.find_spec behave like runpy._fixed_find_spec in my patch. -- ___ Python tracker rep...@bugs.python.org

[issue19700] Update runpy for PEP 451

2013-12-10 Thread Eric Snow
Eric Snow added the comment: patch LGTM -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19700 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19700] Update runpy for PEP 451

2013-12-08 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19700 ___ ___ Python-bugs-list

[issue19700] Update runpy for PEP 451

2013-12-08 Thread Nick Coghlan
Nick Coghlan added the comment: OK, I just noticed that importlib.find_spec copies the annoying-as-hell behaviour of importlib.find_loader where it doesn't work with dotted names. Can we fix that please? It's stupid that pkgutil.get_loader has to exist to workaround that design flaw for

[issue19700] Update runpy for PEP 451

2013-12-08 Thread Nick Coghlan
Nick Coghlan added the comment: Deleted a bunch of code, and runpy now correctly sets both __file__ and __cached__ (runpy previously never set the latter properly). You can also see the reason for my rant above in the form of runpy._fixed_find_spec. importlib.find_loader was always kind of

[issue19700] Update runpy for PEP 451

2013-12-08 Thread Brett Cannon
Brett Cannon added the comment: Can you file a separate bug, Nick, for the importlib.find_spec() change you are after? I don't want to lose track of it (and I get what you are after but we should discuss why importlib.find_loader() was designed the way it was initially). --

[issue19700] Update runpy for PEP 451

2013-12-05 Thread Eric Snow
Eric Snow added the comment: _run_module_as_main() is particularly related to #19697. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19700 ___

[issue19700] Update runpy for PEP 451

2013-11-23 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/issue19700 ___

[issue19700] Update runpy for PEP 451

2013-11-23 Thread Nick Coghlan
Nick Coghlan added the comment: D'oh, I forgot there was a runpy API change I planned to offer as part of the PEP 451 integration: exposing a target parameter in both run_path and run_module. http://www.python.org/dev/peps/pep-0451/#the-target-parameter-of-find-spec I guess that slips to 3.5

[issue19700] Update runpy for PEP 451

2013-11-22 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- components: Library (Lib) nosy: brett.cannon, eric.snow, ncoghlan priority: normal severity: normal stage: test needed status: open title: Update runpy for PEP 451 versions: Python 3.4 ___ Python tracker

[issue19700] Update runpy for PEP 451

2013-11-22 Thread Eric Snow
New submission from Eric Snow: This is closely related to issue #19697. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19700 ___ ___