arvindKandpal-ksolves opened a new pull request, #4666: URL: https://github.com/apache/cassandra/pull/4666
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 and CASSANDRA-19206 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

