3

I am using httplib2 on Windows.

I have a URL with lots of & delimited parameters in it. When I give a cache to Http(), and then request the URL, I get:

FileNotFoundError: [Errno 2] No such file or directory: '.cache\\[MY URL]'

If I use /.cache as the cache, then it works, but the cache directory is created under D: instead of near the script. I am guessing the issue here is that with the cache in a relative path, the path becomes too long for Windows to handle, so it fails.

To be honest, this sort of caching system seems silly to me since URLs can end up very long or include illegal characters, and if you just use the URL as filename you can run into issues like this. According to Dive Into Python, httplib2 is supposed to be a sophisticated HTTP library, so surely there is a way to switch into a more sane cache file structure?

Superbest
  • 25,318
  • 14
  • 62
  • 134

0 Answers0