ham-radio-software / D-Rats

D-Rats program for D-Star Ham Radios
https://iz2lxi.jimdofree.com/
Other
43 stars 13 forks source link

Error when sending broadcast text message but choosing image file #264

Closed KP4AJ closed 4 months ago

KP4AJ commented 11 months ago

Hi: This when trying to broadcast text file but sending image (jpeg). Windows 10 D-Rats latest git code. Obviously if user choose correctly this problem should not occur. Here the traceback: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 65: character maps to

Win10 Git Code Broadcast image file: Traceback (most recent call last):

File "C:/Users/edfel/D-Rats/d_rats/ui/main_chat.py", line 876, in _bcast_file data = file_handle.read() ^^^^^^^^^^^^^^^^^^

File "C:/msys64/mingw64/lib/python3.11/encodings/cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 65: character maps to

73' Edfel KP4AJ

wb8tyw commented 4 months ago

I guess that D-Rats should catch the exception and just log (hopefully only once) that the file can not be sent as it has non-text characters. However as with the other ticket, there is no way to know if a text file is displayable on another platform.

wb8tyw commented 4 months ago

This is a duplicate of https://github.com/ham-radio-software/D-Rats/issues/272