[issue36931] json lib doesnt want to load from file

Zachary Ware report at bugs.python.org
Wed May 15 18:51:12 EDT 2019


Zachary Ware <zachary.ware at gmail.com> added the comment:

You're passing in a filename, not a file-like object (see https://docs.python.org/3/library/json.html#json.load).  Instead, you'll want something like:

with open(filename) as f:
    json_data = json.load(f)



Please note that this is not a help forum; in future, please submit queries like this to the python-list at python.org mailing list, StackOverflow, or if you're just learning Python, try the tutor at python.org mailing list.  Thanks!

----------
nosy: +zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: resource usage -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36931>
_______________________________________


More information about the Python-bugs-list mailing list