This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2021-09-01.21:30:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org>
In-reply-to
Content
Since the ctypes module was added to the stdlib (commit babddfca758abe34ff12023f63b18d745fae7ca9 in 2006), ctypes.c_buffer() was an alias to ctypes.create_string_buffer(). The implementation contains a commented deprecation:

def c_buffer(init, size=None):
##    "deprecated, use create_string_buffer instead"
##    import warnings
##    warnings.warn("c_buffer is deprecated, use create_string_buffer instead",
##                  DeprecationWarning, stacklevel=2)
    return create_string_buffer(init, size)

I propose to start to deprecate ctypes.c_buffer(): use ctypes.create_string_buffer() directly.

In older ctypes version, the function was called c_string(): it's still mentioned in the ctypes documentation. This legacy is confusion, and it's time to simplify the API to provide a single function.
History
Date User Action Args
2021-09-01 21:30:22vstinnersetrecipients: + vstinner
2021-09-01 21:30:22vstinnersetmessageid: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org>
2021-09-01 21:30:22vstinnerlinkissue45082 messages
2021-09-01 21:30:22vstinnercreate