mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #281 from m-r-r/master
Patch for issue #271 (« Unicode issue in category name »)
This commit is contained in:
commit
520d9b73c0
1 changed files with 2 additions and 2 deletions
|
|
@ -173,14 +173,14 @@ class URLWrapper(object):
|
|||
return self.name == unicode(other)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
return str(self.name.encode('utf-8', 'replace'))
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
def _from_settings(self, 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'))
|
||||
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue