Repository navigation
fix(python): match two-digit minor versions in pyuserpaths - #14161
Merged
robbyrussell merged 1 commit intoOct 8, 2026
Merged
Conversation
The version pattern used the shortest match (#), so "Python 3.11.4" was truncated to 3.1 and the ~/.local/lib/python3.11/site-packages check never matched on python >= 3.10, leaving pyuserpaths a no-op. Use a longest match (##) so the whole minor version is kept.
robbyrussell
approved these changes
Oct 8, 2026
robbyrussell
left a comment
Member
There was a problem hiding this comment.
Thanks for your first contribution to Oh My Zsh! This one has been quietly broken on every Python since 3.10, so it's a good catch. I checked the old and new parsing against a handful of versions (3.9, 3.10, 3.13, a 3.14 rc) and it does the right thing now. Merging.
RH203
pushed a commit
to RH203/ohmyzsh
that referenced
this pull request
Oct 28, 2026
…4161) The version pattern used the shortest match (#), so "Python 3.11.4" was truncated to 3.1 and the ~/.local/lib/python3.11/site-packages check never matched on python >= 3.10, leaving pyuserpaths a no-op. Use a longest match (##) so the whole minor version is kept.
tutkun
pushed a commit
to tutkun/ohmyzsh
that referenced
this pull request
Oct 29, 2026
…4161) The version pattern used the shortest match (#), so "Python 3.11.4" was truncated to 3.1 and the ~/.local/lib/python3.11/site-packages check never matched on python >= 3.10, leaving pyuserpaths a no-op. Use a longest match (##) so the whole minor version is kept.
jizongFox
pushed a commit
to jizongFox/ohmyzsh
that referenced
this pull request
Nov 2, 2026
…4161) The version pattern used the shortest match (#), so "Python 3.11.4" was truncated to 3.1 and the ~/.local/lib/python3.11/site-packages check never matched on python >= 3.10, leaving pyuserpaths a no-op. Use a longest match (##) so the whole minor version is kept.
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.
Changes:
pyuserpathshas been silently doing nothing on python 3.10 and newer.The version is parsed with a shortest match:
so
Python 3.11.4comes out as3.1,Python 3.13.1also as3.1, and the check then looks for~/.local/lib/python3.1/site-packages, which never exists, so the path is skipped. It only ever worked by accident, because before 3.10 the minor version was a single digit (3.9.7->3.9).Switching
#to##makes it a longest match and keeps the whole minor version:Tested with python stubs reporting 2.7.18, 3.9.7, 3.10, 3.11.4 and 3.13.1: the old versions still parse the same, a missing site-packages directory is still skipped,
PYTHONUSERBASEis still honored, and an existingPYTHONPATHis kept without duplicate entries.