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

does not work on pypy3 (although the fix should be easy) #649

Closed
glyph opened this Issue Dec 12, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@glyph
Contributor

glyph commented Dec 12, 2017

I reported this in the pypy compatibility tracker here:

https://bitbucket.org/pypy/compatibility/issues/8/psycopg2-does-not-work-on-pypy3

For your convenience, the errors are here:

    cc -pthread -arch x86_64 -DNDEBUG -O2 -L/usr/local/Cellar/openssl@1.1/1.1.0g/lib -L/usr/local/opt/openssl@1.1/lib -L/lib -I/usr/local/Cellar/openssl@1.1/1.1.0g/include -I/usr/local/opt/openssl@1.1/include -I/include -L/lib -I/include -I/usr/local/Cellar/openssl@1.1/1.1.0g/include -I/usr/local/opt/openssl@1.1/include -I/include -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3.2 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=100000 -DHAVE_LO64=1 -I/usr/local/Cellar/pypy3/5.9.0/libexec/include -I. -I/usr/local/Cellar/postgresql/10.0/include -I/usr/local/Cellar/postgresql/10.0/include/server -c psycopg/adapter_datetime.c -o build/temp.macosx-10.13-x86_64-3.5/psycopg/adapter_datetime.o
    clang: warning: argument unused during compilation: '-L/usr/local/Cellar/openssl@1.1/1.1.0g/lib' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-L/usr/local/opt/openssl@1.1/lib' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-L/lib' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-L/lib' [-Wunused-command-line-argument]
    psycopg/adapter_datetime.c:103:18: error: no member named 'microseconds' in 'PyDateTime_Delta'
        int a = obj->microseconds;
                ~~~  ^
    psycopg/adapter_datetime.c:112:34: error: no member named 'days' in 'PyDateTime_Delta'
                                obj->days, obj->seconds, buffer);
                                ~~~  ^
    psycopg/adapter_datetime.c:112:45: error: no member named 'seconds' in 'PyDateTime_Delta'
                                obj->days, obj->seconds, buffer);
                                           ~~~  ^
    3 errors generated.
    error: command 'cc' failed with exit status 1

The pypy folks tell me that the issue here is that the fields in PyDateTime are private. As documented in the CPython official docs, the way to get at these values is via macro accessors; for example: https://docs.python.org/3.6/c-api/datetime.html#c.PyDateTime_DATE_GET_MICROSECOND, which PyPy3 does implement.

@ilvalle

This comment has been minimized.

ilvalle commented Feb 25, 2018

travis-ci fails testing pypy3 see https://travis-ci.org/ilvalle/psycopg2/jobs/345388895

@dvarrazzo

This comment has been minimized.

Member

dvarrazzo commented Feb 25, 2018

@ilvalle The error reported in this bug was fixed.

pypy3 is not supported in an official way. If you want to make it work provide a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment