[issue917120] imaplib: incorrect quoting in commands

2021-12-18 Thread Charalampos Tsimpouris


Charalampos Tsimpouris  added the comment:

As far as I can see I have the same problem from a different perspective. 
Selecting folders that include a space result in broken use of API, as server 
responds with "folder is not dound" (which is valid as part of the folder name 
is never sent). To circumvent the problem I suggest using a patched version of 
_command, where if name is "select" or "examine", check if arg startswith ", 
and if not wrap it - locally this seems to fix my problem. A different approach 
would be to force user use _quote function when needed (also fixes my problem 
locally).

--
nosy: +xtsimpouris

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2015-04-13 Thread Maciej Szulik

Changes by Maciej Szulik solt...@gmail.com:


--
nosy: +maciej.szulik

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2015-03-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +bjshan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2013-09-06 Thread Daniël van Eeden

Changes by Daniël van Eeden launch...@myname.nl:


--
nosy: +dveeden

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2013-02-12 Thread Mauro Cicognini

Mauro Cicognini added the comment:

The removal of the dead code causes imaplib under py3k to lose the quoting 
functionality that is described in documentation (except for passwords, that do 
get always quoted as stated).

I submit that we give at least a temporary warning in the docs, and that the 
_quote() function is exposed to let the programmer do their own quoting when 
they feel it necessary.

--
nosy: +Mauro.Cicognini
versions: +Python 3.3 -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2013-02-12 Thread R. David Murray

R. David Murray added the comment:

I don't understand what you mean by removing dead code leading to loss of 
functionality, unless you mean that the removal of the call to the quoting code 
in Python3 led to a loss of functionality relative to Python2, in which case I 
agree.  It also led to the behavior being out of sync with the documentation.

Reviewing the history of the changes (see issue 1210), it appears to me that 
the removal of the call to _checkquote was in fact unintentional and is a bug 
(it existed in the port-to-python3 patch submitted by Victor, but was commented 
out, which probably means he had it commented out for testing and did not 
notice he had not restored it).  This makes the later removal of _checkquote 
incorrect as well.

This error is primarily a consequence of imaplib having very few tests.

This module needs a lot of love in Python3 from someone, and it is not an easy 
topic to wrap ones head around.  It's on my list of things to look at, but 
there are a bunch of things ahead of it.

For the immediate issue, it is working as documented in Python2.7, so there is 
nothing to do there.  For Python3 we haven't had the quoting since the start, 
so we have the opportunity to consider changing the quoting rules if we 
wish...and we may have have no choice, since the new behavior has been in 
released versions for several Python3 versions now and starting to quote like 
Python2.7 did might break otherwise working code.  I don't have an opinion on 
how to fix this this yet, since while I know more about the IMAP protocol than 
I did a year ago, I still don't know enough to even write the tests

--
components: +email
nosy: +barry

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2013-02-12 Thread Mauro Cicognini

Mauro Cicognini added the comment:

David, that is exactly what I meant: functionality for Python 3 is less than 
the functionality available for Python 2, and behavior is completely out of 
sync with the documentation.

Bug or not, and independent of the root cause (I don't know if anyone will ever 
come up with more or better tests), I agree that this behavior for Python 3 has 
been around for a long time. I don't think it will break any significant code, 
but that's just my personal opinion; the main point is that re-introducing 
quoting functionality in imaplib would be a significant effort, also because 
reading the other relevant threads it is apparent that correct implementation 
is not there in Python 2 either.

I think that we have an easy way: 1) fix the documentation for Python 3 so that 
it reflects behavior and 2) expose the _quote() private method with a new 
static function that the user will be able to call when they deem it necessary.
They get to come up with a good regex or other ways to detect strings that need 
quoting, but still it's better than relying (like I did) on the advertised 
functionality and having to dig into the bowels of the module to understand the 
source of some bizarre bugs...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2010-08-19 Thread Mark Lawrence

Mark Lawrence breamore...@yahoo.co.uk added the comment:

I agree with Dan's comment in msg112741 about dead code so this only applies to 
2.7.  I'll raise a new issue to get the dead code removed from py3k.

--
nosy: +BreamoreBoy
stage: unit test needed - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2010-08-05 Thread Dave Baggett

Dave Baggett jyt...@baggett.org added the comment:

Piers Lauder, author of imaplib, emailed me the following comment about this 
bug:

The regex for mustquote_cre looks bizarre, and I regret to say I can
no longer remember its genesis.

Note however, that the term CTL in the RFC definition for atom-specials means 
any ASCII control character and DEL, 0x00 - 0x1f, 0x7f, and so maybe defining 
what is NOT an atom-special was considered easier.

The suggested replacement regex may not match these...?
-

It seems like we need to enumerate the control characters in the regex to be 
absolutely correct here.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2010-08-03 Thread Dan Buch

Dan Buch daniel.b...@gmail.com added the comment:

I'm attaching a patch which does exactly what dmbaggett recommended w.r.t. the 
mustquote regex.  All current tests pass, but I'm not sure if the current tests 
even cover this code (how is coverage measured in the stdlib tests?)

On a related note, the `_checkquote` method which uses the `mustquote` regex is 
dead code in Python 3.2+, AFAICT.

--
keywords: +patch
nosy: +meatballhat, r.david.murray
Added file: 
http://bugs.python.org/file18367/adjust-mustquote-re-in-imaplib.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2009-05-12 Thread Dave Baggett

Dave Baggett jyt...@baggett.org added the comment:

I'm not sure this causes the behavior reported here, but I believe there
really is a bug in imaplib.

In particular, it seems wrong to me that this line:

mustquote = re.compile(r[^\w!#$%'*+,.:;=?^`|~-])

has \w in it. Should that be \s?

I found this when I noticed that SELECT commands on mailboxes with
spaces in their names failed.

--
nosy: +dmbaggett

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2009-05-12 Thread Dave Baggett

Dave Baggett jyt...@baggett.org added the comment:

OK, I missed the initial caret in the regex. The mustquote regex is
listing everything that needn't be quoted, and then negating. I still
think it's wrong, though. According to BNF given in the Formal Syntax
section of RFC 3501, you must must quote atom-specials, which are
defined thus:

atom-specials   = ( / ) / { / SP / CTL / list-wildcards /
  quoted-specials / resp-specials
list-wildcards  = % / *
quoted-specials = DQUOTE / \
resp-specials   = ]

So I think this regex should do it:

mustquote = re.compile(r'[()\s%*]|{|\\|\]')

Changing status to bug.

--
type: feature request - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2009-02-14 Thread Daniel Diniz

Changes by Daniel Diniz aja...@gmail.com:


--
stage:  - test needed
versions: +Python 2.7 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue917120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue917120] imaplib: incorrect quoting in commands

2008-01-20 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +easy
type:  - rfe
versions: +Python 2.6 -Python 2.3


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue917120

___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com