Commit Graph

171 Commits

Author SHA1 Message Date
Martin Panter fd08fdc7be Issue #25659: Change assert to TypeError in from_buffer/_copy()
Based on suggestion by Eryk Sun.
2016-11-20 09:35:06 +00:00
Martin Panter 32d74e1d73 Remove disabled ctypes test
The test was commented out in 2005 before ctypes was added to Python, because
the “cdll” attribute loading feature “will no longer work this way”:
http://svn.python.org/view?view=revision&revision=49102
2016-09-29 02:50:20 +00:00
Vinay Sajip e1f3afbde2 Issue #20160: Handled passing of large structs to callbacks correctly. 2016-08-05 21:10:26 +01:00
Martin Panter a850ef698e Issue #27626: Spelling fixes in docs, comments and internal names
Based on patch by Ville Skyttä.
2016-07-28 01:11:04 +00:00
Victor Stinner eb063011ab Issue #22636: Avoid using a shell in the ctypes.util module
Replace os.popen() with subprocess.Popen.

If the "gcc", "cc" or "objdump" command is not available, the code was
supposed to raise an OSError exception. But there was a bug in the code. The
shell code returns the exit code 10 if the required command is missing, and the
code tries to check for the status 10. The problem is that os.popen() doesn't
return the exit code directly, but a status which should be processed by
os.WIFEXITED() and os.WEXITSTATUS(). In practice, the exception was never
raised. The OSError exception was not documented and ctypes.util.find_library()
is expected to return None if the library is not found.

Based on patch by Victor Stinner.
2014-10-16 09:42:45 +02:00
Martin Panter f45c1755c3 Remove PEP 291 compatibility requirements for ctypes and modulefinder
https://mail.python.org/pipermail/python-dev/2016-May/144502.html
2016-05-14 07:25:37 +00:00
Martin Panter a339e86dc0 Issue #19023: Document ctypes array and pointer classes
Also add some more tests. Based on patch by Sye van der Veen.
2016-01-29 10:12:19 +00:00
Martin Panter 929e363a7b Issue #25622: Rename to PythonValuesTestCase and enable for non-Windows 2015-11-26 02:36:26 +00:00
Serhiy Storchaka bab1f851cc Issue #25582: Fixed 100 MB memory leak in test_ctypes. 2015-11-09 22:31:10 +02:00
Serhiy Storchaka c72e66a048 Issue #25523: Backported a-to-an corrections. 2015-11-02 15:06:09 +02:00
Victor Stinner e97944a27e Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
written by Matthieu Gautier.
2015-07-29 14:37:17 +02:00
Serhiy Storchaka 53ea162067 Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.
2015-03-28 20:38:48 +02:00
Serhiy Storchaka 655720e275 Issue #22777: Test pickling with all protocols. 2014-12-15 14:02:43 +02:00
Steve Dower 31221a7285 Issue #20160: broken ctypes calling convention on MSVC / 64-bit Windows (large structs). Patch by mattip 2014-11-05 19:16:05 -08:00
R David Murray 55bf20ad6e #13096: Fix segfault in CTypes POINTER handling of large values.
Patch by Meador Inge.
2014-10-12 14:26:30 -04:00
Zachary Ware f2eb721d14 Issue #19493: Fix two uses of ctypes.test.requires (it's not a decorator)
and skip test_win32.FunctionCallTestCase.test_SEH when Python was compiled
in debug configuration or by a non-MSC compiler.
2014-07-23 14:29:25 -05:00
Zachary Ware 04349c602c Issue #19493: Backport 6f63fff5c120 2014-06-13 14:40:16 -05:00
Benjamin Peterson d3d23636cb support pep 3118 format strings for ctypes objects with nontrivial shapes (closes #10744)
Patch from Matti Picus.
2014-05-17 14:57:10 -07:00
Ned Deily 3ac866539f Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
copy of libz exists in $HOME/lib or /usr/local/lib.
2014-03-29 00:07:42 -07:00
Benjamin Peterson e3af6f0a88 fix ctypes test alignment assumptions (closes #20946)
Patch by Andreas Schwab.
2014-03-16 10:07:26 +01:00
Serhiy Storchaka 52bbeacb9d Issue #19591: Use specific asserts in ctype tests. 2013-11-17 00:06:02 +02:00
Ezio Melotti bf7e8656b5 #18981: fix a typo in a comment (noticed by Anoop Thomas Mathew). 2013-09-13 23:52:12 +03:00
Ezio Melotti 5dd99ebbc2 #18741: fix more typos. Patch by Févry Thibault. 2013-08-17 16:07:38 +03:00
Ezio Melotti 5cea09d290 #7855: Add tests for ctypes/winreg for issues found in IronPython. Initial patch by Dino Viehland. 2013-05-04 17:59:03 +03:00
Serhiy Storchaka 8e8bbc5e7d Fix test_from_dll* in test_returnfuncptrs.py. 2013-02-07 14:57:53 +02:00
Serhiy Storchaka 28ababcda4 Temporarily disable test_from_dll in test_returnfuncptrs.py for Windows. 2013-02-04 15:19:21 +02:00
Serhiy Storchaka a07a8b4f18 Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
2013-02-04 12:45:46 +02:00
Serhiy Storchaka 72121c6c30 - Issue #17041: Fix testing when Python is configured with the
--without-doc-strings option.
2013-01-27 19:45:49 +02:00
Serhiy Storchaka 74f49ab28b Issue #15989: Fix several occurrences of integer overflow
when result of PyInt_AsLong() or PyLong_AsLong() narrowed
to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:55:39 +02:00
Serhiy Storchaka 8876145fab Issue #16793. Replace deprecated unittest asserts with modern counterparts. 2012-12-28 00:32:19 +02:00
Meador Inge 25be3f68e0 Issue #6493: Fix handling of c_uint32 bitfields with width of 32 on Windows. 2012-07-18 23:51:05 -05:00
Meador Inge fe7aa49f24 Issue #9041: raised exception is misleading
An issue in ctypes.c_longdouble, ctypes.c_double, and ctypes.c_float that
caused an incorrect exception to be returned in the case of overflow has been
fixed.
2012-05-28 13:52:59 -05:00
Meador Inge 0e30317891 Issue #13380: add an internal function for resetting the ctypes caches 2011-11-25 22:25:06 -06:00
Meador Inge ad349a190e Issue #12881: ctypes: Fix segfault with large structure field names. 2011-10-03 21:34:04 -05:00
Amaury Forgeot d'Arc aa3af53f1f Remove trailing spaces 2011-09-12 21:19:53 +02:00
Amaury Forgeot d'Arc 439c25eb9e Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
2011-09-12 20:12:09 +02:00
Amaury Forgeot d'Arc cf316a171e Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
a string.
2011-09-02 20:32:23 +02:00
Amaury Forgeot d'Arc 3d7f236329 Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
2011-08-30 21:04:35 +02:00
Benjamin Peterson 2e7ea507d6 carefully cleanup pointer cache after creating struct pointers 2011-07-13 23:09:30 -05:00
Victor Stinner bf547fd3f2 Close #4376: ctypes now supports nested structures in a endian different than
the parent structure. Patch by Vlad Riscutia.
2011-07-13 21:47:31 +02:00
Benjamin Peterson f21ad92351 check possible recursive _as_parameter_ to prevent segfault (closes #1838) 2011-03-26 17:56:28 -05:00
Ezio Melotti c2077b0d9b #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 12:34:31 +02:00
Ezio Melotti 24b07bcba3 #11515: fix several typos. Patch by Piotr Kasprzyk. 2011-03-15 18:55:01 +02:00
Antoine Pitrou 820021ebd8 Merged revisions 88284 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88284 | antoine.pitrou | 2011-01-31 22:08:57 +0100 (lun., 31 janv. 2011) | 4 lines

  Issue #8275: Fix passing of callback arguments with ctypes under Win64.
  Patch by Stan Mihai. Ok'ed by Georg.
........
2011-01-31 21:47:45 +00:00
Ezio Melotti 2623a37852 Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
2010-11-21 13:34:58 +00:00
Tim Golden 3523443f77 #9055: remove assertion at the end of test_8959_b since the test is about crashing, not about counting and is difficult to manage when run as a service 2010-08-12 11:50:14 +00:00
Thomas Heller a45e6d5791 Add tests for problems reported in issue 8959. 2010-06-21 15:01:18 +00:00
Thomas Heller f180099ec6 Fix #8959 by reverting revision 80761. 2010-06-21 14:00:24 +00:00
Thomas Heller 06a7e2069a On Windows, ctypes does no longer check the stack before and after
calling a foreign function.  This allows to use the unmodified libffi
library.

Remove most files from _ctypes/libffi_msvc, only two include files
stay (updated from _ctypes/libffi/...).  Other files are used in the
cross-platform _ctypes/libffi directory.
2010-05-04 18:44:42 +00:00
Victor Stinner 47c884129d Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)
Rewrite r80556: the thread test have to be executed just after the test on
libc_open() and so the test cannot be splitted in two functions (without
duplicating code, and I don't want to duplicate code).
2010-04-27 23:33:58 +00:00