projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2891b2c
)
Fixed a UnicodeError in the sql.models.MediaEntry
author
Joar Wandborg
<git@wandborg.com>
Fri, 3 Aug 2012 14:02:18 +0000
(16:02 +0200)
committer
Joar Wandborg
<git@wandborg.com>
Fri, 3 Aug 2012 14:02:18 +0000
(16:02 +0200)
The __repr__() call would crash the process when it tried to convert an
unicode title to ASCII for terminal/logfile output.
mediagoblin/db/sql/models.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/db/sql/models.py
b/mediagoblin/db/sql/models.py
index 6ce4e06fafdf93296552f68c10f6dab8afd17619..7c8c0f99be05469eea3a507964014f16e5194aa4 100644
(file)
--- a/
mediagoblin/db/sql/models.py
+++ b/
mediagoblin/db/sql/models.py
@@
-212,10
+212,12
@@
class MediaEntry(Base, MediaEntryMixin):
return sys.modules[models_module].DATA_MODEL
def __repr__(self):
+ safe_title = self.title.encode('ascii', 'replace')
+
return '<{classname} {id}: {title}>'.format(
classname=self.__class__.__name__,
id=self.id,
- title=s
elf.
title)
+ title=s
afe_
title)
class FileKeynames(Base):