-
-
Save philmayers/387597c7407ab98f159426cea5f44a69 to your computer and use it in GitHub Desktop.
lxml & twisted trial crash repro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import io | |
from lxml import etree | |
def gen(f): | |
with etree.xmlfile(f, encoding='us-ascii', buffered=False) as xf: | |
xf.write_declaration() | |
with xf.element('tag'): | |
try: | |
while True: | |
el = (yield) | |
xf.write(el) | |
except GeneratorExit: | |
pass | |
g1 = gen(io.BytesIO()) | |
next(g1) | |
g2 = gen(io.BytesIO()) | |
next(g2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment