[issue10281] Exception raised when an NNTP overview field is absent

2010-11-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, committed in r86139. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-03 Thread Julien ÉLIE
Julien ÉLIE added the comment: > My conclusion in working on the email package is that only > the first space after the ':', if it exists, should be stripped. > That is, even though the RFC (for email) reads as if the space > after the colon is part of the value, in practice it is part > of the

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-03 Thread Julien ÉLIE
Julien ÉLIE added the comment: > Er, so you're disagreeing with your previous message? > Or am I missing something? :) I was saying that if an empty string is returned, then it means that the header exists and is empty. An example was "User-Agent: \r\n". And my remark "I believe None is bette

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg120300 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Besides being shorter, the advantages of assertLE are consistent with the rich comparison method names, no worries about Than, no camel casing ambiguities, no pluralization or other nmemonic issues (LessThanEqual or LessThanEquals or LessThanOrEqual or Les

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread R. David Murray
R. David Murray added the comment: My conclusion in working on the email package is that only the first space after the ':', if it exists, should be stripped. That is, even though the RFC (for email) reads as if the space after the colon is part of the value, in practice it is part of the de

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oops, sorry. -- Added file: http://bugs.python.org/file19474/nntpover2.patch ___ Python tracker ___ ___

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file19473/nntpover2.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch trying to better handle whitespace. Would it be ok for you? -- Added file: http://bugs.python.org/file19473/nntpover2.patch ___ Python tracker

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > OK, thanks. > By the way, why is the token stripped? > token = token[len(h):].lstrip(" ") > > "X-Header: test \r\n" in an header is kept in the overview as-is. > I do not see why " test " should not be the value returned. It's a simple way of handling

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Julien ÉLIE
Julien ÉLIE added the comment: OK, thanks. By the way, why is the token stripped? token = token[len(h):].lstrip(" ") "X-Header: test \r\n" in an header is kept in the overview as-is. I do not see why " test " should not be the value returned. Also, with: token = token or None "X-Head

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch for returning None on absent fields. (works with trigofacile.com) -- keywords: +patch Added file: http://bugs.python.org/file19471/nntpover.patch ___ Python tracker

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Julien ÉLIE
Julien ÉLIE added the comment: The empty string would mean the header exists, and is empty (though not RFC-compliant). For instance: "User-Agent: \r\n" I believe None is better. -- ___ Python tracker __

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: I am wondering how to return the corresponding information. Should the field be totally absent from the returned dictionary, should it map to the empty string, or should it map to None? I'm leaning towards the latter (map to None), but perhaps the empty string

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-01 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-01 Thread Julien ÉLIE
New submission from Julien ÉLIE : Following the first example of the documentation: import nntplib s = nntplib.NNTP('news.trigofacile.com') resp, count, first, last, name = s.group('fr.comp.lang.python') print('Group', name, 'has', count, 'articles, range', first, 'to', last) resp, overviews =