Update quopri from 3.13.5 (#5989)

This commit is contained in:
Shahar Naveh authored and GitHub committed 2025-07-17 00:03:25 +09:00
1 parent 6a3dff63bb
commit a0a6f735a1
2 files changed
+5 -7

No files matched your search

+2 -7
View File
@@ -67,10 +67,7 @@ def encode(input, output, quotetabs, header=False):
output.write(s + lineEnd)
prevline = None
while 1:
line = input.readline()
if not line:
break
while line := input.readline():
outline = []
# Strip off any readline induced trailing newline
stripped = b''
@@ -126,9 +123,7 @@ def decode(input, output, header=False):
return
new = b''
while 1:
line = input.readline()
if not line: break
while line := input.readline():
i, n = 0, len(line)
if n > 0 and line[n-1:n] == b'\n':
partial = 0; n = n-1
+3
View File
@@ -3,6 +3,7 @@ import unittest
import sys, io, subprocess
import quopri
from test import support
ENCSAMPLE = b"""\
@@ -180,6 +181,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
for p, e in self.HSTRINGS:
self.assertEqual(quopri.decodestring(e, header=True), p)
@support.requires_subprocess()
def test_scriptencode(self):
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri"],
@@ -196,6 +198,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
self.assertEqual(cout[i], e[i])
self.assertEqual(cout, e)
@support.requires_subprocess()
def test_scriptdecode(self):
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri", "-d"],