mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
patch for bug #271 (Unicode issue in category name)
This commit is contained in:
parent
0d9298313f
commit
fc584969c9
1 changed files with 2 additions and 2 deletions
|
|
@ -173,14 +173,14 @@ class URLWrapper(object):
|
||||||
return self.name == unicode(other)
|
return self.name == unicode(other)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.name)
|
return str(self.name.encode('utf-8', 'replace'))
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def _from_settings(self, key):
|
def _from_settings(self, key):
|
||||||
setting = "%s_%s" % (self.__class__.__name__.upper(), key)
|
setting = "%s_%s" % (self.__class__.__name__.upper(), key)
|
||||||
return self.settings[setting].format(**self.as_dict())
|
return unicode(self.settings[setting]).format(**self.as_dict())
|
||||||
|
|
||||||
url = property(functools.partial(_from_settings, key='URL'))
|
url = property(functools.partial(_from_settings, key='URL'))
|
||||||
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))
|
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue