From 5c1ab137495a113669e727521edf9b87e9e2fc1c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 15 Nov 2013 16:16:21 +0100 Subject: [PATCH] no need to load json string into ram --- ox/file.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ox/file.py b/ox/file.py index 79772ce..92240d7 100644 --- a/ox/file.py +++ b/ox/file.py @@ -275,7 +275,11 @@ def read_file(file, verbose=False): return data def read_json(file, verbose=False): - return json.loads(read_file(file, verbose=verbose)) + if verbose: + print 'reading', file + with open(file) as fd: + data = json.load(fd) + return data def write_file(file, data, verbose=False): if verbose: