classification
Title: ElementTree: Document handling processing instructions
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Claudiu.Popa, docs@python, eli.bendersky, eric.araujo, ezio.melotti, georg.brandl, nikratio, python-dev, scoder
Priority: normal Keywords: patch

Created on 2014-01-24 04:53 by nikratio, last changed 2014-04-04 07:01 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
xml.etree_r1.patch nikratio, 2014-01-24 04:53 review
etree-testcases.patch nikratio, 2014-01-26 01:33 review
issue20375.diff nikratio, 2014-03-26 00:32 review
issue20375.diff nikratio, 2014-03-31 16:37 review
issue20375.diff nikratio, 2014-04-03 01:46 review
issue20375.diff nikratio, 2014-04-03 01:58 review
Messages (13)
msg209036 - (view) Author: Nikolaus Rath (nikratio) * Date: 2014-01-24 04:53
(This issue was branched of from #9521).

When parsing XML, etree currently skips over all processing instructions and comments. However, both can be represented in the tree and are also written out when generating XML.

The attached patch documents this (IMO surprising) behavior.
msg209265 - (view) Author: Nikolaus Rath (nikratio) * Date: 2014-01-26 01:33
I've also attached a testcase to confirm that the docpatch reflects current behavior, and to make sure that anticipated enhancements in Python 3.5 behave in a backwards compatible way.
msg214076 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-03-19 11:03
Hello. I left a couple of comments on Rietveld.
msg214803 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2014-03-25 10:33
I think you attached the wrong file.
msg214873 - (view) Author: Nikolaus Rath (nikratio) * Date: 2014-03-26 00:32
Indeed I did, here's the correct patch. Thanks!
msg215235 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2014-03-31 13:25
The patch appears to contain code (tests) along with the documentation. Is this intended? This issue is not tagged properly if it is.

I'd suggest to split them to separate patches.
msg215250 - (view) Author: Nikolaus Rath (nikratio) * Date: 2014-03-31 16:37
Yes, the new testcases were deliberately included. I submitted the patch prior to the 3.4 release, am I right that at that point this wouldn't have been a problem?

I have attached a new patch containing just the doc changes. I hope that's still acceptable for inclusion in 3.4 (and maybe 3.3? not sure if there'll be another bugfix release).
msg215381 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2014-04-02 13:27
I left some comments in Rietveld.

There shouldn't be a problem getting these into 3.4 too - doc changes are usually excempt from most restrictions.
msg215415 - (view) Author: Nikolaus Rath (nikratio) * Date: 2014-04-03 01:46
Thanks for your feedback! I've attached an updated patch.
msg215445 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-04-03 13:15
New changeset 871278b87c62 by Eli Bendersky in branch '3.4':
Issue #20375: Clarify ET's parsing of comments and processing instructions.
http://hg.python.org/cpython/rev/871278b87c62

New changeset 5c3166ec80e1 by Eli Bendersky in branch 'default':
Issue #20375: Clarify ET's parsing of comments and processing instructions.
http://hg.python.org/cpython/rev/5c3166ec80e1
msg215446 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2014-04-03 13:16
Thanks. Doc patch committed with some slight rewording.

Would you like to prepare a separate patch for the tests, default branch only this time?
msg215465 - (view) Author: Nikolaus Rath (nikratio) * Date: 2014-04-03 20:19
Thanks for the commit!

My intention is to fix the behavior itself for 3.5 (see issue 9521), so I think adding testcases for the old behavior in the meantime isn't necessary.
msg215471 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2014-04-03 21:39
On Thu, Apr 3, 2014 at 1:19 PM, Nikolaus Rath <report@bugs.python.org>wrote:

>
> Nikolaus Rath added the comment:
>
> Thanks for the commit!
>
> My intention is to fix the behavior itself for 3.5 (see issue 9521), so I
> think adding testcases for the old behavior in the meantime isn't necessary.
>

Fair enough. So you can close this issue, then.
History
Date User Action Args
2014-04-04 07:01:28berker.peksagsetresolution: fixed
stage: resolved
2014-04-04 00:05:10nikratiosetstatus: open -> closed
2014-04-03 21:39:15eli.benderskysetmessages: + msg215471
2014-04-03 20:19:02nikratiosetmessages: + msg215465
2014-04-03 13:16:19eli.benderskysetmessages: + msg215446
versions: - Python 3.4
2014-04-03 13:15:29python-devsetnosy: + python-dev
messages: + msg215445
2014-04-03 01:58:58nikratiosetfiles: + issue20375.diff
2014-04-03 01:46:35nikratiosetfiles: + issue20375.diff

messages: + msg215415
2014-04-02 13:27:23eli.benderskysetmessages: + msg215381
2014-03-31 16:37:57nikratiosetfiles: + issue20375.diff

messages: + msg215250
versions: + Python 3.4
2014-03-31 13:25:21eli.benderskysetmessages: + msg215235
versions: + Python 3.5, - Python 2.7, Python 3.3, Python 3.4
2014-03-26 00:32:12nikratiosetfiles: + issue20375.diff

messages: + msg214873
2014-03-25 21:06:28nikratiosetfiles: - issue20951.diff
2014-03-25 10:33:37scodersetmessages: + msg214803
2014-03-20 02:44:58nikratiosetfiles: + issue20951.diff
2014-03-19 11:03:04Claudiu.Popasetnosy: + Claudiu.Popa
messages: + msg214076
2014-01-26 01:33:09nikratiosetfiles: + etree-testcases.patch

messages: + msg209265
2014-01-24 04:53:36nikratiocreate