Add encoding-param to open(), in case the underlying OS has a different default (#3827)
This commit is contained in:
parent
1440709e4c
commit
39db57d151
@ -1,6 +1,10 @@
|
||||
import json
|
||||
import random
|
||||
import string
|
||||
import six
|
||||
|
||||
if six.PY2:
|
||||
from io import open
|
||||
|
||||
|
||||
def random_string(length=None):
|
||||
@ -18,5 +22,5 @@ def load_resource(filename):
|
||||
from pkg_resources import resource_filename
|
||||
load_resource(resource_filename(__name__, "resources/file.json"))
|
||||
"""
|
||||
with open(filename, "r") as f:
|
||||
return json.load(f, encoding="utf-8")
|
||||
with open(filename, "r", encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
Loading…
Reference in New Issue
Block a user