diff -Nru python-cffi-1.12.1/c/call_python.c python-cffi-1.12.2/c/call_python.c --- python-cffi-1.12.1/c/call_python.c 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/c/call_python.c 2019-02-26 15:01:22.000000000 +0000 @@ -1,3 +1,9 @@ +#if PY_VERSION_HEX >= 0x03080000 +# define Py_BUILD_CORE +/* for access to the fields of PyInterpreterState */ +# include "internal/pycore_pystate.h" +# undef Py_BUILD_CORE +#endif static PyObject *_get_interpstate_dict(void) { diff -Nru python-cffi-1.12.1/c/_cffi_backend.c python-cffi-1.12.2/c/_cffi_backend.c --- python-cffi-1.12.1/c/_cffi_backend.c 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/c/_cffi_backend.c 2019-02-26 15:01:22.000000000 +0000 @@ -2,7 +2,7 @@ #include #include "structmember.h" -#define CFFI_VERSION "1.12.1" +#define CFFI_VERSION "1.12.2" #ifdef MS_WIN32 #include diff -Nru python-cffi-1.12.1/c/test_c.py python-cffi-1.12.2/c/test_c.py --- python-cffi-1.12.1/c/test_c.py 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/c/test_c.py 2019-02-26 15:01:22.000000000 +0000 @@ -12,7 +12,7 @@ # ____________________________________________________________ import sys -assert __version__ == "1.12.1", ("This test_c.py file is for testing a version" +assert __version__ == "1.12.2", ("This test_c.py file is for testing a version" " of cffi that differs from the one that we" " get from 'import _cffi_backend'") if sys.version_info < (3,): diff -Nru python-cffi-1.12.1/cffi/_embedding.h python-cffi-1.12.2/cffi/_embedding.h --- python-cffi-1.12.1/cffi/_embedding.h 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/cffi/_embedding.h 2019-02-26 15:01:22.000000000 +0000 @@ -221,7 +221,7 @@ if (f != NULL && f != Py_None) { PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME - "\ncompiled with cffi version: 1.12.1" + "\ncompiled with cffi version: 1.12.2" "\n_cffi_backend module: ", f); modules = PyImport_GetModuleDict(); mod = PyDict_GetItemString(modules, "_cffi_backend"); diff -Nru python-cffi-1.12.1/cffi/__init__.py python-cffi-1.12.2/cffi/__init__.py --- python-cffi-1.12.1/cffi/__init__.py 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/cffi/__init__.py 2019-02-26 15:01:22.000000000 +0000 @@ -5,8 +5,8 @@ from .error import CDefError, FFIError, VerificationError, VerificationMissing from .error import PkgConfigError -__version__ = "1.12.1" -__version_info__ = (1, 12, 1) +__version__ = "1.12.2" +__version_info__ = (1, 12, 2) # The verifier module file names are based on the CRC32 of a string that # contains the following version number. It may be older than __version__ diff -Nru python-cffi-1.12.1/cffi.egg-info/PKG-INFO python-cffi-1.12.2/cffi.egg-info/PKG-INFO --- python-cffi-1.12.1/cffi.egg-info/PKG-INFO 2019-02-16 16:19:51.000000000 +0000 +++ python-cffi-1.12.2/cffi.egg-info/PKG-INFO 2019-02-26 15:02:13.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: cffi -Version: 1.12.1 +Version: 1.12.2 Summary: Foreign Function Interface for Python calling C code. Home-page: http://cffi.readthedocs.org Author: Armin Rigo, Maciej Fijalkowski diff -Nru python-cffi-1.12.1/debian/changelog python-cffi-1.12.2/debian/changelog --- python-cffi-1.12.1/debian/changelog 2019-02-25 19:01:48.000000000 +0000 +++ python-cffi-1.12.2/debian/changelog 2019-02-26 22:00:14.000000000 +0000 @@ -1,3 +1,10 @@ +python-cffi (1.12.2-1) unstable; urgency=medium + + * New upstream release. + - With initial Python 3.8 compatibility. + + -- Stefano Rivera Tue, 26 Feb 2019 14:00:14 -0800 + python-cffi (1.12.1-1) unstable; urgency=medium * New upstream release. diff -Nru python-cffi-1.12.1/doc/source/conf.py python-cffi-1.12.2/doc/source/conf.py --- python-cffi-1.12.1/doc/source/conf.py 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/doc/source/conf.py 2019-02-26 15:01:22.000000000 +0000 @@ -47,7 +47,7 @@ # The short X.Y version. version = '1.12' # The full version, including alpha/beta/rc tags. -release = '1.12.1' +release = '1.12.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Nru python-cffi-1.12.1/doc/source/installation.rst python-cffi-1.12.2/doc/source/installation.rst --- python-cffi-1.12.1/doc/source/installation.rst 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/doc/source/installation.rst 2019-02-26 15:01:22.000000000 +0000 @@ -52,7 +52,7 @@ * https://pypi.python.org/pypi/cffi -* Checksums of the "source" package version 1.12.1: +* Checksums of the "source" package version 1.12.2: - MD5: ... diff -Nru python-cffi-1.12.1/doc/source/ref.rst python-cffi-1.12.2/doc/source/ref.rst --- python-cffi-1.12.1/doc/source/ref.rst 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/doc/source/ref.rst 2019-02-26 15:01:22.000000000 +0000 @@ -146,36 +146,43 @@ +++++++++++++++++++++++++++++++ **ffi.buffer(cdata, [size])**: return a buffer object that references -the raw C data pointed to by the given 'cdata', of 'size' bytes. The -'cdata' must be a pointer or an array. If unspecified, the size of the +the raw C data pointed to by the given 'cdata', of 'size' bytes. What +Python calls "a buffer", or more precisely "an object supporting the +buffer interface", is an object that represents some raw memory and +that can be passed around to various built-in or extension functions; +these built-in functions read from or write to the raw memory directly, +without needing an extra copy. + +The 'cdata' argument +must be a pointer or an array. If unspecified, the size of the buffer is either the size of what ``cdata`` points to, or the whole size -of the array. Getting a buffer is useful because you can read from it -without an extra copy, or write into it to change the original value. +of the array. Here are a few examples of where buffer() would be useful: - use ``file.write()`` and ``file.readinto()`` with such a buffer (for files opened in binary mode) -- use ``ffi.buffer(mystruct[0])[:] = socket.recv(len(buffer))`` to read - into a struct over a socket, rewriting the contents of mystruct[0] +- overwrite the content of a struct: if ``p`` is a cdata pointing to + it, use ``ffi.buffer(p)[:] = newcontent``, where ``newcontent`` is + a bytes object (``str`` in Python 2). Remember that like in C, you can use ``array + index`` to get the pointer to the index'th item of an array. (In C you might more naturally write ``&array[index]``, but that is equivalent.) -The returned object is not a built-in buffer nor memoryview object, -because these objects' API changes too much across Python versions. -Instead it has the following Python API (a subset of Python 2's -``buffer``): +The returned object's type is not the builtin ``buffer`` nor ``memoryview`` +types, because these types' API changes too much across Python versions. +Instead it has the following Python API (a subset of Python 2's ``buffer``) +in addition to supporting the buffer interface: -- ``buf[:]`` or ``bytes(buf)``: fetch a copy as a regular byte string (or - ``buf[start:end]`` for a part) +- ``buf[:]`` or ``bytes(buf)``: copy data out of the buffer, returning a + regular byte string (or ``buf[start:end]`` for a part) -- ``buf[:] = newstr``: change the original content (or ``buf[start:end] +- ``buf[:] = newstr``: copy data into the buffer (or ``buf[start:end] = newstr``) -- ``len(buf), buf[index], buf[index] = newchar``: access as a sequence +- ``len(buf)``, ``buf[index]``, ``buf[index] = newchar``: access as a sequence of characters. The buffer object returned by ``ffi.buffer(cdata)`` keeps alive the @@ -193,9 +200,11 @@ **ffi.from_buffer([cdecl,] python_buffer, require_writable=False)**: return an array cdata (by default a ````) that points to the data of the given Python object, which must support the -buffer interface. This is the opposite of ``ffi.buffer()``. It gives -a reference to the existing data, not a copy. -It is meant to be used on objects +buffer interface. Note that ``ffi.from_buffer()`` turns a generic +Python buffer object into a cdata object, whereas ``ffi.buffer()`` does +the opposite conversion. Both calls don't actually copy any data. + +``ffi.from_buffer()`` is meant to be used on objects containing large quantities of raw data, like bytearrays or ``array.array`` or numpy arrays. It supports both the old *buffer* API (in Python 2.x) and the diff -Nru python-cffi-1.12.1/doc/source/whatsnew.rst python-cffi-1.12.2/doc/source/whatsnew.rst --- python-cffi-1.12.1/doc/source/whatsnew.rst 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/doc/source/whatsnew.rst 2019-02-26 15:01:22.000000000 +0000 @@ -3,6 +3,12 @@ ====================== +v1.12.2 +======= + +* Added temporary workaround to compile on CPython 3.8.0a2. + + v1.12.1 ======= diff -Nru python-cffi-1.12.1/PKG-INFO python-cffi-1.12.2/PKG-INFO --- python-cffi-1.12.1/PKG-INFO 2019-02-16 16:19:52.000000000 +0000 +++ python-cffi-1.12.2/PKG-INFO 2019-02-26 15:02:13.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: cffi -Version: 1.12.1 +Version: 1.12.2 Summary: Foreign Function Interface for Python calling C code. Home-page: http://cffi.readthedocs.org Author: Armin Rigo, Maciej Fijalkowski diff -Nru python-cffi-1.12.1/setup.py python-cffi-1.12.2/setup.py --- python-cffi-1.12.1/setup.py 2019-02-16 15:28:51.000000000 +0000 +++ python-cffi-1.12.2/setup.py 2019-02-26 15:01:22.000000000 +0000 @@ -198,7 +198,7 @@ `Mailing list `_ """, - version='1.12.1', + version='1.12.2', packages=['cffi'] if cpython else [], package_data={'cffi': ['_cffi_include.h', 'parse_c_type.h', '_embedding.h', '_cffi_errors.h']}