Bug 44977 - Недоступен бэкэнд sqlite
Summary: Недоступен бэкэнд sqlite
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-requests-cache (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Grigory Ustinov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on: 44989
Blocks:
  Show dependency tree
 
Reported: 2023-01-20 01:16 MSK by Anton Zhukharev
Modified: 2023-02-18 11:45 MSK (History)
19 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).