[Python-bugs-list] [Bug #123625] "authinfo" belongs before "mode reader" in nntplib.py

noreply@sourceforge.net noreply@sourceforge.net
Wed, 03 Jan 2001 14:08:19 -0800


Bug #123625, was updated on 2000-Nov-27 12:20
Here is a current snapshot of the bug.

Project: Python
Category: None
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: mogul
Assigned to : twouters
Summary: "authinfo" belongs before "mode reader" in nntplib.py

Details: On some secure news servers (Netcape Collabra in this case), a
client cannot even set "mode reader" before providing authentication
information.  If you have Mailman attempt to gate news from such a server,
it will error with an entry such as this in the logs: 

Nov 27 11:01:44 2000 gate_news(9768): Traceback (innermost last):
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 222, in ?
Nov 27 11:01:44 2000 gate_news(9768):      main()
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 203, in main
Nov 27 11:01:44 2000 gate_news(9768):      process_lists(lock)
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 148, in process_lists
Nov 27 11:01:44 2000 gate_news(9768):      conn, first, last =
open_newsgroup(mlist)
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 75, in open_newsgroup
Nov 27 11:01:44 2000 gate_news(9768):      password=mm_cfg.NNTP_PASSWORD)
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/Mailman/pythonlib/nntplib.py", line 117, in __init__
Nov 27 11:01:44 2000 gate_news(9768):      self.welcome =
self.shortcmd('mode reader')
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/Mailman/pythonlib/nntplib.py", line 210, in shortcmd
Nov 27 11:01:44 2000 gate_news(9768):      return self.getresp()
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/Mailman/pythonlib/nntplib.py", line 184, in getresp
Nov 27 11:01:44 2000 gate_news(9768):      raise NNTPTemporaryError(resp)
Nov 27 11:01:44 2000 gate_news(9768): Mailman.pythonlib.nntplib .
NNTPTemporaryError :  480 Authentication required for command 


My solution: Move these lines...

	if readermode:
		try:
                         	self.welcome = self.shortcmd('mode reader')
	except NNTPPermanentError:
	# error 500, probably 'not implemented'
            		pass

to the end of NNTP's constructor, in other words, after the authinfo
exchange is done.

Bret

Follow-Ups:

Date: 2001-Jan-03 14:08
By: gvanrossum

Comment:
Thomas, you seem to be the author of the readermode code.

I was going to just check in the suggested change, but when I read the CVS
logs, it mentioned that "mode reader" was sent before authentication, so
perhaps there's a reason.

If you agree with the suggestion here, please go ahead and check it in --
no need to go through the patch manager.
-------------------------------------------------------

Date: 2001-Jan-02 22:30
By: bwarsaw

Comment:
This is more accurately a bug in Python's nntplib.py
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123625&group_id=5470