fix: support _elsdk_.py filename in intersystems-irispython >= 3.4#60
Open
isc-tdyar wants to merge 13 commits intointersystems-community:mainfrom
Open
fix: support _elsdk_.py filename in intersystems-irispython >= 3.4#60isc-tdyar wants to merge 13 commits intointersystems-community:mainfrom
isc-tdyar wants to merge 13 commits intointersystems-community:mainfrom
Conversation
…ion framework (v0.5.15)
…ity/feature/llm-cache-and-evaluation LLM Caching, Connection Hardening, and Evaluation Framework (v0.5.15)
… PyPI publication
iris_dbapi_connector searched only for _init_elsdk.py when manually loading the DBAPI shim into the iris module namespace. In newer builds of intersystems-irispython (and current macOS/Linux packages from containers.intersystems.com), the shim was renamed to _elsdk_.py. The search loop found nothing, connect() was never injected, and all DBAPI connections returned None with the log message: _init_elsdk.py not found in any search paths Fix: check both filenames in the search loop. First hit wins. Workaround for users on existing installs: IRIS_PKG=$(python3 -c "import iris,os; print(os.path.dirname(iris.__file__))") ln -sf "$IRIS_PKG/_elsdk_.py" "$IRIS_PKG/_init_elsdk.py"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
`_get_iris_dbapi_module()` searches for `_init_elsdk.py` when manually loading the DBAPI shim. In newer builds of intersystems-irispython (current macOS and Linux packages from containers.intersystems.com), the shim was renamed to `elsdk.py`.
The search loop finds nothing, `connect()` is never injected, and all DBAPI connections return `None`:
```
iris module imported but connect() method not found!
Available attributes: ['current_dir', 'file_name_elsdk', 'os']
_init_elsdk.py not found in any search paths
IRIS connection utility returned None
```
Fix
Check both filenames in the inner search loop. First hit wins. One extra `for` loop, no other changes.
Workaround for users on existing installs
```bash
IRIS_PKG=$(python3 -c "import iris,os; print(os.path.dirname(iris.file))")
ln -sf "$IRIS_PKG/elsdk.py" "$IRIS_PKG/_init_elsdk.py"
```
Tested