Python Forum
[Solved] I'm not getting the good type
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] I'm not getting the good type
#5
I added the . at the beginning of each suffix, il will be cleaner like that.

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 return file you could write raise ValueError(f"Invalid file nane {file.name!r}")
Instead of copy/pasting like a dummy, I would like to understand why this instruction?
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?
Reply


Messages In This Thread
[Solved] I'm not getting the good type - by slain - Apr-10-2024, 07:51 AM
RE: I'm not getting the good type - by Gribouillis - Apr-10-2024, 08:48 AM
RE: I'm not getting the good type - by slain - Apr-10-2024, 11:49 AM
RE: I'm not getting the good type - by Gribouillis - Apr-10-2024, 12:26 PM
RE: I'm not getting the good type - by slain - Apr-10-2024, 01:49 PM
RE: I'm not getting the good type - by Gribouillis - Apr-10-2024, 02:29 PM
RE: I'm not getting the good type - by slain - Apr-10-2024, 02:48 PM
RE: I'm not getting the good type - by Gribouillis - Apr-10-2024, 03:01 PM
RE: I'm not getting the good type - by slain - Apr-11-2024, 07:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] Good way to handle input args? Winfried 2 2,170 May-18-2021, 07:33 PM
Last Post: Winfried
  Type hinting - return type based on parameter micseydel 2 2,592 Jan-14-2020, 01:20 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020