Skip to content

Index error when using Python 3.11 #1

@nednoodlehead

Description

@nednoodlehead

When plugging in my own link to music

(replacing:

with testfiles() as files:
file = files[0]

With
file = "path/to/my/music"
It raises an error:
File "F:\Projects\Python Projects\punge\audio_player.py", line 50, in callback data = f.read(nblk)["buffer"] ~~~~~~~~~~~~^^^^^^^^^^ IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices Traceback (most recent call last): File "F:\Projects\Python Projects\punge\audio_player.py", line 79, in <module> mine.play(mus) File "F:\Projects\Python Projects\punge\audio_player.py", line 63, in play self.exited.wait(0.1) File "C:\Users\Spencer\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 622, in wait signaled = self._cond.wait(timeout) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Spencer\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 324, in wait gotit = waiter.acquire(True, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IndexError

I tried this exact code in a Python 3.10 environment, and it worked as expected. Moved over to a python 3.11, and error.

I would appreciate help 'cause I would like to write my project in 3.11 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions