Open Rustbeard86 opened 4 days ago
Everyt ime the application is run
Config file already exists at C:\Users\drewb\.epomaker-controller\config.json
is displayed.
The config.json file is written to disk.
Is this the intended behavior?
@Rustbeard86 great find! I will update with the changes you suggested (https://github.com/strodgers/epomaker-controller/pull/47)
Apparently the default file encoding used by python is platform specific, so for Windows it's cp1252, but json.dump()
defaults to using utf-8, so even though that particular file was written and then opened by the same program there's still a mismatch. I might do some experimenting with this, since it could also be a problem if a Windows user opens the config file to make changes and accidentally changes the encoding.
As for the print out, it is intended but isn't really needed anymore so I'll get rid of it.
Thanks very much!
I installed via unigetui.
To fix the issue I had to adjust "%USERPROFILE%\AppData\Local\Programs\Python\Python312\Lib\site-packages\epomakercontroller\configs\confgis.py
I modified line 41 as follows
with open(self._find_config_path(self.filename, self.type), "r", encoding="utf-8") as f:
Specifying the encoding type as utf-8.I'm not much of a programmer, but dabble a bit, I'm unsure as to why this error occurs.
The config file written by the application was indeed UTF-8 encoded with Windows CR LF