Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 843857 - dev-python/requests-cache broken by recent update
Summary: dev-python/requests-cache broken by recent update
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jason A. Donenfeld
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-12 10:40 UTC by Thomas Capricelli
Modified: 2022-05-18 14:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2022-05-12 10:40:22 UTC
I have some code doing a very basic usage of it. It only contains two lines related to requests-cache, the import and
requests_cache.install_cache('localcache.db')

The symptom is the following:
AttributeError: module 'requests_cache' has no attribute 'install_cache'

At first i suspected the update from dev-python/requests-cache-0.9.1 to dev-python/requests-cache-0.9.3, but checking the source code, the install_cache is still there, and mostly unchanged.

Then i did some tests (from bpython):
>>> import requests
>>> import requests_cache
No module named 'bson'
>>> import requests_cache
>>> 

This error 'bson' is the source i guess. Even if it is silent, it seems this error prevent the 'patcher' module from requests_cache to load. Further testing:

>>> from requests_cache.patcher import *
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    from requests_cache.patcher import *
  File "/usr/lib/python3.9/site-packages/requests_cache/patcher.py", line 16, in <module>
    from .backends import BackendSpecifier, BaseCache
  File "/usr/lib/python3.9/site-packages/requests_cache/backends/__init__.py", line 7, in <module>
    from .base import BaseCache, BaseStorage, DictStorage
  File "/usr/lib/python3.9/site-packages/requests_cache/backends/base.py", line 18, in <module>
    from ..serializers import init_serializer
  File "/usr/lib/python3.9/site-packages/requests_cache/serializers/__init__.py", line 6, in <module>
    from .preconf import (
  File "/usr/lib/python3.9/site-packages/requests_cache/serializers/preconf.py", line 18, in <module>
    from cattr.preconf import bson as bson_preconf
  File "/usr/lib/python3.9/site-packages/cattr/preconf/bson.py", line 6, in <module>
    from bson import DEFAULT_CODEC_OPTIONS, CodecOptions, ObjectId, decode, encode
ModuleNotFoundError: No module named 'bson'
>>> 

After this, i'm really not sure. It might have a relation to this update (cattrs is a dependancy for requests-cache)
     Wed Apr 13 14:18:16 2022 >>> dev-python/cattrs-1.10.0-r1
     Thu May 12 11:58:37 2022 >>> dev-python/cattrs-22.1.0

The ebuild for dev-python/cattrs-22.1.0 mentions a dev-python/bson, but it is commented out. My system doesn't have such a package (checked with eix and ls in portage 'dev-python/').



Reproducible: Always
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-05-13 20:01:26 UTC
I think it was supposed to be fixed in requests-cache 0.9.4.  If you could confirm that, I'd remove 0.9.3.
Comment 2 Thomas Capricelli 2022-05-18 14:46:25 UTC
0.9.4 seems to fix it indeed. Thanks !