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
Hi,
it's a helpful tool you've done, but when trying to make it works under linux ubuntu, I ran into this critical error as soon as it reached a step requiring to decode the JSON data :
/dff/battle/get_battle_init_data called
Traceback (most recent call last):
File "FFRKProxy.py", line 113, in
...
File "FFRKProxy.py", line 70, in handle_response
json_data = json.loads(flow.response.content)
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
by adding a .decode('utf-8-sig') to all json.loads(flow.response.content), and it worked perfectly
Could you add this as default, or in a less static way, reuse in the json.loads the charset data from the http response-headers ?
It would fix both the issue on Windows and on some, if not all, linux distribs
The text was updated successfully, but these errors were encountered:
Hi,
it's a helpful tool you've done, but when trying to make it works under linux ubuntu, I ran into this critical error as soon as it reached a step requiring to decode the JSON data :
/dff/battle/get_battle_init_data called
Traceback (most recent call last):
File "FFRKProxy.py", line 113, in
...
File "FFRKProxy.py", line 70, in handle_response
json_data = json.loads(flow.response.content)
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Problem is, it seems that by default on linux, it doesn't check or default to utf, the data type needs to be explicit.
I used the solution given here for Windows :
https://www.reddit.com/r/FFRecordKeeper/comments/34p36e/how_to_peek_items_drops_in_windows/cqwyroo
by adding a .decode('utf-8-sig') to all json.loads(flow.response.content), and it worked perfectly
Could you add this as default, or in a less static way, reuse in the json.loads the charset data from the http response-headers ?
It would fix both the issue on Windows and on some, if not all, linux distribs
The text was updated successfully, but these errors were encountered: