SwatPhonLab / UltraTrace

A Free/Open-Source tool for manual annotation of Ultrasound Tongue Imaging data.
GNU General Public License v3.0
10 stars 5 forks source link

file not found should be a warning not a crash #149

Open jonorthwash opened 3 years ago

jonorthwash commented 3 years ago

The following happened when a symlink was linked to file that didn't exist:

DEBUG:     - creating new metadata file: `../ultrasound-data-TurkicVowels-processed/P06/metadata.json`
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/data/Documents/Research/PhonLab/UltraTrace/ultratrace/__main__.py", line 628, in <module>
    app = App()
  File "/data/Documents/Research/PhonLab/UltraTrace/ultratrace/__main__.py", line 82, in __init__
    self.Data = modules.Metadata( self, args.path )
  File "/data/Documents/Research/PhonLab/UltraTrace/ultratrace/modules/metadata.py", line 93, in __init__
    mime_type = Magic(mime=True).from_file(real_filepath)
  File "/usr/lib/python3/dist-packages/magic/__init__.py", line 96, in from_file
    with _real_open(filename):
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/backup/ultrasound/raw/2015-11-13/flac/10-42-48.flac'

This should instead throw a warning and continue.