-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PRAW unable to handle x-ratelimit-remaining header #173
Comments
Update: As of 21:00 UTC the issue seems to be resolved. The sample code will no longer reproduce the error at this time. |
My guess is that this was a transient bug on Reddit's part, since their docs on https://support.reddithelp.com/hc/en-us/articles/16160319875092-Reddit-Data-API-Wiki say that this header value is a single number:
Regardless, ideally prawcore should just ignore bad header values here, not crash. |
Kept getting this today at around 14:35 UTC:
|
+1 here - now running into this error
|
@oussama-gourari @the1daBread any thoughts on the origins of this error? Do you suspect it is an issue with |
@0xj7r Seems to be a Reddit issue, a fix is on the way: https://www.reddit.com/r/redditdev/comments/1df1bmg/xratelimitremaining_header_value_issue/l8fu2lk/ |
This is an error with Reddit's API. It should be returning floats for headers. |
True! ...but also ideally prawcore should probably handle it better than crashing. 😆 #173 (comment) |
True, but this is rate limit code and handling it would likely involve discarding it and could cause your app to exceed the rate limits. This isn't a good thing for an API wrapper than handles rate limits for you. |
True! That seems like a policy choice though, right? You could easily fail closed, ie interpret it as over the rate limit, instead of failing open and interpreting as under the rate limit. Or something else entirely. I'm sure you all will know the options and policy reasoning better than me! It just seems like surfacing an unexpected |
I'm going to close this issue as it seems like a one off bug on Reddit's end that was resolved. For the PRAW project, it is customary for unexpected data to result in unexpected exceptions occurring. |
Describe the Bug
Calls to
subreddit.mod.stream.modqueue
are failing with error message similar to this:Desired Result
Ratelimit handling works without errors.
Code to reproduce the bug
My code does not include sensitive credentials
Relevant Logs
This code has previously worked as intended
Yes
Operating System/Environment
Ubuntu 20.04, 22.04
Python Version
3.8.10, 3.10.12
prawcore Version
2.3.0
Links, references, and/or additional comments?
No response
The text was updated successfully, but these errors were encountered: