def get_quietly(arg): """Wrapper for GetTorrent.get() which works around an IE bug. If there's an error opening a file from the IE cache, act like we simply didn't get a file (because we didn't). This happens when IE passes us a path to a file in its cache that has already been deleted because it came from a website which set Pragma:No-Cache on it. """ try: data = get(arg) except FileException, e: cache = get_cache_dir() if (cache is not None) and (cache in unicode(e.args[0])): data = None else: raise
def get_cache_dir(): return decode_from_filesystem(platform.get_cache_dir())