summaryrefslogtreecommitdiffstats
path: root/Python/import.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove PyArg_ParseTuple() for methods which take no args,Neal Norwitz2003-02-171-23/+13
| | | | use METH_NOARGS instead
* Cleanup from patch #683257:Neal Norwitz2003-02-121-4/+7
| | | | | | | Add missing INCREFs and re-indent returns to be consistent. Add \n\ for lines in docstring Add a pathetic test Add docs
* Provide access to the import lock, fixing SF bug #580952. This isGuido van Rossum2003-02-121-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.
* MacPython-OS9 specific fix: If there are non-string items on sys.path don't ↵Jack Jansen2003-01-241-15/+18
| | | | 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.
* PEP 302 + zipimport:Just van Rossum2002-12-301-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.
* Backing out patch #642578 in anticipation of final acceptance of PEP 302.Just van Rossum2002-12-251-147/+0
|
* Added missing casts.Jack Jansen2002-12-131-2/+2
|
* Patch #614055: Support OpenVMS.Martin v. Löwis2002-12-061-2/+5
|
* Slightly improved version of patch #642578: "Expose PyImport_FrozenModulesJust van Rossum2002-11-291-0/+147
| | | | | in imp". This adds two functions to the imp module: get_frozenmodules() and set_frozenmodules().
* Because MWH changed the bytecode again, moved the magic number *back*Guido van Rossum2002-08-311-1/+6
| | | | | to 62011. This should get the snake-farm to throw away its old .pyc files, amongst others.
* This is my patchMichael W. Hudson2002-08-151-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.
* Patch #569753: Remove support for WIN16.Martin v. Löwis2002-06-301-5/+5
| | | | Rename all occurrences of MS_WIN32 to MS_WINDOWS.
* Apply diff2.txt from SF patch http://www.python.org/sf/566999Walter Dörwald2002-06-171-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.
* Fix SF bug # 561858 Assertion with very long listsNeal Norwitz2002-06-141-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.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-28/+21
|
* imp_load_module(): correct and comment the sense of the test for '+'Guido van Rossum2002-05-301-2/+7
| | | | in the mode (it's forbidden).
* Cover a few corners in the 'U' mode integration to make imp work.Jeremy Hylton2002-05-301-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.
* File modes in filedescr entries are also passed to Python, so we now put "U"Jack Jansen2002-05-281-4/+7
| | | | | | | in there, and convert it to "rb" (or "r" for non-universal-newline builds) before passing it to fopen(). Fixes #561326.
* Mass checkin of universal newline support.Jack Jansen2002-04-141-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.
* Got rid of ifdefs for long-obsolete GUSI versions.Jack Jansen2002-04-111-21/+0
|
* is_builtin() is not a Boolean -- it can return -1, 0, 1. [SF #541652]Guido van Rossum2002-04-091-1/+1
|
* Return bools from functions named is_<whatever>().Guido van Rossum2002-04-071-4/+4
|
* Use symbolic METH_VARARGS instead of 1 for ml_flagsNeal Norwitz2002-03-311-16/+16
|
* Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.Tim Peters2002-03-291-2/+0
|
* OS/2 EMX port changes (Python part of patch #450267):Andrew MacIntyre2002-02-261-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
* Fix to the UTF-8 encoder: it failed on 0-length input strings.Marc-André Lemburg2002-02-071-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.
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-4/+0
|
* Since the MAGIC number scheme is going to break on January 1st, documentTim Peters2001-11-181-4/+16
| | | | what it is more carefully and point out some of the subtleties.
* On the macintosh don't take a quick exit in find_module() for frozen ↵Jack Jansen2001-10-301-0/+8
| | | | submodule imports: the frozen import goes through a different mechanism.
* Use PyDict_Copy() and PyDict_Update() instead of using PyObject_CallMethod()Fred Drake2001-10-251-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.
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-241-7/+31
|
* First part of SF patch #416704: More robust freeze, by Toby Dickenson.Guido van Rossum2001-10-181-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).
* Remove a couple of unused local variables (bug #445960, compiler warningsGreg Ward2001-10-041-4/+2
| | | | on IRIX 6.5).
* Add a new function imp.lock_held(), and use it to skip test_threaded_importTim Peters2001-08-301-0/+19
| | | | when that test is doomed to deadlock.
* Fixed typo in comment leading up to _PyImport_FixupExtension().Barry Warsaw2001-08-131-1/+1
|
* Put conditional S_IFMT definition into pyport.h.Martin v. Löwis2001-08-081-5/+0
|
* Put conditional S_ISDIR definition(s) into pyport.h.Martin v. Löwis2001-08-081-4/+0
|
* Derived from SF patch #446899 Permit import of .pyw under Windows, fromTim Peters2001-08-041-5/+14
| | | | David Bolen.
* Merge of descr-branch back into trunk.Tim Peters2001-08-021-2/+5
|
* Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer2001-07-231-4/+4
| | | | and PYTHONPATH).
* SF Patch #441791, with changes: when "import foo.bar" fails with anGuido van Rossum2001-07-231-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. :-)
* SF bug #438295: [Windows] __init__.py cause strange behaviorTim Peters2001-07-051-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.
* SF bug #417093: Case sensitive import: dir and .py file w/ same nameTim Peters2001-04-291-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.
* Iterators phase 1. This comprises:Guido van Rossum2001-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER new C API PyObject_GetIter(), calls tp_iter new builtin iter(), with two forms: iter(obj), and iter(function, sentinel) new internal object types iterobject and calliterobject new exception StopIteration new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py) new magic number for .pyc files new special method for instances: __iter__() returns an iterator iteration over dictionaries: "for x in dict" iterates over the keys iteration over files: "for x in file" iterates over lines TODO: documentation test suite decide whether to use a different way to spell iter(function, sentinal) decide whether "for key in dict" is a good idea use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?) speed tuning (make next() a slot tp_next???)
* split long lineJeremy Hylton2001-04-131-1/+2
|
* Case-checking was broken on the Macintosh. Fixed.Jack Jansen2001-03-201-3/+2
|
* Add some spaces around the "=" in assignments.Fred Drake2001-03-061-2/+2
|
* RISCOS changes by dschwertberger.Guido van Rossum2001-03-021-0/+58
|
* Thanks to Steven Majewski, finally putting MacOS X imports to bed for 2.1b1.Tim Peters2001-03-021-9/+3
|
* More MacOSX fiddling. As noted in a comment, I believe all variationsTim Peters2001-03-011-18/+37
| | | | | of these "search the directory" schemes (including this one) are still prone to making mistakes.