Deprecation warnings when compile cffi on CPython 3.7.0a0

67 views
Skip to first unread message

TitanSnow

unread,
Sep 16, 2017, 9:08:44 PM9/16/17
to python-cffi
When I compile cffi on CPython 3.7.0a0 nightly version, I got some deprecation warnings. Here is a part of the compiler message

c/minibuffer.h: In function ‘mb_ass_slice’:
c/minibuffer.h:66:5: warning: ‘PyObject_AsReadBuffer’ is deprecated

c/_cffi_backend.c: In function ‘b_complete_struct_or_union’:
c/_cffi_backend.c:4748:17: warning: ‘PyUnicode_GetSize’ is deprecated

The ``PyObject_AsReadBuffer`` is deprecated in PEP 3118. The ``PyUnicode_GetSize`` is deprecated in PEP 393.

Will it troubles? Will cffi replace them with new APIs?

Armin Rigo

unread,
Sep 17, 2017, 2:42:50 AM9/17/17
to pytho...@googlegroups.com
Hi TitanSnow,
I will work around this when the time comes to do so. For now, I'm
fine with ignoring the warnings as long as CPython 3.7 is not
released. Just the other day I got an issue about some field
somewhere that disappeared, making cffi not compile; the next day the
CPython patch itself was reverted for unrelated reasons and cffi
compiles again.

Thanks anyway!


A bientôt,

Armin.

TitanSnow

unread,
Sep 17, 2017, 5:13:17 AM9/17/17
to python-cffi
Hi,
I agree with not to deal with unreleased versions. But these APIs are deprecated in documentation and for long.
``PyObject_AsReadBuffer`` is deprecated in CPython 3.0, ``PyUnicode_GetSize`` is deprecated in CPython 3.3,
although they're still usable and silently without any warnings in those versions and other released versions.


Yours,
TitanSnow.

Armin Rigo

unread,
Sep 17, 2017, 8:49:55 AM9/17/17
to pytho...@googlegroups.com
Hi TitanSnow,

On 17 September 2017 at 11:13, TitanSnow <tttnn...@gmail.com> wrote:
> I agree with not to deal with unreleased versions. But these APIs are
> deprecated in documentation and for long.
> ``PyObject_AsReadBuffer`` is deprecated in CPython 3.0,
> ``PyUnicode_GetSize`` is deprecated in CPython 3.3,
> although they're still usable and silently without any warnings in those
> versions and other released versions.

Ah, thanks for pointing this out. I'll look at how easily they can be
replaced in cffi, then.


Armin
Reply all
Reply to author
Forward
0 new messages