Fixed a UnicodeError in the sql.models.MediaEntry
The __repr__() call would crash the process when it tried to convert an unicode title to ASCII for terminal/logfile output.
This commit is contained in:
parent
2891b2c6d0
commit
79f28e0b93
@ -212,10 +212,12 @@ class MediaEntry(Base, MediaEntryMixin):
|
|||||||
return sys.modules[models_module].DATA_MODEL
|
return sys.modules[models_module].DATA_MODEL
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
safe_title = self.title.encode('ascii', 'replace')
|
||||||
|
|
||||||
return '<{classname} {id}: {title}>'.format(
|
return '<{classname} {id}: {title}>'.format(
|
||||||
classname=self.__class__.__name__,
|
classname=self.__class__.__name__,
|
||||||
id=self.id,
|
id=self.id,
|
||||||
title=self.title)
|
title=safe_title)
|
||||||
|
|
||||||
|
|
||||||
class FileKeynames(Base):
|
class FileKeynames(Base):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user