Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #516: patch1091.txt

Line 
1 Index: sessions.py
2 ===================================================================
3 --- sessions.py (revisión: 1091)
4 +++ sessions.py (copia de trabajo)
5 @@ -12,6 +12,7 @@
6  """
7  
8  import datetime
9 +import locale
10  import os
11  try:
12      import cPickle as pickle
13 @@ -123,8 +124,15 @@
14          #   So we have to use the old "expires" ... sigh ...
15          #cookie[cookie_name]['max-age'] = self.timeout * 60
16          gmt_expiration_time = time.gmtime(time.time() + (self.timeout * 60))
17 +        oldlocale = locale.getlocale(locale.LC_ALL)
18 +        deflocale = locale.setlocale(locale.LC_ALL)
19 +        locale.setlocale(locale.LC_ALL, 'C')
20          cookie[self.cookie_name]['expires'] = time.strftime(
21                  "%a, %d-%b-%Y %H:%M:%S GMT", gmt_expiration_time)
22 +        try:
23 +            locale.setlocale(locale.LC_ALL, oldlocale)
24 +        except Exception, e:
25 +            locale.setlocale(locale.LC_ALL, deflocale)
26          if self.cookie_domain is not None:
27              cookie[self.cookie_name]['domain'] = self.cookie_domain
28          if self.cookie_secure is True:

Hosted by WebFaction

Log in as guest/cpguest to create tickets