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: traceback from _checkquote with empty string
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: anadelonbrin, r.david.murray
Priority: normal Keywords: easy, patch

Created on 2003-11-20 04:01 by anadelonbrin, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
imaplib.diff anadelonbrin, 2003-11-20 04:01 Patch for the _checkquote function in imaplib.py.
Messages (5)
msg19046 - (view) Author: Tony Meyer (anadelonbrin) Date: 2003-11-20 04:01
Python 2.3.2 and also 18/11/03 CVS; Windows XP.

If _checkquote is passed the empty string, it raises and 
exception (because it tries to get an index into the 
string).  The easiest way to reproduce this is:

>>> import imaplib
>>> i = imaplib.IMAP4('server.name')
>>> i.login("username", "password")
>>> i.select("")
[Traceback here]

While it's unlikely that there's a folder called "", this 
should really give the 'invalid folder name' error, rather 
than an exception.

The attached diff fixes this, simply by checking for the 
empty string in _checkquote.
msg109890 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-10 16:49
The patch adds two lines to imaplib.py, would applying it after all these years be more trouble than it's worth?
msg110064 - (view) Author: Tony Meyer (anadelonbrin) Date: 2010-07-12 02:52
Why does the patch being very small make it more trouble?
msg114298 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-18 23:28
The patch is more trouble than it's worth because it's hopelessly out of date.  I think this needs a new patch if it's still relevant or else it should be closed.
msg118019 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-10-05 16:34
The example works fine for me (server returns mailbox does not exist) in both 2.7 and py3k trunk, so I'm closing this as out of date.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39570
2010-10-05 16:34:51r.david.murraysetstatus: open -> closed
nosy: + r.david.murray, - BreamoreBoy
messages: + msg118019

resolution: out of date
stage: patch review -> resolved
2010-08-18 23:28:23BreamoreBoysetmessages: + msg114298
2010-07-12 02:52:32anadelonbrinsetmessages: + msg110064
2010-07-10 16:49:57BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
nosy: + BreamoreBoy

messages: + msg109890

stage: test needed -> patch review
2009-04-22 17:20:18ajaksu2setkeywords: + patch, easy
2009-02-13 05:01:34ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6, - Python 2.3
2003-11-20 04:01:01anadelonbrincreate