question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Post author flair disappears from post after accessing post.comments

See original GitHub issue

Issue Description

As also reported by other user on reddit.

When accessing post.comment on a post from subreddit.new() (for example by doing post.comments.replace_more() or post.comments.list()) the post.author_flair_* properties are cleared

Example code (reddit is a Reddit instance from apraw.Reddit()):

# Get post with flair set
post = [post for post in reddit.subreddit("mechmarket").new() if post.author_flair_css_class is not None][0]
print(post.author_flair_css_class)  # Prints i-[value]
post.comments.list()  # Get list of comments, result not important
print(post.author_flair_css_class)  # Prints None

System Information

PRAW Version: 5.0.1 (also reported on 5.4.0) Python Version: 2.7.12 Operating System: Ubuntu 16.04

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bboecommented, Apr 30, 2018

I’m not going to merge the fix in just yet, as I’d like to wait for confirmation from Reddit that this is intended behavior, or hopefully that it is a bug they will resolve, in which case there is no need for the fix.

0reactions
jarhill0commented, Jan 9, 2019

It seems that Reddit has resolved this on their end. I just tested:

In [18]: # Get post with flair set
    ...: post = [post for post in reddit.subreddit("mechmarket").new() if post.author_flair_css_class is not None][0]
    ...: print(post.author_flair_css_class)  # Prints i-[value]
    ...: post.comments.list()  # Get list of comments, result not important
    ...: print(post.author_flair_css_class)  # Prints None
    ...: 
i-1
i-1
Read more comments on GitHub >

github_iconTop Results From Across the Web

User flairs keep disappearing : r/RedesignHelp
- Go to old.reddit.com and see if your flairs are showing up there under Moderation Tools > Edit Flair.
Read more >
Why are my posts on Reddit immediately removed by ...
Yes in most cases it means the user has deleted their account. Many do it after a negative post or comment that spurred...
Read more >
How do I get user flair?
On reddit.com​​ Next to User Flair Preview, click the edit icon to set up your flair. If you don't see the User Flair...
Read more >
Reddit Has Hidden Search Tools
For example, entering author:PresidentObama lists content posted only by u/PresidentObama. flair: This word filters by a subreddit's flair, ...
Read more >
CivilServant-Analysis/Front Page R Science Data Creation.ipynb
newcomer comments on posts that are allowed to remain ... so try to ## add in the author information here, since ## the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found