[issue21737] runpy.run_path() fails with frozen __main__ modules

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

The code looks very different from the patch now, is this issue still relevant?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21737] runpy.run_path() fails with frozen __main__ modules

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21737] runpy.run_path() fails with frozen __main__ modules

2014-06-12 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg:

The logic in runpy.run_path() assumes that removing the __main__ entry from 
sys.modules is enough to be able to use the module search logic for e.g. 
importing packages and ZIP files (with embedded __main__.py files).

In Python 3.4 (and probably also 3.3 where the importlib was added), this no 
longer works if a frozen __main__ module is present.

The reason is that the sys.meta_path lists the FrozenImporter before the 
PathFinder. The runpy trick only works if the PathFinder gets a chance to do 
its magic, but never gets to play, since the FrozenImporter always returns the 
existing frozen __main__ module (causing all kinds of strange effects).

Now, looking at the implementation, the frozen __main__ is imported by 
import.c, not the importlib, so a working solution is to not have the 
FrozenImporter work on __main__ modules at all.

This then allows the PathFinder to deal with finding the __main__ module in 
directories or ZIP files and thus allows the hack in runpy to work again.

BTW: In the long run, it would probably better to clean up runpy altogether. 
It's really messy code due to the many details that it has to address, but I 
guess this a larger project on its own.

--
components: Interpreter Core
messages: 220364
nosy: lemburg
priority: normal
severity: normal
status: open
title: runpy.run_path() fails with frozen __main__ modules
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21737
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21737] runpy.run_path() fails with frozen __main__ modules

2014-06-12 Thread Marc-Andre Lemburg

Changes by Marc-Andre Lemburg m...@egenix.com:


--
keywords: +patch
Added file: 
http://bugs.python.org/file35596/FrozenImporter-without-__main__-support.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21737
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21737] runpy.run_path() fails with frozen __main__ modules

2014-06-12 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21737
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com