diff --git a/config/sort-ini.py b/config/sort-ini.py index 98976d3..e2db9ff 100755 --- a/config/sort-ini.py +++ b/config/sort-ini.py @@ -1,20 +1,20 @@ #!/usr/bin/env python import sys -import ConfigParser +import configparser if len(sys.argv) > 1: filename = sys.argv[1] else: filename = 'config.ini' -oconfig = ConfigParser.RawConfigParser() +oconfig = configparser.RawConfigParser() oconfig.read(filename) # This part will destroy the configuration if there's a crash while # writing the output. We're in an GIT-controlled directory, so # I didn't care enough to fix this. -with open(filename, 'wb') as fd: +with open(filename, 'w', encoding='utf-8') as fd: # Copy of write() code that sorts output by section if oconfig._defaults: fd.write("[%s]\n" % DEFAULTSECT)