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 resolution of a name that's a prefix of another name #2521

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

native-api
Copy link
Member

…name

Make sure you have checked all steps below.

Prerequisite

  • Please consider implementing the feature as a hook script or plugin as a first step.
    • pyenv has some powerful support for plugins and hook scripts. Please refer to Authoring plugins for details and try to implement it as a plugin if possible.
  • Please consider contributing the patch upstream to rbenv, since we have borrowed most of the code from that project.
    • We occasionally import the changes from rbenv. In general, you can expect changes made in rbenv will be imported to pyenv too, eventually.
    • Generally speaking, we prefer not to make changes in the core in order to keep compatibility with rbenv.
  • My PR addresses the following pyenv issue (if any)

Description

  • Here are some details about my PR

Makes a complete name resolve to itself before trying to apply it as a prefix.

I hesitated to add this initially because subcommands that use pyenv-latest already do that -- if the prefix resolution fails, they fall back to using the original name. However, if there are 2 names like foo and foo.bar, pyenv latest foo undesirably succeeds.

Tests

  • My PR adds the following unit tests (if any)
    Test for the new use case

@native-api native-api merged commit ed1083e into pyenv:master Nov 10, 2022
@native-api native-api deleted the prefix_of_itself branch November 10, 2022 01:46
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.

pyenv-latest may report the wrong prefix
1 participant