This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imaplib.IMAP4.open() typo
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pierslauder Nosy List: edemaine, gvanrossum, pierslauder, rhettinger
Priority: normal Keywords:

Created on 2002-05-23 22:47 by edemaine, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (6)
msg10911 - (view) Author: Erik Demaine (edemaine) Date: 2002-05-23 22:47
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.
msg10912 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2002-05-24 14:36
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.
msg10913 - (view) Author: Erik Demaine (edemaine) Date: 2002-05-30 14:06
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.
msg10914 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-06-05 19:18
Logged In: YES 
user_id=6380

Hm, you seem to be right. Piers, what do you think?
msg10915 - (view) Author: Piers Lauder (pierslauder) * (Python triager) Date: 2002-06-05 20:36
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.
msg10916 - (view) Author: Piers Lauder (pierslauder) * (Python triager) Date: 2002-06-05 22:53
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.
History
Date User Action Args
2022-04-10 16:05:20adminsetgithub: 36640
2002-05-23 22:47:00edemainecreate