aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands/import_export.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-15 11:21:15 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-15 11:21:15 +0100
commita9c7af90408c3537f42763e63862a2ae44bcc368 (patch)
treea4c65c55decbd839d85ef6b762d57ca4dd2a2ca7 /mediagoblin/gmg_commands/import_export.py
parent2b7aa99d3c221e713a95b664491f35612f9023cc (diff)
downloadmediagoblin-a9c7af90408c3537f42763e63862a2ae44bcc368.tar.lz
mediagoblin-a9c7af90408c3537f42763e63862a2ae44bcc368.tar.xz
mediagoblin-a9c7af90408c3537f42763e63862a2ae44bcc368.zip
export: Handle Unicode titles better in logging
log("ascii %s" % unicode_string) tries to convert unicode to ascii, which might fail. Better use log(u"unicode format %s" % unicode_string) and let the logging framework handle the conversion. This works much better and the exceptions still happening aren't stopping the main app. Also remove one useless import.
Diffstat (limited to 'mediagoblin/gmg_commands/import_export.py')
-rw-r--r--mediagoblin/gmg_commands/import_export.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py
index a46219a0..30112969 100644
--- a/mediagoblin/gmg_commands/import_export.py
+++ b/mediagoblin/gmg_commands/import_export.py
@@ -16,7 +16,6 @@
from mediagoblin import mg_globals
from mediagoblin.db.open import setup_connection_and_db_from_config
-from mediagoblin.init.config import read_mediagoblin_config
from mediagoblin.storage.filestorage import BasicFileStorage
from mediagoblin.init import setup_storage, setup_global_and_app_config
@@ -209,7 +208,7 @@ def _export_media(db, args):
for entry in db.media_entries.find():
for name, path in entry['media_files'].items():
- _log.info('Exporting {0} - {1}'.format(
+ _log.info(u'Exporting {0} - {1}'.format(
entry['title'],
name))