praw-dev/asyncpraw

AttributeError: 'Redditor' object has no attribute 'icon_img'.

cikeZ00 opened this issue · 1 comments

Describe the bug
Almost all Submission.author attributes dont work.

To Reproduce
Steps to reproduce the behavior:

  1. Get a sub post using asyncpraw
  2. Try and fetch anything author related except name and a few others.
  3. And it should say "AttributeError: 'Redditor' object has no attribute 'icon_img'. 'Redditor' object has not been fetched, did you forget to execute '.load()'?"

Expected behavior
asyncpraw should properly fetch author (Redditor) attributes.

Code/Logs
subreddit = await reddit.subreddit(config["Reddit"].get("sub_name"))
async for submission in subreddit.stream.submissions(skip_existing=True):
print(submission.author.icon_img)

System Info

  • OS: Windows 10 1809
  • Python: 3.7
  • Async PRAW Version: 7.1.0

You will need to execute await submission.author.load() before you can access that attribute.