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

PYTHON-1366 Handle removal of asyncore in Python 3.12 #1187

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Conversation

absurdfarce
Copy link
Collaborator

@absurdfarce absurdfarce commented Nov 10, 2023

Goal is to maintain existing behaviour for Python 3.8 through 3.11. For Python 3.12 return a specific exception type with a message indicating that asyncore won't work on Python 3.12 due to it's removal.

We also change the load process for the libs to use a reduce op. We'll try to load working event loops in a specific sequence; if we're able to load one we short-circuit the rest, otherwise we keep trying. Return a single exception which contains the full set of failures for loading each event loop implementation.

@@ -440,6 +443,8 @@ class AsyncoreConnectionTests(ConnectionTests, unittest.TestCase):
def setUp(self):
if is_monkey_patched():
raise unittest.SkipTest("Can't test asyncore with monkey patching")
if AsyncoreConnection is None:
raise unittest.SkipTest('Unable to import asyncore module')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary to avoid executing this test on Python 3.12

@absurdfarce
Copy link
Collaborator Author

Jenkins run with these changes confirms that with this change we're only seeing failures for other known issues on Python 3.12.

@absurdfarce absurdfarce merged commit 3ca41e2 into master Nov 10, 2023
1 of 4 checks passed
@absurdfarce absurdfarce deleted the python1366 branch November 10, 2023 22:28
fruch added a commit to fruch/python-driver that referenced this pull request Jun 6, 2024
…sync_with_upstream_3.29.1

version 3.29.0

* tag '3.29.0' of https://github.com/datastax/python-driver:
  Documentation (and other) updates for 3.29.0 (datastax#1194)
  PYTHON-1331 ssl.match_hostname() is deprecated in 3.7 (datastax#1191)
  PYTHON-1371 Add explicit exception type for serialization failures (datastax#1193)
  Remove outdated Python pre-3.7 references (datastax#1186)
  PYTHON-1368 Avoid installing DSE deps + executing DSE tests for Python 3.12 (datastax#1188)
  PYTHON-1366 Handle removal of asyncore in Python 3.12 (datastax#1187)
  Removed backup(.bak) files (datastax#1185)
  docs: Fix typo in add_callbacks (datastax#1177)
  Remove some remnants of Python2 (datastax#1172)
  PYTHON-1313 Fix asyncio removals in Python 3.10 (datastax#1179)
  PYTHON-1364 Fix ssl.wrap_socket errors (from eventlet) for Python 3.12 (datastax#1181)
  Add Jenkins support for Python 3.12.0 (datastax#1180)
  Update redirects in docs.yaml (datastax#1178)
  Jenkins using new python versions in the matrix (datastax#1174)
  Update docs.yaml to point to most recent 3.28.0 docs changes
  CONN-38 Notes for 3.28.0 on PYTHON-1350 (datastax#1167)
  Include docs for 3.28.0
  Fixed non-valid rst in README
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

Successfully merging this pull request may close these issues.

1 participant