Get AssertionError when submitting url post to selftext only subreddit while ratelimited
See original GitHub issueDescribe the bug
If I am ratelimted on Reddit, such as for posting to /r/tifu, and I post a URL post, which is banned, instead of getting either error, I get an AssertionError
To Reproduce Steps to reproduce the behavior: Submit to a selftext-only subreddit while post-ratelimited.
Expected behavior
Raise one or both errors
Code/Logs
Code:
reddit.subreddit("tifu").submit("Test", url="https://www.google.com", validate_on_submit=True)
Error:
File "<ipython-input-8-2dd185cc0bda>", line 1, in <module>
reddit.subreddit("tifu").submit("Test", url="https://www.google.com", validate_on_submit=True)
File "~/PycharmProjects/praw/praw/models/reddit/subreddit.py", line 835, in submit
return self._reddit.post(API_PATH["submit"], data=data)
File "~/PycharmProjects/praw/praw/reddit.py", line 560, in post
return self._objector.objectify(data)
File "~/PycharmProjects/praw/praw/objector.py", line 172, in objectify
errors,
AssertionError: ('Errors did not get raised as an APIException', [['NO_LINKS', 'that subreddit only allows text posts', 'sr'], ['RATELIMIT', 'you are doing that too much. try again in 13 minutes.', 'ratelimit']])
System Info
- OS: MacOS 10.14
- Python: 3.7
- PRAW Version: 7.0.0dev0
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Change Log — PRAW 7.3.0 documentation - Read the Docs
Ability to pass a gallery url to Reddit.submission() . ... Add method invited() to get invited moderators of a subreddit. Ability to submit...
Read more >Python Reddit API Wrapper Documentation - Read the Docs
So we test if any of the strings are within the selftext, and if they are the bot sends me a message. But...
Read more >Retrieving only entries with selftext reddit praw - Stack Overflow
I got 'selftext': '[removed]' in self text while fetching data by users. Any Idea? – parlad. May 29 at 6:37. Add a ...
Read more >How does Rate Limiting work? · Issue #15 · krisives/cronnit.com
It's only when I use Cronnit that I'm hit with the rate limit error. Error message is simply 'This post has been rate...
Read more >what does ratelimit error mean? : r/redditdev
I'm currently only posting on testing subreddits. I even got an error while trying to submit this post. "you are doing that too...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pythoncoderas what happens if you don’t pass that parameter?
I once had plans to make
APIException
iterable and then take these assertions out but never got around to it. Regardless of whether @PythonCoderAS’ story is true or not, multiple API errors is definitely a possibly and these assertions need to be dealt with.A reliable way to reproduce multiple errors for the purposes of testing: