[Python-bugs-list] [ python-Bugs-559884 ] imaplib.IMAP4.open() typo
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 05 Jun 2002 15:53:01 -0700
Bugs item #559884, was opened at 2002-05-24 08:47
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=559884&group_id=5470
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Erik Demaine (edemaine)
Assigned to: Piers Lauder (pierslauder)
Summary: imaplib.IMAP4.open() typo
Initial Comment:
Looking at imaplib.py, class IMAP4, method open(),
there are two arguments, host and port, which are never
used in the method. Instead, self.host and self.port
(set only in __init__) are used. This gives a
misleading notion of what open() does. I suggest that
these arguments be removed, because currently an IMAP4
object cannot be open()ed later by an external user,
i.e., open() is really private.
----------------------------------------------------------------------
>Comment By: Piers Lauder (pierslauder)
Date: 2002-06-06 08:53
Message:
Logged In: YES
user_id=196212
Updated imaplib.py containing new versions of open for IMAP4
and IMAP4_SSL classes checked into CVS.
NB: the "self.host" and "self.port" instance variables are redundant,
but I've retained them for the sake of backwards-compatibility.
----------------------------------------------------------------------
Comment By: Piers Lauder (pierslauder)
Date: 2002-06-06 06:36
Message:
Logged In: YES
user_id=196212
It's a bug. One should definately be able to supply
alternate host and port values when using open() from
a sub-class. Will fix.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-06 05:18
Message:
Logged In: YES
user_id=6380
Hm, you seem to be right. Piers, what do you think?
----------------------------------------------------------------------
Comment By: Erik Demaine (edemaine)
Date: 2002-05-31 00:06
Message:
Logged In: YES
user_id=265183
Looks OK, but shouldn't self.host and self.port be set if
they are specified in open()? (Presumably in case another
method wants to use them.) See attached alternative patch.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2002-05-25 00:36
Message:
Logged In: YES
user_id=80475
The two arguments are needed because open() can be
overridden in a sub-class.
Suggest testing to see if arguments are supplied and using
them instead of self.host and self.port. See attached
patch.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=559884&group_id=5470