Skip to content

Commit

Permalink
Prevent error when the value is unicode and can't be encoded to ascii
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 27, 2016
1 parent c399626 commit 0f59e96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/%server/%database/%collection/%filter/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import datetime
import pprint
import functools

import six
from six.moves import urllib

import mongs
Expand Down Expand Up @@ -36,7 +37,7 @@ class Pair:
if isinstance(v, (int, float)):
v = "<code>%s</code>" % v
escape = False
nv = len(str(v))
nv = len(six.text_type(v))
link = ''
if k == '_id':
link = "%s/%s/" % (base, _id)
Expand Down

0 comments on commit 0f59e96

Please sign in to comment.