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 launching PowerShell on UNC paths #6322

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

socram8888
Copy link
Contributor

@socram8888 socram8888 commented Dec 3, 2024

Thank you for contributing to Pipenv!

The issue

When using PowerShell in Windows, executing pipenv shell inside a UNC path (such as a SMB share) will cause a CMD.EXE error to be thrown, and a change to an incorrect CWD (normally, C:\Windows)

The fix

By disabling the shell functionality of subprocess.call, this is avoided.

On Windows, when this parameter is set to true, causes an intermediate CMD.EXE to be spawned between Python and PowerShell, which does not support the UNC path, causing the wrong CWD to be presented to the final PowerShell shell.

The checklist

  • Associated issue (pipenv shell not changing directory on Windows remote share #4438)
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix.rst, .feature.rst, .behavior.rst, .doc.rst. .vendor.rst. or .trivial.rst (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

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.

2 participants