[Python-bugs-list] [ python-Bugs-667770 ] import C API mess
SourceForge.net
noreply@sourceforge.net
Tue, 14 Jan 2003 07:02:56 -0800
Bugs item #667770, was opened at 2003-01-14 10:02
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=667770&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Guido van Rossum (gvanrossum)
Summary: import C API mess
Initial Comment:
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.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=667770&group_id=5470