Skip to content

Spaces in path break virtualenv creation #8390

Closed

Description

@schumannd

./mach build --dev fails with Pip failed to execute properly. which comes from l.135 in python/mach_bootstrap.py

This is due to:
subprocess.check_call([pip, "install", "-q", "-r", req_path])
where pip contains the path to pip in the newly created virtual environment, but without escaped spaces.

To reproduce just try to set up rust in a folder which contains a space in its name.

Activity

  1. self-assigned this
    on Nov 7, 2015
  2. added
    C-assigned
    on Nov 7, 2015
  3. added a commit that references this issue on Nov 7, 2015
    4ff8d3a
  4. added 2 commits that reference this issue on Nov 7, 2015
    6e8071f
    abf2dfe
  5. zbynekwinkler commented on Apr 13, 2016

    @zbynekwinkler
    Contributor

    I think the fix in #8394 (4ff8d3a) is not correct (meaning it does not help in any way) and in addition it breaks windows build for me. Does windows build work for anyone else from a clean checkout?

    Doing

    >>> from pipes import quote
    >>> quote('windows\\path')
    "'windows\\path'"
    >>>

    creates a quoted path that is good for shell but not for __file__. Inside activate_this.py it is used to adjust the PATH but it fails:

    >>> os.getcwd()
    'C:\\software\\git'
    >>> os.path.abspath(__file__)
    "C:\\software\\git\\'windows\\path'"
    >>>

    Please note how the 'windows\path' gets embedded literately to make nonexisting path.

    Also according to https://docs.python.org/2/library/subprocess.html#subprocess.check_call by default shell is not involved so shell quoting is not needed. The original problem must have been caused by something else.

  6. frewsxcv commented on Apr 14, 2016

    @frewsxcv
    Contributor

    @zwn Can you open a new issue for that? This issue was (implicitly) about OSX/Linux, so if there's an issue with spaces in filepaths on Windows, we should probably create a new issue. You can just copy and paste what you just wrote into the body of the issue

  7. zbynekwinkler commented on Apr 14, 2016

    @zbynekwinkler
    Contributor

    Done so in #10595.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-assigned

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions