def get_quietly(arg): (data, errors) = get(arg) # 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) if errors: cache = get_cache_dir() if (cache is not None) and (cache in arg): errors = [] return data, errors
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