diff options
author | Simon Schampijer <simon@schampijer.de> | 2011-04-04 17:32:15 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2011-04-11 15:13:22 (GMT) |
commit | ba8583f8b009d15e5ae78d21bc700a990c6d10c4 (patch) | |
tree | 36286d239dbaab8ea3732c598393cc23255d0b26 /src/jarabe/journal/model.py | |
parent | 39513c9d317d9cd121ba065b8e64331f8ca4296e (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/jarabe/journal/model.py')
-rw-r--r-- | src/jarabe/journal/model.py | 2 |
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']) |