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 popen_spawn when specifying a path on Windows which contains "\" separators #564

Merged
merged 1 commit into from
Sep 16, 2017

Conversation

eli-b
Copy link
Contributor

@eli-b eli-b commented Sep 15, 2017

I've opened an identical PR for pexpect: pexpect/pexpect#446

@kennethreitz
Copy link
Contributor

what exactly does this do?

@kennethreitz
Copy link
Contributor

everything is behaving as expected right now.

@eli-b
Copy link
Contributor Author

eli-b commented Sep 15, 2017

This lets me run pipenv install --three --python=C:\Miniconda2\envs\python3\python.exe -d on Windows without getting WindowsError: [Error 2] The system cannot find the file specified. shlex.split() without posix=False treats backslashes as escapes instead of preserving them.

There's an open StackOverflow question about this issue in popen_expect.

I should have explained the problem this solves for me.

@kennethreitz kennethreitz reopened this Sep 16, 2017
@kennethreitz kennethreitz merged commit ec384b3 into pypa:master Sep 16, 2017
@uranusjr
Copy link
Member

Is posix=(os.sep == '/') maybe a more pragmatic solution?

@techalchemy
Copy link
Member

given that we are specifically interested in whether we are dealing with a posix compliant platform I would recommend posix=(os.name == 'posix')

@eli-b
Copy link
Contributor Author

eli-b commented Sep 16, 2017

I just copied the test from earlier in the function where sys.platform == 'win32' is used. Testing for a POSIX system directly might be clearer.

@techalchemy
Copy link
Member

I have a slight change to this over in #570 for reference

@eli-b eli-b deleted the windows-support branch September 17, 2017 10:38
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.

None yet

4 participants