Skip to content

Commit

Permalink
Fix config.ini encoding error
Browse files Browse the repository at this point in the history
  • Loading branch information
krepe-suZette committed Sep 21, 2018
1 parent 125ca6a commit c0c129a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@


config = configparser.ConfigParser()
config.read("config.ini", encoding="utf-8")
try:
config.read("config.ini", encoding="utf-8")
except configparser.MissingSectionHeaderError:
config.read("config.ini", encoding="utf-8-sig")

core_version = config.getfloat("main", "core_version")
name_key = "name" if core_version < 2 else "codename"
Expand Down

0 comments on commit c0c129a

Please sign in to comment.