Bug #11385
closedCannot close CHIRP next-20240614 Python 3.10.8 wx 4.2.0 msw 3.2.0, and cannot open saved .img .csv
100%
Description
Hi, for CHIRP next-20240614 Python 3.10.8 wx 4.2.0 msw 3.2.0 on windows 10 pro (czech locale), Quansheng UV-K5 Egzumer 0.19 (does not matter for bug 1):
1) Cannot close the program with "Close" and "X" buttons, must kill it in process explorer
2) cannot open saved .img or .csv, it does nothing
but i can download from radio, modify and upload back. I would like to be able upload to new radio from save for example, now i need to download, and upload to radio because i cannot open save file no matter what.
Files
Updated by Michael Skřepský 5 months ago
- File chirp.config chirp.config added
- File error chirp.jpg error chirp.jpg added
Here it is.
i also tried to open some default config .csv (shows in that config file), shows error (pic included)
then tried my downloaded and saved .img and .csv again, does not load and does not show errors
Updated by Alexandre J. Raymond 5 months ago
Hi Michael, would you happen to use folders with CHIRP that include the following character in their name: ů ?
Updated by Alexandre J. Raymond 5 months ago
Dan Smith, looks like the config file is opened without a specific encoding in config.py, which would yield cp1252 on Windows.
def save(self):
cfg = os.path.join(self.__basepath, self.__name)
with open(cfg, "w") as cfg_file:
self.__config.write(cfg_file)
I am able to reproduce similar issues a few different ways:
1) use a RadioReference.com username containing ů
2) opening a csv file in a folder named ů
CP1252 seems unable to represent ů.
>>> '\u016f'.encode('cp1252')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python310\lib\encodings\cp1252.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character '\u016f' in position 0: character maps to <undefined>
Updated by Michael Skřepský 5 months ago
- File chirp_debug-k87buokk.txt chirp_debug-k87buokk.txt added
Hi Alexandre,
opened from different folder, works ok and even can be closed normally.
I will watch unusual folder names and move files if needed.
Thank you for solving this mystery!
Updated by Dan Smith 5 months ago
looks like the config file is opened without a specific encoding in config.py, which would yield cp1252 on Windows.
Yep, that's why I wanted to see the config so I could try locally, but of course it was failing to write so it never ended up in the file. That config reading and writing predates python3 of course. I'll queue a fix.
Updated by Dan Smith 5 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset github|846bfcd61ae9f7b6d901c19aa52cb1ba9e844969.