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

FileExistsError on Every Run #84

Closed
fny opened this issue Aug 11, 2017 · 5 comments
Closed

FileExistsError on Every Run #84

fny opened this issue Aug 11, 2017 · 5 comments
Labels

Comments

@fny
Copy link

fny commented Aug 11, 2017

For some strange reason, I'm getting a FileExistsError on every run:

Traceback (most recent call last):
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/smuggler-3.6/bin/check-manifest", line 11, in <module>
    sys.exit(main())
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/smuggler-3.6/lib/python3.6/site-packages/check_manifest.py", line 920, in main
    update=args.update, python=args.python):
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/smuggler-3.6/lib/python3.6/site-packages/check_manifest.py", line 808, in check_manifest
    copy_files(existing_source_files, tempsourcedir)
  File "/Users/faraz/.pyenv/versions/3.6.2/envs/smuggler-3.6/lib/python3.6/site-packages/check_manifest.py", line 217, in copy_files
    os.mkdir(destfile)
FileExistsError: [Errno 17] File exists: '/var/folders/lg/m3q3m8z11458bpm2mbnl235h0000gn/T/check-manifest-eeltcupj-sources/.'

System Version: macOS 10.12.5 (16F73)
Kernel Version: Darwin 16.6.0

@mgedmin
Copy link
Owner

mgedmin commented Aug 12, 2017

Oh, interesting! Somehow you end up with a . in the existing_source_files list. A quick fix would be to add . to the default IGNORE list, but I'd like to understand where it comes from (in case I end up with a . entry in a subdirectory or something).

What version control system do you use for the project you're feeding to check-manifest?

Is there any way for me to try and reproduce this with your source repo (e.g. is it open-source code)?

@mgedmin mgedmin added the bug label Aug 12, 2017
@fny
Copy link
Author

fny commented Aug 13, 2017

Here's the repo: https://github.com/fny/smuggler

@mgedmin
Copy link
Owner

mgedmin commented Aug 14, 2017

I cannot reproduce the error on Linux, using check-manifest 0.35 and git 2.11.0.

Your repository doesn't use submodules, so what check-manifest does is run git ls-files. When I try that on your repo, I get

.gitignore
.travis.yml
LICENSE.txt
MANIFEST.in
README.rst
fixtures/contraband.py
setup.cfg
setup.py
smuggler.py
tests/__init__.py
tests/fixtures/fake_drugs.py
tests/fixtures/inner_russian_doll.py
tests/fixtures/outer_russian_doll.py
tests/test_smuggle.py
tox.ini

Do you get anything different if you do git ls-files? E.g. if your git prints every filename as ./tox.ini etc, that could probably explain this bug.

Also, can you tell me what git --version prints for you?

@SpotlightKid
Copy link

This can also happen, if you are working in a git repo, which you have just initialized with git init, but haven't commited anything yet.

@mgedmin
Copy link
Owner

mgedmin commented Nov 21, 2017

I can reproduce this after a fresh git init!

The core cause is that ''.split('\0') returns [''] rather than [] in Python, which then gets normalized to ['.'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants