silkyclouds / FlacChecker

A tool to identify and handle potentially corrupted FLAC audio files in your collection
GNU General Public License v3.0
4 stars 1 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '/app/progress.log' #1

Open tordenflesk opened 1 year ago

tordenflesk commented 1 year ago
Process Process-1:
Traceback (most recent call last):
  File "C:\Python310\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 67, in log_progress
    with open(log_progress_file, 'a') as log:
FileNotFoundError: [Errno 2] No such file or directory: '/app/progress.log'
tordenflesk commented 1 year ago
Traceback (most recent call last):
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 102, in <module>
    scan_folder_for_flac(input_folder, output_folder, log_file, already_processed_files)
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 51, in scan_folder_for_flac
    log.write(f"Checking {file_path}...\n")
  File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2211' in position 94: character maps to <undefined>
silkyclouds commented 1 year ago

python clearly indicates the error, it expects the progress.log file to exist :

FileNotFoundError: [Errno 2] No such file or directory: '/app/progress.log'

I would create the log files upfront as a start :

touch flac_checker.log && touche progress.log

then start the script again.

silkyclouds commented 1 year ago
Traceback (most recent call last):
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 102, in <module>
    scan_folder_for_flac(input_folder, output_folder, log_file, already_processed_files)
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 51, in scan_folder_for_flac
    log.write(f"Checking {file_path}...\n")
  File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2211' in position 94: character maps to <undefined>

OK this looks like an encoding error. I will modify the script to force it to write the logs in UTF-8 format. this should hopefully solve this issue.

tordenflesk commented 1 year ago

python clearly indicates the error, it expects the progress.log file to exist :

FileNotFoundError: [Errno 2] No such file or directory: '/app/progress.log'

I would create the log files upfront as a start :

touch flac_checker.log && touche progress.log

then start the script again.

Windows doesn't use forward-slashes

silkyclouds commented 1 year ago

python clearly indicates the error, it expects the progress.log file to exist : FileNotFoundError: [Errno 2] No such file or directory: '/app/progress.log' I would create the log files upfront as a start : touch flac_checker.log && touche progress.log then start the script again.

Windows doesn't use forward-slashes

Indeed, I don't use windows and never test any script under this OS. But let me adapt the script and upload it as flac_checker_windows_test.py so you can try it again.

I've added UTF-8 encoding as well for the logs, and made sure the logs, if not present, are been created by the script.

Once downloaded, you need to rename it flac_checker.py, obviously, before you run it.

silkyclouds commented 1 year ago

python clearly indicates the error, it expects the progress.log file to exist : FileNotFoundError: [Errno 2] No such file or directory: '/app/progress.log' I would create the log files upfront as a start : touch flac_checker.log && touche progress.log then start the script again.

Windows doesn't use forward-slashes

Is it working now ?

tordenflesk commented 1 year ago

Almost, another error:

Processing: F:\Music\_VA\Verve Remixed\2008 - Verve Unmixed⁴\11 - Everybody Loves The Sunshine.flac
Exception in thread Thread-7579 (_readerthread):
Traceback (most recent call last):
  File "C:\Python310\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\Python310\lib\threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Python310\lib\subprocess.py", line 1494, in _readerthread
    buffer.append(fh.read())
  File "C:\Python310\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 48: character maps to <undefined>
Traceback (most recent call last):
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 112, in <module>
    scan_folder_for_flac(input_folder, output_folder, log_file, already_processed_files)
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 58, in scan_folder_for_flac
    corruption_reason = check_flac_file(file_path, output_folder, log_file, already_processed_files)
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 33, in check_flac_file
    if "audio/flac" not in result.stdout:
TypeError: argument of type 'NoneType' is not iterable
Process Process-1:
Traceback (most recent call last):
  File "C:\Python310\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Scripts\Audio\FlacChecker\flac_checker.py", line 80, in log_progress
    time.sleep(10)
KeyboardInterrupt
Exception ignored in atexit callback: <function _exit_function at 0x0000000002CE2CB0>
Traceback (most recent call last):
  File "C:\Python310\lib\multiprocessing\util.py", line 357, in _exit_function
    p.join()
  File "C:\Python310\lib\multiprocessing\process.py", line 149, in join
    res = self._popen.wait(timeout)
  File "C:\Python310\lib\multiprocessing\popen_spawn_win32.py", line 108, in wait
    res = _winapi.WaitForSingleObject(int(self._handle), msecs)
KeyboardInterrupt:

I'm assuming it's the ⁴ that's the issue.

rodrigorodrigo commented 5 months ago

pushed a PL to fix this. Literally one line. For some reason you were asking for /app/progress, a folder that does not exist. https://github.com/silkyclouds/FlacChecker/pull/2