[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-07-03 Thread Xiang Zhang
Xiang Zhang added the comment: Put a not in escape's doc. -- Added file: http://bugs.python.org/file43617/sax_escape_doc.patch ___ Python tracker ___

[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-07-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> docs@python components: +Documentation nosy: +docs@python type: behavior -> enhancement ___ Python tracker

[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-07-03 Thread Xiang Zhang
Xiang Zhang added the comment: I thought of that too. But the doc doesn't tell you that you can not put any characters in the entities, so I think we should make the implementation right when some unexpected characters are passed in. If you don't like the implementation to be changed, I think

[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-07-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The purpose of xml.sax.saxutils.escape() is escaping characters, that can't be used directly in XML: "&", "<", etc. Quotes are escaped in attributes. It shouldn't be used for replacing ";", because this character itself is used in escapes. There is no a

[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-07-03 Thread Xiang Zhang
Xiang Zhang added the comment: I think this a bug. There should be no override when escape or unescape. Upload a patch to fix this. -- keywords: +patch nosy: +martin.panter, serhiy.storchaka Added file: http://bugs.python.org/file43616/issue27429.patch

[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-07-01 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue27429] xml.sax.saxutils.escape doesn't escape multiple characters safely

2016-06-30 Thread tylerjohnhughes
New submission from tylerjohnhughes: The escape function appears to go through the list in multiple passes, replacing characters as it encounters them on each pass, rather than traversing the source string and replacing matches in the entities dict. This results in invalid escape strings if a