vlmaksime / weather.gismeteo

Gismeteo Weather Forecast for KODI
14 stars 6 forks source link

KODI Exception - UnicodeEncodeError (surrogates not allowed) #6

Closed Gen1usCat closed 3 years ago

Gen1usCat commented 3 years ago

KODI 19

Error Type: <class 'UnicodeEncodeError'>
Error Contents: 'utf-8' codec can't encode character '\udca0' in position 11182: surrogates not allowed
Traceback (most recent call last):
  File "*/.kodi/addons/weather.gismeteo/resources/libs/simpleplugin.py", line 366, in __getitem__
    return pickle.loads(bytes(raw_item))
  TypeError: string argument without an encoding
---
  File "*/.kodi/addons/weather.gismeteo/resources/libs/simpleplugin.py", line 368, in __getitem__
    return pickle.loads(bytes(raw_item, 'utf-8'))
  UnicodeEncodeError: 'utf-8' codec can't encode character '\udca0' in position 11182: surrogates not allowed

To resolve the issue in the file weather.gismeteo/resources/libs/simpleplugin.py on line 368 must be changed to return pickle.loads(bytes(raw_item, 'utf-8', errors='surrogateescape'))

IvanO-20 commented 3 years ago

confirmed from my side. the same error/stacktrace, and this change are fixing it.

popy2k14 commented 3 years ago

i can confirm the fix is working also on my side. PLease push it to the kodi repo.

thx

vlmaksime commented 3 years ago

I've already done a PR with this changes, but it hasn't been accepted yet. https://github.com/xbmc/repo-scripts/pull/1972 https://github.com/xbmc/repo-scripts/pull/1973

popy2k14 commented 3 years ago

Thx a lot. Hope they get 's merged soon