]> granicus.if.org Git - python/commitdiff
- Issue #13840: Fix ctypes.create_string_buffer exception message and docs.
authorMeador Inge <meadori@gmail.com>
Thu, 26 Jan 2012 14:44:00 +0000 (08:44 -0600)
committerMeador Inge <meadori@gmail.com>
Thu, 26 Jan 2012 14:44:00 +0000 (08:44 -0600)
Doc/library/ctypes.rst
Misc/NEWS
Modules/_ctypes/_ctypes.c

index fce59135ace261ba5876bfb8c392d3af7c31391d..df39c28cc9828c13fd3ddd8e031d7d1298ce937c 100644 (file)
@@ -1815,8 +1815,6 @@ Utility functions
    termination character. An integer can be passed as second argument which allows
    to specify the size of the array if the length of the bytes should not be used.
 
-   If the first parameter is a string, it is converted into a bytes object
-   according to ctypes conversion rules.
 
 
 .. function:: create_unicode_buffer(init_or_size, size=None)
@@ -1833,8 +1831,6 @@ Utility functions
    allows to specify the size of the array if the length of the string should not
    be used.
 
-   If the first parameter is a bytes object, it is converted into an unicode string
-   according to ctypes conversion rules.
 
 
 .. function:: DllCanUnloadNow()
index 5e2c47ee04404af23d2d90e7cc1316c565ccc67d..7005518d121b332c9bab5801c6697de429b49e66 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -402,6 +402,9 @@ Tests
 Extension Modules
 -----------------
 
+- Issue #13840: The error message produced by ctypes.create_string_buffer
+  when given a Unicode string has been fixed.
+
 - Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
   Vilmos Nebehaj.
 
index 8f378e246df652021b76b351b888446028f6193f..8be5958b0a089e705ad20b024d6bc0c3ba0f2fc5 100644 (file)
@@ -1096,7 +1096,7 @@ CharArray_set_value(CDataObject *self, PyObject *value)
 
     if (!PyBytes_Check(value)) {
         PyErr_Format(PyExc_TypeError,
-                     "str/bytes expected instead of %s instance",
+                     "bytes expected instead of %s instance",
                      Py_TYPE(value)->tp_name);
         return -1;
     } else