Commit Graph

1487 Commits

Author SHA1 Message Date
Larry Hastings 5ac006dfd3 Capsule-related changes:
* PyCObject_AsVoidPtr() can now open capsules.  This addresses
  most of the remaining backwards-compatibility concerns about
  the conversion of Python 2.7 from CObjects to capsules.
* CObjects were marked Pending Deprecation.
* Documentation about this pending deprecation was added to
  cobject.h.
* The capsule source files were added to the legacy PC build
  processes.
2010-04-02 11:01:35 +00:00
Antoine Pitrou 76c8649038 Issue #8276: PyEval_CallObject() is now only available in macro form. The
function declaration, which was kept for backwards compatibility reasons,
is now removed (the macro was introduced in 1997!).
2010-04-01 16:42:11 +00:00
Antoine Pitrou a57df2cf1d Issue #8268: Old-style classes (not just instances) now support weak
references.
2010-03-31 21:32:15 +00:00
Larry Hastings 4e9830f7ac Remove extraneous experimental code checked in by accident. 2010-03-25 01:23:27 +00:00
Larry Hastings 402b73fb8d Backported PyCapsule from 3.1, and converted most uses of
CObject to PyCapsule.
2010-03-25 00:54:54 +00:00
Collin Winter 001a3952c9 Add support for weak references to code objects. This will be used by an optimization in the incoming Python 3 JIT.
Patch by Reid Kleckner!
2010-03-18 21:54:01 +00:00
Benjamin Peterson 5da7e7ce3f post release update 2010-03-06 22:44:07 +00:00
Benjamin Peterson 8e7c1178a0 bump version to 2.7a4 2010-03-06 20:34:14 +00:00
Victor Stinner 71fb87e64c Issue #7544: Preallocate thread memory before creating the thread to avoid a
fatal error in low memory condition.
2010-03-03 23:20:25 +00:00
Amaury Forgeot d'Arc adfc80bd81 #4852: Remove dead code in every thread implementation, unused for many years. 2010-02-23 23:19:39 +00:00
Mark Dickinson d5fdc069fa Silence more 'comparison between signed and unsigned' warnings. 2010-02-14 13:40:30 +00:00
Benjamin Peterson 2d798ac619 post release updates 2010-02-06 18:26:27 +00:00
Benjamin Peterson a7be9d240a bump version to 2.7a3 2010-02-06 16:37:32 +00:00
Antoine Pitrou bb445a1f22 Issue #5677: Explicitly forbid write operations on read-only file objects,
and read operations on write-only file objects.  On Windows, the system C
library would return a bogus result; on Solaris, it was possible to crash
the interpreter.  Patch by Stefan Krah.
2010-02-05 17:05:54 +00:00
Mark Dickinson a36507c64c Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a
long long variant of PyLong_AsLongAndOverflow.  Patch by Case Van
Horsen.
2010-01-30 10:08:33 +00:00
Ronald Oussoren a55af9a9db - Issue #7658: Ensure that the new pythonw executable works on OSX 10.4
- Issue #7714: Use ``gcc -dumpversion`` to detect the version of GCC on
  MacOSX.

- Make configure look for util.h as well as libutil.h. The former
  is the header file that on OSX contains the defition of openpty.

  (Needed to compile for OSX 10.4 on OSX 10.6)

- Use the correct definition of CC to compile the pythonw executable
2010-01-17 16:25:57 +00:00
Antoine Pitrou 60ba2c8bf8 Use PyAPI_DATA. 2010-01-17 15:55:45 +00:00
Antoine Pitrou e80a6a4ead Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)
could crash in many places because of the PyByteArray_AS_STRING() macro
returning NULL.  The macro now returns a statically allocated empty
string instead.
2010-01-17 12:26:20 +00:00
Alexandre Vassalotti 69eb51697c Issue #1967: Backport dictionary views. 2010-01-11 23:17:10 +00:00
Alexandre Vassalotti b646547bb4 Issue #2333: Backport set and dict comprehensions syntax. 2010-01-11 22:36:12 +00:00
Alexandre Vassalotti ee936a2130 Issue #2335: Backport set literals syntax from Python 3.x. 2010-01-09 23:35:54 +00:00
Benjamin Peterson dd6d92a560 post release version adjustment 2010-01-09 17:30:31 +00:00
Benjamin Peterson aa7e51f006 bump version to 2.7a2 2010-01-09 16:34:06 +00:00
Mark Dickinson d3e323215c Refactor some longobject internals: PyLong_AsDouble and _PyLong_AsScaledDouble
(the latter renamed to _PyLong_Frexp) now use the same core code.  The
exponent produced by _PyLong_Frexp now has type Py_ssize_t instead of the
previously used int, and no longer needs scaling by PyLong_SHIFT.  This
frees the math module from having to know anything about the PyLong
implementation.  This closes issue #5576.
2010-01-02 14:45:40 +00:00
Georg Brandl 740cdc3a9f #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new exceptions a docstring. 2009-12-28 08:34:58 +00:00
Mark Dickinson 12748b003c Issue #7518: Move substitute definitions of C99 math functions from
pymath.c to Modules/_math.c.
2009-12-21 15:22:00 +00:00
Mark Dickinson e31d300664 Issue #7528: Backport PyLong_AsLongAndOverflow from py3k to trunk.
Thanks Case Van Horsen for the patch.
2009-12-21 11:21:25 +00:00
Benjamin Peterson 3095d20a53 initialize to NULL 2009-12-13 21:21:43 +00:00
Mark Dickinson fd25634715 Replace the size check for PyMem_MALLOC and PyMem_REALLOC with an almost
equivalent[*] check that doesn't produce compiler warnings about a 'x < 0'
check on an unsigned type.

[*] it's equivalent for inputs of type size_t or Py_ssize_t, or any smaller
unsigned or signed integer type.
2009-12-10 10:36:32 +00:00
Ronald Oussoren a254302f52 Fix for issue 7452: HAVE_GCC_ASM_FOR_X87 gets set when doing a universal build on
an i386 based machine, but should only be active when compiling the x86 part of
the universal binary.
2009-12-08 16:32:52 +00:00
Benjamin Peterson 4f51baf466 post release version bump 2009-12-05 18:40:02 +00:00
Benjamin Peterson d78cec5f39 bump version to 2.7a1 2009-12-05 17:47:56 +00:00
Ronald Oussoren 7072f74dc8 Fix for issue #7416: SIZEOF_UINTPTR_T can be invalid when configuring a
multi-architecture build (in particular when the architectures don't share
a common pointer size).

Fixed the same issue for SIZEOF_PTHREAD_T.

(No update to the NEWS file because this is a bugfix for an as yet unreleased
feature)
2009-12-01 15:54:01 +00:00
Mark Dickinson 31f0cfef0e Include ieeefp.h (when available) in pyport.h instead of individually in
Objects/floatobject.c and Objects/complexobject.c.  This should silence
compiler warnings about implicit declaration of the 'finite' function
on Solaris.
2009-11-28 12:30:36 +00:00
Mark Dickinson 845688d0c6 Enable short float repr! 2009-11-18 20:14:57 +00:00
Mark Dickinson bd15a06fd3 Issue #7117, continued: Change round implementation to use the correctly-rounded
string <-> float conversions;  this makes sure that the result of the round
operation is correctly rounded, and hence displays nicely using the new float
repr.
2009-11-18 19:33:35 +00:00
Mark Dickinson 82864d1ab1 Issue #7228: Add '%lld' and '%llu' support to PyFormat_FromString,
PyFormat_FromStringV and PyErr_Format.
2009-11-15 16:18:58 +00:00
Mark Dickinson 3e1eb0f715 Issue #7117: Backport missing pystrtod.h declarations from py3k. 2009-10-26 21:09:09 +00:00
Eric Smith c1bdf89145 Finished removing _PyOS_double_to_string, as mentioned in issue 7117. 2009-10-26 17:46:17 +00:00
Mark Dickinson f325407038 Issue #7117: temporarily disable the short float repr while the
pieces are being assembled.  To re-enable, define the preprocessor
symbol PY_SHORT_FLOAT_REPR
2009-10-24 15:54:35 +00:00
Mark Dickinson 1d6e2e1833 Issue #7117 (backport py3k float repr) continued:
- add double endianness detection to configure script
 - add configure-time check to see whether we can use inline
   assembly to get and set x87 control word in configure script
 - add functions to get and set x87 control word in Python/pymath.c
 - add pyport.h logic to determine whether it's safe to use the
   short float repr or not
2009-10-24 13:28:38 +00:00
Mark Dickinson bb28285ea2 Issue #7117: Prepare for backport of py3k float repr.
Add the Python/dtoa.c file containing the main algorithms;
add corresponding include file and include in Python.h;
include license information for Python/dtoa.c;
add dtoa.c and dtoa.h to Makefile.
2009-10-24 12:13:30 +00:00
Kristján Valur Jónsson 02ca57ce4c http://bugs.python.org/issue6836
The debug memory api now keeps track of which external API (PyMem_* or PyObject_*) was used to allocate each block and treats any API violation as an error.  Added separate _PyMem_DebugMalloc functions for the Py_Mem API instead of having it use the _PyObject_DebugMalloc functions.
2009-09-28 13:12:38 +00:00
Mark Dickinson aa2adc828a Issue #6713: Improve performance of str(n) and repr(n) for integers n
(up to 3.1 times faster in tests), by special-casing base 10 in
_PyLong_Format.  (Backport of r74851 from py3k.)
2009-09-16 22:10:56 +00:00
Thomas Wouters c4dcb3801e Fix issue #1590864, multiple threads and fork() can cause deadlocks, by
acquiring the import lock around fork() calls. This prevents other threads
from having that lock while the fork happens, and is the recommended way of
dealing with such issues. There are two other locks we care about, the GIL
and the Thread Local Storage lock. The GIL is obviously held when calling
Python functions like os.fork(), and the TLS lock is explicitly reallocated
instead, while also deleting now-orphaned TLS data.

This only fixes calls to os.fork(), not extension modules or embedding
programs calling C's fork() directly. Solving that requires a new set of API
functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
warning explaining the problem to the documentation in the mean time.

This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
getting the import lock reallocated, seemingly to avoid this very same
problem. This is not the right approach, because the import lock is a
re-entrant one, and reallocating would do the wrong thing when forking while
holding the import lock.

Will backport to 2.6, minus the tiny AIX behaviour change.
2009-09-16 19:55:54 +00:00
Mark Dickinson 6b3f1ef190 Issue #6848: Fix curses module build failure on OS X 10.6. 2009-09-06 21:21:05 +00:00
Mark Dickinson 2f865b962c Issue #6347: Add inttypes.h to the pyport.h #includes; fixes a build
failure on HP-UX 11.00.
2009-06-30 15:32:30 +00:00
Mark Dickinson 1dcc38456f Remove unused stdint.h includes 2009-06-28 22:37:13 +00:00
Benjamin Peterson 94819cf47c remove some unused symtable constants 2009-06-23 03:01:56 +00:00
Benjamin Peterson d9920c255d remove tmpname support since it's no longer used 2009-06-21 23:03:36 +00:00