mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Patch 471400: escape single-dot lines; by Jason Hildebrand.
RFC 2049 recommends never outputting a line consisting of a single dot.
This commit is contained in:
parent
5aace07fe0
commit
1346e83eb0
2 changed files with 3 additions and 0 deletions
|
|
@ -61,6 +61,8 @@ def write(s, output=output, lineEnd='\n'):
|
|||
# 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ Gary Herron
|
|||
Bernhard Herzog
|
||||
Magnus L. Hetland
|
||||
Kevan Heydon
|
||||
Jason Hildebrand
|
||||
Konrad Hinsen
|
||||
David Hobley
|
||||
Tim Hochberg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue