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 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) * (Python committer) | 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 versions: + Python 3.11, - Python 2.6 |
| 2013年01月31日 07:44:27 | Chenguang.Wang | set | files:
+ w.patch nosy: + Chenguang.Wang messages: + msg181008 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 | |