This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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 | |