From 4e09d5c6d6f5e3eaf8175c0ec54901b6f7a005a1 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 11 Sep 2002 02:32:14 +0000 Subject: unquote(): Didn't properly de-backslash-ify. This patch (adapted from Quinn Dunkan's mimelib SF patch #573204) fixes the problem. --- Lib/rfc822.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 3d9e13f..4f69b22 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -477,9 +477,9 @@ class Message: def unquote(str): """Remove quotes from a string.""" if len(str) > 1: - if str[0] == '"' and str[-1:] == '"': - return str[1:-1] - if str[0] == '<' and str[-1:] == '>': + if str.startswith('"') and str.endswith('"'): + return str[1:-1].replace('\\\\', '\\').replace('\\"', '"') + if str.startswith('<') and str.endswith('>'): return str[1:-1] return str -- cgit v0.12