Skip to content

CASSANDRA-20997: Support Python 3.12 and 3.13 in cqlsh#4628

Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-20997-python3.13-support
Open

CASSANDRA-20997: Support Python 3.12 and 3.13 in cqlsh#4628
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-20997-python3.13-support

Conversation

@arvindKandpal-ksolves
Copy link
Contributor

Support Python 3.12 and 3.13 in cqlsh by vendoring the pyasyncore package.

Context / Background

Currently, starting cqlsh with Python 3.12 or 3.13 fails. Even if the version guards are relaxed, it crashes with a DependencyException because Python 3.12 removed the asyncore module from the standard library (PEP 594). The bundled Datastax python driver (cassandra-driver-internal-only) relies on asyncore as a default fallback event loop when C-extensions (libev) are not present, causing it to crash at import time.

Changes Made

To fix this without modifying the bundled third-party driver's internal code:

  1. Dependency Management: Updated .build/build-resolver.xml to fetch the official pyasyncore package from PyPI and package it as a .zip in the lib/ directory.
  2. Path Injection: Added 'pyasyncore-' to the third_parties tuple in bin/cqlsh.py so it gets injected into sys.path at runtime (matching the existing approach for wcwidth and pure_sasl).
  3. Version Guards: Relaxed the supported version checks in both bin/cqlsh and bin/cqlsh.py to allow Python up to 3.13.

Testing

  • Successfully ran ant cqlsh to verify that pyasyncore-1.0.5-py3-none-any.zip is downloaded and copied to the lib/ directory.
  • Tested cqlsh locally with CQLSH_PYTHON=python3.12 and CQLSH_PYTHON=python3.13 to confirm it successfully connects to the cluster without throwing driver import errors.
  • Confirmed that Python 3.14 correctly triggers the "unsupported version" warning message.

patch by Arvind Kandpal; for CASSANDRA-20997

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

Comments