Skip to content

Commit

Permalink
fix: timezone name is returned in local encoding, but unicode convert…
Browse files Browse the repository at this point in the history
…er assumes ascii by default (fixes ''exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte'' problems. solution: provide locale encoding to unicode converter.
  • Loading branch information
Tobias Oberstein committed Mar 30, 2010
1 parent 6d534c3 commit 3aeccfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions buildbot/status/web/base.py
@@ -1,6 +1,6 @@

import urlparse, urllib, time, re
import os, cgi, sys
import os, cgi, sys, locale
import jinja2
from zope.interface import Interface
from twisted.web import resource, static
Expand Down Expand Up @@ -162,7 +162,7 @@ def getContext(self, request):
version = version,
time = time.strftime("%a %d %b %Y %H:%M:%S",
time.localtime(util.now())),
tz = time.tzname[time.localtime()[-1]],
tz = unicode(time.tzname[time.localtime()[-1]], locale.getdefaultlocale()[1]),
metatags = [],
title = self.getTitle(request),
welcomeurl = rootpath)
Expand Down
4 changes: 2 additions & 2 deletions buildbot/status/web/waterfall.py
Expand Up @@ -4,7 +4,7 @@
from twisted.python import log, components
import urllib

import time
import time, locale
import operator

from buildbot import interfaces, util
Expand Down Expand Up @@ -387,7 +387,7 @@ def content(self, request, ctx):
self.buildGrid(request, builders)

# start the table: top-header material
ctx['tz'] = time.tzname[time.localtime()[-1]]
ctx['tz'] = unicode(time.tzname[time.localtime()[-1]], locale.getdefaultlocale()[1])
ctx['changes_url'] = request.childLink("../changes")

bn = ctx['builders'] = []
Expand Down

0 comments on commit 3aeccfc

Please sign in to comment.