Issue 845560: imaplib: traceback from _checkquote with empty string (original) (raw)

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:01 admin set github: 39570
2010-10-05 16:34:51 r.david.murray set status: open -> closednosy: + r.david.murray, - BreamoreBoymessages: + resolution: out of datestage: patch review -> resolved
2010-08-18 23:28:23 BreamoreBoy set messages: +
2010-07-12 02:52:32 anadelonbrin set messages: +
2010-07-10 16:49:57 BreamoreBoy set versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6nosy: + BreamoreBoymessages: + stage: test needed -> patch review
2009-04-22 17:20:18 ajaksu2 set keywords: + patch, easy
2009-02-13 05:01:34 ajaksu2 set stage: test neededtype: behaviorversions: + Python 2.6, - Python 2.3
2003-11-20 04:01:01 anadelonbrin create