Commit graph

4720 commits

Author SHA1 Message Date
Facundo Batista
1a664419bb Issue 3306. Better control for a lenght in findmax() function. 2008-07-07 17:02:59 +00:00
Gregory P. Smith
04222925f1 Add commented out #_sha256 and #_sha512 lines per issue 3183. 2008-07-07 04:54:31 +00:00
Gregory P. Smith
3b1e6b2f83 - Issue #3309: Fix bz2.BZFile itererator to release its internal lock
properly when raising an exception due to the bz2file being closed.
  Prevents a deadlock.
2008-07-07 04:31:58 +00:00
Gregory P. Smith
eb77fe4cbf fix issue3304 - remove an incorrect PyMem_Free in fileio_init 2008-07-06 17:06:29 +00:00
Gregory P. Smith
2fe77060eb - Issue #2862: Make int and float freelist management consistent with other
freelists.  Changes their CompactFreeList apis into ClearFreeList apis and
  calls them via gc.collect().
2008-07-06 03:35:58 +00:00
Facundo Batista
083902af8f Issue 3289. Removed two lines that ended doing nothing. 2008-07-05 19:19:50 +00:00
Mark Dickinson
ecf8d8cc4b Minor rewrite of cmath_log to work around a Sun compiler bug. See issue
#3168.
2008-07-05 15:25:48 +00:00
Amaury Forgeot d'Arc
968117e974 Try a blind fix to nismodule which fails on the solaris10 3.0 buildbot:
the GIL must be re-acquired in the callback function
2008-07-02 23:40:28 +00:00
Amaury Forgeot d'Arc
1f40c8a8d7 #Issue3088 in-progress: Race condition with instances of classes derived from threading.local:
When a thread touches such an object for the first time, a new thread-local __dict__ is created,
and the __init__ method is run.
But a thread switch can occur here; if the other thread touches the same object, it installs another
__dict__; when the first thread resumes, it updates the dictionary of the second...

This is the deep cause of the failures in test_multiprocessing involving "managers" objects.

Also a 2.5 backport candidate.
2008-06-30 22:42:40 +00:00
Facundo Batista
763d309bba Fix #2702, with a correct accounting of recursion. 2008-06-30 01:10:55 +00:00
Bill Janssen
934b16d0c2 various SSL fixes; issues 1251, 3162, 3212 2008-06-28 22:19:33 +00:00
Facundo Batista
68dc052ca6 Reverting the patch from #3165, as it broke other
behaviours. I left the original test commented out (note
that that test came from #2702, which seems to have a
problem in FreeBSD and Windows, but not in Linux).

I included a new test, to watch over the now-broken
behaviour, I took it from #3179.
2008-06-25 19:24:53 +00:00
Thomas Heller
b436a24eed Fix compilation on Windows. 2008-06-23 14:49:56 +00:00
Facundo Batista
9da18b3133 Fixing the problem stated in issue 2702 with the patch submitted
in the issue 3165. Now cPickle does not fails with uncontrolled
behaviour when pickling into a very deep nested structure.
2008-06-22 23:19:14 +00:00
Georg Brandl
ac0c3810e4 Expand docstrings of sqlite3 functions. 2008-06-22 18:31:54 +00:00
Facundo Batista
1461886eee Issue 3164. Small fix to don't repeat a comparation
without necessity.
2008-06-22 15:27:10 +00:00
Facundo Batista
5596b0cfc2 Issue #2722. Now the char buffer to support the path string has
not fixed length, it mallocs memory if needed. As a result, we
don't have a maximum for the getcwd() method.
2008-06-22 13:36:20 +00:00
Mark Dickinson
2fcd8c9703 Fix another typo in math_sum comment 2008-06-20 15:26:19 +00:00
Andrew M. Kuchling
5f198bee4e Fix comment typos 2008-06-20 02:11:42 +00:00
Andrew M. Kuchling
3d8f8c1d62 Only include update_lines_cols() function when it's actually going to be used 2008-06-19 14:02:30 +00:00
Raymond Hettinger
2281da42b0 Fix double decref. 2008-06-18 00:56:57 +00:00
Mark Dickinson
fb1c4b98e9 Issue 3118: make test_math pass on Ubuntu/ia64. exp(-745.0) was raising
OverflowError incorrectly on this platform, presumably as a result of
the libm setting errno = ERANGE for this call.
2008-06-17 21:16:55 +00:00
Amaury Forgeot d'Arc
d25cdc370d on windows, r64214 broke compilation with some recent SDKs,
because IPPROTO_IPV6 may be an enumeration member...
2008-06-14 08:36:07 +00:00
Benjamin Peterson
dfd79494ce convert multiprocessing to unix line endings 2008-06-13 19:13:39 +00:00
Martin v. Löwis
111c180674 Make more symbols static. 2008-06-13 07:47:47 +00:00
Georg Brandl
e1f6646d68 Typo. 2008-06-13 07:08:48 +00:00
Georg Brandl
6d53e7e69c #3095: don't leak values from Py_BuildValue. 2008-06-13 06:56:50 +00:00
Neal Norwitz
705cd06f91 Fix some memory dealloc problems when exceptions occur.
It caused: "Fatal Python error: UNREF invalid object" in the DoubleTest.
2008-06-13 06:02:26 +00:00
Neal Norwitz
e9ee44c25b Check for memory alloc failure 2008-06-13 06:00:46 +00:00
Amaury Forgeot d'Arc
a4dd2e20e2 Restore support for Microsoft VC6 compiler.
Some functions in the msvcrt module are skipped,
and socket.ioctl is enabled only when using a more recent Platform SDK.

(and yes, there are still companies that use a 10-years old compiler)
2008-06-13 00:42:22 +00:00
Benjamin Peterson
114f7e5fff #1683 prevent forking from interfering in threading storage
This should prevent some test_multiprocessing failures
2008-06-13 00:09:47 +00:00
Georg Brandl
89f48876a2 Add future_builtins.ascii(). 2008-06-11 18:55:38 +00:00
Raymond Hettinger
6fbfb481b8 Optimize previous checkin for heapq. 2008-06-11 12:39:09 +00:00
Raymond Hettinger
f0bc3cbdc0 Issue 3051: Let heapq work with either __lt__ or __le__. 2008-06-11 12:06:49 +00:00
Gregory P. Smith
9d53457e59 Merge in release25-maint r60793:
Added checks for integer overflows, contributed by Google. Some are
 only available if asserts are left in the code, in cases where they
 can't be triggered from Python code.
2008-06-11 07:41:16 +00:00
Benjamin Peterson
190d56e009 add the multiprocessing package to fulfill PEP 371 2008-06-11 02:40:25 +00:00
Gregory P. Smith
99a3dce92d More reverting of r63675 per the mailing list discussions. This restores
occurances of PyBytes_ in the code to their original PyString_ names.  The
bytesobject.c file will be renamed back to stringobject.c in a future checkin.
2008-06-10 17:42:36 +00:00
Thomas Heller
dcea9a91c6 Add an optional 'offset' parameter to byref, defaultingto zero. 2008-06-10 14:02:46 +00:00
Georg Brandl
8550d69a84 #2536: fix itertools.permutations and itertools.combinations docstrings. 2008-06-10 12:46:39 +00:00
Raymond Hettinger
d623414141 Unhappy buildbots. Revert 64052. Long doubles have unexpected effects on some builds. 2008-06-09 11:24:47 +00:00
Raymond Hettinger
7b1ed66372 Address double-rounding scenarios by setting all variables to long doubles. 2008-06-09 09:29:17 +00:00
Raymond Hettinger
ecbdd2e9b0 Issue #2138: Add math.factorial(). 2008-06-09 06:54:45 +00:00
Gregory P. Smith
dd96db63f6 This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html

Python 2.6 should stick with PyString_* in its codebase.  The PyBytes_* names
in the spirit of 3.0 are available via a #define only.  See the email thread.
2008-06-09 04:58:54 +00:00
Travis E. Oliphant
0144f27602 Remove locking part of new buffer protocol. 2008-06-06 22:39:47 +00:00
Raymond Hettinger
ec2fe78d47 Issue 3501: Make heapq support both __le__ and __lt__. 2008-06-06 21:47:51 +00:00
Thomas Heller
f89b04c164 Performance improvement: Use PyDict_Get/SetItem instead of
PyDict_Get/SetItemString.
2008-06-06 18:37:55 +00:00
Thomas Heller
fbb9c0bf3c Issue #1798: Add ctypes calling convention that allows safe access of errno.
ctypes maintains thread-local storage that has space for two error
numbers: private copies of the system 'errno' value and, on Windows,
the system error code accessed by the GetLastError() and
SetLastError() api functions.

Foreign functions created with CDLL(..., use_errno=True), when called,
swap the system 'errno' value with the private copy just before the
actual function call, and swapped again immediately afterwards.  The
'use_errno' parameter defaults to False, in this case 'ctypes_errno'
is not touched.

On Windows, foreign functions created with CDLL(...,
use_last_error=True) or WinDLL(..., use_last_error=True) swap the
system LastError value with the ctypes private copy.

The values are also swapped immeditately before and after ctypes
callback functions are called, if the callbacks are constructed using
the new optional use_errno parameter set to True: CFUNCTYPE(...,
use_errno=TRUE) or WINFUNCTYPE(..., use_errno=True).

New ctypes functions are provided to access the ctypes private copies
from Python:

- ctypes.set_errno(value) and ctypes.set_last_error(value) store
  'value' in the private copy and returns the previous value.

- ctypes.get_errno() and ctypes.get_last_error() returns the current
  ctypes private copies value.
2008-06-06 08:33:46 +00:00
Thomas Heller
2e75c450d2 Backport from py3k: Implement the new buffer interface from pep3118
for ctypes instances.  Closes issue #2404.
2008-06-05 17:51:15 +00:00
Ronald Oussoren
5640ce2f1e MacOS X: Enable 4-way universal builds
This patch adds a new configure argument on OSX:
        --with-universal-archs=[32-bit|64-bit|all]

When used with the --enable-universalsdk option this controls which
CPU architectures are includes in the framework. The default is 32-bit,
meaning i386 and ppc. The most useful alternative is 'all', which includes
all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64).

This includes limited support for the Carbon bindings in 64-bit mode as well,
limited because (a) I haven't done extensive testing and (b) a large portion
of the Carbon API's aren't available in 64-bit mode anyway.

I've also duplicated a feature of Apple's build of python: setting the
environment variable 'ARCHFLAGS' controls the '-arch' flags used for building
extensions using distutils.
2008-06-05 12:58:24 +00:00
Thomas Heller
d5bb9215c9 Revert revisions 63943 and 63942 (Issue #1798: Add ctypes calling
convention that allows safe access to errno)

This code does not yet work on OS X (__thread storage specifier not
available), so i needs a configure check plus a more portable
solution.
2008-06-04 20:22:05 +00:00