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

Revert "also disallow altsep beside pathsep inside paths" #1598

Merged
merged 2 commits into from
Feb 13, 2020

Conversation

vphilippon
Copy link
Member

@vphilippon vphilippon commented Feb 12, 2020

This reverts commit 524d95e.

Fixes #1582
This essentially allows back the usage of / in pathname on Windows for virtualenvs for nested dirs.
Ex: python -m virtualenv foo/bar.

Thanks for contributing a pull request, see checklist all is good!

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added news fragment in docs/changelog folder

@gaborbernat
Copy link
Contributor

This needs a test of using Unix paths on windows, and a changelog.

@vphilippon
Copy link
Member Author

So I'm trying to understand how/where the path provided is used to write a proper test (rather than sticking the os.altsep component in some pre-existing matrix).

As I dig in, I'm getting an omnious feeling with how via_os_path.Path might behave in some cases.

I'll take some extra time to look this up. I'd like to make sure that the path get standardized with os.sep early and explicitly, rather than "hoping" that the mangling around eventually normalize it.

@vphilippon vphilippon changed the title Revert "also disallow altsep beside pathsep inside paths" WIP: Revert "also disallow altsep beside pathsep inside paths" Feb 12, 2020
Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a test to validate that passing altsep paths work, I'm happy to go ahead with this. The test can be as simple as creating a env with activators and ensuring the paths within the activators use the sep instead of altsep.

@gaborbernat gaborbernat changed the title WIP: Revert "also disallow altsep beside pathsep inside paths" Revert "also disallow altsep beside pathsep inside paths" Feb 13, 2020
@vphilippon
Copy link
Member Author

In the end, since the creator is the piece providing, validating and sanitizing the dest path input, I've put a test on Creator.validate_dest. The activators currently rely on the creator giving a valid path, so I think this is the best way to test this.
Plus, that means there's no need to worry about os.altsep in other pieces past that point.

If you think of cases this won't cover let me know.

@gaborbernat gaborbernat merged commit eb80439 into pypa:master Feb 13, 2020
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.

With Git bash, cannot create virtualenv with a nested path.
2 participants