NNTP Post a file
Daniel
Daniel.Kinnaer at Advalvas.be
Thu May 3 12:07:55 EDT 2001
Hi.
I've been trying to use Python to post a message to the newsgroup.
Here you can find the source code
import nntplib
print "start"
s = nntplib.NNTP('news.skynet.be')
s.group('comp.lang.python')
f=open('c:/temp/mymsg.txt')
s.post(f)
s.quit
print "done..."
I suppose that the problem is mymsg.txt. Here it follows:
From: Daniel <Daniel.Kinnaer at Advalvas.be>
Newsgroups: comp.lang.python
Subject: Testing NNTP using Python
Date: Thu, 3 May 2001 17:58:06 +0200
Message-ID: <>
References: <>
X-Newsreader: Python home brew
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 3
This is a testfile, please disregard.
Posting this file using Python
end of message
Could someone please tell me why Python refuses to post this?
Below is a traceback from this
start
Traceback (most recent call last):
File "C:\Python20\Pythonwin\pywin\framework\scriptutils.py", line
301, in RunScript
exec codeObject in __main__.__dict__
File "C:\Data\Py\AProject\NNTP\NNTP_Post2.py", line 7, in ?
s.post(f)
File "c:\python20\lib\nntplib.py", line 482, in post
return self.getresp()
File "c:\python20\lib\nntplib.py", line 184, in getresp
raise NNTPTemporaryError(resp)
NNTPTemporaryError: 441 435 Bad Message-ID
Hope to read you soon. Best regards, Daniel
More information about the Python-list
mailing list