fix reading config file in python2
This commit is contained in:
parent
69f9bbdc78
commit
dd61a4f5f4
1 changed files with 2 additions and 2 deletions
|
@ -60,11 +60,11 @@ def createConfigFile():
|
||||||
"""
|
"""
|
||||||
configFile = os.path.join(os.path.expanduser('~'), '.wakatime.cfg')
|
configFile = os.path.join(os.path.expanduser('~'), '.wakatime.cfg')
|
||||||
try:
|
try:
|
||||||
with open(configFile, 'r', encoding='utf-8') as fh:
|
with open(configFile) as fh:
|
||||||
pass
|
pass
|
||||||
except IOError:
|
except IOError:
|
||||||
try:
|
try:
|
||||||
with open(configFile, 'w', encoding='utf-8') as fh:
|
with open(configFile, 'w') as fh:
|
||||||
fh.write("[settings]\n")
|
fh.write("[settings]\n")
|
||||||
fh.write("debug = false\n")
|
fh.write("debug = false\n")
|
||||||
fh.write("hidefilenames = false\n")
|
fh.write("hidefilenames = false\n")
|
||||||
|
|
Loading…
Reference in a new issue