Skip to content
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

rules.mod.reorder no longer working #1898

Closed
NathanTech7713 opened this issue Sep 13, 2022 · 13 comments
Closed

rules.mod.reorder no longer working #1898

NathanTech7713 opened this issue Sep 13, 2022 · 13 comments
Labels
Auto-closed - Stale Automatically closed due to being stale for too long Reddit API Change Related to a change with Reddit's API Stale Issue or pull request has been inactive for 20 days

Comments

@NathanTech7713
Copy link
Contributor

NathanTech7713 commented Sep 13, 2022

Describe the Bug

Attempting to reorder the rules of a subreddit tracebacks because the response is returning None.

Desired Result

It looks as though this line should return an iterative function:
response = self.subreddit_rules._reddit.post(API_PATH["reorder_subreddit_rules"], data=data)I've tried commenting out the lines that traceback to just see what response is, and response=None

Relevant Logs

File "C:\python332\lib\site-packages\praw\models\reddit\rules.py", line 448, in reorder
    for rule in response:
TypeError: 'NoneType' object is not iterable
>>>

Code to reproduce the bug

subreddit = reddit.subreddit("test")
rules = list(subreddit.rules)
# reorder them in any means you like, my preferred is:
new = [rules[1], rules[0], rules[2]]
subreddit.rules.mod.reorder(new)

My code example does not include the Reddit() initialization to prevent credential leakage.

Yes

This code has previously worked as intended.

No

Operating System/Environment

windows

Python Version

3.8

PRAW Version

7.6.0

Prawcore Version

2.3.0

Anything else?

No response

@github-actions
Copy link

github-actions bot commented Oct 3, 2022

This issue is stale because it has been open for 20 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Oct 3, 2022
@LilSpazJoekp
Copy link
Member

Is this issue still occurring?

@NathanTech7713
Copy link
Contributor Author

Hello.
Yes, this is still occurring.
Thanks.

@github-actions github-actions bot removed the Stale Issue or pull request has been inactive for 20 days label Oct 5, 2022
@github-actions
Copy link

This issue is stale because it has been open for 20 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Oct 25, 2022
@NathanTech7713
Copy link
Contributor Author

@LilSpazJoekp commenting because the bot wants to make this issue stale, not sure if there is more you need from me?

@github-actions github-actions bot removed the Stale Issue or pull request has been inactive for 20 days label Oct 25, 2022
@LilSpazJoekp
Copy link
Member

Not at the moment no. I'll let you know if I need anything else!

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Nov 24, 2022
@LilSpazJoekp LilSpazJoekp added Bug Something isn't working and removed Stale Issue or pull request has been inactive for 20 days labels Nov 24, 2022
@LilSpazJoekp LilSpazJoekp removed the Bug Something isn't working label Dec 24, 2022
@LilSpazJoekp
Copy link
Member

I looked into this. I was only able to reproduce when the new list did not contain all the rules or had extra rules. Reddit must have changed how they validate rules and now doesn't return error data when an invalid order is used.

@LilSpazJoekp LilSpazJoekp added the Reddit API Change Related to a change with Reddit's API label Dec 24, 2022
@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Jan 24, 2023
@LilSpazJoekp LilSpazJoekp removed the Stale Issue or pull request has been inactive for 20 days label Feb 10, 2023
@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Mar 13, 2023
@github-actions
Copy link

This issue was closed because it has been stale for 30 days with no activity.

@github-actions github-actions bot added the Auto-closed - Stale Automatically closed due to being stale for too long label Apr 12, 2023
@NathanTech7713
Copy link
Contributor Author

I have found the source of this issue.
If a rule's short reason contains commas, it breaks the validity when it reorders.

I redid my rules without commas, and it reordered perfectly.

@bboe
Copy link
Member

bboe commented Jun 19, 2023

Thanks for the follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-closed - Stale Automatically closed due to being stale for too long Reddit API Change Related to a change with Reddit's API Stale Issue or pull request has been inactive for 20 days
Projects
None yet
Development

No branches or pull requests

3 participants