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

Providing a source file which does not have an extension writes to a .txt file in current dir #470

Closed
davidovich opened this issue Mar 17, 2017 · 2 comments

Comments

@davidovich
Copy link
Contributor

If you happen to use an extensionless filename as a source of requirements in, pip-compile will deduce the wrong output filename and generate a ".txt" file (relative file, thus at current working dir).

Environment Versions
  1. OS Type Should be cross platform, but observed on Windows
  2. Python version: $ python -V 2.7.8
  3. pip version: $ pip --version 9.0.1
  4. pip-tools version: $ pip-compile --version 1.8.1rc2
Steps to replicate
  1. echo "request" > no_extension
  2. pip-compile no_extension
Expected result

We should error out because it is difficult to deduce a new name if there is no extension to remove.

Actual result

a .txt file is generated at the current directory.

@vphilippon
Copy link
Member

Giving an error is an option, but how about simply adding ".txt" for the output filename , as it's already the used extension for the output file.
Ex:
pip-compile no_extension
Result: no_extension.txt is created, containing the pip-compile output.

That way, if anyone happens to be using files without extension as input, it won't break them, while not outputing to exact same file for every filename without extension, which is the case right now.

@davidovich
Copy link
Contributor Author

@vphilippon yes, you are right, appending .txt to a filename missing extension is the simple solution.

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

No branches or pull requests

2 participants