Skip to content

py3.8/cython build error 'asyncpg.protocol.protocol.Codec' has no attribute '__reduce_cython__ #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cpaelzer opened this issue Nov 11, 2019 · 5 comments

Comments

@cpaelzer
Copy link

  • asyncpg version: 0.19
  • PostgreSQL version: 12
  • **Do you use a PostgreSQL SaaS?: No, issue reproduces at build time
  • Python version: 3.8
  • Platform: x86, armhf, arm64, ppc64el, s390x
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: No
  • If you built asyncpg locally, which version of Cython did you use?: 0.29.13
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : Sorry, I don't know

Hi,
I was looking at build issues of asyncpg in recent Ubuntu versions. After some struggle I decided to go ahead and use asyncpg 0.19 for its release page listing PG-12 support.

It passes the PG-12 related issues it failed on before, but it breaks on some odd cython errors that exceed my python-foo. I wanted to report this here in case it might be known or if there are others affected by the same.

The build errors look like:

==================================== ERRORS ====================================
_ ERROR collecting .pybuild/cpython3_3.8_asyncpg/build/tests/test__environment.py _
Traceback (most recent call last):
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/tests/test__environment.py", line 11, in
import asyncpg
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/init.py", line 8, in
from .connection import connect, Connection # NOQA
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/connection.py", line 20, in
from . import connect_utils
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/connect_utils.py", line 27, in
from . import protocol
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/protocol/init.py", line 8, in
from .protocol import Protocol, Record, NO_TIMEOUT # NOQA
File "asyncpg/protocol/protocol.pyx", line 1, in init asyncpg.protocol.protocol
# Copyright (C) 2016-present the asyncpg authors and contributors
File "asyncpg/pgproto/./uuid.pyx", line 162, in init asyncpg.pgproto.pgproto
class UUID(PgBaseUUID, uuid.UUID):
TypeError: multiple bases have instance lay-out conflict
_ ERROR collecting .pybuild/cpython3_3.8_asyncpg/build/tests/test_adversity.py _
Traceback (most recent call last):
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/tests/test_adversity.py", line 13, in
from asyncpg import _testbase as tb
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/init.py", line 8, in
from .connection import connect, Connection # NOQA
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/connection.py", line 20, in
from . import connect_utils
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/connect_utils.py", line 27, in
from . import protocol
File "/<>/.pybuild/cpython3_3.8_asyncpg/build/asyncpg/protocol/init.py", line 8, in
from .protocol import Protocol, Record, NO_TIMEOUT # NOQA
File "asyncpg/protocol/codecs/base.pyx", line 20, in init asyncpg.protocol.protocol
cdef class Codec:
AttributeError: type object 'asyncpg.protocol.protocol.Codec' has no attribute 'reduce_cython'

The latter one is repeating with different sources and trace paths.
A full log is in pastebin here

Note: I first sumbled about pgptoto being removed from the release tarball in 0.19, but I fused it with head of pgproto at 93f8959 as all commits since the last in the git submodule reference read safe and good. If you'd want me to exchange that for another version let me know.

@elprans
Copy link
Member

elprans commented Nov 11, 2019

Python 3.8 is not supported yet.

@cpaelzer
Copy link
Author

Thanks @elprans , that might explain all the issues I was seeing.

Please ping on this issue once there is work going on on it that would be testable so that I can give the Ubuntu/Debian packaging along postgresql-12/py3.8 a retry.

@1st1
Copy link
Member

1st1 commented Nov 19, 2019

Should be fixed in #504

@1st1
Copy link
Member

1st1 commented Nov 21, 2019

0.20.0 has been shipped yesterday with 3.8 support.

@1st1 1st1 closed this as completed Nov 21, 2019
@kamikaze
Copy link

Getting same issue with Python 3.8.3 and:

asyncpg==0.20.1
asyncpgsa==0.26.3
psycopg2==2.8.5

on arm64

src/my_app/db/__init__.py:1: in <module>
    from asyncpgsa import PG
../.venv38/lib/python3.8/site-packages/asyncpgsa/__init__.py:1: in <module>
    from .pool import create_pool
../.venv38/lib/python3.8/site-packages/asyncpgsa/pool.py:3: in <module>
    import asyncpg
../.venv38/lib/python3.8/site-packages/asyncpg/__init__.py:8: in <module>
    from .connection import connect, Connection  # NOQA
../.venv38/lib/python3.8/site-packages/asyncpg/connection.py:19: in <module>
    from . import connect_utils
../.venv38/lib/python3.8/site-packages/asyncpg/connect_utils.py:27: in <module>
    from . import protocol
../.venv38/lib/python3.8/site-packages/asyncpg/protocol/__init__.py:8: in <module>
    from .protocol import Protocol, Record, NO_TIMEOUT  # NOQA
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   AttributeError: type object 'asyncpg.protocol.protocol.Codec' has no attribute '__reduce_cython__'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants