Skip to content

[Codec] TypeError: Expected list, got tuple #2153

Closed

Description

@ladaapp

Hi, when installing PyAV from source I can trigger this bug (not reproducible on latest version 16.1..0)

Python 3.13.11 (main, Dec 17 2025, 21:08:16) [Clang 21.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import av
>>> c=av.codec.Codec('libx264', 'w')
>>> c.hardware_configs
ret [] type <class 'list'>
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    c.hardware_configs
  File "av/codec/codec.py", line 249, in av.codec.codec.Codec.hardware_configs.__get__
    ret = tuple(ret)
    ^^^
TypeError: Expected list, got tuple

So for some reason reassigning ret from a list to tuple doesn't work. Looks like this was introduced with recent cython changes in that file.

This change fixes it for me but you might have a better understanding of why the above fails and can fix it in a better way (I don't know cython)

-        ret = tuple(ret)
-        self._hardware_configs = ret
-        return ret
+        self._hardware_configs = tuple(ret)
+        return self._hardware_configs

Activity

  1. added a commit that references this issue on Feb 4, 2026
    9af70cb
  2. added a commit that references this issue on Feb 4, 2026
    d74d09c
  3. added a commit that references this issue on Mar 6, 2026
    eded99c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions