ctypes-commit Mailing List for ctypes (Page 13)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Thomas H. <th...@us...> - 2006-04-13 12:22:26
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29709 Modified Files: Tag: LoadLibrary_branch test_find.py Log Message: Cleanup. Index: test_find.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_find.py,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** test_find.py 13 Apr 2006 12:19:54 -0000 1.1.2.4 --- test_find.py 13 Apr 2006 12:22:24 -0000 1.1.2.5 *************** *** 3,6 **** --- 3,7 ---- from ctypes._find import find_library + # On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode. class TestRTLD_GLOBAL(unittest.TestCase): def test_GL(self): *************** *** 9,20 **** lib_glut = find_library("glut") lib_gle = find_library("gle") ! print "OpenGL libraries:", (("GL", lib_gl), ! ("GLU", lib_glu), ! ("glut", lib_glut), ! ("gle", lib_gle)) ! ## print "GL", lib_gl ! ## print "GLU", lib_glu ! ## print "glut", lib_glut ! ## print "gle", lib_gle if lib_gl: --- 10,18 ---- lib_glut = find_library("glut") lib_gle = find_library("gle") ! if lib_gl or lib_glu or lib_glut or lib_gle: ! print "OpenGL libraries:", (("GL", lib_gl), ! ("GLU", lib_glu), ! ("glut", lib_glut), ! ("gle", lib_gle)) if lib_gl: *************** *** 24,29 **** if lib_glut: CDLL(lib_glut) ! if lib_gle: ! CDLL(lib_gle) ##if os.name == "posix" and sys.platform != "darwin": --- 22,27 ---- if lib_glut: CDLL(lib_glut) ! if lib_gle: ! CDLL(lib_gle) ##if os.name == "posix" and sys.platform != "darwin": |
From: Thomas H. <th...@us...> - 2006-04-13 12:10:24
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19961 Modified Files: Tag: LoadLibrary_branch test_find.py Log Message: Fix silly mistakes. Index: test_find.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_find.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** test_find.py 13 Apr 2006 12:08:54 -0000 1.1.2.2 --- test_find.py 13 Apr 2006 12:10:21 -0000 1.1.2.3 *************** *** 1,3 **** ! import unittest, os, sys from ctypes import * --- 1,3 ---- ! import unittest from ctypes import * *************** *** 13,17 **** if lib_glu: CDLL(lib_glu) ! lib_glu = find_library("glut") print "glut", lib_glut if lib_glut: --- 13,17 ---- if lib_glu: CDLL(lib_glu) ! lib_glut = find_library("glut") print "glut", lib_glut if lib_glut: |
From: Thomas H. <th...@us...> - 2006-04-13 12:03:16
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13041 Modified Files: Tag: LoadLibrary_branch test-cf.py Log Message: *** empty log message *** Index: test-cf.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/test-cf.py,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** test-cf.py 11 Apr 2006 20:18:21 -0000 1.6.2.1 --- test-cf.py 13 Apr 2006 12:03:12 -0000 1.6.2.2 *************** *** 23,27 **** ("amd64-linux1", "/usr/bin/python -u"), ! ("amd64-linux2", "/usr/bin/python -u"), # Host key verification failed --- 23,28 ---- ("amd64-linux1", "/usr/bin/python -u"), ! # offline ! ## ("amd64-linux2", "/usr/bin/python -u"), # Host key verification failed *************** *** 29,36 **** # No route to host: ! ("ppc-osx1", "/sw/bin/python -u"), # No route to host: ! ("ppc-osx2", "/usr/bin/python -u"), # Not python 2.3 or newer, so use my own build of Python 2.4.2: --- 30,37 ---- # No route to host: ! ## ("ppc-osx1", "/sw/bin/python -u"), # No route to host: ! ## ("ppc-osx2", "/usr/bin/python -u"), # Not python 2.3 or newer, so use my own build of Python 2.4.2: *************** *** 52,58 **** print "*" * 20, hostname, "*" * 20 if len(sys.argv) > 1: ! cmd = "cd $HOME/ctypes; %s setup.py %s" % (python, " ".join(sys.argv[1:])) else: ! cmd = "cd $HOME/ctypes; %s setup.py test " % python print cmd if (hostname, python) in hostinfo: --- 53,61 ---- print "*" * 20, hostname, "*" * 20 if len(sys.argv) > 1: ! args = " ".join(sys.argv[1:]) else: ! args = "test" ! ! cmd = "cd $HOME/ctypes; %s setup.py %s" % (python, args) print cmd if (hostname, python) in hostinfo: |
From: Thomas H. <th...@us...> - 2006-04-13 12:02:33
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12243 Added Files: Tag: LoadLibrary_branch _find.py Removed Files: Tag: LoadLibrary_branch _loader.py Log Message: More fixes: Rename _findLib into find_library, and move it into the ctypes._find module. Remove the ctypes._loader module. Renamed the ctypes.test.test_posix module into ctypes.test.test_find. --- NEW FILE: _find.py --- # WORK IN PROGRESS! DO NOT (yet) USE! import sys, os import ctypes # find_library(name) returns the pathname of a library, or None. if os.name in ("nt", "ce"): def find_library(name): # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) if os.path.exists(fname): return fname if fname.lower().endswith(".dll"): continue fname = fname + ".dll" if os.path.exists(fname): return fname return None if os.name == "posix" and sys.platform == "darwin": from ctypes.macholib.dyld import dyld_find as _dyld_find def find_library(name): possible = ['lib%s.dylib' % name, '%s.dylib' % name, '%s.framework/%s' % (name, name)] for name in possible: try: return _dyld_find(name) except ValueError: continue return None elif os.name == "posix": # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump import re, tempfile def _findLib_gcc(name): expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name cmd = 'if type gcc &>/dev/null; then CC=gcc; else CC=cc; fi;' \ '$CC -Wl,-t -o /dev/null 2>&1 -l' + name try: fdout, outfile = tempfile.mkstemp() fd = os.popen(cmd) trace = fd.read() err = fd.close() finally: try: os.unlink(outfile) except OSError, e: if e.errno != errno.ENOENT: raise res = re.search(expr, trace) if not res: return None return res.group(0) def _findLib_ld(name): expr = '/[^\(\)\s]*lib%s\.[^\(\)\s]*' % name res = re.search(expr, os.popen('/sbin/ldconfig -p 2>/dev/null').read()) if not res: cmd = 'ldd %s 2>/dev/null' % sys.executable res = re.search(expr, os.popen(cmd).read()) if not res: return None return res.group(0) def _get_soname(f): cmd = "objdump -p -j .dynamic 2>/dev/null " + f res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: return None return res.group(1) def find_library(name): lib = _findLib_ld(name) or _findLib_gcc(name) if not lib: return None return _get_soname(lib) ################################################################ # test code def test(): from ctypes import cdll if os.name == "nt": print cdll.msvcrt print cdll.load("msvcrt") print find_library("msvcrt") if os.name == "posix": # find and load_version print find_library("m") print find_library("c") print find_library("bz2") # getattr ## print cdll.m ## print cdll.bz2 # load if sys.platform == "darwin": print cdll.LoadLibrary("libm.dylib") print cdll.LoadLibrary("libcrypto.dylib") print cdll.LoadLibrary("libSystem.dylib") print cdll.LoadLibrary("System.framework/System") else: print cdll.LoadLibrary("libm.so") print cdll.LoadLibrary("libcrypt.so") print find_library("crypt") if __name__ == "__main__": test() --- _loader.py DELETED --- |
From: Thomas H. <th...@us...> - 2006-04-13 11:35:21
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19964 Modified Files: Tag: LoadLibrary_branch _loader.py Log Message: _findLib: return None if library not found. Index: _loader.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/_loader.py,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -C2 -d -r1.4.2.2 -r1.4.2.3 *** _loader.py 13 Apr 2006 07:49:39 -0000 1.4.2.2 --- _loader.py 13 Apr 2006 11:35:15 -0000 1.4.2.3 *************** *** 59,71 **** res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: ! return f return res.group(1) def _findLib(name): ! lib = _findLib_ld(name) if not lib: ! lib = _findLib_gcc(name) ! if not lib: ! return name return _get_soname(lib) --- 59,69 ---- res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: ! return None return res.group(1) def _findLib(name): ! lib = _findLib_ld(name) or _findLib_gcc(name) if not lib: ! return None return _get_soname(lib) |
From: Thomas H. <th...@us...> - 2006-04-13 11:31:10
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16259 Modified Files: Tag: LoadLibrary_branch test_posix.py Log Message: Some systems need RTLD_GLOBAL for libGL.so, otherwise libGLU.so does not load. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_posix.py,v retrieving revision 1.4.4.5 retrieving revision 1.4.4.6 diff -C2 -d -r1.4.4.5 -r1.4.4.6 *** test_posix.py 13 Apr 2006 10:35:50 -0000 1.4.4.5 --- test_posix.py 13 Apr 2006 11:31:03 -0000 1.4.4.6 *************** *** 7,14 **** lib_gl = _findLib("GL") print "GL", lib_gl - if lib_gl: - CDLL(lib_gl)#, mode=RTLD_GLOBAL) lib_glu = _findLib("GLU") print "GLU", lib_glu if lib_glu: CDLL(lib_glu) --- 7,14 ---- lib_gl = _findLib("GL") print "GL", lib_gl lib_glu = _findLib("GLU") print "GLU", lib_glu + if lib_gl: + CDLL(lib_gl, mode=RTLD_GLOBAL) if lib_glu: CDLL(lib_glu) |
From: Thomas H. <th...@us...> - 2006-04-13 10:35:53
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1630 Modified Files: Tag: LoadLibrary_branch test_posix.py Log Message: Test without RTLD_GLOBAL. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_posix.py,v retrieving revision 1.4.4.4 retrieving revision 1.4.4.5 diff -C2 -d -r1.4.4.4 -r1.4.4.5 *** test_posix.py 13 Apr 2006 09:13:03 -0000 1.4.4.4 --- test_posix.py 13 Apr 2006 10:35:50 -0000 1.4.4.5 *************** *** 8,12 **** print "GL", lib_gl if lib_gl: ! CDLL(lib_gl, mode=RTLD_GLOBAL) lib_glu = _findLib("GLU") print "GLU", lib_glu --- 8,12 ---- print "GL", lib_gl if lib_gl: ! CDLL(lib_gl)#, mode=RTLD_GLOBAL) lib_glu = _findLib("GLU") print "GLU", lib_glu |
From: Thomas H. <th...@us...> - 2006-04-13 09:13:28
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29514 Modified Files: Tag: LoadLibrary_branch test_posix.py Log Message: Try on more platforms. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_posix.py,v retrieving revision 1.4.4.3 retrieving revision 1.4.4.4 diff -C2 -d -r1.4.4.3 -r1.4.4.4 *** test_posix.py 13 Apr 2006 09:10:31 -0000 1.4.4.3 --- test_posix.py 13 Apr 2006 09:13:03 -0000 1.4.4.4 *************** *** 2,21 **** from ctypes import * ! if os.name == "posix" and sys.platform == "linux2": ! # I don't really know on which platforms this works, ! # later it should use the find_library stuff to avoid ! # hardcoding the names. ! ! class TestRTLD_GLOBAL(unittest.TestCase): ! def test_GL(self): ! from ctypes._loader import _findLib ! lib_gl = _findLib("GL") ! print "GL", lib_gl ! if lib_gl: ! CDLL(lib_gl, mode=RTLD_GLOBAL) ! lib_glu = _findLib("GLU") ! print "GLU", lib_glu ! if lib_glu: ! CDLL(lib_glu) ##if os.name == "posix" and sys.platform != "darwin": --- 2,16 ---- from ctypes import * ! class TestRTLD_GLOBAL(unittest.TestCase): ! def test_GL(self): ! from ctypes._loader import _findLib ! lib_gl = _findLib("GL") ! print "GL", lib_gl ! if lib_gl: ! CDLL(lib_gl, mode=RTLD_GLOBAL) ! lib_glu = _findLib("GLU") ! print "GLU", lib_glu ! if lib_glu: ! CDLL(lib_glu) ##if os.name == "posix" and sys.platform != "darwin": |
From: Thomas H. <th...@us...> - 2006-04-13 09:10:34
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27633 Modified Files: Tag: LoadLibrary_branch test_posix.py Log Message: Damn. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_posix.py,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** test_posix.py 13 Apr 2006 09:08:06 -0000 1.4.4.2 --- test_posix.py 13 Apr 2006 09:10:31 -0000 1.4.4.3 *************** *** 14,18 **** if lib_gl: CDLL(lib_gl, mode=RTLD_GLOBAL) ! lib_glu _findLib("GLU") print "GLU", lib_glu if lib_glu: --- 14,18 ---- if lib_gl: CDLL(lib_gl, mode=RTLD_GLOBAL) ! lib_glu = _findLib("GLU") print "GLU", lib_glu if lib_glu: |
From: Thomas H. <th...@us...> - 2006-04-13 09:08:17
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25697 Modified Files: Tag: LoadLibrary_branch test_posix.py Log Message: More work in progress. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_posix.py,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -C2 -d -r1.4.4.1 -r1.4.4.2 *** test_posix.py 13 Apr 2006 09:05:48 -0000 1.4.4.1 --- test_posix.py 13 Apr 2006 09:08:06 -0000 1.4.4.2 *************** *** 10,19 **** def test_GL(self): from ctypes._loader import _findLib ! print "GL?", _findLib("GL") ! if os.path.exists('/usr/lib/libGL.so'): ! cdll.load('libGL.so', mode=RTLD_GLOBAL) ! print "GL?", _findLib("GLU") ! if os.path.exists('/usr/lib/libGLU.so'): ! cdll.load('libGLU.so') ##if os.name == "posix" and sys.platform != "darwin": --- 10,21 ---- def test_GL(self): from ctypes._loader import _findLib ! lib_gl = _findLib("GL") ! print "GL", lib_gl ! if lib_gl: ! CDLL(lib_gl, mode=RTLD_GLOBAL) ! lib_glu _findLib("GLU") ! print "GLU", lib_glu ! if lib_glu: ! CDLL(lib_glu) ##if os.name == "posix" and sys.platform != "darwin": |
From: Thomas H. <th...@us...> - 2006-04-13 09:05:51
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23580 Modified Files: Tag: LoadLibrary_branch test_posix.py Log Message: Work in progress. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_posix.py,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** test_posix.py 17 Mar 2006 15:34:44 -0000 1.4 --- test_posix.py 13 Apr 2006 09:05:48 -0000 1.4.4.1 *************** *** 9,14 **** --- 9,17 ---- class TestRTLD_GLOBAL(unittest.TestCase): def test_GL(self): + from ctypes._loader import _findLib + print "GL?", _findLib("GL") if os.path.exists('/usr/lib/libGL.so'): cdll.load('libGL.so', mode=RTLD_GLOBAL) + print "GL?", _findLib("GLU") if os.path.exists('/usr/lib/libGLU.so'): cdll.load('libGLU.so') |
From: Thomas H. <th...@us...> - 2006-04-13 08:51:11
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11265 Modified Files: Tag: LoadLibrary_branch test_loading.py Log Message: Oops - UnboundLocalError. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.15.2.4 retrieving revision 1.15.2.5 diff -C2 -d -r1.15.2.4 -r1.15.2.5 *** test_loading.py 13 Apr 2006 08:48:09 -0000 1.15.2.4 --- test_loading.py 13 Apr 2006 08:51:06 -0000 1.15.2.5 *************** *** 40,47 **** def test_find(self): print "Found", _findLib("c") print "Found", _findLib("m") - from ctypes._loader import _findLib lib = _findLib("c") if lib: --- 40,47 ---- def test_find(self): + from ctypes._loader import _findLib print "Found", _findLib("c") print "Found", _findLib("m") lib = _findLib("c") if lib: |
From: Thomas H. <th...@us...> - 2006-04-13 08:48:11
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8345 Modified Files: Tag: LoadLibrary_branch test_loading.py Log Message: Ready to test on multiple archs. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.15.2.3 retrieving revision 1.15.2.4 diff -C2 -d -r1.15.2.3 -r1.15.2.4 *** test_loading.py 13 Apr 2006 07:51:44 -0000 1.15.2.3 --- test_loading.py 13 Apr 2006 08:48:09 -0000 1.15.2.4 *************** *** 39,49 **** self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll) ! def test_find(self): ! from ctypes._loader import _findLib ! lib = _findLib("c") ! if lib: ! print "Found", lib ! cdll.LoadLibrary(lib) ! CDLL(lib) if os.name in ("nt", "ce"): --- 39,51 ---- self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll) ! def test_find(self): ! print "Found", _findLib("c") ! print "Found", _findLib("m") ! ! from ctypes._loader import _findLib ! lib = _findLib("c") ! if lib: ! cdll.LoadLibrary(lib) ! CDLL(lib) if os.name in ("nt", "ce"): |
From: Thomas H. <th...@us...> - 2006-04-11 20:18:24
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12516 Modified Files: Tag: LoadLibrary_branch test-cf.py Log Message: *** empty log message *** Index: test-cf.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/test-cf.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** test-cf.py 20 Mar 2006 09:39:40 -0000 1.6 --- test-cf.py 11 Apr 2006 20:18:21 -0000 1.6.2.1 *************** *** 44,55 **** import sys, os ! for hostname, python in hostinfo: print "*" * 20, hostname, "*" * 20 if len(sys.argv) > 1: ! cmd = "cd ~/ctypes; %s setup.py %s" % (python, " ".join(sys.argv[1:])) else: ! cmd = "cd ~/ctypes; %s setup.py test " % python print cmd ! ret = os.system('ssh -l theller cf-shell.sf.net "ssh %s \'%s\'"' % (hostname, cmd)) if ret: print "(RETCODE %s)" % ret --- 44,63 ---- import sys, os ! try: ! from others import others ! except ImportError: ! others = [] ! ! for hostname, python in others + hostinfo: print "*" * 20, hostname, "*" * 20 if len(sys.argv) > 1: ! cmd = "cd $HOME/ctypes; %s setup.py %s" % (python, " ".join(sys.argv[1:])) else: ! cmd = "cd $HOME/ctypes; %s setup.py test " % python print cmd ! if (hostname, python) in hostinfo: ! ret = os.system('ssh -l theller cf-shell.sf.net "ssh %s \'%s\'"' % (hostname, cmd)) ! else: ! ret = os.system('ssh -l theller %s \"%s\"' % (hostname, cmd)) if ret: print "(RETCODE %s)" % ret |
From: Thomas H. <th...@us...> - 2006-04-06 11:39:13
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21569 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** ChangeLog 5 Apr 2006 14:04:32 -0000 1.117 --- ChangeLog 6 Apr 2006 11:38:59 -0000 1.118 *************** *** 1,2 **** --- 1,10 ---- + 2006-04-06 Thomas Heller <th...@py...> + + * Simplify code, improve error handling, and a Py_ssize_t fix by + Neal Norwitz. + + * Spelled 'signed char' instead of 'char', to avoid test failures + on platforms where the C 'char' type is unsigned. + 2006-04-05 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2006-04-06 11:31:07
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043 Modified Files: _ctypes.c Log Message: Simplify code, improve error handling, and a Py_ssize_t fix by Neal Norwitz. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.319 retrieving revision 1.320 diff -C2 -d -r1.319 -r1.320 *** _ctypes.c 5 Apr 2006 12:41:31 -0000 1.319 --- _ctypes.c 6 Apr 2006 11:30:53 -0000 1.320 *************** *** 1285,1289 **** PyObject *swapped_args; static PyObject *suffix; ! int i; swapped_args = PyTuple_New(PyTuple_GET_SIZE(args)); --- 1285,1289 ---- PyObject *swapped_args; static PyObject *suffix; ! Py_ssize_t i; swapped_args = PyTuple_New(PyTuple_GET_SIZE(args)); *************** *** 1298,1303 **** #endif ! Py_INCREF(suffix); ! PyString_ConcatAndDel(&name, suffix); PyTuple_SET_ITEM(swapped_args, 0, name); --- 1298,1304 ---- #endif ! PyString_Concat(&name, suffix); ! if (name == NULL) ! return NULL; PyTuple_SET_ITEM(swapped_args, 0, name); |
From: Thomas H. <th...@us...> - 2006-04-05 19:17:19
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21071 Modified Files: test_loading.py Log Message: Another fix. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_loading.py 5 Apr 2006 17:33:52 -0000 1.14 --- test_loading.py 5 Apr 2006 19:17:10 -0000 1.15 *************** *** 32,36 **** self.assertRaises(OSError, cdll.load, self.unknowndll) ! if libc_name is not None and "libc.so.6" in libc_name: def test_load_version(self): cdll.load_version("c", "6") --- 32,36 ---- self.assertRaises(OSError, cdll.load, self.unknowndll) ! if libc_name is not None and os.path.basename(libc_name) == "libc.so.6": def test_load_version(self): cdll.load_version("c", "6") |
From: Thomas H. <th...@us...> - 2006-04-05 17:33:59
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10113 Modified Files: test_loading.py Log Message: Use 'ldd' to find the libc to load. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_loading.py 5 Apr 2006 17:13:52 -0000 1.13 --- test_loading.py 5 Apr 2006 17:33:52 -0000 1.14 *************** *** 15,20 **** for line in os.popen("ldd %s" % sys.executable): if "libc.so" in line: ! libc_name = line.split()[2] ! print "libc_name is", line break --- 15,23 ---- for line in os.popen("ldd %s" % sys.executable): if "libc.so" in line: ! if sys.platform == "openbsd3": ! libc_name = line.split()[4] ! else: ! libc_name = line.split()[2] ! ## print "libc_name is", libc_name break |
From: Thomas H. <th...@us...> - 2006-04-05 17:14:02
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27344 Modified Files: test_loading.py Log Message: Debugging, and a small fix. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_loading.py 5 Apr 2006 17:08:44 -0000 1.12 --- test_loading.py 5 Apr 2006 17:13:52 -0000 1.13 *************** *** 16,20 **** if "libc.so" in line: libc_name = line.split()[2] ! print "libc_name is", libc_name break --- 16,20 ---- if "libc.so" in line: libc_name = line.split()[2] ! print "libc_name is", line break *************** *** 33,40 **** cdll.load_version("c", "6") # linux uses version, libc 9 should not exist ! self.assertRaises(OSError, cdll.load_version, name, "9") self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") - ## if os.name == "posix" and sys.platform != "sunos5": def test_find(self): name = "c" --- 33,39 ---- cdll.load_version("c", "6") # linux uses version, libc 9 should not exist ! self.assertRaises(OSError, cdll.load_version, "c", "9") self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") def test_find(self): name = "c" |
From: Thomas H. <th...@us...> - 2006-04-05 17:08:52
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23770 Modified Files: test_loading.py Log Message: Try to fix this test. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_loading.py 5 Apr 2006 14:05:33 -0000 1.11 --- test_loading.py 5 Apr 2006 17:08:44 -0000 1.12 *************** *** 28,44 **** cdll.load(os.path.basename(libc_name)) self.assertRaises(OSError, cdll.load, self.unknowndll) - else: - print "Warning: libc not found" ! def test_load_version(self): ! version = "6" ! name = "c" ! if sys.platform == "linux2": ! cdll.load_version(name, version) # linux uses version, libc 9 should not exist self.assertRaises(OSError, cdll.load_version, name, "9") ! self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") ! if os.name == "posix" and sys.platform != "sunos5": def test_find(self): name = "c" --- 28,40 ---- cdll.load(os.path.basename(libc_name)) self.assertRaises(OSError, cdll.load, self.unknowndll) ! if libc_name is not None and "libc.so.6" in libc_name: ! def test_load_version(self): ! cdll.load_version("c", "6") # linux uses version, libc 9 should not exist self.assertRaises(OSError, cdll.load_version, name, "9") ! self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") ! ## if os.name == "posix" and sys.platform != "sunos5": def test_find(self): name = "c" *************** *** 46,61 **** self.assertRaises(OSError, cdll.find, self.unknowndll) ! def test_load_library(self): ! if os.name == "nt": ! windll.load_library("kernel32").GetModuleHandleW ! windll.LoadLibrary("kernel32").GetModuleHandleW ! WinDLL("kernel32").GetModuleHandleW ! elif os.name == "ce": ! windll.load_library("coredll").GetModuleHandleW ! windll.LoadLibrary("coredll").GetModuleHandleW ! WinDLL("coredll").GetModuleHandleW ! def test_load_ordinal_functions(self): ! if os.name in ("nt", "ce"): import _ctypes_test dll = WinDLL(_ctypes_test.__file__) --- 42,57 ---- self.assertRaises(OSError, cdll.find, self.unknowndll) ! if os.name in ("nt", "ce"): ! def test_load_library(self): ! if os.name == "nt": ! windll.load_library("kernel32").GetModuleHandleW ! windll.LoadLibrary("kernel32").GetModuleHandleW ! WinDLL("kernel32").GetModuleHandleW ! elif os.name == "ce": ! windll.load_library("coredll").GetModuleHandleW ! windll.LoadLibrary("coredll").GetModuleHandleW ! WinDLL("coredll").GetModuleHandleW ! def test_load_ordinal_functions(self): import _ctypes_test dll = WinDLL(_ctypes_test.__file__) |
From: Thomas H. <th...@us...> - 2006-04-05 14:05:39
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15972/ctypes/test Modified Files: test_loading.py Log Message: Use ldd to find the libc library. Suggested by Matthias Klose. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_loading.py 5 Apr 2006 12:37:45 -0000 1.10 --- test_loading.py 5 Apr 2006 14:05:33 -0000 1.11 *************** *** 3,31 **** import os, StringIO class LoaderTest(unittest.TestCase): unknowndll = "xxrandomnamexx" ! def test_load(self): ! if os.name == "nt": ! name = "msvcrt" ! elif os.name == "ce": ! name = "coredll" ! elif sys.platform == "darwin": ! name = "libc.dylib" ! elif sys.platform.startswith("freebsd"): ! name = "libc.so" ! elif sys.platform in ("sunos5", "osf1V5"): ! name = "libc.so" ! elif sys.platform.startswith("netbsd") or sys.platform.startswith("openbsd"): ! name = "libc.so" ! else: ! name = "libc.so.6" ! ## print (sys.platform, os.name) ! try: ! cdll.load(name) ! except Exception, details: ! self.fail((str(details), name, (os.name, sys.platform))) ! self.assertRaises(OSError, cdll.load, self.unknowndll) def test_load_version(self): --- 3,33 ---- import os, StringIO + libc_name = None + if os.name == "nt": + libc_name = "msvcrt" + elif os.name == "ce": + libc_name = "coredll" + elif sys.platform == "darwin": + libc_name = "libc.dylib" + elif sys.platform == "cygwin": + libc_name = "cygwin1.dll" + else: + for line in os.popen("ldd %s" % sys.executable): + if "libc.so" in line: + libc_name = line.split()[2] + print "libc_name is", libc_name + break + class LoaderTest(unittest.TestCase): unknowndll = "xxrandomnamexx" ! if libc_name is not None: ! def test_load(self): ! cdll.load(libc_name) ! cdll.load(os.path.basename(libc_name)) ! self.assertRaises(OSError, cdll.load, self.unknowndll) ! else: ! print "Warning: libc not found" def test_load_version(self): |
From: Thomas H. <th...@us...> - 2006-04-05 14:04:37
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16254 Modified Files: ChangeLog Log Message: *** empty log message *** Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** ChangeLog 5 Apr 2006 12:54:34 -0000 1.116 --- ChangeLog 5 Apr 2006 14:04:32 -0000 1.117 *************** *** 11,14 **** --- 11,22 ---- works. + 2006-03-29 Thomas Heller <th...@py...> + + * source\_ctypes.c: Accept function pointers as first argument, + and a function pointer types as second argument in the cast + function. + + Fix a potential segfault. + 2006-03-27 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2006-03-27 19:58:51
|
Update of /cvsroot/ctypes/ctypes/source/libffi_msvc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11285 Modified Files: prep_cif.c Log Message: Fix calling of stdcall functions on Windows, even with MINGW32. Index: prep_cif.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/libffi_msvc/prep_cif.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** prep_cif.c 3 Mar 2006 20:20:11 -0000 1.8 --- prep_cif.c 27 Mar 2006 19:58:44 -0000 1.9 *************** *** 148,152 **** #endif { ! #ifndef _MSC_VER /* Don't know if this is a libffi bug or not. At least on Windows with MSVC, function call parameters are *not* --- 148,152 ---- #endif { ! #if !defined(_MSC_VER) && !defined(__MINGW32__) /* Don't know if this is a libffi bug or not. At least on Windows with MSVC, function call parameters are *not* |
From: Thomas H. <th...@us...> - 2006-03-27 19:22:21
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25560 Modified Files: setup.py Log Message: Remove MingW32's extra_link_args from both the _ctypes and the _ctypes_test extension. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** setup.py 27 Mar 2006 18:39:51 -0000 1.137 --- setup.py 27 Mar 2006 19:22:07 -0000 1.138 *************** *** 140,144 **** if ext.name == "_ctypes": ext.sources.remove("source/libffi_msvc/win32.S") ! ext.extra_link_args = [] build_ext.build_ext.build_extensions(self) --- 140,144 ---- if ext.name == "_ctypes": ext.sources.remove("source/libffi_msvc/win32.S") ! ext.extra_link_args = [] build_ext.build_ext.build_extensions(self) |
From: Thomas H. <th...@us...> - 2006-03-27 18:41:39
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5769 Modified Files: ChangeLog Log Message: *** empty log message *** Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** ChangeLog 20 Mar 2006 07:27:59 -0000 1.113 --- ChangeLog 27 Mar 2006 18:41:35 -0000 1.114 *************** *** 1,2 **** --- 1,20 ---- + 2006-03-27 Thomas Heller <th...@py...> + + * setup.py: Fixes from Khalid A. Bakr. + + He writes: """I have made some changes (see attached diff) to the + setup.py to have MinGW pass the "--enable-stdcall-fixup" to the + linker to suppress some warnings. And I have added another linker + option, namely "--kill-at" to remove the @XY decoration that MinGW + normally attaches to stdcall functions. + + With the latter change, test_cfuncs (which had previously reported + 26 failures out of 52 tests) now only reports 3. It seems that the + stdcall part now passes as it does when compiled with a MSVC type + compiler.""" + + Still, all ctypes callback tests crash Python, and there are other + failures as well - when compiled with mingw. + 2006-03-20 Thomas Heller <th...@py...> |