]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
merge
authorRaymond Hettinger <python@rcn.com>
Mon, 12 Sep 2016 06:23:24 +0000 (23:23 -0700)
committerRaymond Hettinger <python@rcn.com>
Mon, 12 Sep 2016 06:23:24 +0000 (23:23 -0700)
1  2 
Lib/test/test_xml_etree.py
Lib/xml/etree/ElementTree.py
Misc/NEWS

Simple merge
index 4b0c661e31783b10136dd15df3490cc7b51898b9,92821c5706268a27972b1e1abd3ea4baa44b2c69..735405681ff8c8b445b291e1b5a4fc9fc6cebbb5
@@@ -1084,8 -1083,19 +1084,19 @@@ def _escape_attrib(text)
              text = text.replace(">", "&gt;")
          if "\"" in text:
              text = text.replace("\"", "&quot;")
 -        # Section 2.11 of the XML specification, stating that 
+         # The following business with carriage returns is to satisfy
++        # Section 2.11 of the XML specification, stating that
+         # CR or CR LN should be replaced with just LN
+         # http://www.w3.org/TR/REC-xml/#sec-line-ends
+         if "\r\n" in text:
+             text = text.replace("\r\n", "\n")
+         if "\r" in text:
+             text = text.replace("\r", "\n")
+         #The following four lines are issue 17582
          if "\n" in text:
              text = text.replace("\n", "&#10;")
+         if "\t" in text:
+             text = text.replace("\t", "&#09;")
          return text
      except (TypeError, AttributeError):
          _raise_serialization_error(text)
diff --cc Misc/NEWS
index e6f03849ab1af5571865860ecf59ee3e9ffca199,1dc5ad898ca66ab0237578b3dac4115e597722b9..b58822e24a8c97f2537895f0fe3457751a7b81dc
+++ b/Misc/NEWS
@@@ -202,13 -81,11 +202,16 @@@ Librar
  - Issue #14977: mailcap now respects the order of the lines in the mailcap
    files ("first match"), as required by RFC 1542.  Patch by Michael Lazar.
  
 +- Issue #28025: Convert all ssl module constants to IntEnum and IntFlags.
 +  SSLContext properties now return flags and enums.
 +
 +- Issue #433028: Added support of modifier spans in regular expressions.
 +
  - Issue #24594: Validates persist parameter when opening MSI database
  
+ - Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes
+   (Patch by Duane Griffin.  Reviewed and approved by Stefan Behnel.)
  - Issue #28047: Fixed calculation of line length used for the base64 CTE
    in the new email policies.