[PATCH] Re: imaputil.py: Improved fix for quote detection regex

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon Jan 12 00:00:00 GMT 2015


On Mon, Jul 15, 2013 at 04:22:23PM -0500, Richard Tollerton wrote:

> Lotus Notes/Domino likes to return quoted strings of the form '"\\\\"', which
> when unescaped, ought to produce '"\\"'. The previous attempted fix didn't
> *quite*; this regex is ripped directly from Friedl.

Who is Friedl?

Did you run with this patch in a daily basis since you sent it?

Could you rebase it on current next/master and re-send, please?

> Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
> ---
>  offlineimap/imaputil.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/offlineimap/imaputil.py b/offlineimap/imaputil.py
> index fe69b7a..9fb5946 100644
> --- a/offlineimap/imaputil.py
> +++ b/offlineimap/imaputil.py
> @@ -23,7 +23,7 @@ from offlineimap.ui import getglobalui
>  
>  # find the first quote in a string
>  quotere = re.compile(
> -    r"""(?P<quote>"[^\"\\]*(?:\\"|[^"])*") # Quote, possibly containing encoded
> +    r"""(?P<quote>"[^"\\]*(?:\\.[^"\\]*)*") # Quote, possibly containing encoded
>                                     # quotation mark
>          \s*(?P<rest>.*)$           # Whitespace & remainder of string""",
>      re.VERBOSE)
-- 
Nicolas Sebrecht



More information about the OfflineIMAP-project mailing list