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

Antoine Pitrou report at bugs.python.org
Wed Nov 3 00:08:41 CET 2010


Antoine Pitrou <pitrou at free.fr> 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 "Xref: foo" and returning "foo" rather
than " foo". If spaces are supposed to be significant I can just strip
the first one, though.

> Also, with:
>   token = token or None
> 
> "X-Header: \r\n" becomes None if I understand how the source code
> works...  Yet, it is a real '', not None.

Er, so you're disagreeing with your previous message? Or am I missing
something? :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10281>
_______________________________________


More information about the Python-bugs-list mailing list