Summary: | www/py-tvdb_api: Fails to run after www/py-requests-cache update: ImportError: cannot import name '_to_bytes' from 'requests_cache.backends.base | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | huber.georg |
Component: | Individual Port(s) | Assignee: | Muhammad Moinur Rahman <bofh> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | bofh, python |
Priority: | --- | Keywords: | regression |
Version: | Latest | Flags: | linimon:
maintainer-feedback?
(bofh) koobs: merge-quarterly? |
Hardware: | Any | ||
OS: | Any |
Description
huber.georg
2022-05-08 10:15:17 UTC
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=27beb3553afb9e379d1b6d16fa6dce99f9a12a54 commit 27beb3553afb9e379d1b6d16fa6dce99f9a12a54 Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2022-05-08 14:21:46 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2022-05-08 14:21:46 +0000 www/py-tvdb_api: Runtime fix multimedia/py-tvnamer is failing to run after Python upgrade to 3.8.13. This update fix this runtime issue. py-tvdb_api is the core library used by py-tvnamer. PR: 263862 Reported by: huber.georg@gmail.com www/py-tvdb_api/Makefile | 8 ++++++-- www/py-tvdb_api/distinfo | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) Many thanks for the speedy implementation. However, now I get the following: Traceback (most recent call last): File "/usr/local/bin/tvnamer", line 33, in <module> sys.exit(load_entry_point('tvnamer==3.0.4', 'console_scripts', 'tvnamer')()) File "/usr/local/lib/python3.8/site-packages/tvnamer/main.py", line 474, in main tvnamer(paths = sorted(args)) File "/usr/local/lib/python3.8/site-packages/tvnamer/main.py", line 370, in tvnamer processFile(tvdb_instance, episode) File "/usr/local/lib/python3.8/site-packages/tvnamer/main.py", line 175, in processFile episode.populateFromTvdb(tvdb_instance, force_name=Config['force_name'], series_id=Config['series_id']) File "/usr/local/lib/python3.8/site-packages/tvnamer/utils.py", line 641, in populateFromTvdb show = tvdb_instance[force_name or self.seriesname] File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 1152, in __getitem__ sid = self._nameToSid(key) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 1136, in _nameToSid selected_series = self._getSeries(name) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 935, in _getSeries all_series = self.search(series) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 914, in search series_resp = self._getetsrc(self.config['url_getSeries'] % (series)) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 874, in _getetsrc src = self._loadUrl(url, language=language) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 811, in _loadUrl self.authorize() File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 859, in authorize r = self.session.post( File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 577, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests_cache/session.py", line 115, in request return super().request(method, url, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests_cache/session.py", line 127, in send cache_key = self.cache.create_key(request, **kwargs) TypeError: create_key() got an unexpected keyword argument 'timeout' (In reply to huber.georg from comment #2) In previous I actually used to use this application a lot but now I don't use it anymore, but still maintaining it. So it's hard for me to troubleshoot this problem. However if you can dig some solution which needs to be translated to code I can take care of it. And from what I can see from the error is that tvdb_api actually do not support latest version of requests_cache. Currently we have 0.9.4 on the tree(https://www.freshports.org/www/py-requests-cache/) which was just released 16 days ago. ^Triage: www/py-requests-cache updated to 0.9.3 and 0.9.4 in ports 80923c7c2312 and ports c2a2614fd6d0 respectively, request feedback from sunpoet@ (In reply to Kubilay Kocak from comment #4) Hi, I tried to contact sunpoet@ via e-mail, but unfortunately he seems to be unavailable. Is there maybe someone else who could maintain requests_cache? Many thanks Georg (In reply to Muhammad Moinur Rahman from comment #3) Muhammad, As you say, you used the program before but no longer, do you have an alternative suggestion for a different program? Many thanks Georg (In reply to huber.georg from comment #5) It's pointless trying to communicate with the maintainer of requests_cache? As it's not a good idea to downgrade a port. So you have to communicate with the maintainer of tvdb_api so that they update their code to be run with the latest version of requests_cache. (In reply to huber.georg from comment #6) Once upon a time I used to run FreeBSD as my daily driver for Desktop but nowadays I actually do not use it for that purpose any more. Most of my movies and TV shows resides in a Plex Server which I believe has some sort of API accessibility for the tvdb.com. (In reply to Muhammad Moinur Rahman from comment #7) We cant as a group just break ports and not take care of things. In this case a better option would have been to produce a branched version of the requests_cache port for those that didn't support the version it was being updated to. Yes, identifying runtime api issues is hard, yes creating version specific ports for consumers is annoying and temporary and yes just fixing py-tvdb_api to support the API changes is the most appropriate/permanent long term solution. In the meantime, we have a port that's been broken for over a month without progress. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7e598a20ff3bfe260aebbee6f3a99d6c7f7c36fd commit 7e598a20ff3bfe260aebbee6f3a99d6c7f7c36fd Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2022-06-06 11:33:41 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2022-06-06 11:33:41 +0000 www/py-tvdb_api: Runtime fix py-tvdb_api is not compatible with latest 0.9.4 of py-requests-cache. update DEPS with the py-requests-cache93 for now. PR: 263862 Reported by: huber.georg@gmail.com www/py-tvdb_api/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (In reply to Kubilay Kocak from comment #8) I wish everyone maintained and updated their deps regularly. Often this is the case when upstream also loses interest in the project and do not update properly. That is the time when we should RIP those ports. On another note I wish all the committer's would have updated their ports regularly. And for the last thing please don't bring the story of another port in the running bug. (In reply to commit-hook from comment #9) Thanks Muhammad! When I portmaster the port, it stops, complaining pkg-static: py38-requests-cache93-0.9.3 conflicts with py38-requests-cache-0.9.4 (installs files into the same place). Problematic file: /usr/local/lib/python3.8/site-packages/requests_cache/__init__.py do I need to downgrade the port entirely? Thanks, Georg (In reply to huber.georg from comment #11) No, you do not. Just do pkg remove py38-requests-cache before running portmaster. (In reply to Muhammad Moinur Rahman from comment #12) Thanks, but I guess, I give up: #################### # Starting tvnamer # Found 1 episode #################### # Processing file: Ted.Lasso.S01E01.WEB-DL.x264-ION10.mp4 # With custom replacements: Ted.Lasso.S01E01.WEB-DL.x264-ION10.mp4 # Detected series: Ted Lasso (season: 1, episode: 1) Traceback (most recent call last): File "/usr/local/bin/tvnamer", line 33, in <module> sys.exit(load_entry_point('tvnamer==3.0.4', 'console_scripts', 'tvnamer')()) File "/usr/local/lib/python3.8/site-packages/tvnamer/main.py", line 474, in main tvnamer(paths = sorted(args)) File "/usr/local/lib/python3.8/site-packages/tvnamer/main.py", line 370, in tvnamer processFile(tvdb_instance, episode) File "/usr/local/lib/python3.8/site-packages/tvnamer/main.py", line 175, in processFile episode.populateFromTvdb(tvdb_instance, force_name=Config['force_name'], series_id=Config['series_id']) File "/usr/local/lib/python3.8/site-packages/tvnamer/utils.py", line 641, in populateFromTvdb show = tvdb_instance[force_name or self.seriesname] File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 1152, in __getitem__ sid = self._nameToSid(key) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 1136, in _nameToSid selected_series = self._getSeries(name) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 935, in _getSeries all_series = self.search(series) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 914, in search series_resp = self._getetsrc(self.config['url_getSeries'] % (series)) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 874, in _getetsrc src = self._loadUrl(url, language=language) File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 811, in _loadUrl self.authorize() File "/usr/local/lib/python3.8/site-packages/tvdb_api.py", line 859, in authorize r = self.session.post( File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 577, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests_cache/session.py", line 115, in request return super().request(method, url, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests_cache/session.py", line 127, in send cache_key = self.cache.create_key(request, **kwargs) TypeError: create_key() got an unexpected keyword argument 'timeout' Reopen (In reply to huber.georg from comment #13) Are you sure you have removed py38-requests-cache as I can see the error is similar to comment #2? Hi, sorry, for not responding earlier. Many thanks, but I should have removed py38-requests-cache and I have installed the 0.93 branch. pkg info py38-requests-2.27.1 Python HTTP for Humans py38-requests-cache93-0.9.3 Transparent persistent cache for the requests library (0.9.3 branch) Unfortunately, I have no idea, what the error means. Thanks again, Georg (In reply to Muhammad Moinur Rahman from comment #15) Hi, I have a new FBSD 13.1 installation on a new server and there it works. The old setup still gives me the same error. Many thanks Georg (In reply to huber.georg from comment #17) Hi, when Portmaster upgraded the ports to py39, I receice the same error as in my comment #2. I have installed py39-requests-2.28.0 Python HTTP for Humans py39-requests-cache93-0.9.3 Transparent persistent cache for the requests library (0.9.3 branch) py39-tvdb_api-3.1.0_2 API interface to TheTVDB.com py39-tvnamer-3.0.4 Automatically names downloaded/recorded TV-episode unfortunately I am clueless, the error is (again): Traceback (most recent call last): File "/usr/local/bin/tvnamer", line 33, in <module> sys.exit(load_entry_point('tvnamer==3.0.4', 'console_scripts', 'tvnamer')()) File "/usr/local/lib/python3.9/site-packages/tvnamer/main.py", line 474, in main tvnamer(paths = sorted(args)) File "/usr/local/lib/python3.9/site-packages/tvnamer/main.py", line 370, in tvnamer processFile(tvdb_instance, episode) File "/usr/local/lib/python3.9/site-packages/tvnamer/main.py", line 175, in processFile episode.populateFromTvdb(tvdb_instance, force_name=Config['force_name'], series_id=Config['series_id']) File "/usr/local/lib/python3.9/site-packages/tvnamer/utils.py", line 641, in populateFromTvdb show = tvdb_instance[force_name or self.seriesname] File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 1152, in __getitem__ sid = self._nameToSid(key) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 1136, in _nameToSid selected_series = self._getSeries(name) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 935, in _getSeries all_series = self.search(series) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 914, in search series_resp = self._getetsrc(self.config['url_getSeries'] % (series)) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 874, in _getetsrc src = self._loadUrl(url, language=language) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 811, in _loadUrl self.authorize() File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 859, in authorize r = self.session.post( File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 635, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests_cache/session.py", line 115, in request return super().request(method, url, *args, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/site-packages/requests_cache/session.py", line 127, in send cache_key = self.cache.create_key(request, **kwargs) TypeError: create_key() got an unexpected keyword argument 'timeout' Please help, thank you! Looks like they do not support python 3.9 so you should go back to python38. Add in your make.conf: DEFAULT_VERSIONS= python=3.8 and rebuild all ports. Muhammad, I think you were a day too early in closing the thread :) I had a conversation with Jordan, from requests_cache, and based on your input, he has looked into the matter. https://github.com/dbr/tvdb_api/issues/94#issuecomment-1264504733 also, he seems to have "fixed" something: https://github.com/dbr/tvdb_api/pull/102/commits/a346a0bb4348d084de767d235e028b9207e123c1 Can you estimate, when this will be reflected in the ports/pkgs? Many thanks (as always) Georg A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0fb68679d73d79fc0bb0a6ebfe835d0efd4abca2 commit 0fb68679d73d79fc0bb0a6ebfe835d0efd4abca2 Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2022-10-02 19:01:37 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2022-10-02 19:02:24 +0000 www/py-tvdb_api: Runtime fix multimedia/py-tvnamer is failing to run after Python upgrade to 3.8.13. This update fix this runtime issue. py-tvdb_api is the core library used by py-tvnamer. PR: 263862 Reported by: huber.georg@gmail.com www/py-tvdb_api/Makefile | 5 +++-- www/py-tvdb_api/distinfo | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (In reply to commit-hook from comment #21) Is quarterly affected? If so, can we get a merre please Thanks Muhammad! However now I get this error: tvnamer star.trek.strange.new.world.s01e10.mkv #################### # Starting tvnamer # Found 1 episode #################### # Processing file: star.trek.strange.new.world.s01e10.mkv # Detected series: star trek strange new world (season: 1, episode: 10) Traceback (most recent call last): File "/usr/local/bin/tvnamer", line 33, in <module> sys.exit(load_entry_point('tvnamer==3.0.4', 'console_scripts', 'tvnamer')()) File "/usr/local/lib/python3.9/site-packages/tvnamer/main.py", line 474, in main tvnamer(paths = sorted(args)) File "/usr/local/lib/python3.9/site-packages/tvnamer/main.py", line 370, in tvnamer processFile(tvdb_instance, episode) File "/usr/local/lib/python3.9/site-packages/tvnamer/main.py", line 175, in processFile episode.populateFromTvdb(tvdb_instance, force_name=Config['force_name'], series_id=Config['series_id']) File "/usr/local/lib/python3.9/site-packages/tvnamer/utils.py", line 641, in populateFromTvdb show = tvdb_instance[force_name or self.seriesname] File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 1152, in __getitem__ sid = self._nameToSid(key) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 1136, in _nameToSid selected_series = self._getSeries(name) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 935, in _getSeries all_series = self.search(series) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 914, in search series_resp = self._getetsrc(self.config['url_getSeries'] % (series)) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 874, in _getetsrc src = self._loadUrl(url, language=language) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 811, in _loadUrl self.authorize() File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 859, in authorize r = self.session.post( File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 635, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests_cache/session.py", line 115, in request return super().request(method, url, *args, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/site-packages/requests_cache/session.py", line 127, in send cache_key = self.cache.create_key(request, **kwargs) File "/usr/local/lib/python3.9/site-packages/tvdb_api.py", line 547, in create_key if self._ignored_parameters: AttributeError: 'SQLiteCache' object has no attribute '_ignored_parameters' Hi, I just received a notification from github that they have fixed the requests_cache issue below. https://github.com/dbr/tvdb_api/pull/105/commits/a4e4060d8d8f6b8ff9c9cd2ebc73ad5a9a39c263 Will this "automatically" arrive in the ports tree or will you have to implement this manually (in which case I kindly ask you to fix it and I apologize for the trouble I caused). Thank you thank you thank you, I hope I can finally put this issue to rest (not that it deprived me of sleep, but still I knew something wasn't working right on my system). Georg (In reply to huber.georg from comment #24) Perhaps now that the requests_cache appears to be fixed (at least this is what the committer at GitHub told me), the branch to requests_cache.0.9.3 is no longer necessary and we could use the current 0.9.6 version with py-tvnamer and py-tvdb_api. Could anyone look into this? I would gladly do it myself, but I really can't program. Many thanks to the devs/committers! G. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1ed1c8c879d1008ee4612026d9284ccc31bcbd1d commit 1ed1c8c879d1008ee4612026d9284ccc31bcbd1d Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2023-07-15 14:12:55 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2023-07-15 15:43:33 +0000 www/py-tvdb_api: Runtime fix with newer requests-cache PR: 263862 Reported by: huber.georg@gmail.com www/py-tvdb_api/Makefile | 4 ++-- www/py-tvdb_api/distinfo | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) |