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

2011-11-18 Thread Ezio Melotti
Ezio Melotti 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 ___ Python tracker

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

2011-11-18 Thread Roundup Robot
Roundup Robot 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. http://hg.python.org/cpython/rev/7262f8f276ff New ch

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

2011-11-18 Thread Ezio Melotti
Ezio Melotti 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: text text Here both the text nodes are printed on a newline and they are indented. With your patch it sho

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

2011-11-15 Thread Dan Kenigsberg
Dan Kenigsberg 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 tracker

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

2011-11-15 Thread Ezio Melotti
Ezio Melotti 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 text nodes, because they w

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

2011-11-15 Thread Peter Funk
Changes by Peter Funk : -- nosy: +pefu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/ma

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

2011-11-15 Thread Ezio Melotti
Changes by Ezio Melotti : -- assignee: -> ezio.melotti nosy: +benjamin.peterson, georg.brandl priority: normal -> release blocker ___ Python tracker ___ _

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

2011-11-15 Thread R. David Murray
R. David Murray 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 tracker

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

2011-11-14 Thread anatoly techtonik
anatoly techtonik added the comment: I would revert this patch (leaving several test cases though) until a proper fix is available. -- ___ Python tracker ___ ___

[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 : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

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

2011-10-02 Thread R. David Murray
R. David Murray 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 someone who has step

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

2011-10-02 Thread Dan Kenigsberg
Dan Kenigsberg 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 reading the pretty

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

2011-10-02 Thread Dan Kenigsberg
Dan Kenigsberg 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 http://bugs.python.org/file11832/minidom-toprettyxml-01.patch made an effor

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

2011-10-01 Thread Ezio Melotti
Ezio Melotti added the comment: The patch seems wrong to me: >>> d = minidom.parseString('AAABBBCCC') >>> print(d.toprettyxml()) AAA BBB CCC Even if the newlines are gone, the indentation before the closing tag is preserved. Also a newline is added before the te

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

2011-10-01 Thread R. David Murray
R. David Murray 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 release, but it does seem to

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

2011-10-01 Thread Roundup Robot
Roundup Robot 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 -- ___ Python tracker

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

2011-10-01 Thread Roundup Robot
Roundup Robot 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 branch 'default': merge #4147: minid

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

2011-10-01 Thread Dan Kenigsberg
Dan Kenigsberg 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: http://bugs.python.org/file23286/minidom-Text

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

2010-11-24 Thread anatoly techtonik
anatoly techtonik added the comment: This one is bug. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

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

2010-11-24 Thread anatoly techtonik
Changes by anatoly techtonik : -- nosy: +techtonik ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

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

2010-11-03 Thread Tod Olson
Changes by Tod Olson : -- nosy: +tod ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

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

2010-07-26 Thread Mark Lawrence
Mark Lawrence 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

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

2010-04-25 Thread Dan Kenigsberg
Changes by Dan Kenigsberg : -- nosy: +danken ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

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

2010-04-03 Thread Michel Samia
Michel Samia 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: http://ronrothman.com/public/leftbraned/xml-dom-minidom-toprettyxml-and-silly-whitespace/

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

2009-07-16 Thread Jim Garrison
Jim Garrison 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 _

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

2009-07-15 Thread Jim Garrison
Jim Garrison 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. Bob Becomes: Bob >From what I understand the handling of whites