Please help, i'm getting this error:
with open('Data/language.json') as settings_file:
TypeError: Required argument 'flags' (pos 2) not found
My code is:
import json
with open('Data/settings.json') as settings_file:
Settings = json.load(settings_file)
asked Jul 8, 2013 at 21:58
Hendry
9001 gold badge11 silver badges27 bronze badges
1 Answer 1
It looks like you imported open from the os module with something like:
from os import open
os.open isn't the same as the builtin open function (which you don't need to import). Remove that import and you'll use the builtin open, which defaults to read mode.
answered Jul 9, 2013 at 6:01
Blender
300k55 gold badges463 silver badges513 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py
from os import open?open(the built-inopenthat you don't need to import) automatically defaults to read mode.