[New-bugs-announce] [issue17084] nntplib.NNTP.xover does not always return results as documented

David Holm report at bugs.python.org
Wed Jan 30 20:16:53 CET 2013

New submission from David Holm:

The response from NNTP.xover doesn't always match the format described in the documentation. It is supposed to return a (result, list) where the list contains entries of the format (article number, subject, poster, date, id, references, size, lines). However, I have found it to sometimes split the subject into two entries or only one of multiple references being in a list (see example below).

I am attempting to interpret the data using an enum-like structure to match the indices to the values but it fails very often because the date field contains part of the subject or the size field contains a cross reference entry.

Example using Python 2.7:

    >>> import nntplib
    >>> c = nntplib.NNTP(..)
    >>> c.group('alt.binaries.linux')
    ('211 317334 3 317336 alt.binaries.linux', '317334', '3', '317336', 'alt.binaries.linux')
    >>> resp, lst = c.xover('114179', '114179')
    >>> print resp
    224 data follows
    >>> print lst
    [('114179', 'Re: Newsposter - The Linux Binary Posting Script Version 7.2', 'Patriot <American1 at shangri.la.org>', 'Mon, 04 Jan 2010 17:36:44 -0600', '<cu-dnfpXgcsR5t_WnZ2dnUVZ_rBi4p2d at giganews.com>', ['<5aydnT9obM20bKrWnZ2dnUVZ_v2dnZ2d at giganews.com>'], '<XGa0n.15891$0U1.11678 at newsfe16.iad>', '1443')]

In the example above '<XGa0n.15891$0U1.11678 at newsfe16.iad>' can be found at index 6 where the size is supposed to be.

components: Library (Lib)
messages: 180987
nosy: dholm
priority: normal
severity: normal
status: open
title: nntplib.NNTP.xover does not always return results as documented
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list