Update to python 3.12 (#636)

* Fix

* Use read_file instead of read
This commit is contained in:
kilmanio 2023-10-11 20:20:36 +00:00 committed by GitHub
parent f15a87f92b
commit 7456a940fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import codecs
import re
import os
import sys
from configparser import SafeConfigParser, DEFAULTSECT
from configparser import ConfigParser, DEFAULTSECT
from syncplay import constants, utils, version, milestone
from syncplay.messages import getMessage, setLanguage, isValidLanguage
@ -389,7 +389,7 @@ class ConfigurationGetter(object):
open(iniPath, 'w').close()
else:
return
parser.readfp(codecs.open(iniPath, "r", "utf_8_sig"))
parser.read_file(codecs.open(iniPath, "r", "utf_8_sig"))
for section, options in list(self._iniStructure.items()):
if parser.has_section(section):
for option in options:
@ -432,7 +432,7 @@ class ConfigurationGetter(object):
if self._config['noStore']:
return
parser = SafeConfigParserUnicode(strict=False)
parser.readfp(codecs.open(iniPath, "r", "utf_8_sig"))
parser.read_file(codecs.open(iniPath, "r", "utf_8_sig"))
for section, options in list(self._iniStructure.items()):
if not parser.has_section(section):
parser.add_section(section)
@ -593,7 +593,7 @@ class ConfigurationGetter(object):
self._config = backup
class SafeConfigParserUnicode(SafeConfigParser):
class SafeConfigParserUnicode(ConfigParser):
def write(self, fp):
"""Write an .ini-format representation of the configuration state."""
if self._defaults: