Bug 44977

Summary: Недоступен бэкэнд sqlite
Product: Sisyphus Reporter: Anton Zhukharev <ancieg>
Component: python3-module-requests-cacheAssignee: Grigory Ustinov <grenka>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: antohami, cas, cow, evg, george, grenka, imz, kotopesutility, lav, nbr, qa_viy, rider, sem, shaba, sin, slev, toni, vitty, viy
Version: unstable   
Hardware: all   
OS: Linux   
Bug Depends on: 44989    
Bug Blocks:    

Description Anton Zhukharev 2023-01-20 01:16:38 MSK
Версия пакета: 0.4.13-alt3

Не видит бэкэнд sqlite при установленном пакете python3-modules-sqlite3.

Воспроизводится так:

$ python3 <<< "import requests, requests_cache
requests_cache.install_cache('cache', backend='sqlite')"

Вывод:
Traceback (most recent call last):
  File "/usr/lib/python3/site-packages/requests_cache/backends/__init__.py", line 50, in create_backend
    return registry[backend_name](cache_name, **options)
KeyError: 'sqlite'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python3/site-packages/requests_cache/core.py", line 182, in install_cache
    backend = backends.create_backend(backend, cache_name, backend_options)
  File "/usr/lib/python3/site-packages/requests_cache/backends/__init__.py", line 53, in create_backend
    raise ImportError('You must install the python package: %s' %
ImportError: You must install the python package: sqlite3

--------------------------------------------------------------------------------

В p10 такого не наблюдается (версия пакета: 0.4.13-alt2).

--------------------------------------------------------------------------------

Кстати, в апстриме уже версия 0.9.8.
Comment 1 Stanislav Levin 2023-01-20 11:33:55 MSK
Проблема скрыта глубже:
```
>>> from requests_cache.backends.sqlite import DbCache
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/site-packages/requests_cache/backends/sqlite.py", line 10, in <module>
    from .storage.dbdict import DbDict, DbPickleDict
  File "/usr/lib/python3/site-packages/requests_cache/backends/storage/dbdict.py", line 9, in <module>
    from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
```

Было поправлено 0.5.0.

Python 3.10 related change:
https://bugs.python.org/issue37324
Comment 2 Repository Robot 2023-02-18 11:45:22 MSK
python3-module-requests-cache-0.9.8-alt1 -> sisyphus:

 Fri Jan 20 2023 Grigory Ustinov <grenka@altlinux> 0.9.8-alt1
 - Build new version (Closes: #44977).