Fix dash escaping to be applied unconditionally
According to RFC 4880, 'an implementation MAY dash-escape any line, SHOULD dash-escape lines commencing "From" followed by a space [...]'. Therefore it is necessary to unescape all lines starting with dash-space sequences, and not just these that have a dash following this sequence. Fixes #341 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -844,7 +844,7 @@ class PGPUID(ParentRef):
|
||||
class PGPMessage(Armorable, PGPObject):
|
||||
@staticmethod
|
||||
def dash_unescape(text):
|
||||
return re.subn(r'^- -', '-', text, flags=re.MULTILINE)[0]
|
||||
return re.subn(r'^- ', '', text, flags=re.MULTILINE)[0]
|
||||
|
||||
@staticmethod
|
||||
def dash_escape(text):
|
||||
|
||||
Reference in New Issue
Block a user