| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
Also, added more regression tests to cover the new type and test its
conformity with range().
|
| |
|
|
|
|
| |
In the error message, say del for del and assign for everything else.
|
|
|
|
| |
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.
|
|
|
|
|
| |
that are in the process of deprecation (PendingDeprecationWarning).
Docs could be improved.
|
|
|
|
|
| |
literals must not contain \u, \U or \N escapes. (XXX Should they also
not contain non-ASCII characters?)
|
|
|
|
|
|
|
| |
in there, and convert it to "rb" (or "r" for non-universal-newline builds)
before passing it to fopen().
Fixes #561326.
|
|
|
|
|
|
|
| |
for 'str' and 'unicode', and can be used instead of
types.StringTypes, e.g. to test whether something is "a string":
isinstance(x, string) is True for Unicode and 8-bit strings. This
is an abstract base class and cannot be instantiated directly.
|
|
|
|
|
|
| |
The old syntax suggested that a trailing comma was OK inside backticks,
but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar
to avoid the ambiguity. Fred: you may want to update the refman.
|
|
|
|
| |
"power" was formally ambiguous. Here's his fix.
|
|
|
|
|
|
|
|
|
|
|
| |
[ 558249 ] softspace vs --disable-unicode
And #endif was in the wrong place.
Bugfix candidate, almost surely.
I think I will embark on squashing test failures in --disable-unicode builds --
a Real Bug was hiding under them.
|
|
|
|
|
| |
NOT a bugfix candidate: this is a fix to an optimization introduced
in 2.3.
|
|
|
|
|
|
|
| |
and allocate it in one gulp.
This isn't a bugfix, it's just a minor optimization that may or may not
pay off.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
don't understand how this function works, also beefed up the docs. The
most common usage error is of this form (often spread out across gotos):
if (_PyString_Resize(&s, n) < 0) {
Py_DECREF(s);
s = NULL;
goto outtahere;
}
The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL. So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s): s is already
NULL! A correct way to write the above is the simpler (and intended)
if (_PyString_Resize(&s, n) < 0)
goto outtahere;
Bugfix candidate.
|
|
|
|
|
| |
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
The argument can be an arbitrary iterable object.
|
|
|
|
| |
test __debug__ at runtime. Closes SF patch #548833.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SIGXFSZ signal is sent when the maximum file size limit is
exceeded (RLIMIT_FSIZE). Apparently, it is also sent when the 2GB
file limit is reached on platforms without large file support.
The default action for SIGXFSZ is to terminate the process and dump
core. When it is ignored, the system call that caused the limit to be
exceeded returns an error and sets errno to EFBIG. Python
always checks errno on I/O syscalls, so there is nothing to do with
the signal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
+ Redirect PyMem_{Del, DEL} to the object allocator's free() when
pymalloc is enabled. Needed so old extensions can continue to
mix PyObject_New with PyMem_DEL.
+ This implies that pgen needs to be able to see the PyObject_XYZ
declarations too. pgenheaders.h now includes Python.h. An
implication is that I expect obmalloc.o needs to get linked into
pgen on non-Windows boxes.
+ When PYMALLOC_DEBUG is defined, *all* Py memory API functions
now funnel through the debug allocator wrapper around pymalloc.
This is the default in a debug build.
+ That caused compile.c to fail: it indirectly mixed PyMem_Malloc
with raw platform free() in one place. This is verbotten.
|
|
|
|
|
|
|
|
| |
a str subclass.
test_descr.py/string_exceptions(): New sub-test.
For 2.3 only. Guido doesn't want this backported.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Added code to call this when PYMALLOC_DEBUG is enabled, and envar
PYTHONMALLOCSTATS is set, whenever a new arena is obtained and once
late in the Python shutdown process.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes bug #525620.
|
| |
|
|
|
|
| |
Bugfix candidate.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PEP 285. Everything described in the PEP is here, and there is even
some documentation. I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison. I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.
Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SF bug 535905 (Evil Trashcan and GC interaction).
The SETLOCAL() macro should not DECREF the local variable in-place and
then store the new value; it should copy the old value to a temporary
value, then store the new value, and then DECREF the temporary value.
This is because it is possible that during the DECREF the frame is
accessed by other code (e.g. a __del__ method or gc.collect()) and the
variable would be pointing to already-freed memory.
BUGFIX CANDIDATE!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
descriptor, as used for the tp_methods slot of a type. These new flag
bits are both optional, and mutually exclusive. Most methods will not
use either. These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.
If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.
If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.
These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.
|
|
|
|
| |
sys.exit() now requires 0-1 arguments. Previously 2+ arguments were allowed.
|
|
|
|
| |
ever do, they can damn well #define _POSIX_THREADS their own damn selves.
|
|
|
|
|
|
|
|
|
|
| |
This fixes the symptom, but PRINT_ITEM has no way to know what (if
anything) PyFile_WriteObject() writes unless the object being printed
is a string. When the object isn't a string, this fix retains the
guess that softspace should be set after PyFile_WriteObject().
We might want to say that it's the job of filelike-object write methods
to leave the file's softspace in the correct state. That would probably
be better -- but everyone relies on PRINT_ITEM to guess for them now.
|
| |
|
|
|
|
| |
statement.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
that it didn't tell enough of the truth.
Bugfix candidate (I guess -- it helps and it's harmless).
|