bpo-9883: writexml on a DocumentFragment acts on children by arp11 · Pull Request #1745 · python/cpython · GitHub
Skip to content

bpo-9883: writexml on a DocumentFragment acts on children - #1745

Closed
arp11 wants to merge 1 commit into
python:masterfrom
arp11:9883
Closed

arp11 wants to merge 1 commit into
python:masterfrom
arp11:9883

Conversation

@arp11

@arp11 arp11 commented May 23, 2017

Copy link
Copy Markdown

Adds writexml method as well as a test to make sure it works. Since there was no attribute previously, the only behavior change is if a client introspects the available attributes on this node type specifically. There seems to be no other test coverage for writexml whatsoever.

https://bugs.python.org/issue9883

@the-knights-who-say-ni

Copy link
Copy Markdown

@mention-bot

Copy link
Copy Markdown

@arp11, thanks for your PR! By analyzing the history of the files in this pull request, we identified @loewis, @freddrake and @Yhg1s to be potential reviewers.

@BoboTiG BoboTiG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Thank you for the patch. I locally checked and it is working fine.
Could you update the PR to include the news file as well?

Comment thread Lib/test/test_minidom.py
dom, orig, c1, c2, c3, frag = self._create_fragment_test_nodes()
written = StringIO()
frag.writexml(writer=written, indent=' ', addindent='-', newl=':')
self.assertEquals(written.getvalue(), ' foo: bar: bat:')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use self.assertEqual() (without the trailing s).

Comment thread Lib/test/test_minidom.py
dom.unlink()

def testWriteXMLChildFragment(self):
dom, orig, c1, c2, c3, frag = self._create_fragment_test_nodes()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could delete unused vars by using dom, *_, frag = ....

@brettcannon brettcannon reopened this Mar 26, 2019
@brettcannon brettcannon added the type-feature A feature request or enhancement label Mar 26, 2019
@freddrake

freddrake commented Apr 3, 2019

Copy link
Copy Markdown
Member

I'm not sure why this has languished so long, but I don't remember reading the patch when I first saw bpo-9883 (though it was present).

@arp11: Are you willing to update the patch to resolve the conflicts, even though this has aged a bit?

@csabella

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants