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

Support entry point paths with spaces #1660

Merged
merged 4 commits into from
Feb 26, 2020

Conversation

nsoranzo
Copy link
Contributor

@nsoranzo nsoranzo commented Feb 25, 2020

Before this patch:

$ virtualenv --version
virtualenv 20.0.6.dev5+g9201422 from /usr/users/ga002/soranzon/software/nsoranzo_virtualenv/.venv/local/lib/python2.7/site-packages/virtualenv/__init__.pyc
$ virtualenv 'foo bar'
created virtual environment CPython2.7.17.final.0-64 in 403ms
  creator CPython2Posix(dest=/usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/usr/users/ga002/soranzon/.local/share/virtualenv/seed-v1)
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
$ head -n 3 foo\ bar/bin/pip
#!/bin/sh
'''exec' /usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar/bin/python "$0" "$@"
' '''
$ ./foo\ bar/bin/pip
./foo bar/bin/pip: 2: exec: /usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo: not found

After this patch:

$ virtualenv 'foo bar'
created virtual environment CPython2.7.17.final.0-64 in 336ms
  creator CPython2Posix(dest=/usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/usr/users/ga002/soranzon/.local/share/virtualenv/seed-v1)
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
$ head -n 3 foo\ bar/bin/pip
#!/bin/sh
'''exec' "/usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar/bin/python" "$0" "$@"
' '''
$ ./foo\ bar/bin/pip

Usage:
  pip <command> [options]
...

N.B.: virtualenv <20 was also quoting the path and therefore did not have the issue.

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

@nsoranzo nsoranzo force-pushed the fix_entry_points_with_spaces branch from db31ef5 to fed246e Compare February 25, 2020 01:49
nsoranzo added a commit to nsoranzo/galaxy that referenced this pull request Feb 25, 2020
Also:
- Fix integration tests for checkout@v2 action: the working directory is not
  updated any more when `path` is specified
- Use checkout action to clone the galaxy-test-data repo and rsync to move
  them in place
- Install virtualenv<20 when running tests via tox in a directory containing
  spaces, xref. pypa/virtualenv#1660
@gaborbernat gaborbernat force-pushed the fix_entry_points_with_spaces branch from 0ed3dac to c52b376 Compare February 25, 2020 11:28
nsoranzo and others added 3 commits February 26, 2020 08:17
Before this patch:

```console
$ virtualenv --version
virtualenv 20.0.6.dev5+g9201422 from /usr/users/ga002/soranzon/software/nsoranzo_virtualenv/.venv/local/lib/python2.7/site-packages/virtualenv/__init__.pyc
$ virtualenv 'foo bar'
created virtual environment CPython2.7.17.final.0-64 in 403ms
  creator CPython2Posix(dest=/usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/usr/users/ga002/soranzon/.local/share/virtualenv/seed-v1)
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
$ head -n 3 foo\ bar/bin/pip
#!/bin/sh
'''exec' /usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar/bin/python "$0" "$@"
' '''
$ ./foo\ bar/bin/pip
./foo bar/bin/pip: 2: exec: /usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo: not found
```

After this patch:

```console
$ virtualenv 'foo bar'
created virtual environment CPython2.7.17.final.0-64 in 336ms
  creator CPython2Posix(dest=/usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/usr/users/ga002/soranzon/.local/share/virtualenv/seed-v1)
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
$ head -n 3 foo\ bar/bin/pip
#!/bin/sh
'''exec' "/usr/users/ga002/soranzon/software/nsoranzo_virtualenv/foo bar/bin/python" "$0" "$@"
' '''
$ ./foo\ bar/bin/pip

Usage:
  pip <command> [options]
...
```
Signed-off-by: Bernat Gabor <[email protected]>
Signed-off-by: Bernat Gabor <[email protected]>
@gaborbernat gaborbernat force-pushed the fix_entry_points_with_spaces branch from c52b376 to 8f3d8d2 Compare February 26, 2020 08:18
@gaborbernat gaborbernat changed the title Fix creation of entry points when path contains spaces support entry point paths with space Feb 26, 2020
@gaborbernat gaborbernat merged commit 13ab07c into pypa:master Feb 26, 2020
@nsoranzo nsoranzo deleted the fix_entry_points_with_spaces branch February 26, 2020 10:26
@nsoranzo nsoranzo changed the title support entry point paths with space Support entry point paths with spaces Feb 26, 2020
@gaborbernat
Copy link
Contributor

Hello, a fix for this issue has been released via virtualenv 20.0.6; see https://pypi.org/project/virtualenv/20.0.6/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-6-2020-02-26) . Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release.
thanks

@soomrozaid
Copy link

I am experiencing this issue in version 20.14.1

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.

3 participants