This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2018年12月29日 13:33 by Devika Sondhi, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg332716 - (view) | Author: Devika Sondhi (Devika Sondhi) | Date: 2018年12月29日 13:33 | |
As per XML 1.0 and 1.1 specs, the null character is treated as invalid in an XML doc. (https://en.wikipedia.org/wiki/Valid_characters_in_XML) Shouldn't invalid xml characters be omitted while escaping? The current behavior(tested on Python 3.7) is as follows: >>> from xml.sax.saxutils import escape >>> escape("a\u0000\u0001\u0008\u000b\u000c\u000e\u001fb") 'a\x00\x01\x08\x0b\x0c\x0e\x1fb' |
|||
| msg332725 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2018年12月29日 16:44 | |
This question has come up before. See Issue13648 where it was pointed out that null characters "are forbidden both in raw form *and* in escaped form. So even if they get escaped, they *still* will lead to errors. So there is no point in escaping them." |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:09 | admin | set | github: 79794 |
| 2018年12月29日 16:44:51 | ned.deily | set | status: open -> closed superseder: xml.sax.saxutils.escape does not escapes \x00 nosy: + ned.deily messages: + msg332725 resolution: duplicate stage: resolved |
| 2018年12月29日 13:33:58 | Devika Sondhi | create | |