mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
[email] bpo-29478: Fix passing max_line_length=None from Compat32 policy (GH-595)
If max_line_length=None is specified while using the Compat32 policy, it is no longer ignored.
This commit is contained in:
parent
3fd54d4a7e
commit
b459f74826
4 changed files with 17 additions and 2 deletions
|
|
@ -361,8 +361,12 @@ class Compat32(Policy):
|
|||
# Assume it is a Header-like object.
|
||||
h = value
|
||||
if h is not None:
|
||||
parts.append(h.encode(linesep=self.linesep,
|
||||
maxlinelen=self.max_line_length))
|
||||
# The Header class interprets a value of None for maxlinelen as the
|
||||
# default value of 78, as recommended by RFC 2822.
|
||||
maxlinelen = 0
|
||||
if self.max_line_length is not None:
|
||||
maxlinelen = self.max_line_length
|
||||
parts.append(h.encode(linesep=self.linesep, maxlinelen=maxlinelen))
|
||||
parts.append(self.linesep)
|
||||
return ''.join(parts)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue