We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 print(cache[search_q]) ~~~~~^^^^^^^^^^ File "/home/username/repo/.venv/lib/python3.11/site-packages/diskcache/core.py", line 1234, in getitem raise KeyError(key) KeyError: 'search_term'
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?
The text was updated successfully, but these errors were encountered:
I was able to resolve using the command offered in #304
Sorry, something went wrong.
No branches or pull requests
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:
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
print(cache[search_q])
~~~~~^^^^^^^^^^
File "/home/username/repo/.venv/lib/python3.11/site-packages/diskcache/core.py", line 1234, in getitem
raise KeyError(key)
KeyError: 'search_term'
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?
The text was updated successfully, but these errors were encountered: