Thomas Heller
99120c4f7e
Revert rev. 59925, it breaks comtypes (I need to further examine this).
2008-01-28 08:44:13 +00:00
Christian Heimes
d7e1b2bd17
static PyObject* variables should use PyString_InternFromString() instead of PyObject_FromString() to store a python string in a function level static var.
2008-01-28 02:07:53 +00:00
Neal Norwitz
b3c8243c47
Update to newer version of ffi. Fixes crashes and test failures of longdouble
2008-01-27 17:10:43 +00:00
Neal Norwitz
e9057ff1a9
Initialize variable to prevent warning on some platform/config.
2008-01-27 17:10:35 +00:00
Neal Norwitz
e1027f9034
Use int for the sign rather than a char. char can be signed or unsigned.
...
It's system dependent. This might fix the problem with test_rfind failing.
2008-01-27 07:37:38 +00:00
Neal Norwitz
448654f1f8
Mostly reformat. Also set an error and return NULL if neither MS_WINDOWS
...
nor UNIX is defined. This may have caused problems on cygwin.
2008-01-27 07:36:03 +00:00
Neal Norwitz
739a3c40e6
Cleanup the code a bit. test_rfind is failing on PPC and PPC64 buildbots,
...
this might fix the problem.
2008-01-26 20:24:36 +00:00
Georg Brandl
29604a1b4c
#1940 : make it possible to use curses.filter() before curses.initscr()
...
as the documentation says.
2008-01-26 14:03:47 +00:00
Christian Heimes
543cabc842
setup.py doesn't pick up changes to a header file
2008-01-25 14:54:23 +00:00
Christian Heimes
7f39c9fcbb
Backport of several functions from Python 3.0 to 2.6 including PyUnicode_FromString, PyUnicode_Format and PyLong_From/AsSsize_t. The functions are partly required for the backport of the bytearray type and _fileio module. They should also make it easier to port C to 3.0.
...
First chapter of the Python 3.0 io framework back port: _fileio
The next step depends on a working bytearray type which itself depends on a backport of the nwe buffer API.
2008-01-25 12:18:43 +00:00
Neal Norwitz
5f95a79b2b
Add prototypes to get the mathmodule.c to compile on OSF1 5.1 (Tru64)
...
and eliminate a compiler warning in floatobject.c. There might be
a better way to go about this, but it should be good enough for now.
2008-01-25 08:04:16 +00:00
Thomas Heller
5ca924038d
Invert the checks in get_[u]long and get_[u]longlong. The intent was
...
to not accept float types; the result was that integer-like objects
were not accepted.
Ported from release25-maint.
2008-01-24 19:15:02 +00:00
Thomas Heller
71dba4ccee
Replace Py_BuildValue with PyTuple_Pack because it is faster.
...
Also add a missing DECREF.
2008-01-24 18:54:12 +00:00
Thomas Heller
e4c03e4520
Use a PyDictObject again for the array type cache; retrieving items
...
from the WeakValueDictionary was slower by nearly a factor of 3.
To avoid leaks, weakref proxies for the array types are put into the
cache dict, with weakref callbacks that removes the entries when the
type goes away.
2008-01-24 18:36:27 +00:00
Guido van Rossum
6f4ee2d48f
Fix misleading comment reported in issue #1917 .
2008-01-23 22:43:27 +00:00
Armin Rigo
964ca4274f
patch 1754489 by vlahan:
...
improve portability of address length calculation for AF_UNIX sockets
2008-01-23 14:07:13 +00:00
Christian Heimes
501dbbfb70
Use Py_TYPE() instead of ->ob_type
2008-01-23 14:00:25 +00:00
Georg Brandl
d02fc48f67
Fix for #1087741 patch.
2008-01-22 19:56:03 +00:00
Georg Brandl
c09b94e063
Reformat some ugly code.
2008-01-21 21:28:32 +00:00
Georg Brandl
32a3fb5ec9
Patch #1720595 : add T_BOOL to the range of structmember types.
...
Patch by Angelo Mottola, reviewed by MvL, tests by me.
2008-01-21 21:23:15 +00:00
Georg Brandl
845c403c08
#1087741 : make mmap.mmap the type of mmap objects, not a
...
factory function. Allow it to be subclassed.
2008-01-21 14:16:46 +00:00
Georg Brandl
ef92802f73
Switch mmap from old Py_FindMethod to new PyObject_GenericGetAttr attribute access.
...
Fixes #1087735 .
2008-01-20 14:50:05 +00:00
Georg Brandl
f558d2e5f5
#1509 : fix sqlite3 docstrings and docs w.r.t. cursor.fetchXXX methods.
2008-01-19 20:53:07 +00:00
Andrew M. Kuchling
060e6855a8
Patch #1019808 from Federico Schwindt: Return correct socket error when
...
a default timeout has been set, by using getsockopt() to get the error
condition (instead of trying another connect() call, which seems to be
a Linuxism).
2.5 bugfix candidate, assuming no one reports any problems with this change.
2008-01-19 20:47:59 +00:00
Georg Brandl
309501a617
#1663329 : add os.closerange() to close a range of fds,
...
ignoring errors, and use this in subprocess to speed up
subprocess creation in close_fds mode. Patch by Mike Klaas.
2008-01-19 20:22:13 +00:00
Andrew M. Kuchling
5c60bfcfbf
Patch #976880 : add mmap .rfind() method, and 'end' paramter to .find().
...
Contributed by John Lenton.
2008-01-19 18:18:41 +00:00
Christian Heimes
4956d2b889
Silence Coverity false alerts with CIDs #172 , #183 , #184
2008-01-18 19:12:56 +00:00
Christian Heimes
5cc3f26c48
Coverity CID #168
...
leaked_storage: Returned without freeing storage "fp"
2008-01-18 08:53:45 +00:00
Christian Heimes
87dcf3d260
Coverity issue CID #182
...
size_error: Allocating 1 bytes to pointer "children", which needs at least 4 bytes
2008-01-18 08:04:57 +00:00
Christian Heimes
62a8e95fea
Coverity issue CID #197
...
var_decl: Declared variable "stm" without initializer
ninit_use_in_call: Using uninitialized value "stm" (field "stm".tm_zone uninitialized) in call to function "mktime"
2008-01-18 07:30:20 +00:00
Raymond Hettinger
18e08e5e61
clearcache() needs to remove the dict as well as clear it.
2008-01-18 00:10:42 +00:00
Brett Cannon
a35a8b11c3
Fix a function pointer declaration to silence the compiler.
2008-01-17 18:45:10 +00:00
Raymond Hettinger
473170908e
Make starmap() match its pure python definition and accept any itertable input (not just tuples).
2008-01-17 03:02:14 +00:00
Thomas Heller
0f75f9847a
Use 'g' instead of 'D' as the ctypes typecode for c_longdouble, for
...
compliance with PEP 3118.
2008-01-16 20:34:37 +00:00
Thomas Heller
415c1e36a9
Raise a TypeError instead of a ValueError when too many initializers
...
are used in a Structure or Union constructor.
2008-01-16 19:45:51 +00:00
Thomas Heller
02ec289f3e
Raise a TypeError if conflicting positional and named arguments are
...
passed to a Structure or Union constructor.
2008-01-16 19:37:33 +00:00
Thomas Heller
902d30752f
Convert the internal ctypes array type cache to a WeakValueDict so
...
that array types do not live longer than needed.
2008-01-16 19:16:27 +00:00
Thomas Heller
7a66a1becc
Issue 1821: configure libffi for amd64 on FreeeBSD.
2008-01-14 10:35:28 +00:00
Amaury Forgeot d'Arc
7cdf5f5c31
?Why did my tests not notice this before?
...
Slots inheritance is very different from OO inheritance.
This code lead to infinite recursion on classes derived from StructType.
2008-01-14 01:07:27 +00:00
Amaury Forgeot d'Arc
08ccf202e6
As discussed in issue 1700288:
...
ctypes takes some liberties when creating python types: it modifies the types'
__dict__ directly, bypassing all the machinery of type objects which deal with
special methods. And this broke recent optimisations of method lookup.
Now we try to modify the type with more "official" functions.
2008-01-14 00:22:44 +00:00
Thomas Heller
5f0b7ae481
Make Modules/socketobject.c compile for Windows again.
2008-01-13 11:19:43 +00:00
Thomas Heller
43617bc610
Fix a potential 'SystemError: NULL result without error'.
...
NULL may be a valid return value from PyLong_AsVoidPtr.
Will backport to release25-maint.
2008-01-11 20:29:19 +00:00
Thomas Heller
c682614df0
Raise an error instead of crashing with a segfault when a NULL
...
function pointer is called.
Will backport to release25-maint.
2008-01-11 19:34:06 +00:00
Christian Heimes
0f973934f4
Removed unused variable
2008-01-11 15:42:29 +00:00
Georg Brandl
ff15c866a6
Guard definition of TIPC_SUB_CANCEL with an #ifdef.
2008-01-11 09:19:11 +00:00
Raymond Hettinger
a7d984e838
Comment-out missing constant (from rev 59819)
2008-01-11 02:12:33 +00:00
Andrew M. Kuchling
7c22ccc3dd
Check for fd of -1 to save fsync() and fstat() call
2008-01-10 13:37:12 +00:00
Andrew M. Kuchling
3eb4aa733a
Related to patch #1114 : fix another place where attr_t is assumed to be a long
2008-01-09 12:27:41 +00:00
Facundo Batista
4473d225a8
Issue 846388. Adds a call to PyErr_CheckSignals to
...
SRE_MATCH so that signal handlers can be invoked during
long regular expression matches. It also adds a new
error return value indicating that an exception
occurred in a signal handler during the match, allowing
exceptions in the signal handler to propagate up to the
main loop. Thanks Josh Hoyt and Ralf Schmitt.
2008-01-08 21:10:12 +00:00
Thomas Heller
41f278ffa5
Use relative instead of absolute filenames in the C-level tracebacks.
...
This prevents traceback prints pointing to files in this way:
File "\loewis\25\python\Modules\_ctypes\callbacks.c", line 206, in 'calling callback function'
2008-01-08 15:15:09 +00:00