summaryrefslogtreecommitdiff
path: root/Python/importdl.c
AgeCommit message (Collapse)AuthorLines
2013-07-11Issue #18426: improve exception message. Courtesy of AmauryChristian Heimes-1/+5
2013-07-11Issue #18426: Fix NULL pointer dereference in C extension import whenChristian Heimes-0/+2
PyModule_GetDef() returns an error.
2012-04-20Issue #14599: Generalize a test for ImportError.path and add supportBrett Cannon-4/+5
in Python/dynload_shlibs.c. This should fix the remaining importlib test failure on Windows. Support in AIX and HP-UX will be in a separate checkin.
2012-04-14Issue #2377: Make importlib the implementation of __import__().Brett Cannon-4/+0
importlib._bootstrap is now frozen into Python/importlib.h and stored as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen code along with sys and imp and then uses _frozen_importlib._install() to set builtins.__import__() w/ _frozen_importlib.__import__().
2011-05-07_PyImport_LoadDynamicModule() encodes the module name explicitly to ASCIIVictor Stinner-15/+25
The name must be encodable to ASCII because dynamic module must have a function called "PyInit_NAME", they are written in C, and the C language doesn't accept non-ASCII identifiers.
2011-04-04Issue #11619: _PyImport_LoadDynamicModule() doesn't encode the path to bytesVictor Stinner-0/+11
on Windows.
2011-03-14Issue #3080: _PyImport_LoadDynamicModule() uses Unicode for name and pathVictor Stinner-41/+29
Document also that dynamic module names are ASCII only
2011-03-07Issue #3080: Import builtins using Unicode stringsVictor Stinner-6/+18
- is_builtin(), init_builtin(), load_builtin() and other builtin related functions use Unicode strings, instead of byte strings - Rename _PyImport_FixupExtensionUnicode() to _PyImport_FixupExtensionObject() - Rename _PyImport_FindExtensionUnicode() to _PyImport_FindExtensionObject()
2011-02-22Issue #3080: Remove unused argument of _PyImport_GetDynLoadFunc()Victor Stinner-3/+2
The first argument, fqname, was not used.
2010-10-17_PyImport_FixupExtension() and _PyImport_FindExtension() uses FS encodingVictor Stinner-10/+24
* Rename _PyImport_FindExtension() to _PyImport_FindExtensionUnicode(): the filename becomes a Unicode object instead of byte string * Rename _PyImport_FixupExtension() to _PyImport_FixupExtensionUnicode(): the filename becomes a Unicode object instead of byte string
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-58/+58
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2008-06-11Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis-11/+19
2007-10-15Move decl so it compiles with C89.Neal Norwitz-1/+1
2007-10-15Patch #1272, by Christian Heimes and Alexandre Vassalotti.Guido van Rossum-1/+3
Changes to make __file__ a proper Unicode object, using the default filesystem encoding. This is a bit tricky because the default filesystem encoding isn't set by the time we import the first modules; at that point we fudge things a bit. This is okay since __file__ isn't really used much except for error reporting. Tested on OSX and Linux only so far.
2003-09-04Patch #794826: Add __file__ in dynamically loaded modules for multipleMartin v. Löwis-2/+3
interpreters. Fixes #698282. Will backport to 2.3.
2002-08-26Simplify, and avoid PyModule_GetDict() while we're at it.Fred Drake-5/+2
2001-10-16SF patch #471839: Bug when extensions import extensions (Shane Hathaway)Guido van Rossum-2/+3
When an extension imports another extension in its initXXX() function, the variable _Py_PackageContext is prematurely reset to NULL. If the outer extension then calls Py_InitModule(), the extension is installed in sys.modules without its package name. The manifestation of this bug is a "SystemError: _PyImport_FixupExtension: module <package>.<extension> not loaded". To fix this, importdl.c just needs to retain the old value of _Py_PackageContext and restore it after the initXXX() method is called. The attached patch does this. This patch applies to Python 2.1.1 and the current CVS.
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-07-22Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters-4/+1
declarations yet, those come later.
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
1999-12-22Cleanup patches from Greg Stein:Guido van Rossum-65/+13
* in import.c, #ifdef out references to dynamic loading based on HAVE_DYNAMIC_LOADING * clean out the platform-specific crud from importdl.c. [ maybe fold this function into import.c and drop the importdl.c file? Greg.] * change GetDynLoadFunc's "funcname" parameter to "shortname". change "name" to "fqname" for clarification. * each GetDynLoadFunc now creates its own funcname value. WARNING: as I mentioned previously, we may run into an issue with a missing "_" on some platforms. Testing will show this pretty quickly, however. * move pathname munging into dynload_shlib.c
1999-12-20Moved most of the platform-specific code to dynload_<platform>.c files.Guido van Rossum-1029/+26
(A few nite remain, these will probably disappear soon.) This is part of a set of patches by Greg Stein.
1999-11-16Patch by Vladimir Marangozov, inspired by a bug report from GaryGuido van Rossum-1/+7
Duzan, for AIX, to support C++ objects with static initializers, when using the genuine IBM C++ compiler (namely xlC/xlC_r). See accompanying patches to configure.in and acconfig.h.
1999-08-04Vladimir Marangozov fixes an AIX-specific problem, writing:Guido van Rossum-4/+7
""" Following up Robin Dunn's troubles with freeze, here's a patch that fixes an oddity regarding the import logic of shared modules on AIX. Symbol resolution of shared modules is now handled properly for the cases when the python library is linked to a binary with an arbitrary name. This includes the standard python[version] executable, but also applications that are embedding the python core (i.e. linked with libpython[version].a, the latter being static or shared). """
1999-01-27Patches by William Lewis for Nextstep descendants.Guido van Rossum-4/+71
1999-01-07Ty Sarna writes:Guido van Rossum-1/+1
The following patches (relative to 1.5.2b1) enable Python dynamic loading to work on NetBSD platforms that use ELF (presnetly mips and alpha systems). They automaticly determine wether the system is ELF or a.out rather than using astatic list of platforms so that when other NetBSD platforms move to ELF, python will continue to work without change.
1999-01-04Chris Herborth writes:Guido van Rossum-38/+4
Donn Cave tells me the PyImport_BeImageID() function isn't needed anymore.
1998-12-21Thanks to Chris Herborth, the thread primitives now have proper Py*Guido van Rossum-1/+1
names in the source code (they already had those for the linker, through some smart macros; but the source still had the old, un-Py names).
1998-10-12Replace fprintf(stderr, ...) with PySys_WriteStderr(...).Guido van Rossum-1/+1
1998-10-08On Win32, useGuido van Rossum-1/+4
LoadLibraryEx(pathname, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) to search dependent DLLs in the directory of the pathname.
1998-10-01Renamed thread.h to pythread.h.Guido van Rossum-15/+15
(Also removed whitespace after # in some BEOS related cpp directives.)
1998-09-30In FreeBSD when using ELF, an underscore is needed in front of theGuido van Rossum-1/+1
function name. (Vladimir Kushnir by way of Thomas Gellekum.)
1998-09-14Mac-specific mod to enable aliases on import paths.Guido van Rossum-0/+9
(Jack Jansen and/or Just van Rossum)
1998-08-24Ted Horst writes in psa-members@python.org:Guido van Rossum-0/+41
This is a patch that Bill Bummgarner did for 1.4 that hasn't made its way into the distribution yet. This is important if you want to use the ObjC module.
1998-08-04Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum-0/+285
1998-07-08Reindented some OS/2 and hpux code that looked ugly or at leastGuido van Rossum-29/+28
inconsistent.
1998-06-27Windows-specific hack to make sure that when LoadLibrary() is called,Guido van Rossum-0/+22
the filename contains at least a rudimentary pathname. (The bad part is that we need to call getcwd() because only a prefix of ".\\" is not enough -- we prefix the drive letter.)
1998-05-18Remove use of RTLD_GLOBAL.Guido van Rossum-6/+4
1998-05-15In debug mode on MS Windows, DLLs are called foo_d.pyd or foo_d.dll.Guido van Rossum-0/+5
1998-04-13Support for OpenBSD :-(Guido van Rossum-1/+1
1998-04-10Move #include <sys/param.h> to before osdefs.h (Donn Cave).Guido van Rossum-4/+5
1998-01-19Protect PyErr_Format format string argument from overflow.Guido van Rossum-1/+1
1998-01-19Better #ifdefs for NetBSD, taking into account that at least on netBSDGuido van Rossum-3/+8
1.3, dlopen() etc. are fully implemented, including dlerror(). From Jaromir Dolecek and Ty Sarna.
1997-12-02Add the flag RTLD_GLOBAL to the dlopen() options.Guido van Rossum-3/+7
This exports symbols defined by the loaded extension to other extensions (loaded later). (I'm not quite sure about this but suppose it can't hurt...)
1997-11-22os2 patch by Jeff RushGuido van Rossum-0/+38
1997-11-19Fix importing of shared libraries from inside packages.Guido van Rossum-3/+16
This is a bit of a hack: when the shared library is loaded, the module name is "package.module", but the module calls Py_InitModule*() with just "module" for the name. The shared library loader squirrels away the true name of the module in _Py_PackageContext, and Py_InitModule*() will substitute this (if the name actually matches).
1997-10-10Shared libraries didn't quite work under AIX because of the change inGuido van Rossum-0/+11
status of the GNU readline interface. Here's a patch, by Vladimir Marangozov.
1997-08-16set sharedlib extensions properly for NeXT (Ted Horst)Guido van Rossum-0/+2
1997-08-02The last of the mass checkins for separate (sub)interpreters.Guido van Rossum-4/+10
Everything should now work again. See the comments for the .h files mass checkin (e.g. pystate.h) for more detail.