[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I did some tests, creating an element ('elem') that contains two adjacent text nodes ('text'). With my latest patch the prettyprint is: ?xml version=1.0 ? elem text text /elem Here both the text nodes are printed on a

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-18 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 7262f8f276ff by Ezio Melotti in branch '2.7': #4147: minidom's toprettyxml no longer adds whitespace around a text node when it is the only child of an element. Initial patch by Dan Kenigsberg.

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I committed my patch with a few more tests. This should be fixed now. Thanks for the report and the patch! -- resolution: - fixed stage: commit review - committed/rejected status: open - closed

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Yeah, I just haven't found time to do the revert yet (my first naive attempt using hg commands failed and I haven't found time to figure it out or do the reverse-patch method). -- ___ Python

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-15 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: - ezio.melotti nosy: +benjamin.peterson, georg.brandl priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-15 Thread Peter Funk
Changes by Peter Funk p...@users.sourceforge.net: -- nosy: +pefu ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147 ___ ___ Python-bugs-list

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Here is a new patch based on Dan's last patch. Correct me if I'm wrong, but it seems to me that it's not possible for a node to have only text-nodes as children and yet have more than one child; i.e. you can't have two or more adjacent

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-15 Thread Dan Kenigsberg
Dan Kenigsberg dan...@redhat.com added the comment: Technically, adjacent Text nodes are not illegal, but preserving this oddity in pretty-print is impossible. It is perfectly fine to pretty-print only the simple case of len()==1. -- ___ Python

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-14 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147 ___

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-11-14 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: I would revert this patch (leaving several test cases though) until a proper fix is available. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-02 Thread Dan Kenigsberg
Dan Kenigsberg dan...@redhat.com added the comment: Oh dear. Thanks, Enzio, for pointing out that former patch is wrong. It is also quite naive, since the whole NATURE of toprettyprint() is to add whitespace to Text nodes. Tomas Lee's

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-02 Thread Dan Kenigsberg
Dan Kenigsberg dan...@redhat.com added the comment: btw, http://www.w3.org/TR/xml/#sec-white-space is a bit vague on how should a parser deal with whitespace, and seems to allow non-preservation of text nodes. Preserving simple text nodes is allowed, too, and is more polite to applications

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-02 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Heh, you happened to post your patch at a time when I wanted something to do as a break from something I didn't want to do...and I *thought* I understood the problem, after reading the various links. But clearly I didn't. We don't have

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-01 Thread Dan Kenigsberg
Dan Kenigsberg dan...@redhat.com added the comment: Here's another take on fixing this bug, with an accompanying unit test. Personally, I'm monkey-patching xml.dom.minidom in order to avoid it, but please consider fixing it properly upstream. -- Added file:

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-01 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 086ca132e161 by R David Murray in branch '3.2': #4147: minidom's toprettyxml no longer adds whitespace to text nodes. http://hg.python.org/cpython/rev/086ca132e161 New changeset fa0b1e50270f by R David Murray in

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-01 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 406c5b69cb1b by R David Murray in branch '2.7': #4147: minidom's toprettyxml no longer adds whitespace to text nodes. http://hg.python.org/cpython/rev/406c5b69cb1b -- ___

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-01 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: This looks correct to me, and it tested out fine on the test suite (and the provided test failed without the provided fix), so I committed it. I have a small concern that the change in output might be a bit radical for a bug fix

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2011-10-01 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: The patch seems wrong to me: d = minidom.parseString('foobarAAA/barBBBbarCCC/bar/foo') print(d.toprettyxml()) ?xml version=1.0 ? foo barAAA/bar BBB barCCC/bar /foo Even if the newlines are gone, the indentation

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2010-11-24 Thread anatoly techtonik
Changes by anatoly techtonik techto...@gmail.com: -- nosy: +techtonik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147 ___ ___ Python-bugs-list

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2010-11-24 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: This one is bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147 ___ ___

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2010-11-03 Thread Tod Olson
Changes by Tod Olson t...@uchicago.edu: -- nosy: +tod ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147 ___ ___ Python-bugs-list mailing list

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2010-07-26 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: @Thomas: could you provide a unit test to go with your patch. -- nosy: +BreamoreBoy stage: - unit test needed versions: +Python 3.2 -Python 2.7 ___ Python tracker rep...@bugs.python.org

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2010-04-25 Thread Dan Kenigsberg
Changes by Dan Kenigsberg dan...@redhat.com: -- nosy: +danken ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4147 ___ ___ Python-bugs-list mailing

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2010-04-03 Thread Michel Samia
Michel Samia m.sa...@seznam.cz added the comment: Could you please apply that patch? People are starting to use non-standard libraries to process xml files because of this issue for example this man is using lxml or pyxml:

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2009-07-16 Thread Jim Garrison
Jim Garrison jgarri...@troux.com added the comment: To clarify: ... it should never alter the content of (i.e. insert whitespace into) existing text elements that contain non-whitespace characters. -- ___ Python tracker rep...@bugs.python.org

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2009-07-15 Thread Jim Garrison
Jim Garrison jgarri...@troux.com added the comment: Also needed here. While pretty-printing should be able to insert non-significant whitespace BETWEEN xml elements, it should never alter the content of (i.e. insert whitespace into) existing text elements. -- nosy: +jgarrison

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2008-10-19 Thread Thomas Lee
New submission from Thomas Lee [EMAIL PROTECTED]: For XML elements containing only text data, it would be nice if toprettyxml could omit the whitespace it normally injects before after the text, e.g. person first-name Bob /first-name /person Becomes: person