
The Nomadic Coder writes:
This came out personal frustration, as I use this 3 line function very, very often, and the whole community does.
I don't deny your experience, but mine differs. Most JSON I get as single objects arrives as strings (eg as an attribute on an HTTP response object), not in files or file-like objects. Most JSON I get from file-like objects comes as streams of objects, rather than as single objects, which means that to use the json module I have to do something a little more complicated (sometimes quite a bit more complicated) than a 3-line function. The issue of handling such streams has come up in the past.
Still learning-to-navigate what's accepted here and what's not :)
On this list, you can ask as long as you don't get pissy about not receiving. See Naoki Inada's post for why this might be a good idea even though it's a three-line function. It's not open and shut (for one thing, on most modern systems the system default encoding is already UTF-8), but it definitely is food for thought. Also Serhiy's post on issues specific to working with files and json. So this is a richer learning experience than you might have thought!