Skip to content
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

Psycopg2 doesn't install on Python 3.13 alpha #1692

Open
3 tasks done
junepark678 opened this issue Apr 16, 2024 · 3 comments
Open
3 tasks done

Psycopg2 doesn't install on Python 3.13 alpha #1692

junepark678 opened this issue Apr 16, 2024 · 3 comments

Comments

@junepark678
Copy link

This is a bug tracker
If you have a question, such has "how do you do X with Python/PostgreSQL/psycopg2" please write to the mailing list or open a question instead.

Before opening this ticket, please confirm that:

Please complete the following information:

  • OS: Linux (6.8.5-zen1-1-zen) on Arch Linux
  • Psycopg version: 2.9.9
  • Python version: 3.13.0a6+ (heads/main:6dc661bc9f)
  • PostgreSQL version: 16.2
  • pip version: 24.0
@hroncok
Copy link
Contributor

hroncok commented Apr 23, 2024

psycopg2/psycopg/utils.c

Lines 395 to 397 in a971c11

#if PY_VERSION_HEX >= 0x03080000
/* tested with Python 3.8.0a2 */
return _PyInterpreterState_Get() == PyInterpreterState_Main();

This function was made public and was renamed to PyInterpreterState_Get in Python 3.13.0a1+ in python/cpython#106321

@befeleme
Copy link

And after a rename of the function, this is the test run:

======================================================================
FAIL: test_cidr_adapt (tests.test_ipaddress.NetworkingTestCase.test_cidr_adapt)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/psycopg2-2.9.9/tests/test_ipaddress.py", line 112, in test_cidr_adapt
    self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128')
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '::ffff:1.2.3.0/128' != '::ffff:102:300/128'
- ::ffff:1.2.3.0/128
?         ^ ^ ^
+ ::ffff:102:300/128
?         ^ ^ ^


======================================================================
FAIL: test_inet_adapt (tests.test_ipaddress.NetworkingTestCase.test_inet_adapt)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/psycopg2-2.9.9/tests/test_ipaddress.py", line 71, in test_inet_adapt
    self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128')
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '::ffff:1.2.3.0/128' != '::ffff:102:300/128'
- ::ffff:1.2.3.0/128
?         ^ ^ ^
+ ::ffff:102:300/128
?         ^ ^ ^

Apparently, the textual representation of addresses has changed: python/cpython@f22bf8e

@dvarrazzo
Copy link
Member

Can you provide a MR with the function renamed, and a change to the tests to accept both the results?

Thank you very much 🙂

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