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 <americ...@shangri.la.org>', 'Mon, 04 Jan 2010 17:36:44 -0600', 
'<cu-dnfpxgcsr5t_wnz2dnuvz_rbi4...@giganews.com>', 
['<5aydnt9obm20bkrwnz2dnuvz_v2dn...@giganews.com>'], 
'<XGa0n.15891$0u1.11...@newsfe16.iad>', '1443')]

In the example above '<XGa0n.15891$0u1.11...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue17084>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to