[issue35428] xml.etree.ElementTree.tostring violates W3 standards allowing encoding='unicode' without error

2019-01-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35428] xml.etree.ElementTree.tostring violates W3 standards allowing encoding='unicode' without error

2018-12-07 Thread Stefan Behnel


Stefan Behnel  added the comment:

What exactly is the problem here? encoding='unicode' will never appear in the 
XML declaration, and thus will never be "presented to XML processors". It is up 
to the user to deal with encodings in this case, which I think is fine. It's 
them who asked for the non-encoded result, after all.

The XML spec does not forbid XML tools to grow convenience features, and that's 
what I think this is. Is there any problem with this feature, besides not being 
covered by the XML spec?

--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35428] xml.etree.ElementTree.tostring violates W3 standards allowing encoding='unicode' without error

2018-12-06 Thread EZ

New submission from EZ :

The documentation[0] for 3.x of xml.etree.ElementTree.tostring is quite clear:

> Use encoding="unicode" to generate a Unicode string.

See also the creation of the problem:
https://bugs.python.org/issue10942

This is a violation of W3 standards, referenced by the ElementTree 
documentation[1] claiming it must conform to these standards, which state:

...it is a fatal error for an entity including an encoding declaration to be 
presented to the XML processor in an encoding other than that named in the 
declaration

Encoding for 'unicode' does not appear in the named declarations 
(https://www.iana.org/assignments/character-sets/character-sets.xhtml) 
referenced by the same documentation[1].

Handling of a fatal error, must, in part: 

Once a fatal error is detected, however, the processor MUST NOT continue normal 
processing (i.e., it MUST NOT continue to pass character data and information 
about the document's logical structure to the application in the normal way)

[0] https://docs.python.org/3.2/library/xml.etree.elementtree.html
[1] The encoding string included in XML output should conform to the 
appropriate standards. For example, “UTF-8” is valid, but “UTF8” is not. See 
http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl and 
http://www.iana.org/assignments/character-sets.

--
components: XML
messages: 331242
nosy: Zim
priority: normal
severity: normal
status: open
title: xml.etree.ElementTree.tostring violates W3 standards allowing 
encoding='unicode' without error
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com