| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
use METH_NOARGS instead
|
|
|
|
|
|
|
| |
Add missing INCREFs and re-indent returns to be consistent.
Add \n\ for lines in docstring
Add a pathetic test
Add docs
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
in imp". This adds two functions to the imp module: get_frozenmodules()
and set_frozenmodules().
|
|
|
|
|
| |
to 62011. This should get the snake-farm to throw away its old .pyc
files, amongst others.
|
|
|
|
|
|
|
|
| |
[ 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.
|
|
|
|
| |
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Write 4 bytes for co_stacksize, etc. to prevent writing out
bad .pyc files which can cause a crash when read back in.
|
| |
|
|
|
|
| |
in the mode (it's forbidden).
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
in there, and convert it to "rb" (or "r" for non-universal-newline builds)
before passing it to fopen().
Fixes #561326.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
| |
what it is more carefully and point out some of the subtleties.
|
|
|
|
| |
submodule imports: the frozen import goes through a different mechanism.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
on IRIX 6.5).
|
|
|
|
| |
when that test is doomed to deadlock.
|
| |
|
| |
|
| |
|
|
|
|
| |
David Bolen.
|
| |
|
|
|
|
| |
and PYTHONPATH).
|
|
|
|
|
|
|
| |
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. :-)
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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???)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
of these "search the directory" schemes (including this one) are still prone
to making mistakes.
|