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

No such file or directory crash due to erroneously duplicated path segment in submodule #85

Closed
rubenwardy opened this issue Dec 3, 2020 · 8 comments

Comments

@rubenwardy
Copy link

rubenwardy commented Dec 3, 2020

The module duplicates the "display_api" in /tmp/test/mesecons_lab/mods/display_modpack/display_api/display_api/API.md, despite there being no such subfolder.

From command line

git clone --recursive https://github.com/BuckarooBanzay/mesecons_lab
git-archive-all -C mesecons_lab --force-submodules out.zip
[Errno 2] No such file or directory: '/tmp/test/mesecons_lab/mods/display_modpack/display_api/display_api/API.md'

as a library

  File "/home/cdb/app/tasks/importtasks.py", line 304, in makeVCSRelease
    archiver.create(destPath)
  File "/usr/local/lib/python3.6/site-packages/git_archive_all.py", line 260, in create
    self.archive_all_files(archiver)
  File "/usr/local/lib/python3.6/site-packages/git_archive_all.py", line 307, in archive_all_files
    archiver(path.join(self.main_repo_abspath, file_path), path.join(self.prefix, file_path))
  File "/usr/local/lib/python3.6/site-packages/git_archive_all.py", line 253, in archiver
    add_file(file_path, arcname)
  File "/usr/local/lib/python3.6/site-packages/git_archive_all.py", line 227, in add_file
    archive.write(file_path, arcname, ZIP_DEFLATED)
  File "/usr/local/lib/python3.6/zipfile.py", line 1617, in write
    zinfo = ZipInfo.from_file(filename, arcname)
  File "/usr/local/lib/python3.6/zipfile.py", line 507, in from_file
    st = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test/mesecons_lab/mods/display_modpack/display_api/display_api/API.md'

/re luanti-org/contentdb#245

@rubenwardy rubenwardy changed the title Crash on zip.add_file due to erroneously duplicated path segment No such file or directory crash due to erroneously duplicated path segment Dec 3, 2020
@rubenwardy rubenwardy changed the title No such file or directory crash due to erroneously duplicated path segment No such file or directory crash due to erroneously duplicated path segment in submodule Dec 3, 2020
@rubenwardy
Copy link
Author

I have a feeling this is due to this incorrect .gitmodules config in display_modpack: https://github.com/pyrollo/display_modpack/blob/6135b3a60c4adb270b1a3a05b8d3449ecfa68148/.gitmodules
(display_api is both a folder and a submodule here)

@Kentzo
Copy link
Owner

Kentzo commented Dec 4, 2020

It might be incorrect, but if git handles it without failure so should git-archive-all.

Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
Kentzo added a commit that referenced this issue Dec 4, 2020
Parsing .gitmodules may yield paths that are ignored by git.
Refs #85
@Kentzo
Copy link
Owner

Kentzo commented Dec 4, 2020

Please try the issue-85 branch, I hope I got quoting right.

@rubenwardy
Copy link
Author

Hi, I can confirm that this branch fixes the problem in my code. Thanks!

@sobedrinker42
Copy link

Hi, This fix also worked for me!

Thank you for the work

@Kentzo
Copy link
Owner

Kentzo commented Jan 29, 2021

Time to get it merged then.

@Kentzo Kentzo closed this as completed Jan 29, 2021
@rubenwardy
Copy link
Author

How long does it take for a new version to be available on PIP?

@Kentzo
Copy link
Owner

Kentzo commented Jan 29, 2021

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

3 participants