reddit-replier icon indicating copy to clipboard operation
reddit-replier copied to clipboard

Crashes with configparser.NoSectionError with current version of PRAW

Open jonathangjertsen opened this issue 7 years ago • 6 comments

Replier is passing self.user_agent as an unnamed argument to praw.Reddit(), but in the latest version of PRAW the first unnamed argument is a site-name (referring to a token in a praw.ini file). Initializing a bot therefore crashes with:

configparser.NoSectionError: No section: 'redditreplier v1.0.0a1 by /u/naiyt'
You provided the name of a praw.ini configuration which does not exist.

This can presumably be fixed by changing praw.Reddit(self.user_agent) to praw.Reddit(user_agent=self.user_agent).

jonathangjertsen avatar Jul 06 '17 17:07 jonathangjertsen

Thanks for the report, I actually haven't touched this in years...looks like you have a good idea of the fix, if you have time would you mind opening a PR?

naiyt avatar Jul 07 '17 03:07 naiyt

Will do.

jonathangjertsen avatar Jul 07 '17 11:07 jonathangjertsen

Anything happening with this? Latest version doesn't seem to be fixed.

(no idea how PRs work, didn't do this before)

stnokott avatar Aug 11 '17 16:08 stnokott

I'm guessing @jonathangjertsen hasn't had time to put together a PR for it yet. If you'd like to use the fix he recommended you could edit the source and add his recommended change where you're running the code.

naiyt avatar Aug 12 '17 02:08 naiyt

Yah, did that, now gives me

praw.exceptions.ClientException: required configuration setting 'client_id' is missing.

This setting can be provided in a praw.ini file, as a keyword argument to the Reddit class constructor, or as an environment variable.

stnokott avatar Aug 14 '17 23:08 stnokott

I have just added a PR modifying the relevant line @jonathangjertsen was referencing. This is my first time doing a PR request, so please feel free to point out anything else I might need to do if I have somehow managed to botch things up!

james-townsend-jian avatar Mar 24 '21 21:03 james-townsend-jian