Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'failing': 0.05; 'subject:missing': 0.07; 'subject:How': 0.09; 'ast': 0.09; 'creighton': 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; 'jan': 0.11; '2.7': 0.13; 'skip:f 30': 0.15; '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; 'laura': 0.18; 'changes': 0.20; 'trying': 0.22; 'doc': 0.22; 'lawrence': 0.22; 'am,': 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; 'maybe': 0.31; 'code': 0.31; 'skip:p 30': 0.32; 'url:python': 0.33; 'subject:?': 0.34; 'to:addr:python- list': 0.35; 'something': 0.35; 'url:org': 0.36; 'there': 0.36; 'closing': 0.36; 'subject:" ': 0.36; 'should': 0.37; 'subject:: ': 0.37; 'missing': 0.37; 'rather': 0.38; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'mark': 0.40; 'field': 0.60; 'subject': 0.68; 'frustrating': 0.84; 'recursively?': 0.84; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: How to debug TypeError: required field "lineno" missing from expr? Date: Mon, 29 Jun 2015 07:17:24 -0400 References: <201506290708.t5T78rhr024655@fido.openend.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 In-Reply-To: <201506290708.t5T78rhr024655@fido.openend.se> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1435576655 news.xs4all.nl 2944 [2001:888:2000:d::a6]:37648 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93286 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? I do not understand the closing of this issue given that a) the failing part of the code is copied from the doc (3.4 has the same in the docstring) and b) that there is no recursion for a single node ast, which the example should be. The error message comes from F:\Python\dev\34\Python\Python-ast.c: 3752: PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from stmt"); -- Terry Jan Reedy