Closed
Bug 1276254
Opened 10 years ago
Closed 10 years ago
Replace unnecessary usage of read() when loading json from files
Categories
(Tree Management :: Treeherder, defect, P3)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
Details
Attachments
(1 file)
Another minor cleanup that's been sitting in my stashes for a while (having a spring clean).
This pattern:
with open(...) as f:
foo = json.loads(f.read())
Can be replaced with:
with open(...) as f:
foo = json.load(f)
Comment 1•10 years ago
|
||
| Assignee | ||
Updated•10 years ago
|
Attachment #8757343 -
Flags: review?(cdawson)
Updated•10 years ago
|
Attachment #8757343 -
Flags: review?(cdawson) → review+
Comment 2•10 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/b6677fd5c699a676203baf1e38905510cc93cfa1
Bug 1276254 - Remove unnecessary usage of .read() when json decoding
By using `json.load()` instead of `json.loads()` we can pass the file
object directly, rather than having to `.read()` it first.
| Assignee | ||
Updated•10 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•