diff options
author | Daniel Drake <dsd@laptop.org> | 2009-11-18 12:17:47 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2009-11-23 11:01:46 (GMT) |
commit | cff9e43527ead20b088a9bfc6bbf12b0827debfd (patch) | |
tree | b7e55fd146187bfca81a8ffccd36704fea0d93eb /src/jarabe/journal/journalentrybundle.py | |
parent | 03d80f06f184e1e1e4635f7eb284b15113126251 (diff) |
Revert "Move to cjson and drop pyjson and simplejson"
This reverts commit ee4535c98ae74347e7072909d49dcf8a5e16ca7b.
cjson has a big bug dealing with slashes, this is a significant
long-term bug and upstream has not been responsive other than
acknowledging it. This bug breaks journal entry bundles.
http://dev.sugarlabs.org/ticket/1553
Thanks to Martin Langhoff for identifying and researching this issue
Diffstat (limited to 'src/jarabe/journal/journalentrybundle.py')
-rw-r--r-- | src/jarabe/journal/journalentrybundle.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/jarabe/journal/journalentrybundle.py b/src/jarabe/journal/journalentrybundle.py index ebe7ec3..a0bc935 100644 --- a/src/jarabe/journal/journalentrybundle.py +++ b/src/jarabe/journal/journalentrybundle.py @@ -18,7 +18,7 @@ import os import tempfile import shutil -import cjson +import json import dbus from sugar.bundle.bundle import Bundle, MalformedBundleException @@ -70,7 +70,12 @@ class JournalEntryBundle(Bundle): if not os.path.exists(metadata_path): raise MalformedBundleException( 'Bundle must contain the file "_metadata.json"') - return cjson.decode(open(metadata_path, 'r').read()) + f = open(metadata_path, 'r') + try: + json_data = f.read() + finally: + f.close() + return json.read(json_data) def _read_preview(self, uid, bundle_dir): preview_path = os.path.join(bundle_dir, 'preview', uid) |