Apr-10-2024, 01:49 PM
I added the . at the beginning of each suffix, il will be cleaner like that.
It still throws me this error:
If I understand correctly what I googled (English is not my mother tongue, so translation errors are possible), it would throw me an error, but this would stop the script, no?
And, as the error also occurs with an mp3 (so out of the case statements), it wouldn't solve the AttributeError, would it?
It still throws me this error:
AttributeError: '_io.BufferedRandom' object has no attribute 'getvalue' Traceback: File "/home/ild/.local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script exec(code, module.__dict__) File "/home/ild/conv-cripteur.py", line 58, in <module> cpte_rendu = transcriptor(temp_file) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ild/conv-cripteur.py", line 45, in transcriptor waveform = file.getvalue() ^^^^^^^^^^^^^ File "/home/ild/miniconda3/lib/python3.12/tempfile.py", line 494, in __getattr__ a = getattr(file, name) ^^^^^^^^^^^^^^^^^^^
Quote:The case statements probably need modification as well.Instead of copy/pasting like a dummy, I would like to understand why this instruction?
Instead of return file you could writeraise ValueError(f"Invalid file nane {file.name!r}")
If I understand correctly what I googled (English is not my mother tongue, so translation errors are possible), it would throw me an error, but this would stop the script, no?
And, as the error also occurs with an mp3 (so out of the case statements), it wouldn't solve the AttributeError, would it?