Issue 667770: import C API mess
Created on 2003-01-14 15:02 by gvanrossum, last changed 2022-04-10 16:06 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg60301 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2003-01-14 15:02 | |
There are too many different C-level APIs for importing a module. Many of them have the nasty property that they can try to do a relative import in the context of the nearest Python stack frame, where that is not what the C code intended. This needs to be cleaned up. Example use case: time.strptime() is now a C wrapper that imports the _strptime module; but if you follow the path it takes to import, it's quite an amazing journey. It should cut all of that short by looking in sys.modules['_strptime'] first. (But what about restricted execution? Well _strptime.py ought to be safe.) |
|||
| msg63892 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2008-03-18 05:04 | |
Brett, perhaps you can consider this with your integration of import-rewritten-in-Python? I think it's fine to leave this alone for 2.6. |
|||
| msg63896 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2008-03-18 05:40 | |
I was planning to do that in order to make my life simpler when I have to re-implement the C API. |
|||
| msg175766 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2012-11-17 16:14 | |
The story of impports from the C level is much more sane than back in the 2.6 days thanks to PyImport_Import, PyImport_ImportModuleLevelObject, and PyImport_ImportModuleLevel. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-10 16:06:08 | admin | set | github: 37769 |
| 2012-11-17 16:14:07 | brett.cannon | set | status: open -> closed resolution: fixed messages: + msg175766 stage: needs patch -> resolved |
| 2011-06-27 00:36:10 | brett.cannon | set | dependencies: + Replace __import__ w/ importlib.__import__ |
| 2010-08-17 23:59:43 | gvanrossum | set | nosy:
- gvanrossum |
| 2010-08-17 22:55:24 | BreamoreBoy | set | stage: needs patch type: enhancement versions: + Python 3.2, - Python 3.0 |
| 2008-03-18 05:40:10 | brett.cannon | set | messages: + msg63896 |
| 2008-03-18 05:04:56 | gvanrossum | set | assignee: gvanrossum -> brett.cannon messages: + msg63892 nosy: + brett.cannon components: + Interpreter Core, - None versions: + Python 3.0 |
| 2003-01-14 15:02:56 | gvanrossum | create | |
