Skip to content

Failed to load requirements.txt on Windows with dockerizePip set to false #252

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

Closed
PatrickBuTaxdoo opened this issue Sep 20, 2018 · 1 comment

Comments

@PatrickBuTaxdoo
Copy link
Contributor

PatrickBuTaxdoo commented Sep 20, 2018

The sls deploy command fails if dockerizePip is set to false while using a windows system:

Could not open requirements file: [Errno 22] Invalid argument: 'C\\:\\\\Users\\\\[...]\\\\.serverless\\\\requirements\\\\requirements.txt'

There are way too many slashes. I think the error originates from this function in lib/pip.js:

function dockerPathForWin(options, path) {
  if (process.platform === 'win32' && options.dockerizePip) {
    return path.replace(/\\/g, '/');
  }
  return quote_single(path);
}

It should instead look like this:

function dockerPathForWin(options, path) {
  if (process.platform === 'win32') {
    return path.replace(/\\/g, '/');
  }
  return quote_single(path);
}
@dschep
Copy link
Contributor

dschep commented Sep 20, 2018

That's probably right. Did you test this change? Either way, feel free to make a PR. I'll cut a release if this fix is confirmed, but I don't have a windows box.

PatrickBuTaxdoo added a commit to PatrickBuTaxdoo/serverless-python-requirements that referenced this issue Sep 20, 2018
dschep pushed a commit that referenced this issue Sep 20, 2018
(cherry picked from commit 462385a)
PatrickBuTaxdoo added a commit to PatrickBuTaxdoo/serverless-python-requirements that referenced this issue Sep 21, 2018
dschep pushed a commit that referenced this issue Sep 21, 2018
@dschep dschep closed this as completed in a42eee3 Oct 11, 2018
dschep added a commit that referenced this issue Nov 1, 2018
* Fixes issues with spaces in path on windows #184
* More windows path issues #252
* fix issues when using pip-tools with hashes #261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants