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
There is a bug where the Server Module is checking all the scenarios, and if response is still set to None, the line writing out what the response.status is will throw an error (Line 277 in server.py)
# write status linestatus_message=status_message_map.get(**response.status**, "Unknown")
either need to check if response is still None (if response is not None) or set it to a default value.
There is another line further down 282 that will also fail - for key, value in response.headers.items():
The text was updated successfully, but these errors were encountered:
I've been trying to track down an odd bug, that tends to cause my pico's wifi interface to occasionally hang/crash until a full machine.reset(), a few times a day..
Once I add that if response is not None to the lines you suggest, the error that usually lead to the interface crash, doesn't seem to do that anymore. (Or at least, I think it's related to what's causing it: [error / 117kB] need more than 0 values to unpack)
So far so good tho, saw the error once, but the device hasn't crashed again yet, so hopefully this was a good enough fix!
Here's more specifically what I modified, basically just indenting from line 276 to 285, if anyone else is having this issue:
ifresponseisnotNone:
# write status linestatus_message=status_message_map.get(response.status, "Unknown")
writer.write(f"HTTP/1.1 {response.status}{status_message}\r\n".encode("ascii"))
# write headersforkey, valueinresponse.headers.items():
writer.write(f"{key}: {value}\r\n".encode("ascii"))
# blank line to denote end of headerswriter.write("\r\n".encode("ascii"))
Edit: It seems to have made a slight improvement, but there's still a crash that happens somewhere.. Also testing a possible fix to the _parse_json_body function, if it's sent an invalid json request..
Edit2: nvm, that previous edit doesn't really seem to matter one way or the other. What did improve things for me, was adding a lot of error-catching code to things. And it seems to have improved stability, so I setup a fork for it: https://github.com/Nikorasu/phewer
There is a bug where the
Server
Module is checking all the scenarios, and ifresponse
is still set to None, the line writing out what theresponse.status
is will throw an error (Line 277 in server.py)either need to check if response is still None (
if response is not None
) or set it to a default value.There is another line further down 282 that will also fail -
for key, value in response.headers.items():
The text was updated successfully, but these errors were encountered: