gwibber fails to run: using wrong locale call

Bug #267528 reported by Tm_T (Jussi Kekkonen)
28
Affects Status Importance Assigned to Milestone
Gwibber
Fix Released
Undecided
Unassigned

Bug Description

File "/usr/lib/python2.5/locale.py", line 461, in getlocale

says....

def getlocale(category=LC_CTYPE):

    """ Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766. code and encoding can be None in case the values cannot
        be determined.

    """

!!! BUT !!!

  File "/home/media/bzr/webkitui/gwibber/microblog/support/__init__.py", line 12, in parse_time
    loc = locale.getlocale(locale.LC_ALL)

following patch (also as attachment) should fix this to smarter, right?

=== modified file 'gwibber/microblog/support/__init__.py'
--- gwibber/microblog/support/__init__.py 2008-08-30 18:01:22 +0000
+++ gwibber/microblog/support/__init__.py 2008-09-05 21:19:53 +0000
@@ -9,10 +9,10 @@
 import re, os, facelib, locale, mx.DateTime

 def parse_time(t):
- loc = locale.getlocale(locale.LC_ALL)
- locale.setlocale(locale.LC_ALL, 'C')
+ loc = locale.getlocale(locale.LC_TIME)
+ locale.setlocale(locale.LC_TIME, 'C')
   result = mx.DateTime.Parser.DateTimeFromString(t)
- locale.setlocale(locale.LC_ALL, loc)
+ locale.setlocale(locale.LC_TIME, loc)
   return result

 LINK_PARSE = re.compile("(https?://[^ )\n]+)")

Related branches

Revision history for this message
Tm_T (Jussi Kekkonen) (tmt) wrote :
Revision history for this message
Ryan Paul (segphault) wrote :

Thanks! I've applied your patch in revision 111. :-)

Changed in gwibber:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.