#1084947 tvnamer: Crash with "'CachedSession' object has no attribute 'remove_expired_responses'"

#1084947#5
Date:
2024-10-11 15:07:36 UTC
From:
To:
Dear Maintainer,

When using tvnamer to rename files, I get an error:

$ python3 -m tvnamer.main --dry-run ~/Videos/download/file.mp4
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/cweiske/dev/tools/tvnamer/tvnamer/main.py", line 550, in <module>
    main()
  File "/home/cweiske/dev/tools/tvnamer/tvnamer/main.py", line 540, in main
    tvnamer(paths=sorted(args))
  File "/home/cweiske/dev/tools/tvnamer/tvnamer/main.py", line 424, in tvnamer
    tvdb_instance = tvdb_api.Tvdb(
                    ^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/tvdb_api.py", line 703, in __init__
    self.session.remove_expired_responses()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CachedSession' object has no attribute 'remove_expired_responses'


This error is caused because python3-tvdb-api 3.1-4 uses the API method which
has been removed in python3-requests-cache 1.2.0, and Debian ships 1.2.1-1.

For the version info see
https://aur.archlinux.org/packages/plover_plugins_manager#comment-988008

I reported this bug upstream at
https://github.com/dbr/tvdb_api/issues/107

#1084947#18
Date:
2026-10-20 04:19:38 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
tvdb-api, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1084947@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sandro Tosi <morph@debian.org> (supplier of updated tvdb-api package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 20 Oct 2026 00:00:56 -0400
Source: tvdb-api
Architecture: source
Version: 3.1-5
Distribution: unstable
Urgency: medium
Maintainer: Sandro Tosi <morph@debian.org>
Changed-By: Sandro Tosi <morph@debian.org>
Closes: 1084947
Changes:
 tvdb-api (3.1-5) unstable; urgency=medium
 .
   * debian/patches/requests-cache-1.2.patch
     - port to requests-cache 1.x, which removed remove_expired_responses(),
       has_key() and the cache attributes create_key() used; Closes: #1084947
   * debian/patches/tests-recorded-cache.patch
     - load the recorded TheTVDB responses with requests-cache 1.x, so tests
       run offline again
   * debian/patches/PR97.patch
     - add Origin and Applied-Upstream headers, it's merged upstream
   * debian/patches/PR105.patch
     - add Forwarded and Bug-Debian headers
   * debian/control
     - bump debhelper compat to 14; add dh-sequence-python3 and
       dh-sequence-single-binary to b-d, replacing dh-python
     - b-d on python3-all instead of python3
     - add pybuild-plugin-pyproject to b-d
     - add pytest-env to b-d, needed by tests
     - enable Testsuite: autopkgtest-pkg-pybuild
     - version requests-cache in Depends to >= 1.0, needed by
       requests-cache-1.2.patch
     - drop requests and the substvars from Depends, now generated and applied
       automatically
     - drop Priority, optional is now the default
     - extend the long description
     - bump Standards-Version to 4.7.4.1 (no further changes needed)
   * debian/rules
     - run tests at build time again, they no longer need network access
     - drop --with python3, replaced by dh-sequence-python3
     - export PYBUILD_NAME
     - build with the pyproject plugin, instead of the deprecated setup.py
       install
     - drop override_dh_auto_install, dh_auto_install already installs the
       module; it installed it a second time and removed the metadata, which
       dh_python3 now uses to generate Depends
     - drop override_dh_clean, pybuild already removes the egg-info
   * debian/pybuild.testfiles
     - remove, pybuild copies pytest.ini and tests by default
   * debian/watch
     - switch to version 5, using the GitHub template
   * debian/upstream/metadata
     - add Changelog
   * debian/copyright
     - extend packaging copyright years
Checksums-Sha1:
 5fb0f165054983cf14c9e90f89d7bfa2f7ac030e 2114 tvdb-api_3.1-5.dsc
 eb52476fe246a9204ad451ad10118c416f98afaf 7020 tvdb-api_3.1-5.debian.tar.xz
 026ee28db1737c42180b20422293093d513414b3 8966 tvdb-api_3.1-5_source.buildinfo
Checksums-Sha256:
 b01656e364c3bf924f8a83ecd853c40f12cbc0d69157ea6157c8039314495a3f 2114 tvdb-api_3.1-5.dsc
 fae76e40b7ff722d5d98cf2aab07417c66607ea2c4fb2db4f2be2c7282929e97 7020 tvdb-api_3.1-5.debian.tar.xz
 d78ec256010004866806b6052c0c3c6cb051c6b093f94ed65b8daf22ebbc77a4 8966 tvdb-api_3.1-5_source.buildinfo
Files:
 e5b6c2317e7b772d78de2ecba38deab8 2114 python optional tvdb-api_3.1-5.dsc
 9fc7c397e93e040e46a7ba564401dc92 7020 python optional tvdb-api_3.1-5.debian.tar.xz
 fc8032fca24ff0bb1963ca6fc363888b 8966 python optional tvdb-api_3.1-5_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEufrTGSrz5KUwnZ05h588mTgBqU8FAmrW54MACgkQh588mTgB
qU/V/g//WBC1QNnZW5dswanF/Hi25da4j2ucgv4lPRqr0oljuSv+z2KZJQQ3Mp3I
ZP+41NSVh0xlvULQQ0zUo0KNCQK60ZBmyLQJ6d0z9tGWLYLt79Igx88TxOl6Njdf
0RxsKUx54NxXBooYCoyu3ijmzKNYji1nX8eOc+ECCCTbrBuH5fCF71gK8W06HMXc
K6+JiLyTRmrCsmF1vgKHJORczGuHvQZw5Unyp1ySh3WUc3G4c/hmj6UWYcDHoqfQ
K1K7wbtNyJHvkWJmewyXeurIdSEyrju0PrjvdBD7ERJc4uhIcjKYaXtGiMoF/fsB
R5UuQmgcln9nXeWEKuF82xV8GYOKxcoZ1NkaZcQcxuYCQGzeFmCbBxLhVott09an
SFrpM4JYyaMfU6vCWXzF0b3qyg+yso7yK9hYyyu7Blt/HFD1DPUY6z/VzzakIyRy
RU5dhf4dERDhHNrVxwhRbMJbVwKPFBPZIIWpxSbvO4cxcPlC0yqD5zzkVnQwhfzR
A+vRpeJMchJz4tEucvUHB1DOYe2EY9Ryzhes9AZiql/W9WmHMIGGVLxp/hJWLdDi
2MpAr5hdql/H0k2VIXHRJg8w3tsTXO2RjGUUDSlk9mDE7u+YmI3oD0nVGhSefgUP
ThRuJV6MWumPftQZUT98bpNsiS7D2Fz3pb8HeAVZZiq4PUoUEUg=
=8d08
-----END PGP SIGNATURE-----