cache3 icon indicating copy to clipboard operation
cache3 copied to clipboard

cannot automatically create directory deeper than 1

Open EnderHane opened this issue 3 years ago • 0 comments

import cache3
cache3.DiskCache(directory='.cache3/deeper_dir')

leads to FileNotFoundError if ".cache3" does not exist

Traceback
 
Traceback (most recent call last):
  File "C:\Users\u\PycharmProjects\test\main.py", line 2, in 
    cache3.DiskCache(directory='.cache3/cache3')
  File "C:\Users\u\AppData\Local\pypoetry\Cache\virtualenvs\xxx\lib\site-packages\cache3\disk.py", line 194, in __init__
    self.directory: Path = directory
  File "C:\Users\u\AppData\Local\pypoetry\Cache\virtualenvs\xxx\lib\site-packages\cache3\validate.py", line 22, in __set__
    validate_value: Any = self.validate(value)
  File "C:\Users\u\AppData\Local\pypoetry\Cache\virtualenvs\xxx\lib\site-packages\cache3\validate.py", line 100, in validate
    path.mkdir()
  File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'C:\\Users\\u\\PycharmProjects\\test\\.cache3\\cache3'
  

Windows 22621.521 Python 3.10.7 cache3 0.3.1

EnderHane avatar Sep 27 '22 23:09 EnderHane