]> granicus.if.org Git - python/commitdiff
Issue #19296: Silence compiler warning in dbm_open.
authorChristian Heimes <christian@cheimes.de>
Thu, 5 Dec 2013 23:20:00 +0000 (00:20 +0100)
committerChristian Heimes <christian@cheimes.de>
Thu, 5 Dec 2013 23:20:00 +0000 (00:20 +0100)
Some dbm header files declare the first argument as char * instead of a const char *.

Misc/NEWS
Modules/_dbmmodule.c

index 1522379dc6494e21aa51f4a276f9e29df4129305..90e0dce393aa12eaf11d56d4418fc556aba31b24 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -18,6 +18,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #19296: Silence compiler warning in dbm_open
+
 - Issue #19839: Fix regression in bz2 module's handling of non-bzip2 data at
   EOF, and analogous bug in lzma module.
 
index 10f8fb939ee27fd737965201274f2aa19d820995..f9a0e5e7066703f397155be1052267832fe13cc5 100644 (file)
@@ -66,7 +66,8 @@ newdbmobject(const char *file, int flags, int mode)
     if (dp == NULL)
         return NULL;
     dp->di_size = -1;
-    if ( (dp->di_dbm = dbm_open(file, flags, mode)) == 0 ) {
+    /* See issue #19296 */
+    if ( (dp->di_dbm = dbm_open((char *)file, flags, mode)) == 0 ) {
         PyErr_SetFromErrno(DbmError);
         Py_DECREF(dp);
         return NULL;