Opened 9 years ago
Closed 9 years ago
#26694 closed Bug (fixed)
FileBasedCache.get() ignores all IOError errno values
| Reported by: | Jon Dufresne | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Cache system) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Current implementation:
def get(self, key, default=None, version=None):
fname = self._key_to_file(key, version)
try:
with io.open(fname, 'rb') as f:
if not self._is_expired(f):
return pickle.loads(zlib.decompress(f.read()))
except IOError as e:
if e.errno == errno.ENOENT:
pass # Cache file doesn't exist.
return default
By inspection, this appears to be ignoring all errno values. However, judging from the surrounding code and comments, it should only be ignoring ENOENT. See discussion in PR #6652 for more details.
Change History (3)
comment:1 by , 9 years ago
| Component: | Uncategorized → Core (Cache system) |
|---|---|
| Has patch: | set |
comment:2 by , 9 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Note:
See TracTickets
for help on using tickets.
https://github.com/django/django/pull/6679