configfile: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
b859c11378
commit
0da3d84a87
|
@ -150,7 +150,7 @@ class PrinterConfig:
|
||||||
return self.printer
|
return self.printer
|
||||||
def _read_config_file(self, filename):
|
def _read_config_file(self, filename):
|
||||||
try:
|
try:
|
||||||
f = open(filename, 'rb')
|
f = open(filename, 'r')
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
except:
|
except:
|
||||||
|
@ -383,7 +383,7 @@ class PrinterConfig:
|
||||||
logging.info("SAVE_CONFIG to '%s' (backup in '%s')",
|
logging.info("SAVE_CONFIG to '%s' (backup in '%s')",
|
||||||
cfgname, backup_name)
|
cfgname, backup_name)
|
||||||
try:
|
try:
|
||||||
f = open(temp_name, 'wb')
|
f = open(temp_name, 'w')
|
||||||
f.write(data)
|
f.write(data)
|
||||||
f.close()
|
f.close()
|
||||||
os.rename(cfgname, backup_name)
|
os.rename(cfgname, backup_name)
|
||||||
|
|
Loading…
Reference in New Issue