[Python-3000-checkins] r64978 - in python/branches/py3k: Misc/ACKS Misc/NEWS Modules/_ctypes/callproc.c

thomas.heller python-3000-checkins at python.org
Tue Jul 15 21:46:52 CEST 2008


Author: thomas.heller
Date: Tue Jul 15 21:46:52 2008
New Revision: 64978

Log:
Merged revisions 64976-64977 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r64976 | thomas.heller | 2008-07-15 21:39:38 +0200 (Tue, 15 Jul 2008) | 3 lines
  
  Issue #3313: Contrary to the man page, a failed dlopen() call does not
  always set a dlerror() message.
........
  r64977 | thomas.heller | 2008-07-15 21:44:25 +0200 (Tue, 15 Jul 2008) | 2 lines
  
  Add Victor Stinner, he provided the patch for issue #3313.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Misc/ACKS
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Modules/_ctypes/callproc.c

Modified: python/branches/py3k/Misc/ACKS
==============================================================================
--- python/branches/py3k/Misc/ACKS	(original)
+++ python/branches/py3k/Misc/ACKS	Tue Jul 15 21:46:52 2008
@@ -771,3 +771,4 @@
 Amaury Forgeot d'Arc
 Peter Åstrand
 Tarek ZiadŽ
+Victor Stinner

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Tue Jul 15 21:46:52 2008
@@ -27,6 +27,9 @@
 Library
 -------
 
+- Issue #3313: Fixed a crash when a failed dlopen() call does not set
+  a valid dlerror() message.
+
 - Issue #3258: Fixed a crash when a ctypes POINTER type to an
   incomplete structure was created.
 

Modified: python/branches/py3k/Modules/_ctypes/callproc.c
==============================================================================
--- python/branches/py3k/Modules/_ctypes/callproc.c	(original)
+++ python/branches/py3k/Modules/_ctypes/callproc.c	Tue Jul 15 21:46:52 2008
@@ -1383,8 +1383,11 @@
 	mode |= RTLD_NOW;
 	handle = ctypes_dlopen(name, mode);
 	if (!handle) {
+		char *errmsg = ctypes_dlerror();
+		if (!errmsg)
+			errmsg = "dlopen() error";
 		PyErr_SetString(PyExc_OSError,
-				       ctypes_dlerror());
+				       errmsg);
 		return NULL;
 	}
 	return PyLong_FromVoidPtr(handle);


More information about the Python-3000-checkins mailing list