[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Martin Hosken
Change by Martin Hosken : -- versions: +Python 3.6 ___ Python tracker <https://bugs.python.org/issue36300> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Martin Hosken
New submission from Martin Hosken : The following code fails: >>> lcls = {'w': 100} >>> eval('[w for x in ("hello", "world")]', None, lcls) Traceback (most recent call last): File "", line 1, in File &

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-09 Thread Martin Hosken
Martin Hosken added the comment: Blast. Bugs. Sorry. Missing superclass init call in CommentingTb. I enclose the whole thing again to save editing. Also fixes comment output to give text. from __future__ import print_function import sys import xml.etree.ElementTree as et import

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-09 Thread Martin Hosken
Martin Hosken added the comment: Sorry. This test is rather long because it is 3 tests: from __future__ import print_function import sys import xml.etree.ElementTree as et import xml.etree.cElementTree as cet from io import StringIO teststr = u""" Hello World

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-06 Thread Martin Hosken
New submission from Martin Hosken : This is a regression from python2 by being forced to use cElementTree. I have code that uses iterparse to process an XML file, but I also want to process comments and so I have a comment handling function called by the parser during iterparse. Under