| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
to protect against actual uninitialized usage.
Objects/longobject.c: In function ‘PyLong_AsDouble’:
Objects/longobject.c:655: warning: ‘e’ may be used uninitialized in this function
Objects/longobject.c: In function ‘long_true_divide’:
Objects/longobject.c:2263: warning: ‘aexp’ may be used uninitialized in this function
Objects/longobject.c:2263: warning: ‘bexp’ may be used uninitialized in this function
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is how string objects work. u'%f' could use , instead of .
for the decimal point. Now both strings and unicode always use periods.
This is the code that would break:
import locale
locale.setlocale(locale.LC_NUMERIC, 'de_DE')
u'%.1f' % 1.0
assert '1.0' == u'%.1f' % 1.0
I couldn't create a test case which fails, but this fixes the problem.
Will backport.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also, stop determining Unicode sizes with PyString_GET_SIZE.
|
| |
|
|
|
|
| |
no code changes.
|
|
|
|
|
| |
A patch by mwh to check that user-defined mro's are reasonable
enough.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* set sq_repeat and sq_concat to NULL for user-defined new-style
classes, as a way to fix a number of related problems. See
test_descr.notimplemented()). One of these problems was fixed
in r25556 and r25557 but many more existed; this is a general
fix and thus reverts r25556-r25557.
* to avoid having PySequence_Repeat()/PySequence_Concat() failing
on user-defined classes, they now fall back to nb_add/nb_mul if
sq_concat/sq_repeat are not defined and the arguments appear to
be sequences.
* added tests.
Backport candidate.
|
| |
|
|
|
|
| |
just like string codecs.
|
|
|
|
|
| |
(calling ftell(stdin) doesn't seem defined). So we won't test errors
from ftell unless we can do it portably.
|
|
|
|
|
| |
ftell(3) on BSD doesn't set errno even for ttys and returns useless
values.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
|
|
|
|
|
|
|
|
| |
[ 1346144 ] Segfaults from unaligned loads in floatobject.c
by using memcpy and not just blinding casting char* to double*.
Thanks to Rune Holm for the report.
|
| |
|
|
|
|
| |
Perhaps Py_NO_INLINE should be moved to pyport.h or some other header?
|
| |
|
|
|
|
|
|
|
|
| |
'[].__add__', to match what the other internal descriptor types provide:
'__objclass__' attribute, '__self__' member, and reasonable repr and
comparison.
Added a test.
|
| |
|
| |
|
|
|
|
| |
properties now.
|
| |
|
|
|
|
| |
Remove duplicate declarations from compile.h
|
|
|
|
|
|
|
|
| |
[ 1327110 ] wrong TypeError traceback in generator expressions
by removing the code that can stomp on the users' TypeError raised by the
iterable argument to ''.join() -- PySequence_Fast (now?) gives a perfectly
reasonable message itself. Also, a couple of tests.
|
|
|
|
|
|
|
|
|
|
| |
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
|
|
|
|
|
|
|
|
| |
type lookups: whitespace and linebreak.
These lookup tables are from the Python 1.6 version with the addition
of the 205F code point which was added as whitespace code point to Unicode
since then.
|
|
|
|
| |
Will backport
|
| |
|
|
|
|
| |
Backport candidate.
|
|
|
|
|
|
|
| |
PyUnicode_DecodeCharmap() the accept a unicode string as the mapping
argument which is used as a mapping table.
This code isn't used by any of the codecs yet.
|
|
|
|
| |
enabled.
|
|
|
|
|
| |
segfault when a class contain a non-list value in the (undocumented)
special attribute __slotnames__.
|
| |
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2002-July/026876.html
|
|
|
|
|
|
|
| |
represented as a C int, raise OverflowError.
(Forward port from 2.4.2; the patch to classobject.c was already in
but needed a correction in the error message text.)
|
|
|
|
|
|
| |
containing a value that doesn't fit in a C int, raise OverflowError
rather than truncating silently (and having 50% chance of hitting the
"it should be >= 0" error).
|
|
|
|
| |
Inspired by Armin Rigo's suggestion to do the same with dictionaries.
|
| |
|
|
|
|
|
| |
subclasses should be substituted as-is and not have tp_str called on
them.
|
|
|
|
|
| |
about illegal code points. The codec now supports PEP 293 style error handlers.
(This is a variant of the Nik Haldimann's patch that detects truncated data)
|
|
|
|
| |
(fixes bug #1119418)
|
|
|
|
|
| |
already been computed.
* Apply a GET_SIZE macro().
|
|
|
|
|
|
| |
Fix over-aggressive PyErr_Clear(). The same code fragment appears in
various guises in list.extend(), map(), filter(), zip(), and internally
in PySequence_Tuple().
|
| |
|
| |
|