This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients ezio.melotti, methane, remi.lapeyre, rhettinger, serhiy.storchaka, xtreak, ys19991
Date 2020-07-13.13:01:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594645301.32.0.155425086361.issue41284@roundup.psfhosted.org>
In-reply-to
Content
(Off topic) There is a very common mistake in this code:

```
with oepn(filepath, 'r') as f:
    data = json.load(f)
```

JSON file is encoded in UTF-8. But the default text encoding is locale encoding.

You should do this instead:

```
with oepn(filepath, 'rb') as f:
    data = json.load(f)
```

This works for legacy JSON with UTF-16 or UTF-32 (with/without BOM).too.
History
Date User Action Args
2020-07-13 13:01:41methanesetrecipients: + methane, rhettinger, ezio.melotti, serhiy.storchaka, remi.lapeyre, xtreak, ys19991
2020-07-13 13:01:41methanesetmessageid: <1594645301.32.0.155425086361.issue41284@roundup.psfhosted.org>
2020-07-13 13:01:41methanelinkissue41284 messages
2020-07-13 13:01:41methanecreate