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: Closed FIXED
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
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-01-16 10:32 UTC by huber.georg
Modified: 2020-06-07 13:16 UTC (History)
1 user (show)

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


Attachments
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
    cache=cache,
  File "/usr/local/lib/python3.7/site-packages/tvdb_api.py", line 726, in __init__
    self.session.remove_expired_responses()
  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)

Hi,

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?

Thanks

Georg
Comment 6 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2020-05-26 22:36:00 UTC
(In reply to huber.georg from comment #5)
Looks like a Python Version Problem to me. Most likely python 27 works.
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-05-27 18:42:44 UTC
A commit references this bug:

Author: bofh
Date: Wed May 27 18:42:22 UTC 2020
New revision: 536708
URL: https://svnweb.freebsd.org/changeset/ports/536708

Log:
  www/py-tvdb_api: Update version 2.0=>3.0.2

  - multimedia/py-tvnamer seems to fail specifically with python3.X as
    www/py-tvdb_api was not compatible with python 3.X

  PR:		243386
  Reported by:	huber.georg@gmail.com
  MFH:		2020Q2 (runtime fix)
  Relnotes:	https://github.com/dbr/tvdb_api/releases

Changes:
  head/www/py-tvdb_api/Makefile
  head/www/py-tvdb_api/distinfo
Comment 8 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2020-05-28 00:12:29 UTC
Hope the updates to py-tvdb_api update should fix this problem.
Comment 9 huber.georg 2020-05-28 08:39:34 UTC
Hi,

Thanks, the developer looked into it in January and told me to delete some cache files from py27. That worked.

Thanks for your effort!

Georg
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-06-07 13:16:47 UTC
A commit references this bug:

Author: bofh
Date: Sun Jun  7 13:15:59 UTC 2020
New revision: 538155
URL: https://svnweb.freebsd.org/changeset/ports/538155

Log:
  MFH: r536708

  www/py-tvdb_api: Update version 2.0=>3.0.2

  - multimedia/py-tvnamer seems to fail specifically with python3.X as
    www/py-tvdb_api was not compatible with python 3.X

  PR:		243386
  Reported by:	huber.georg@gmail.com
  Relnotes:	https://github.com/dbr/tvdb_api/releases

  Approved by:	portmgr (blanket: runtime fix)

Changes:
_U  branches/2020Q2/
  branches/2020Q2/www/py-tvdb_api/Makefile
  branches/2020Q2/www/py-tvdb_api/distinfo