diff options
author | ianb <devnull@localhost> | 2007-09-15 17:53:56 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-09-15 17:53:56 +0000 |
commit | 3259acd58a35b8a27aee1f88087f07d318c58726 (patch) | |
tree | 3980c9102d420e4bc3824c59013693db22d941b8 /paste/session.py | |
parent | caf3a1837e938a23967d3927cb549400fb008ef4 (diff) | |
download | paste-3259acd58a35b8a27aee1f88087f07d318c58726.tar.gz |
In paste.session, ignore files that aren't session files
Diffstat (limited to 'paste/session.py')
-rw-r--r-- | paste/session.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/paste/session.py b/paste/session.py index e0ab242..fdcaff2 100644 --- a/paste/session.py +++ b/paste/session.py @@ -235,13 +235,17 @@ class FileSession(object): if len(t) != 2: return t = t[0] - sess_time = datetime.datetime( - int(t[0:4]), - int(t[4:6]), - int(t[6:8]), - int(t[8:10]), - int(t[10:12]), - int(t[12:14])) + try: + sess_time = datetime.datetime( + int(t[0:4]), + int(t[4:6]), + int(t[6:8]), + int(t[8:10]), + int(t[10:12]), + int(t[12:14])) + except ValueError: + # Probably not a session file at all + return if sess_time + exp_time < now: os.remove(os.path.join(self.session_file_path, f)) |