Thomas Heller
99120c4f7e
Revert rev. 59925, it breaks comtypes (I need to further examine this).
2008-01-28 08:44:13 +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
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
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
Thomas Heller
153038efa4
Issue #1642 : Fix segfault in ctypes when trying to delete attributes.
2007-12-18 19:00:34 +00:00
Thomas Heller
03fd077482
Enable the full ctypes c_longdouble tests again.
2007-11-02 19:11:23 +00:00
Thomas Heller
e7becc5007
Added unittest for calling a function with paramflags (backport from py3k branch).
2007-10-24 19:50:45 +00:00
Thomas Heller
7fee6dd2a3
On OS X, use os.uname() instead of gestalt.sysv(...) to get the
...
operating system version. This allows to use ctypes when Python
was configured with --disable-toolbox-glue.
2007-10-11 19:51:32 +00:00
Thomas Heller
a7f49f733b
ctypes.util.find_library uses dump(1) instead of objdump(1) on Solaris.
...
Fixes issue #1777530 ; will backport to release25-maint.
2007-09-14 19:40:35 +00:00
Thomas Heller
0b7120258a
Disable some tests that fail on the 'ppc Debian unstable' buildbot to
...
find out if they cause the segfault on the 'alpha Debian' machine.
2007-09-11 19:17:48 +00:00
Thomas Heller
2e638c3a8a
Backport from py3k branch:
...
Add a workaround for a strange bug on win64, when _ctypes is compiled
with the SDK compiler. This should fix the failing
Lib\ctypes\test\test_as_parameter.py test.
2007-09-07 09:33:24 +00:00
Thomas Heller
2825b2ea44
Add a 'c_longdouble' type to the ctypes module.
2007-09-07 06:32:17 +00:00
Thomas Wouters
dcb3c382ac
Somewhat-preliminary slice-object and extended slicing support for ctypes.
...
The exact behaviour of omitted and negative indices for the Pointer type may
need a closer look (especially as it's subtly different from simple slices)
but there's time yet before 2.6, and not enough before 3.0a1 :-)
2007-08-30 21:01:17 +00:00
Neal Norwitz
60b52bd4ed
Fix typo in docstring (missing c in reacquire)
2007-08-26 01:08:16 +00:00
Thomas Heller
fa704c6ade
Fix for SF# 1701409: segfault in c_char_p of ctypes. The repr output
...
of c_char_p and c_wchar_p has changed as a sideeffect.
2007-07-13 17:12:23 +00:00
Thomas Heller
ad0cfe3dd7
Do not try to load the GLUT library in the ctypes tests. This test
...
adds little value, but has a large problem on OS X, as explained in
SF# 1581906.
2007-07-13 16:50:43 +00:00
Thomas Heller
1fd1cc5be2
Add tests for _ctypes.COMError.
2007-07-13 14:18:06 +00:00
Thomas Heller
1b9e041812
Make this test work with older Python releases where struct has no 't' format character.
2007-06-08 16:10:27 +00:00
Thomas Heller
b4eec28e33
Correct the name of a field in the WIN32_FIND_DATAA and WIN32_FIND_DATAW structures.
...
Closes bug #1726026 .
2007-05-30 07:01:25 +00:00
Thomas Heller
2ebc4d8054
Oops, these tests do not run on Windows CE.
2007-05-04 19:56:32 +00:00
Thomas Heller
1ad576c267
Do not truncate 64-bit pointers to 32-bit integers.
...
Fixes SF #1703286 , will backport to release25-maint.
2007-05-04 19:54:22 +00:00
Thomas Heller
0455214f1c
Fix some ctypes test crashes, when running with a debug Python
...
version on win64 by using proper argtypes and restype function
attributes.
2007-05-04 07:14:39 +00:00
Neal Norwitz
0d4c06e06e
Whitespace normalization. Ugh, we really need to do this more often.
...
You might want to review this change as it's my first time. Be gentle. :-)
2007-04-25 06:30:05 +00:00
Thomas Heller
5dc4fe09b7
Patch #1649190 : Adding support for _Bool to ctypes as c_bool, by David Remahl.
2007-03-13 20:42:52 +00:00
Thomas Heller
2456a3c02a
Bug #1651235 : When a tuple was passed to a ctypes function call,
...
Python would crash instead of raising an error.
The crash was caused by a section of code that should have been
removed long ago, at that time ctypes had other ways to pass
parameters to function calls.
2007-03-09 20:39:22 +00:00
Thomas Heller
c2f7725c86
Fix bug #1646630 : ctypes.string_at(buf, 0) and ctypes.wstring_at(buf, 0)
...
returned string up to the first NUL character.
2007-03-09 19:21:28 +00:00
Thomas Heller
d059e7b423
patch #1610795 : BSD version of ctypes.util.find_library, by Martin
...
Kammerhofer.
release25-maint backport candidate, but the release manager has to
decide.
2007-01-12 20:17:34 +00:00
Thomas Heller
572104ff5c
Avoid warnings in the test suite because ctypes.wintypes cannot be
...
imported on non-windows systems.
2007-01-12 20:08:19 +00:00
Thomas Heller
f5b5183a19
Correct the comments: the code is right.
2007-01-11 21:23:12 +00:00
Thomas Heller
8138c26a83
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
...
of HANDLE, WPARAM, LPARAM data types. Make parameterless foreign
function calls work.
2007-01-11 21:18:56 +00:00
Thomas Heller
fb9d78733e
Change the ctypes version number to "1.1.0".
2007-01-10 20:12:13 +00:00
Thomas Heller
85a2192bb6
Verify the sizes of the basic ctypes data types against the struct
...
module.
Will backport to release25-maint.
2007-01-09 19:19:33 +00:00
Brett Cannon
8211297a7e
Fix a bad assumption that all objects assigned to '__loader__' on a module
...
will have a '_files' attribute.
2006-12-06 23:38:48 +00:00
Thomas Heller
25d208bd46
Fix bug #1598620 : A ctypes structure cannot contain itself.
2006-11-24 18:45:39 +00:00
Thomas Heller
d2ea4a2584
ctypes callback functions only support 'fundamental' result types.
...
Check this and raise an error when something else is used - before
this change ctypes would hang or crash when such a callback was
called. This is a partial fix for #1574584 .
Will backport to release25-maint.
2006-10-17 19:30:48 +00:00
Thomas Heller
2244af596a
The cast function did not accept c_char_p or c_wchar_p instances
...
as first argument, and failed with a 'bad argument to internal function'
error message.
2006-09-07 19:09:54 +00:00
Thomas Heller
fdb62f0e5f
Anonymous structure fields that have a bit-width specified did not work,
...
and they gave a strange error message from PyArg_ParseTuple:
function takes exactly 2 arguments (3 given).
With tests.
2006-09-07 18:56:28 +00:00
Thomas Heller
98619f267c
Port _ctypes.pyd to win64 on AMD64.
2006-08-25 07:27:33 +00:00
Thomas Heller
b4a0cf17c4
Remove the special casing of Py_None when converting the return value
...
of the Python part of a callback function to C. If it cannot be
converted, call PyErr_WriteUnraisable with the exception we got.
Before, arbitrary data has been passed to the calling C code in this
case.
(I'm not really sure the NEWS entry is understandable, but I cannot
find better words)
2006-08-16 15:10:12 +00:00
Thomas Heller
b0aa98fd4f
The __repr__ method of a NULL py_object does no longer raise an
...
exception. Remove a stray '?' character from the exception text
when the value is retrieved of such an object.
Includes tests.
2006-08-16 14:07:44 +00:00
Thomas Heller
867200483b
Apply the patch #1532975 plus ideas from the patch #1533481 .
...
ctypes instances no longer have the internal and undocumented
'_as_parameter_' attribute which was used to adapt them to foreign
function calls; this mechanism is replaced by a function pointer in
the type's stgdict.
In the 'from_param' class methods, try the _as_parameter_ attribute if
other conversions are not possible.
This makes the documented _as_parameter_ mechanism work as intended.
Change the ctypes version number to 1.0.1.
2006-08-14 11:17:48 +00:00
Thomas Heller
09a6f6aad2
Remove code that is no longer used (ctypes.com).
...
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
2006-07-27 18:39:55 +00:00
Thomas Heller
ce049a0aef
Patch #1521817 : The index range checking on ctypes arrays containing
...
exactly one element is enabled again.
2006-07-14 17:51:14 +00:00
Thomas Heller
2bdf29ec28
Fix #1521375 . When running with root priviledges, 'gcc -o /dev/null'
...
did overwrite /dev/null. Use a temporary file instead of /dev/null.
2006-07-13 17:01:14 +00:00
Thomas Heller
47d7a069d1
Fix #1467450 : ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
...
load shared libraries.
2006-07-12 08:43:47 +00:00
Thomas Heller
3b9be2ae6f
Change the ctypes version number to 1.0.0.
2006-07-11 18:40:50 +00:00
Thomas Heller
a42a662fec
When a foreign function is retrived by calling __getitem__ on a ctypes
...
library instance, do not set it as attribute.
2006-07-11 18:28:35 +00:00