FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update quopri from 3.13.5 by ShaharNaveh · Pull Request #5989 · RustPython/RustPython · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 2 additions & 7 deletions Lib/quopri.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ def write(s, output=output, lineEnd=b'\n'):
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''
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_quopri.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys, io, subprocess
import quopri

from test import support


ENCSAMPLE = b"""\
Expand Down Expand Up @@ -180,6 +181,7 @@ def test_decode_header(self):
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"],
Expand All @@ -196,6 +198,7 @@ def test_scriptencode(self):
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"],
Expand Down
Loading

Back | FazBrowse Home | New Git URL