Serhiy Storchaka added the comment:
Patch updated (tostring() and tostringlist() refet to write() about
short_empty_elements parameter). Perhaps descriptions of encoding and method
parameters should not be repeated too?
Why do you force short_empty_elements to be keyword only?
Because
Roundup Robot added the comment:
New changeset 58168d69b496 by Eli Bendersky in branch 'default':
Close #14377: Add a new parameter to ElementTree.write and some module-level
http://hg.python.org/cpython/rev/58168d69b496
--
nosy: +python-dev
resolution: - fixed
stage: patch review -
Éric Araujo added the comment:
I don’t think a space before the slash should be added. (It was common in the
days of XHTML 1 because of an SGML parsing hack.)
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
Eli Bendersky added the comment:
On Sun, Jan 13, 2013 at 6:09 AM, Éric Araujo rep...@bugs.python.org wrote:
Éric Araujo added the comment:
I don’t think a space before the slash should be added. (It was common in
the days of XHTML 1 because of an SGML parsing hack.)
Ok, will fix.
Serhiy Storchaka added the comment:
I think Éric means different spaces, spaces in empty tags (empty / vs
empty/). I don't know what the standard says about this. It should a
separated issue.
As for line continuations in docs, in all cases where they are occurred, a
space used before a
Eli Bendersky added the comment:
OK, thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
___
Python-bugs-list mailing list
Eli Bendersky added the comment:
Ariel, are you interested in pursuing this issue?
Serhiy, I see you assigned this to yourself - would you like to submit a patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
Serhiy Storchaka added the comment:
Serhiy, I see you assigned this to yourself - would you like to submit a
patch?
Not right now. This is low priority for me too. But I want to see this feature
in 3.4.
--
___
Python tracker
Serhiy Storchaka added the comment:
Well, here is a patch which add short_empty_elements flag (as for XMLGenerator)
to write(), tostring() and tostringlist() methods of ElementTree.
--
stage: needs patch - patch review
___
Python tracker
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file28678/etree_short_empty_elements.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
stage: patch review - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
___
Eli Bendersky eli...@gmail.com added the comment:
I see no harm in modifying the signature of the private _serialize_* functions
to accept another argument or dict of options.
--
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka storch...@gmail.com added the comment:
xml.sax.saxutils.XMLGenerator constructor has a parameter short_empty_elements
(False by default). For consistency new ElementTree.write parameter must have
the same name (True by default for compatibility).
--
Ariel Poliak apol...@gmail.com added the comment:
Ideally, this would be taken care by the _serialize_xml() with a parameter
specified when called from within write().
However, the signature for the _serialize_xml() function cannot be changed, as
it needs to match the signature for the rest
Changes by Serhiy Storchaka storch...@gmail.com:
Added file:
http://bugs.python.org/file26010/ElementTree-force_long_tags-v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
Serhiy Storchaka storch...@gmail.com added the comment:
I don't think that the three new fields in each Element is a suitable price for
this very rare used feature.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
Eli Bendersky eli...@gmail.com added the comment:
Agree with Serhiy. Why are these flags required in Element?
Also, I'm moving this to 3.4 since the patch came too late in the 3.3 process -
the first beta is very soon, after which we prefer not to add new features.
--
priority: normal
Ariel Poliak apol...@gmail.com added the comment:
Made a new patch.
This one contains changes for xml.etree.ElementTree for cpython, jython, and
stackless.
It also contains changes to Modules/_elementtree.c for cpython and stackless.
The changes within this patch do not change the signature
Eli Bendersky eli...@gmail.com added the comment:
Any progress, or can this issue be closed?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
Eli Bendersky eli...@gmail.com added the comment:
Hello, thanks for the patch!
Since this is a new feature, I suggest discussion it on the python-ideas list
first.
Next, as for your patch:
1. What is ElementTree_new.py?
2. Note that new features have to be added to in-development versions of
Ariel Poliak apol...@gmail.com added the comment:
To answer eli.bendersky's questions:
1. That's just the name of the file with my changes in it.
I pulled the original file from Hg, copied it to ElementTree_new.py, made my
changes, and created a patch from the two.
2. I'm not very familiar
Serhiy Storchaka storch...@gmail.com added the comment:
-if long_xml or text or len(elem):
+if text or len(elem) or long_xml:
Use alternatives in order of decreasing probability.
--
nosy: +storchaka
___
Python tracker
Changes by Ned Deily n...@acm.org:
--
nosy: +eli.bendersky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14377
___
___
Python-bugs-list mailing
New submission from Ariel Poliak apol...@gmail.com:
As it stands in Hg, when the write() method of an xml.etree.ElementTree object
is called, and a tag within the XML tree has no child tags or defined text, the
tag is written using the short notation tag ... /.
Whether or not the short
25 matches
Mail list logo