Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1572 closed task (fixed)

[M-R][Patch] should also support only username or email

Reported by: limodou@… Owned by: adrian
Component: Documentation Version:
Severity: trivial Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I found that Rss201rev2Feed in only support both username and email supplied situation, and I think if there is only username or email it also need support. And I also change the outpu format from :

email ( username ) to username ( email ) if both of them supplied

I think it's the common format of the author. And I also found that if I'm using Chinese in author_name, they'll be complained that:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)

So I remove 'u' string prefix.

Attachments (2) (1.1 KB) - added by limodou@… 10 years ago. (914 bytes) - added by limodou@… 10 years ago.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by limodou@…

comment:1 Changed 10 years ago by ubernostrum

Not that the RSS spec is useful for anything other than beating one's head against in frustration, but 'email (name)' is what the spec uses, and it doesn't provide any guide, other than its example which includes both email address and name, as to whether a feed can legally omit the name. As to omitting the email address, the spec defines the 'author' element as "Email address of the author of the item", which seems to indicate, about as clearly as the RSS spec indicates anything, that omitting the email address is not permitted.

comment:2 Changed 10 years ago by limodou@…

I think feedgenerator is just an util module, and how to provide rss should be the duty of developer, but not let feedgenerator to decide. If one don't want to show the email of the user, or need both user name and user email he could validate these check before create the rss feed, and it's not difficult. And I think let developer know what he does is very useful.

The format of username(email) I think is a convention. And at least, feedgenerator should enable only username, but not need both username and email. I of course set email , or username , to let either only username or only email. But I think if feedgenerator can support only username or only email is better, so I don't need to set email or username .

comment:3 Changed 10 years ago by ubernostrum

The problem here, as I see it, is not utility -- the problem is conformance to the spec. The RSS spec pretty clearly lays out that there has to be an email address there, and pretty clearly gives an example of the form 'email (user)'. Conformance to the RSS spec would seem to require, then, that both be present and that they occur in that order.

comment:4 Changed 10 years ago by limodou@…

I did review the RSS 2.0 Spec, and it's exactly like what you said:

<author> is an optional sub-element of <item>.

It's the email address of the author of the item. For newspapers and magazines syndicating via RSS, the author is the person who wrote the article that the <item> describes. For collaborative weblogs, the author of the item might be different from the managing editor or webmaster. For a weblog authored by a single individual it would make sense to omit the <author> element.

<author>lawyer@… (Lawyer Boyer)</author>

And you can see, the rss spec need at least an email, or both username and email. And the need all email and username:

if item['author_email'] is not None and item['author_name'] is not None: 
   handler.addQuickElement(u"author", u"%s (%s)" % \ 
  (item['author_email'], item['author_name']))

So I think this process is exactly not match the RSS spec. It should support only email or both username and email I think.

Changed 10 years ago by limodou@…

comment:5 Changed 10 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [2617]) magic-removal: fixed #1572 -- feedgenerator RSSv2 feeds now support missing author names (thanks, limodou)

comment:6 Changed 9 years ago by anonymous

  • Component changed from RSS framework to Documentation
  • priority changed from normal to low
  • Severity changed from normal to trivial
  • Type changed from defect to task
  • Version magic-removal deleted
Note: See TracTickets for help on using tickets.
Back to Top