Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93297

Re: How to debug TypeError: required field "lineno" missing from expr?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'exercise': 0.03; 'from:addr:yahoo.co.uk': 0.05; 'method,': 0.07; 'subject:missing': 0.07; 'subject:How': 0.09; 'ast': 0.09; 'creighton': 0.09; 'fixed,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'throw': 0.09; '2.7': 0.13; 'question.': 0.13; 'doc,': 0.16; 'fixing.': 0.16; 'nodes.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject: \n ': 0.16; 'subject:debug': 0.16; 'subject:required': 0.16; 'wrote:': 0.16; 'copied': 0.18; 'example.': 0.18; 'laura': 0.18; 'creates': 0.18; 'language': 0.19; '>>>': 0.20; 'changes': 0.20; 'fix': 0.21; 'trying': 0.22; 'doc': 0.22; 'lawrence': 0.22; 'am,': 0.23; 'code.': 0.23; '2015': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'url:bugs': 0.24; 'sort': 0.25; 'example': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'error': 0.27; 'checking': 0.27; 'converting': 0.27; "doesn't": 0.28; 'node': 0.29; 'terry': 0.29; 'function': 0.30; 'compared': 0.31; 'maybe': 0.31; 'language.': 0.32; 'url:python': 0.33; 'surprised': 0.33; 'another': 0.34; 'subject:?': 0.34; 'needed': 0.34; 'to:addr:python-list': 0.35; 'something': 0.35; 'copying': 0.35; 'being': 0.36; 'url:org': 0.36; 'there': 0.36; 'subject:" ': 0.36; 'subject:: ': 0.37; 'instead': 0.38; 'rather': 0.38; 'received:org': 0.38; 'someone': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'mark': 0.40; 'skip:n 10': 0.63; 'our': 0.64; 'charset:windows-1252': 0.65; 'results': 0.66; 'subject': 0.68; '3.4': 0.84; 'frustrating': 0.84; 'pythonistas,': 0.84; 'received:as9105.com': 0.84; 'received:dsl.as9105.com': 0.84; 'received:dynamic.dsl.as9105.com': 0.84; 'recursively?': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: How to debug TypeError: required field "lineno" missing from expr?
Date Mon, 29 Jun 2015 23:07:28 +0100
References <mmq666$1e7$1@ger.gmane.org> <201506290708.t5T78rhr024655@fido.openend.se> <mmr9g5$66h$1@ger.gmane.org> <mmsbjc$6mc$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 80-44-196-250.dynamic.dsl.as9105.com
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To <mmsbjc$6mc$1@ger.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.173.1435615662.3674.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1435615662 news.xs4all.nl 2885 [2001:888:2000:d::a6]:59470
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:93297

Show key headers only | View raw


On 29/06/2015 21:59, Terry Reedy wrote:
> On 6/29/2015 7:17 AM, Terry Reedy wrote:
>> On 6/29/2015 3:08 AM, Laura Creighton wrote:
>>> In a message of Mon, 29 Jun 2015 02:14:43 +0100, Mark Lawrence writes:
>>>> Purely as an exercise I've been converting Grant Jenks' pypatt[1] from
>>>> 2.7 to 3.4.  I've managed to sort out most of the required changes by
>>>> checking on what I can see with an AST pretty printer[2].  So it's
>>>> rather frustrating to have the compile stage throw the error given in
>>>> the subject line.
>>>
>>> Are you trying to use ast.copy_location recursively somewhere?
>>> http://bugs.python.org/issue3530   Maybe you have found something else
>>> that doesn't work recursively?
>
> The issue is that copy_location is not recursive and does not fix
> children of the node being fixed, whereas the example method, copied
> from the NodeTransformer doc, creates 3 new nodes, not just 1, that need
> fixing.  I reopened the issue as a doc issue to fix the example and
> recommend the use of recursive fix_missing_locations() instead of the
> non-recursive copy_location.
>
> The only other location-related function in ast is increment_lineno,
> which also works on multiple nodes.  I would not be surprised is Mark's
> issue results from Mark or someone else copying the bad doc example.
>

FTR there is no call to copy_location in Grant's existing code.  Whether 
or not one is actually needed in 3.4 when compared to 2.7 is another 
question.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to debug TypeError: required field "lineno" missing from expr? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-29 23:07 +0100

csiph-web