set_flair_csv returns "improperly formatted row, ignoring" if flair_text contains a comma.
See original GitHub issueTest code:
import praw
r = praw.Reddit(...)
r.login(username, password)
giveflair = [{'flair_css_class': 'icedice', 'user': username, 'flair_text': 'ayy, lmao'}]
print r.get_subreddit(subreddit).set_flair_csv(giveflair)
Returns
[{u'status': u'skipped', u'errors': {u'row': u'improperly formatted row, ignoring'}, u'ok': False, u'warnings': {}}]
While changing giveflair to…
giveflair = [{'flair_css_class': 'icedice', 'user': username, 'flair_text': 'ayy lmao'}]
Goes through just fine. Escaping doesn’t seem to work either.
EDIT: Only tested with commas. Unsure about other symbols…
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@diceroll123 , reddit uses Python’s csv reader from the standard library. If the input is, for example
However, the built in reader supports qouted text with precedence, so,
^ gets output as wanted.
So, you should be able to give a flair with a comma by doing:
This issue is no longer present in PRAW4: https://github.com/praw-dev/praw/commit/739249f2b42631963308205143ed49a61c80e046