Skip to content

Commit fab37e2

Browse files
committed
Make Date header parsing locale-independent (fixes issue 209).
1 parent 441c519 commit fab37e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

couchdb/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from dummy_threading import Lock
2929
import urllib
3030
from urlparse import urlsplit, urlunsplit
31+
from email.Utils import parsedate
3132

3233
from couchdb import json
3334

@@ -165,8 +166,7 @@ class RedirectLimit(Exception):
165166
CHUNK_SIZE = 1024 * 8
166167

167168
def cache_sort(i):
168-
t = time.mktime(time.strptime(i[1][1]['Date'][5:-4], '%d %b %Y %H:%M:%S'))
169-
return datetime.fromtimestamp(t)
169+
return datetime.fromtimestamp(time.mktime(parsedate(i[1][1]['Date'])))
170170

171171
class ResponseBody(object):
172172

0 commit comments

Comments
 (0)