NNTPlib::xover problem

  • Thread starter Helmut Jarausch
  • Start date
H

Helmut Jarausch

Hi

I try to regularly extract recent news from some newsgroups.
If News is an NNTP object I try
(Response,Articles)= News.xover(str(int(Last)+1),'10000000')
where 'Last' is the (previously saved) number of the last
article read.
If there are no new articles I get an Exception

Traceback (most recent call last):
File "/home/jarausch/Python_My/News", line 36, in -toplevel-
(Response,Articles)= News.xover(str(int(Last)+1),'10000000')
File "/usr/local/lib/python2.4/nntplib.py", line 479, in xover
resp, lines = self.longcmd('XOVER ' + start + '-' + end, file)
File "/usr/local/lib/python2.4/nntplib.py", line 265, in longcmd
return self.getlongresp(file)
File "/usr/local/lib/python2.4/nntplib.py", line 236, in getlongresp
resp = self.getresp()
File "/usr/local/lib/python2.4/nntplib.py", line 219, in getresp
raise NNTPTemporaryError(resp)
NNTPTemporaryError: 420 No such article


I would have expected to get an empty 'Response' or the value None
for 'Articles'.

What am I missing?

(This is Python 2.4.3)

Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
M

Michiel Sikma

Hi Helmut,

I guess it simply raises an exception in case there are no articles;
this may not be what you expected, but it would seem that this is the
way it operates. You should try catching the exception to plan out a
course of action in case no articles are present.

Michiel

Op 7-aug-2006, om 12:50 heeft Helmut Jarausch het volgende geschreven:
 
H

Helmut Jarausch

Michiel said:
Hi Helmut,

I guess it simply raises an exception in case there are no articles;
this may not be what you expected, but it would seem that this is the
way it operates. You should try catching the exception to plan out a
course of action in case no articles are present.

Thanks,

though the name of the exception 'nntplib.NNTPTemporaryError'
sound 'temporary'

Helmut.

Op 7-aug-2006, om 12:50 heeft Helmut Jarausch het volgende geschreven:


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top