Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'CachedSession' object has no attribute '_disabled' #284

Open
DocMAX opened this issue Nov 20, 2023 · 9 comments · May be fixed by #291
Open

AttributeError: 'CachedSession' object has no attribute '_disabled' #284

DocMAX opened this issue Nov 20, 2023 · 9 comments · May be fixed by #291

Comments

@DocMAX
Copy link

DocMAX commented Nov 20, 2023

docmax@desktop: /mnt/pve/data/downloads/irc/done $ mnamer .
Starting mnamer

Processing Movie "Back.to.the.Future.1985.UHD.BluRay.DolbyVisionMP4.2160p.Multi.HEVC-d3g.mp4" (67.35GB)

============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2023-11-20
 - platform = Linux-6.2.16-19-pve-x86_64-with-glibc2.38
 - arguments = ['.']
 - cache location = /home/docmax/.cache/mnamer-py3.11.sqlite
 - python version = 3.11.5
 - mnamer version = 2.5.5
 - appdirs version = 1.4.4
 - guessit version = 3.7.1
 - requests version = 2.31.0
 - requests cache version = 1.1.1
 - teletype version = 1.3.4

--------------------------------- stack trace ----------------------------------

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mnamer/__main__.py", line 23, in main
    frontend.launch()
  File "/usr/lib/python3.11/site-packages/mnamer/frontends.py", line 81, in launch
    self._process_targets()
  File "/usr/lib/python3.11/site-packages/mnamer/frontends.py", line 98, in _process_targets
    matches = target.query()
              ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mnamer/target.py", line 232, in query
    for idx, result in enumerate(results, start=1):
  File "/usr/lib/python3.11/site-packages/mnamer/providers.py", line 159, in search
    yield from results
  File "/usr/lib/python3.11/site-packages/mnamer/providers.py", line 181, in _search_name
    response = tmdb_search_movies(
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mnamer/endpoints.py", line 190, in tmdb_search_movies
    status, content = request_json(url, parameters, cache=cache)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mnamer/utils.py", line 259, in request_json
    initial_cache_state = session._disabled  # yes, i'm a bad person
                          ^^^^^^^^^^^^^^^^^
AttributeError: 'CachedSession' object has no attribute '_disabled'

=============================== CRASH REPORT END ===============================

Dang, it looks like mnamer crashed! Please consider filling an issue at
https://github.com/jkwill87/mnamer/issues along with this report.

@ivovegter
Copy link

Me too, and it's a showstopper. Will need to go find a new naming tool until this is fixed.

@devhell
Copy link

devhell commented Dec 24, 2023

Me too, and it's a showstopper. Will need to go find a new naming tool until this is fixed.

Did you find something?

@ivovegter
Copy link

Did you find something?

Not yet. That's why I'm looking at mnamer. Filebot's dependencies are annoying, and there aren't a lot of other linux options out there.

@mrodz07
Copy link

mrodz07 commented Dec 29, 2023

This is also an issue on Arch. Installing through pip works properly.
My environment from the crash report:

[mario@t430 ~]$ mnamer ~/Downloads/benhur.1959.mkv 
Starting mnamer

Processing Movie "benhur.1959.mkv" (6.17GB)

============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2023-12-29
 - platform = Linux-6.6.7-arch1-1-x86_64-with-glibc2.38
 - arguments = ['/home/mario/Downloads/benhur.1959.mkv']
 - cache location = /home/mario/.cache/mnamer-py3.11.sqlite
 - python version = 3.11.6
 - mnamer version = 2.5.5
 - appdirs version = 1.4.4
 - guessit version = 3.7.1
 - requests version = 2.31.0
 - requests cache version = 1.1.1
 - teletype version = 1.3.4

@o7-machinehum o7-machinehum linked a pull request Jan 30, 2024 that will close this issue
@o7-machinehum
Copy link

#291

@j0hax
Copy link

j0hax commented Apr 1, 2024

Also having this problem on NixOS 24.05 (which doesn't use pip in the traditional sense)

============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2024-04-01
 - platform = Linux-6.6.23-x86_64-with-glibc2.38
 - arguments = ['Friesland/']
 - cache location = /home/johannes/.cache/mnamer-py3.11.sql
 - python version = 3.11.8
 - mnamer version = 2.5.4
 - appdirs version = 1.4.4
 - guessit version = 3.8.0
 - requests version = 2.31.0
 - requests cache version = 1.2.0
 - teletype version = 1.3.4

--------------------------------- stack trace ----------------------------------

Traceback (most recent call last):
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/__main__.py", line 23, in main
    frontend.launch()
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/frontends.py", line 80, in launch
    self._process_targets()
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/frontends.py", line 97, in _process_targets
    matches = target.query()
              ^^^^^^^^^^^^^^
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/target.py", line 233, in query
    for idx, result in enumerate(results, start=1):
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/providers.py", line 153, in search
    yield from results
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/providers.py", line 176, in _search_name
    response = tmdb_search_movies(
               ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/endpoints.py", line 213, in tmdb_search_movies
    status, content = request_json(url, parameters, cache=cache)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ps324dvwr7cvmxamp0g8bg2vk7b4071p-mnamer-2.5.4/lib/python3.11/site-packages/mnamer/utils.py", line 283, in request_json
    initial_cache_state = session._disabled  # yes, i'm a bad person
                          ^^^^^^^^^^^^^^^^^
AttributeError: 'CachedSession' object has no attribute '_disabled'

=============================== CRASH REPORT END ===============================

@frank42hh
Copy link

Hi,
after searching for an alternative to tvnamer I found this one, but it crashed:

============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2024-05-18
 - platform = Linux-6.1.90-1-MANJARO-x86_64-with-glibc2.39
 - arguments = ['.']
 - cache location = /home/freddy/.cache/mnamer-py3.12.sqlite
 - python version = 3.12.3
 - mnamer version = 2.5.5
 - appdirs version = 1.4.4
 - guessit version = 3.8.0
 - requests version = 2.31.0
 - requests cache version = 1.2.0
 - teletype version = 1.3.4

--------------------------------- stack trace ----------------------------------

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/mnamer/__main__.py", line 23, in main
    frontend.launch()
  File "/usr/lib/python3.12/site-packages/mnamer/frontends.py", line 81, in launch
    self._process_targets()
  File "/usr/lib/python3.12/site-packages/mnamer/frontends.py", line 98, in _process_targets
    matches = target.query()
              ^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mnamer/target.py", line 232, in query
    for idx, result in enumerate(results, start=1):
  File "/usr/lib/python3.12/site-packages/mnamer/providers.py", line 368, in search
    yield from self._search_with_season_and_episode(
  File "/usr/lib/python3.12/site-packages/mnamer/providers.py", line 433, in _search_with_season_and_episode
    series_data = tvmaze_show_search(series)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mnamer/endpoints.py", line 435, in tvmaze_show_search
    status, content = request_json(url, parameters, cache=cache)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mnamer/utils.py", line 259, in request_json
    initial_cache_state = session._disabled  # yes, i'm a bad person
                          ^^^^^^^^^^^^^^^^^
AttributeError: 'CachedSession' object has no attribute '_disabled'

=============================== CRASH REPORT END ===============================

@austinbutler
Copy link

Opened a PR to work around this issue for Nix (NixOS/nixpkgs#357983).

Until that's merged, if you have Nix installed you can run a working version of mnamer with:

nix run github:austinbutler/nixpkgs/c5466611bcc9c5d3efb66cd585ea154927769a06#mnamer -- --help

@ivovegter
Copy link

I was still getting this error with v2.5.5-1 on Arch, but the workaround in #291 prevents the crash: change all three occurrences of session._disabled to session.settings.disabled in /usr/lib/python3.12/site-packages/mnamer/utils.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants