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

Datapack.save(overwrite=True) raises FileNotFoundError when trying to save different data than what's already written on disk. #443

Open
Belissimo-T opened this issue Jul 8, 2024 · 0 comments

Comments

@Belissimo-T
Copy link

Belissimo-T commented Jul 8, 2024

The title says it all.

Traceback (most recent call last):
  File "[...]/mcutils3/mcutils/ir/datapack.py", line 43, in export
    out.save(overwrite=True)
  File "[...]/mcutils3/venv/lib/python3.12/site-packages/beet/library/base.py", line 1509, in save
    self.dump(pack)
  File "[...]/mcutils3/venv/lib/python3.12/site-packages/beet/library/base.py", line 1445, in dump
    _dump_files(origin, self.list_files())
  File "[...]/mcutils3/venv/lib/python3.12/site-packages/beet/library/base.py", line 1531, in _dump_files
    f.dump(origin, "/".join(directory + (filename,)))
  File "[...]/mcutils3/venv/lib/python3.12/site-packages/beet/core/file.py", line 313, in dump
    shutil.copyfile(self.ensure_source_path(), str(Path(origin, path)))
  File "/usr/lib/python3.12/shutil.py", line 260, in copyfile
    with open(src, 'rb') as fsrc:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '[...]/mcutils3/testout/test/data/test/functions/exists/1_score_639_3.mcfunction'

I think it only happens when it needs to create different subfolders than what's already written to disk. Stangely enough, once I run my program a second time, it always works. When just invoking the function twice, however, it still fails.

PS: Thanks for this awesome library!

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

1 participant