summaryrefslogtreecommitdiff
path: root/Lib/quopri.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-15 18:44:26 +0000
committerGuido van Rossum <guido@python.org>2001-10-15 18:44:26 +0000
commit1346e83eb037ffc03c72d2fdc6da395acef9bc1b (patch)
treedd4922913a54cc025380a014f11ff4852d7b7447 /Lib/quopri.py
parent5aace07fe00d36fc0bf639ef38c3fc7cdc87eeea (diff)
downloadcpython-git-1346e83eb037ffc03c72d2fdc6da395acef9bc1b.tar.gz
Patch 471400: escape single-dot lines; by Jason Hildebrand.
RFC 2049 recommends never outputting a line consisting of a single dot.
Diffstat (limited to 'Lib/quopri.py')
-rwxr-xr-xLib/quopri.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/quopri.py b/Lib/quopri.py
index 6d7cdd613f..edee3d9916 100755
--- a/Lib/quopri.py
+++ b/Lib/quopri.py
@@ -61,6 +61,8 @@ def encode(input, output, quotetabs, header = 0):
# that trailing character encoded.
if s and s[-1:] in ' \t':
output.write(s[:-1] + quote(s[-1]) + lineEnd)
+ elif s == '.':
+ output.write(quote(s) + lineEnd)
else:
output.write(s + lineEnd)