andresch / trackfs

A FUSE filesystem that splits FLAC+CUE files into individual tracks
Other
55 stars 4 forks source link

Trackfs fails totally if directory name ends with .flac|.wav #19

Closed zefir-o closed 3 years ago

zefir-o commented 3 years ago

IsADirectoryError: [Errno 21] Is a directory: '/src/Rod.Stewart-The.Best.Of.Rod.Stewart.1971.Flac'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/fuse.py", line 734, in _wrapper return func(*args, *kwargs) or 0 File "/usr/local/lib/python3.8/site-packages/fuse.py", line 960, in readdir for item in self.operations('readdir', self._decode_optional_path(path), File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 60, in call return super(TrackFSOps, self).call(op, self.root + path, args) File "/usr/local/lib/python3.8/site-packages/fuse.py", line 1076, in call return getattr(self, op)(args) File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 127, in readdir return self._fusepath(path).readdir() File "/usr/local/lib/python3.8/site-packages/trackfs/fusepath.py", line 145, in readdir trx = albuminfo.get(os.path.join(self.source, filename)).tracks() File "/usr/local/lib/python3.8/site-packages/trackfs/albuminfo.py", line 78, in tracks return self.cue.tracks if self.cue is not None else [] File "/usr/local/lib/python3.8/functools.py", line 967, in get val = self.func(instance) File "/usr/local/lib/python3.8/site-packages/trackfs/albuminfo.py", line 63, in cue meta = self.meta File "/usr/local/lib/python3.8/functools.py", line 967, in get val = self.func(instance) File "/usr/local/lib/python3.8/site-packages/trackfs/albuminfo.py", line 37, in meta return File(self.path) File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 162, in wrapper_func with _openfile(None, filething, filename, fileobj, File "/usr/local/lib/python3.8/contextlib.py", line 113, in enter return next(self.gen) File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 272, in _openfile raise MutagenError(e) mutagen.MutagenError: [Errno 21] Is a directory: '/src/Rod.Stewart-The.Best.Of.Rod.Stewart.1971.Flac' INFO Dummy-3 getattr for (/src/autorun.inf) [None] DEBUG Dummy-3 no track file in "/src/autorun.inf" DEBUG Dummy-3 FusePath(source_root='/src/autorun', extension='.inf', is_track=False, num=None, title=None, _factory=Factory(track_separator='.#-#.', max_title_len=20, album_extension='(?i:\.flac|\.wav)', valid_filenamechars='-() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', keep_album=False, track_extension='.flac')) DEBUG Dummy-3 FUSE operation getattr raised a <class 'FileNotFoundError'>, returning errno 2. Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/fuse.py", line 734, in _wrapper return func(args, *kwargs) or 0 File "/usr/local/lib/python3.8/site-packages/fuse.py", line 774, in getattr return self.fgetattr(path, buf, None) File "/usr/local/lib/python3.8/site-packages/fuse.py", line 1027, in fgetattr attrs = self.operations('getattr', self._decode_optional_path(path), fh) File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 60, in call return super(TrackFSOps, self).call(op, self.root + path, args) File "/usr/local/lib/python3.8/site-packages/fuse.py", line 1076, in call return getattr(self, op)(*args) File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 69, in getattr st = os.lstat(fp.source) FileNotFoundError: [Errno 2] No such file or directory: '/src/autorun.inf'

andresch commented 3 years ago

Thanks for reporting a bug and providing a fix a few hours later, @igor-epam! Highly appreciated!