LifeActor / ykdl

a video downloader focus on China mainland video sites.(一款专注于中国大陆视频网站的视频下载器。)
https://github.com/LifeActor/ykdl
Other
1.45k stars 285 forks source link

ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py) #582

Closed panda-mute closed 3 years ago

panda-mute commented 3 years ago

在提交前,请确保您已经检查了以下内容!

请将错误输出粘贴在下面:

 File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/xxxxxxxxx/plugins/ykdl_live.py", line 3, in <module>
    from ykdl.common import url_to_module
  File "/home/xx/.local/lib/python3.8/site-packages/ykdl/common.py", line 7, in <module>
    from .extractors import singlemultimedia
  File "/home/xx/.local/lib/python3.8/site-packages/ykdl/extractors/singlemultimedia.py", line 7, in <module>
    from ykdl.util.m3u8_wrap import load_m3u8_playlist
  File "/home/xx/.local/lib/python3.8/site-packages/ykdl/util/m3u8_wrap.py", line 48, in <module>
    from functools import cache

如果您有其他附言,例如问题只在某个视频发生,或者是一般性讨论或者提出新功能,请在下面添加:

[您的内容]

The documentation for functools.cache states that it's only available from Python 3.9 onwards. If you're using an earlier version then the documentation also states that it's the same as using lru_cache(maxsize=None), so that's probably your best option.

SeaHOH commented 3 years ago

Thanks, this bug and another known bug will be fixed in this week after #580 be merged.

SeaHOH commented 3 years ago

I commit the changes, but sorry there is no time to review, so put merging off to next week.

SeaHOH commented 3 years ago

fixed