You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GNSSNTRIPClient does not work if the server does not return the header in utf-8, but e.g. in cp1250, such as czeposr.cuzk.gov.cz. Connecting to NTRIP fails on exception UnicodeDecodeError('utf-8', b'ICY 200 OK\r\nServer: GNSS Spider 7.9.0.386/1.0\r\nDate: \xfat, 08 \xf8\xedj 2024 13:04:43 GMT', 53, 54, 'invalid start byte')
2024-10-08 16:35:00,817 [ERROR] pygnssutils.gnssntripclient: ConnectionAbortedError("Unable to parse response headers - 'utf-8' codec can't decode byte 0xfa in position 53: invalid start byte"). Retrying in 10 secs (1/5) ...
A quick fix might be to replace it with this one hdr = hdr.decode(errors='backslashreplace').split("\r\n")
I can see the problematic chars in the SOURCETABLE are út, 08 říj ... i.e. Tue, 08 Oct ..., in which case I think the quick fix you suggest should suffice. Thanks for the report.
Describe the bug
GNSSNTRIPClient does not work if the server does not return the header in utf-8, but e.g. in cp1250, such as czeposr.cuzk.gov.cz. Connecting to NTRIP fails on exception UnicodeDecodeError('utf-8', b'ICY 200 OK\r\nServer: GNSS Spider 7.9.0.386/1.0\r\nDate: \xfat, 08 \xf8\xedj 2024 13:04:43 GMT', 53, 54, 'invalid start byte')
2024-10-08 16:35:00,817 [ERROR] pygnssutils.gnssntripclient: ConnectionAbortedError("Unable to parse response headers - 'utf-8' codec can't decode byte 0xfa in position 53: invalid start byte"). Retrying in 10 secs (1/5) ...
pygnssutils/src/pygnssutils/gnssntripclient.py
Line 543 in 85bbc16
The bug has been showing up since version 1.1.0
To Reproduce
Connect to an NTRIP server that returns unsupported utf-8 (or ASCII) characters in the header.
Expected Behaviour
A quick fix might be to replace it with this one
hdr = hdr.decode(errors='backslashreplace').split("\r\n")
The text was updated successfully, but these errors were encountered: