[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Stefan Behnel


Stefan Behnel  added the comment:

As a work-around, you can provide your own XML declaration (or not) and pass 
"xml_declaration=False" into ElementTree.write() to prevent it from adding one. 
UTF-8 encoded XML is ok without such a declaration.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Stefan Behnel


Stefan Behnel  added the comment:

I concur with Serhiy that the bug is in OpenCV (or its parser project), and 
that it is best solved there. Otherwise, we would create a dependency on a 
future/recent Python version for exporting XML to it.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Then report a bug to OpenCV.

I do not think that changing quotation marks in the xml declaration will help 
much, since likely that parser has other flaws (for example what about using 
single quotes for attributes?).

Changing quotation marks for sure will break many tests, in particularly our 
own tests. Needed a stronger reason to overcome this.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-11 Thread Johann Krauter


Johann Krauter  added the comment:

The xml parser of OpenCV (3.4.5) in C++ is not able to load such xml file.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Stefan Behnel


Stefan Behnel  added the comment:

While I do understand the interest in a bit more visual consistency (and, 
lacking further input, I assume that this is the OP's "problem"), it really is 
at best a purely visual improvement with the potential to break code and/or 
tests out there. I'd rather not make that change.

FWIW, lxml also uses single quotes in the XML declaration (originally following 
ElementTree), but double quotes by default for the rest, except for attributes 
that contain double quotes (but no single quotes). Any XML parser in the world 
is able to deal with that (since otherwise, it's not an XML parser). Nothing is 
broken here.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+0 

I support making this change, if only to keep the quoting convention consistent 
with how we quote attributes.  Also, use of double quotes seems to be the norm. 
 I made a brief informal survey of XML samples from multiple sources including 
DocBook, MS Excel, RSS feeds, the W3Schools examples, and various XML tutorials 
-- the only exception to double quotes was a NOAA weather feed.  The XML spec 
itself shows a preference for double quotes in its examples.

--
nosy: +rhettinger

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Both quotes are valid. See 
https://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eli.bendersky, scoder, serhiy.storchaka

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Johann Krauter


New submission from Johann Krauter :

I have the problem, that a xml file is save with the following xml declaration: 
 
instead of 


I would propose to change the line number 769 in the ElementTree.py to: 
write("\n" % (
declared_encoding,))

--
components: XML
files: ElementTree.py
messages: 337463
nosy: Photoniker
priority: normal
severity: normal
status: open
title: xml ElementTree quotation marks of xml version string
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48193/ElementTree.py

___
Python tracker 

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