AttributeError: 'Redditor' object has no attribute 'icon_img'.
cikeZ00 opened this issue · 1 comments
cikeZ00 commented
Describe the bug
Almost all Submission.author attributes dont work.
To Reproduce
Steps to reproduce the behavior:
- Get a sub post using asyncpraw
- Try and fetch anything author related except name and a few others.
- 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
LilSpazJoekp commented
You will need to execute await submission.author.load()
before you can access that attribute.