Issue with Windows/Linux Compatibility?
Hi, I have a large diskcache (~600 GB). I used rsync to sync from my local Windows machine to a Linux VM, and I am getting unusual issues on the VM.
Here's my code:
from diskcache import Cache
path = "path\to\diskcache"
FOUR_TERABYTES = 2**42
HALF_A_KILOBYTE = 2**9
DISKCACHE_SETTINGS = {
"eviction_policy": "none",
"size_limit": FOUR_TERABYTES,
"disk_min_file_size": HALF_A_KILOBYTE,
}
cache = Cache(directory=path, **DISKCACHE_SETTINGS)
search_q = "search_term"
for k in cache.iterkeys():
if search_q.lower() == k.lower():
print(k)
print(cache.get(k))
print(cache.get(search_q))
print(cache[search_q])
The above code works as expected on my local Windows machine. On my Linux machine, the output is:
search_term
None
None
Traceback (most recent call last):
File "/home/username/repo/diskcache_test.py", line 27, in
In other words, it finds the key (but not the associated non-None value). Then, when directly accessing the key, I get a KeyError.
Any idea what might be going on here?
I was able to resolve using the command offered in #304
Thanks for reporting back. This issue can be closed :)