summaryrefslogtreecommitdiff
path: root/Python/import.c
AgeCommit message (Collapse)AuthorLines
2004-09-23Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders.Phillip J. Eby-4/+7
(Backport to 2.3 maintenance branch.)
2004-06-07Fix a refcount bug in an obscure code corner.Thomas Heller-0/+1
2004-03-23Decref all if ensure_fromlist fails. Fixes #876533.Martin v. Löwis-2/+3
2003-10-20Backport checkin:Walter Dörwald-1/+1
Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751)
2003-07-11- fix typoFred Drake-1/+1
- there's a weird variable name here (zimpimport), but I'll leave that for someone that's familiar with the ZIP import support
2003-06-16Don't use the module object setattr when importing submodules. Instead,Neil Schemenauer-18/+38
operate on the module dictionary directly. This prevents spurious depreciation warnings from being raised if a submodule name shadows a builtin name.
2003-03-23SF patch #708201, unchecked return value in import.c by Jason HarperNeal Norwitz-0/+2
Will backport.
2003-02-17Remove PyArg_ParseTuple() for methods which take no args,Neal Norwitz-23/+13
use METH_NOARGS instead
2003-02-12Cleanup from patch #683257:Neal Norwitz-4/+7
Add missing INCREFs and re-indent returns to be consistent. Add \n\ for lines in docstring Add a pathetic test Add docs
2003-02-12Provide access to the import lock, fixing SF bug #580952. This isGuido van Rossum-6/+52
mostly from SF patch #683257, but I had to change unlock_import() to return an error value to avoid fatal error. Should this be backported? The patch requested this, but it's a new feature.
2003-01-24MacPython-OS9 specific fix: If there are non-string items on sys.path don't ↵Jack Jansen-14/+17
try to intern them. This has the theoretical problem that resource filenames on sys.path cannot be unicode objects, but in practice that shouldn't matter.
2002-12-30PEP 302 + zipimport:Just van Rossum-19/+236
- new import hooks in import.c, exposed in the sys module - new module called 'zipimport' - various changes to allow bootstrapping from zip files I hope I didn't break the Windows build (or anything else for that matter), but then again, it's been sitting on sf long enough... Regarding the latest discussions on python-dev: zipimport sets pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as /path/to/Archive.zip/subdir/ are supported again.
2002-12-25Backing out patch #642578 in anticipation of final acceptance of PEP 302.Just van Rossum-147/+0
2002-12-13Added missing casts.Jack Jansen-2/+2
2002-12-06Patch #614055: Support OpenVMS.Martin v. Löwis-2/+5
2002-11-29Slightly improved version of patch #642578: "Expose PyImport_FrozenModulesJust van Rossum-0/+147
in imp". This adds two functions to the imp module: get_frozenmodules() and set_frozenmodules().
2002-08-31Because MWH changed the bytecode again, moved the magic number *back*Guido van Rossum-1/+6
to 62011. This should get the snake-farm to throw away its old .pyc files, amongst others.
2002-08-15This is my patchMichael W. Hudson-1/+5
[ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
2002-06-30Patch #569753: Remove support for WIN16.Martin v. Löwis-5/+5
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
2002-06-17Apply diff2.txt from SF patch http://www.python.org/sf/566999Walter Dörwald-7/+29
This patch enhances Python/import.c/find_module() so that unicode objects found in sys.path will be treated as legal directory names (The current code ignores anything that is not a str). The unicode name is converted to str using Py_FileSystemDefaultEncoding.
2002-06-14Fix SF bug # 561858 Assertion with very long listsNeal Norwitz-2/+2
Write 4 bytes for co_stacksize, etc. to prevent writing out bad .pyc files which can cause a crash when read back in.
2002-06-13Patch #568124: Add doc string macros.Martin v. Löwis-28/+21
2002-05-30imp_load_module(): correct and comment the sense of the test for '+'Guido van Rossum-2/+7
in the mode (it's forbidden).
2002-05-30Cover a few corners in the 'U' mode integration to make imp work.Jeremy Hylton-8/+14
get_file() must convert 'U' to "r" PY_STDIOTEXTMODE before calling fopen(). imp_load_module() must accept 'r' or 'U' or something with '+'. Also reflow some long lines.
2002-05-28File modes in filedescr entries are also passed to Python, so we now put "U"Jack Jansen-4/+7
in there, and convert it to "rb" (or "r" for non-universal-newline builds) before passing it to fopen(). Fixes #561326.
2002-04-14Mass checkin of universal newline support.Jack Jansen-3/+3
Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
2002-04-11Got rid of ifdefs for long-obsolete GUSI versions.Jack Jansen-21/+0
2002-04-09is_builtin() is not a Boolean -- it can return -1, 0, 1. [SF #541652]Guido van Rossum-1/+1
2002-04-07Return bools from functions named is_<whatever>().Guido van Rossum-4/+4
2002-03-31Use symbolic METH_VARARGS instead of 1 for ml_flagsNeal Norwitz-16/+16
2002-03-29Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.Tim Peters-2/+0
2002-02-26OS/2 EMX port changes (Python part of patch #450267):Andrew MacIntyre-0/+76
Python/ dynload_shlib.c // EMX port emulates dlopen() etc. for DL extensions import.c // changes to support 8.3 DLL name limit (VACPP+EMX) // and case sensitive import semantics importdl.h thread_os2.h
2002-02-07Fix to the UTF-8 encoder: it failed on 0-length input strings.Marc-André Lemburg-1/+20
Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception.
2002-01-12Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis-4/+0
2001-11-18Since the MAGIC number scheme is going to break on January 1st, documentTim Peters-4/+16
what it is more carefully and point out some of the subtleties.
2001-10-30On the macintosh don't take a quick exit in find_module() for frozen ↵Jack Jansen-0/+8
submodule imports: the frozen import goes through a different mechanism.
2001-10-25Use PyDict_Copy() and PyDict_Update() instead of using PyObject_CallMethod()Fred Drake-5/+3
to call the corresponding methods. This is not a performance improvement since the times are still swamped by disk I/O, but cleans up the code just a little.
2001-10-24SF patch #474590 -- RISC OS supportGuido van Rossum-7/+31
2001-10-18First part of SF patch #416704: More robust freeze, by Toby Dickenson.Guido van Rossum-5/+23
This fixes the behavior reported by SF bug #404545, where a file x.y.py could be imported by the statement "import x.y" when there's a frozen package x (I believe even if x.y also exists as a frozen module).
2001-10-04Remove a couple of unused local variables (bug #445960, compiler warningsGreg Ward-4/+2
on IRIX 6.5).
2001-08-30Add a new function imp.lock_held(), and use it to skip test_threaded_importTim Peters-0/+19
when that test is doomed to deadlock.
2001-08-13Fixed typo in comment leading up to _PyImport_FixupExtension().Barry Warsaw-1/+1
2001-08-08Put conditional S_IFMT definition into pyport.h.Martin v. Löwis-5/+0
2001-08-08Put conditional S_ISDIR definition(s) into pyport.h.Martin v. Löwis-4/+0
2001-08-04Derived from SF patch #446899 Permit import of .pyw under Windows, fromTim Peters-5/+14
David Bolen.
2001-08-02Merge of descr-branch back into trunk.Tim Peters-2/+5
2001-07-23Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer-4/+4
and PYTHONPATH).
2001-07-23SF Patch #441791, with changes: when "import foo.bar" fails with anGuido van Rossum-4/+16
exception in the execution of bar, ensure that foo.bar exists. (Previously, while sys.modules['foo.bar'] would exist, foo.bar would only be created upon successful execution of bar. This is inconvenient; some would say wrong. :-)
2001-07-05SF bug #438295: [Windows] __init__.py cause strange behaviorTim Peters-11/+28
Probable fix (the bug report doesn't have enough info to say for sure). find_init_module(): Insist on a case-sensitive match for __init__ files. Given __INIT__.PY instead, find_init_module() thought that was fine, but the later attempt to do find_module("__INIT__.PY") didn't and its caller silently suppressed the resulting ImportError. Now find_init_module() refuses to accept __INIT__.PY to begin with. Bugfix candidate; specific to platforms with case-insensitive filesystems.
2001-04-29SF bug #417093: Case sensitive import: dir and .py file w/ same nameTim Peters-8/+5
Directory containing Spam.py spam/__init__.py Then "import Spam" caused a SystemError, because code checking for the existence of "Spam/__init__.py" finds it on a case-insensitive filesystem, but then bails because the directory it finds it in doesn't match case, and then old code assumed that was still an error even though it isn't anymore. Changed the code to just continue looking in this case (instead of calling it an error). So import Spam and import spam both work now.