classification
Title: imaplib: traceback from _checkquote with empty string
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: anadelonbrin (1)
Priority: normal Keywords easy, patch

Created on 2003-11-20 04:01 by anadelonbrin, last changed 2009-04-22 17:20 by ajaksu2.

Files
File name Uploaded Description Edit Remove
imaplib.diff anadelonbrin, 2003-11-20 04:01 Patch for the _checkquote function in imaplib.py.
Messages (1)
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.
History
Date User Action Args
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