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

mergerfs.dedup FileNotFoundError #110

Open
ibidani opened this issue Nov 12, 2020 · 3 comments
Open

mergerfs.dedup FileNotFoundError #110

ibidani opened this issue Nov 12, 2020 · 3 comments

Comments

@ibidani
Copy link

ibidani commented Nov 12, 2020

Thanks @trapexit for your hard work and being super engaged contributor to mergerfs users.
I'm trying to consolidate a few disks using mergerfs.dedup, seems like some of those characters triggered maybe an escaping problem.
It's not a big issue for me but maybe to someone else in the future

root@mymedia:/srv/0e191110-567c-41cf-970e-359f647b8dd3/Media# mergerfs.dedup -v -d newest /srv/0e191110-567c-41cf-970e-359f647b8dd3/Media/
Traceback (most recent call last):
File "/usr/local/bin/mergerfs.dedup", line 548, in
main()
File "/usr/local/bin/mergerfs.dedup", line 533, in main
total_size += dedup(fullpath,verbose,ignorefun,execute,dedupfun)
File "/usr/local/bin/mergerfs.dedup", line 359, in dedup
paths = getxattr(fullpath,b'user.mergerfs.allpaths').split('\0')
File "/usr/local/bin/mergerfs.dedup", line 337, in getxattr
attr = lgetxattr(path,key)
File "/usr/local/bin/mergerfs.dedup", line 50, in lgetxattr
raise IOError(err,os.strerror(err),path)
FileNotFoundError: [Errno 2] No such file or directory: b'/srv/0e191110-567c-41cf-970e-359f647b8dd3/Media/Backup/Backup-Fedoraidan/idan/.local/share/Trash/info/\x10\x03\x01l\udc9a\x7f.trashinfo'

@trapexit
Copy link
Owner

The problem is the encoding of the filename. ::sigh:: I've spent more time screwing with Python's annoying encoding/decoding than working on real shit. I should just rewrite everything in C++.

@ibidani
Copy link
Author

ibidani commented Nov 12, 2020

Some bugs are not worth solving, at least not in a priority of the more impactful ones

@koelie
Copy link

koelie commented Jan 17, 2023

ran into this bug, fixed by replacing:

path = path.encode(errors='backslashreplace')

with

os.fsencode(path)

and replacing:

attr.decode('utf-8')

with:

os.fsdecode(attr)

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