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 issue with creating new projects on Windows #674

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brycepg
Copy link

@brycepg brycepg commented Dec 12, 2023

The previous code contained a bug where git couldn't reside in a relative subdirectory.

This change allows git to be installed in the user directory while avoiding git.exe from being injected via the current directory

For example the package manager scoop installes git.exe at %userprofile%/scoop/shims/git.exe which would previously cause poetry to fail.

I'd be also willing to write some code to enumerate %PATH% to find git.exe instead of using where.exe. That would fix an additional edge case of having the current directory in PATH with git.exe in it and it also being the cwd.

Resolves: python-poetry#7320

  • Added tests for changed code.
  • Updated documentation for changed code.

Closes python-poetry/poetry#7320

The previous code contained a bug where git couldn't reside
in relative subdirectory.

It appears to have done this in attempt to get the absolute
path of the git executable. Instead, I just use resolve
to resolve potential symlinks, etc.
@brycepg brycepg changed the title Fix issue with creating new projects Windows Fix issue with creating new projects on Windows Dec 12, 2023
@brycepg
Copy link
Author

brycepg commented Dec 12, 2023

Do we want a regression test?

@radoering
Copy link
Member

Do we want a regression test?

We always want a test if it is feasible. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants