gmg env_import shouldn't crash on unicode ...
authorJoar Wandborg <git@wandborg.com>
Mon, 2 Apr 2012 13:08:22 +0000 (15:08 +0200)
committerJoar Wandborg <git@wandborg.com>
Mon, 2 Apr 2012 13:08:22 +0000 (15:08 +0200)
characters in media titles

mediagoblin/gmg_commands/import_export.py

index 20cc8fe42114379ca435f2c60a392268d1f56c9e..9d79afb4f165495ecc6d4533cc13bc272f9b9229 100644 (file)
@@ -67,7 +67,7 @@ def _import_media(db, args):
     for entry in db.MediaEntry.find():
         for name, path in entry.media_files.items():
             _log.info('Importing: {0} - {1}'.format(
-                    entry.title,
+                    entry.title.encode('ascii', 'replace'),
                     name))
 
             media_file = mg_globals.public_store.get_file(path, mode='wb')