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

Fix handling of venv bash activation scripts #36

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

kevinconway
Copy link
Owner

The regular expression used to capture the venv's path in a bash activation script was capturing too much. This caused the rewrite that happens during relocate to leave an instance of original path but only in a branch of bash code that is activated when running on Windows.

This patch fixes a bug that was actually present in all regular expressions used to find paths in activation scripts. The bug was previously benign because all virtualenv activation scripts and all but the bash script for venv contain exactly one instance of the matched path which was correctly changed during relocation. Now all scripts use an improved pattern and will automatically handle multiple path instances if they appear over time.

The regular expression used to capture the venv's path in a bash
activation script was capturing too much. This caused the rewrite that
happens during relocate to leave an instance of original path but only
in a branch of bash code that is activated when running on Windows.

This patch fixes a bug that was actually present in all regular
expressions used to find paths in activation scripts. The bug was
previously benign because all virtualenv activation scripts and all but
the bash script for venv contain exactly one instance of the matched
path which was correctly changed during relocation. Now all scripts use
an improved pattern and will automatically handle multiple path
instances if they appear over time.
@kevinconway
Copy link
Owner Author

Fixes #35.

@kevinconway kevinconway merged commit 92e2f4b into master Nov 9, 2024
7 checks passed
@kevinconway kevinconway deleted the multi-path-references branch November 9, 2024 20:49
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