[Python-checkins] python/dist/src/Lib _strptime.py,1.5,1.6
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Wed, 27 Nov 2002 00:30:27 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv11560/Lib
Modified Files:
_strptime.py
Log Message:
Patch #639112: fixes for None locale and tz.
Index: _strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** _strptime.py 23 Sep 2002 22:46:33 -0000 1.5
--- _strptime.py 27 Nov 2002 08:30:25 -0000 1.6
***************
*** 27,31 ****
from string import whitespace as whitespace_string
- __version__ = (2,1,6)
__author__ = "Brett Cannon"
__email__ = "drifty@bigfoot.com"
--- 27,30 ----
***************
*** 288,298 ****
def __calc_lang(self):
! # Set self.lang by using locale.getlocale() or
! # locale.getdefaultlocale().
current_lang = locale.getlocale(locale.LC_TIME)[0]
if current_lang:
self.__lang = current_lang
else:
! self.__lang = locale.getdefaultlocale()[0]
--- 287,303 ----
def __calc_lang(self):
! # Set self.__lang by using locale.getlocale() or
! # locale.getdefaultlocale(). If both turn up empty, set the attribute
! # to ''. This is to stop calls to this method and to make sure
! # strptime() can produce an re object correctly.
current_lang = locale.getlocale(locale.LC_TIME)[0]
if current_lang:
self.__lang = current_lang
else:
! current_lang = locale.getdefaultlocale()[0]
! if current_lang:
! self.__lang = current_lang
! else:
! self.__lang = ''
***************
*** 464,468 ****
elif group_key == 'Z':
found_zone = found_dict['Z'].lower()
! if locale_time.timezone[0].lower() == found_zone:
tz = 0
elif locale_time.timezone[1].lower() == found_zone:
--- 469,476 ----
elif group_key == 'Z':
found_zone = found_dict['Z'].lower()
! if locale_time.timezone[0] == locale_time.timezone[1]:
! pass #Deals with bad locale setup where timezone info is
! # the same; first found on FreeBSD 4.4 -current
! elif locale_time.timezone[0].lower() == found_zone:
tz = 0
elif locale_time.timezone[1].lower() == found_zone: