[Yum-devel][PATCH] locale related traceback

seth vidal skvidal at phy.duke.edu
Thu Jun 9 06:40:52 UTC 2005


On Thu, 2005-06-09 at 08:12 +1000, Menno Smits wrote:
> Terje Rosten wrote:
> > 
> > ===================================================================
> > RCS file: /cvsroot/yum/cvs/yum/output.py,v
> > retrieving revision 1.59
> > diff -u -r1.59 output.py
> > --- output.py	3 Jun 2005 21:21:08 -0000	1.59
> > +++ output.py	8 Jun 2005 08:09:25 -0000
> > @@ -21,7 +21,6 @@
> >  import os.path
> >  import sys
> >  import time
> > -import locale
> >  from i18n import _
> >  
> >  from urlgrabber.progress import TextMeter
> > @@ -36,9 +35,11 @@
> >  class YumOutput:
> >  
> >      def printtime(self):
> > -        locale.setlocale(locale.LC_TIME, 'C')
> > -        ret = time.strftime('%b %d %H:%M:%S ', time.localtime(time.time()))
> > -        locale.resetlocale(locale.LC_TIME)
> > +        months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
> > +                  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
> > +        now = time.localtime(time.time())
> > +        ret = months[int(time.strftime('%m', now)) - 1] + \
> > +              time.strftime(' %d %T ', now)
> >          return ret
> 
> This patch fixes the problem for me. Seth, should we be commiting this? 
> Its obviously not Python 2.3 dependent.
> 

Yah. Definitely.

-sv





More information about the Yum-devel mailing list