From 64de899ccb1118238741dc222af2a116d34d2dfc Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 21 Feb 2022 20:10:31 -0600 Subject: [PATCH 1/2] Switch default Content-Type to text/x-rst, since all PEPs are now RST --- pep2html.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pep2html.py b/pep2html.py index 970c68dbafa..ba0ec100ba9 100755 --- a/pep2html.py +++ b/pep2html.py @@ -260,7 +260,7 @@ def fixfile(inpath, input_lines, outfile): v = date elif k.lower() in ('content-type',): url = PEPURL % 9 - pep_type = v or 'text/plain' + pep_type = v or 'text/x-rst' v = '%s ' % (url, escape(pep_type)) elif k.lower() == 'version': if v.startswith('$' 'Revision: ') and v.endswith(' $'): @@ -569,7 +569,7 @@ def fix_rst_pep(inpath, input_lines, outfile): def get_pep_type(input_lines): """ - Return the Content-Type of the input. "text/plain" is the default. + Return the Content-Type of the input. "text/x-rst" is the default. Return ``None`` if the input is not a PEP. """ pep_type = None @@ -579,11 +579,11 @@ def get_pep_type(input_lines): # End of the RFC 2822 header (first blank line). break elif line.startswith('content-type: '): - pep_type = line.split()[1] or 'text/plain' + pep_type = line.split()[1] or 'text/x-rst' break elif line.startswith('pep: '): # Default PEP type, used if no explicit content-type specified: - pep_type = 'text/plain' + pep_type = 'text/x-rst' return pep_type From 51cf8cbd97b6000a40ad76839b79e3f5d157d5a6 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 21 Feb 2022 20:20:29 -0600 Subject: [PATCH 2/2] PEP 1: Clarify that reST is the default & no plaintext PEPs remain --- pep-0001.txt | 14 ++++++-------- pep-0012/pep-NNNN.rst | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pep-0001.txt b/pep-0001.txt index 9e491b2f04e..8f951f14588 100644 --- a/pep-0001.txt +++ b/pep-0001.txt @@ -205,8 +205,8 @@ The standard PEP workflow is: * The title accurately describes the content. * The PEP's language (spelling, grammar, sentence structure, etc.) and code style (examples should match :pep:`7` & :pep:`8`) should be - correct and conformant. The PEP text will be automatically checked for - correct reStructuredText formatting when the pull request is submitted. + correct and conformant. The PEP text will be automatically checked for + correct reStructuredText formatting when the pull request is submitted. PEPs with invalid reST markup will not be approved. Editors are generally quite lenient about this initial review, @@ -547,7 +547,7 @@ optional and are described below. All other headers are required. Status: Type: - * Content-Type: + * Content-Type: text/x-rst * Requires: Created: * Python-Version: @@ -603,11 +603,9 @@ The Type header specifies the type of PEP: Standards Track, Informational, or Process. The format of a PEP is specified with a Content-Type header. -Valid values are ``text/plain`` for plaintext PEPs (see :pep:`9`) -and ``text/x-rst`` for reStructuredText PEPs (see :pep:`12`). -All new and active PEPs must use reStructuredText, but for backwards -compatibility, plain text is currently still the default if no -Content-Type header is present. +All PEPs must use reStructuredText (see :pep:`12`), +and have a value of ``text/x-rst``, the default. +Previously, plaintext PEPs used ``text/plain`` (see :pep:`9`). The Created header records the date that the PEP was assigned a number, while Post-History is used to record the dates of when new diff --git a/pep-0012/pep-NNNN.rst b/pep-0012/pep-NNNN.rst index 0ced89b223d..fd2884867f4 100644 --- a/pep-0012/pep-NNNN.rst +++ b/pep-0012/pep-NNNN.rst @@ -6,6 +6,7 @@ PEP-Delegate: Discussions-To: Status: Type: +Content-Type: text/x-rst Requires: Created: Python-Version: