Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2011-04-04 17:32:15 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-04-11 15:10:55 (GMT)
commitc7dbbf828ff0212d30755de14d1af121830c884b (patch)
tree9aecc038e9686ad858fba4b4d2a5db52edbd37aa /src
parentbae139cf49c43912dd92ea1fe8632bf9f6a7b5de (diff)
Copy to external device: do not fail on custom binary metadata OLPC #10807
Catch 'UnicodeDecodeError' and do not write the metadata if that error occurs but still write the file itself. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-By: Sascha Silbe <silbe@activitycentral.com>
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/journal/model.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 9cea65e..c768e2a 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -717,7 +717,7 @@ def _write_entry_on_external_device(metadata, file_path):
try:
metadata_json = simplejson.dumps(metadata_copy)
- except EnvironmentError:
+ except (UnicodeDecodeError, EnvironmentError):
logging.error('Could not convert metadata to json.')
else:
(fh, fn) = tempfile.mkstemp(dir=metadata['mountpoint'])