Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Enjoys Math Newsgroups: comp.lang.python Subject: `exec`-based routine crashes app upon migration from 3.4.3 to python 3.5.2. Date: Thu, 28 Jul 2016 08:47:21 -0700 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de XoEJxNMpZQfyCxwlinoiQwjggdTPORuWREPH1Z+b56mQ== 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; 'none,': 0.05; 'none:': 0.05; 'one?': 0.05; 'debugger': 0.09; 'obj': 0.09; 'throws': 0.09; 'def': 0.13; 'subject:python': 0.14; 'breakpoints': 0.16; 'keyerror': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:`': 0.16; 'subject:based': 0.16; 'wingware': 0.16; 'app': 0.16; 'skip:` 20': 0.18; 'thanks.': 0.18; 'exec': 0.22; 'function:': 0.22; "i've": 0.25; 'message-id:@mail.gmail.com': 0.27; 'crash': 0.29; 'skip:_ 10': 0.32; 'received:google.com': 0.35; 'there': 0.36; 'to:addr:python-list': 0.36; 'skip:o 20': 0.38; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'back': 0.62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=JEgTpsAWg921velMx60TlfFWiNQR08x+OGby9jvpScE=; b=PoW1FLe+R+J7n3lwMLnDRv+HACaA8dxTzeaQ+fg+SnnHrZM2Bcqz3J7w3u8tvNNPdM auahjeMmjOwni06ya/nt4TTTzJacj9Ena8nrMuhknpnIzP5PwqMlV2UstCZm9n9McHd/ 8Y4ooXUJNFBhtGx3/k4Vk93cfj5iiR3Osj/+cicecxHBetAE9RwnZPGa15V/Hlgo4s01 w2C8NWu/urPFDf6F7CLHT8si3DTrzxIHVNTNCriFAebLqS6DlUCaZ0jsFRzeAbAsZ3ls qWs5UMX6sFP6xhT+MmHNHrTfZ5JnTz6I6QzECgL28EVqCQWKV6075ptTK7ZzhoLzOj4d pYEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=JEgTpsAWg921velMx60TlfFWiNQR08x+OGby9jvpScE=; b=C3+XyDthGbyfCnfVVTQFAjQEUyfrJAqJ3wr2PjjlHyTOzB+0jlX6xZ4IjkMEHOmlXr AoxQuHV/VFOAILMEXFkk0sRtRFUpl6nnyQkbFO8wCFhXiNvztL01s/hOqPW30O/74QQF DmSoTDk5T+s+HI+RbMlwPCBJODg+IwbBxUSjX0u72ZWTgTRR17pXrcMN8k2soRddKpX8 Vbd2QiBPlRxPYFsMIFoxq/Z/2/BVBfeCMZNHAaWmwbUz3fl2Z0i/PRI+h8CGSi6+YwrR xbesKlDXCGbCyDkWnWWmFIvCAyhsJkdoW+dsPct0Izk/Ntr7LRLXMZ/hpbk0ndl4Gti2 hxNg== X-Gm-Message-State: AEkoouvh/zKn4Q4O7Kq47cm6TQtWMZHruiuXTJqqBd7gcKbzPmRjWDLIlV7aVn/MB0PfeZ8M5gHwmVnN5zfhDg== X-Received: by 10.202.206.66 with SMTP id e63mr19600889oig.136.1469720841660; Thu, 28 Jul 2016 08:47:21 -0700 (PDT) X-Mailman-Approved-At: Thu, 28 Jul 2016 14:25:37 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com comp.lang.python:111988 I've manually set breakpoints and traced this app crash back to this function: def loadLSobjsOfType(self, objType, listJ): if listJ != None: for objJ in listJ: _locals = locals() exec('obj = ' + objType + '(self)', None, _locals) obj = _locals['obj'] obj.loadJson(objJ) self.addLSobjOfType(objType, obj) when breakpoints are set on `obj=_locals['obj']` my wingware debugger kicks in and throws a KeyError exeption. So what's the proper way to get the return value of an exec call when there is one? Thanks. Regards, EM