mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
This commit is contained in:
parent
7dbb1ff77d
commit
91c64a05d2
2 changed files with 7 additions and 2 deletions
|
@ -68,6 +68,8 @@ def quoteattr(data, entities={}):
|
|||
the optional entities parameter. The keys and values must all be
|
||||
strings; each key will be replaced with its corresponding value.
|
||||
"""
|
||||
entities = entities.copy()
|
||||
entities.update({'\n': ' ', '\r': ' ', '\t':'	'})
|
||||
data = escape(data, entities)
|
||||
if '"' in data:
|
||||
if "'" in data:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue