[cache] Align further with yt-dlp

* use compat_os_makedirs
* support non-ASCII characters in cache key
* improve logging
This commit is contained in:
dirkf
2025-04-04 04:42:14 +01:00
parent add4622870
commit cedeeed56f
2 changed files with 41 additions and 31 deletions

View File

@ -63,7 +63,7 @@ class TestCache(unittest.TestCase):
obj = {'x': 1, 'y': ['ä', '\\a', True]}
c.store('test_cache', 'k.', obj)
self.assertEqual(c.load('test_cache', 'k.', min_ver='1970.01.01'), obj)
new_version = '.'.join(('%d' % ((v + 1) if i == 0 else v, )) for i, v in enumerate(version_tuple(__version__)))
new_version = '.'.join(('%0.2d' % ((v + 1) if i == 0 else v, )) for i, v in enumerate(version_tuple(__version__)))
self.assertIs(c.load('test_cache', 'k.', min_ver=new_version), None)