Bug 243386 - multimedia/py-tvnamer: Fails to run: UnicodeDecodeError: 'ascii' codec can't decode byte
Summary: multimedia/py-tvnamer: Fails to run: UnicodeDecodeError: 'ascii' codec can't ...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
Keywords: needs-qa
Depends on:
Reported: 2020-01-16 10:32 UTC by huber.georg
Modified: 2020-01-24 15:34 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bofh)

my current config file (an onscreen output of settings.json) (11.08 KB, text/plain)
2020-01-16 11:26 UTC, huber.georg
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description huber.georg 2020-01-16 10:32:16 UTC
After installing py37-tvnamer (and having to install py37-sqlite3 after that) I receive the following output:

Traceback (most recent call last):
  File "/usr/local/bin/tvnamer", line 11, in <module>
    load_entry_point('tvnamer==2.5', 'console_scripts', 'tvnamer')()
  File "/usr/local/lib/python3.7/site-packages/tvnamer/main.py", line 449, in main
    tvnamer(paths = sorted(args))
  File "/usr/local/lib/python3.7/site-packages/tvnamer/main.py", line 351, in tvnamer
  File "/usr/local/lib/python3.7/site-packages/tvdb_api.py", line 726, in __init__
  File "/usr/local/lib/python3.7/site-packages/requests_cache/core.py", line 159, in remove_expired_responses
    self.cache.remove_old_entries(datetime.utcnow() - self._cache_expire_after)
  File "/usr/local/lib/python3.7/site-packages/requests_cache/backends/base.py", line 110, in remove_old_entries
    response, created_at = self.responses[key]
  File "/usr/local/lib/python3.7/site-packages/requests_cache/backends/storage/dbdict.py", line 163, in __getitem__
    return pickle.loads(bytes(super(DbPickleDict, self).__getitem__(key)))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 18074: ordinal not in range(128)

Did I miss something?
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-01-16 10:55:55 UTC
Thank you for your report

Could you provide information regarding:

 - the source material (filenames, etc) that its failing on
 - include the full and complete command line invocation of tvnamer, and 
 - if the application has a debug/verbose option, using that

For any long/big sections of text, please include the output as an attachment instead of pasting in the comment
Comment 2 huber.georg 2020-01-16 11:26:59 UTC
Created attachment 210790 [details]
my current config file (an onscreen output of settings.json)

attached is my config file.

tvnamer has a debug-mode (-v), unfortunately it crashes before any meaningful output. If I pipe the output of 'tvnamer Greys.Anatomy.S15E15.mkv', all I get is

Loading config: /home/georg/.tvnamer.json
# Starting tvnamer
# Found 1 episode

and then comes the error I submitted
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2020-01-16 11:42:02 UTC
(In reply to huber.georg from comment #2)

Thank you for the extra info.

It's going to be handy to identify the source of the non-ascii characters/data that's producing the error. Can you see anything (metadata? source data file? associated with either that episode or a related entry that contains non-ascii chars?

I note in the traceback that the last method/function called is: 'remove_old_entries' which might suggest that its not necessarily related to S15E15 but something else 'earlier' in either the process, or that exists in the database from prior runs

I also note several open/closed issues in the upstream github project that match UnicodeDecodeError's. They may provide you with more insight into potential causes with actions you can take to test, and I'd be reporting this upstream too, as the author is more likely able to provide information to better isolate/investigate
Comment 4 huber.georg 2020-01-16 12:28:42 UTC
Hmmm... unfortunately thats the point.

None of the files in the directory use non-ascii characters.

I did have to install py37-sqlite as this is apparently required. However as this (and the py37-tvnmaer) install were fresh installs, what 'old_entries' could be referred to?
Comment 5 huber.georg 2020-01-24 15:34:24 UTC
(In reply to Kubilay Kocak from comment #3)


I tried reinstalling tvnamer via the portmaster -f command but I just won't work. The error remains.

Then I "reinstalled" the py27-tvnamer pkg and voila it worked.

Any ideas?