Stefan Behnel added the comment:
After reading up a bit, version "X" should probably be rejected, whereas
"1.[0-9]+" is meant to be allowed also by a 1.0 parser, according to the spec:
https://www.w3.org/TR/REC-xml/#sec-prolog-dtd
"""
When an XML 1.0 processor encounters a document that
Irit Katriel added the comment:
Reproduced in 3.11:
>>> xml.sax.parseString(">> encoding='UTF-8'?>blah", xml.sax.ContentHandler())
>>>
--
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7
___
Python tracker
New submission from Tobias Kuhn:
The first line of an XML file should be something like this:
?xml version='1.0' encoding='UTF-8'?
The XML parser of xml.sax, however, seems to ignore the value of version:
?xml version='X' encoding='UTF-8'?
This should give an error, but it doesn't.
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +christian.heimes, eli.bendersky, scoder
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19832
___
Stefan Behnel added the comment:
If (as I assume) XML 1.1 isn't supported, then rejecting anything but 1.0
would be correct.
Not for Py2.7 anymore, though, I guess, more something to fix for 3.4.
--
___
Python tracker rep...@bugs.python.org