Issue12883
Created on 2011-09-02 10:04 by Michael.Sulyaev, last changed 2022-04-11 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| w.patch | Chenguang.Wang, 2013-01-31 07:44 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg143391 - (view) | Author: Michael Sulyaev (Michael.Sulyaev) | Date: 2011-09-02 10:04 | |
I can get not-well-formed XML output (attribute name must not be empty string):
<?xml version="1.0" encoding="iso-8859-1"?>
<root ="v_for_empty_name" k1="v1"></root>
AttributeImpl must ignore dict entries that may not be cast to valid XML attributes.
Code:
#!/usr/bin/python
from xml.sax.xmlreader import AttributesImpl as Attrs
from xml.sax.saxutils import XMLGenerator as Gen
g = Gen()
a = Attrs(dict([('k1','v1'),('','v_for_empty_name')]))
g.startDocument()
g.startElement('root',a)
g.endElement('root')
g.endDocument()
print
|
|||
| msg180964 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2013-01-30 05:31 | |
bump... |
|||
| msg181008 - (view) | Author: Chenguang Wang (Chenguang.Wang) | Date: 2013-01-31 07:44 | |
I found this problem is still not fixed in the lastest hg version. Seriously? This patch is for the latest v3.4.0a0. |
|||
| msg392406 - (view) | Author: Irit Katriel (iritkatriel) * ![]() |
Date: 2021-04-30 10:10 | |
I don't think the proposed patch is an acceptable solution. It silently skips invalid attributes. It would be ok to either raise an exception or to leave it as it is (junk-in-junk-out). I'm not sure which is better. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:21 | admin | set | github: 57092 |
| 2021-04-30 10:10:21 | iritkatriel | set | nosy:
+ iritkatriel messages:
+ msg392406 |
| 2013-01-31 07:44:27 | Chenguang.Wang | set | files:
+ w.patch nosy:
+ Chenguang.Wang keywords: + patch |
| 2013-01-30 05:31:10 | Ramchandra Apte | set | nosy:
+ Ramchandra Apte messages: + msg180964 |
| 2011-09-02 10:04:02 | Michael.Sulyaev | create | |
