Bugs item #1516184, was opened at 2006-07-03 10:39 Message generated for change (Comment added) made by dq_searchlores You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1516184&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Don Quijote (dq_searchlores) Assigned to: Phillip J. Eby (pje) Summary: inspect.py: still infinite recursion inspecting frames Initial Comment: Using python 2.5 beta 1 on Windows XP, and py2exe 0.6.5. After packing and compressing a project via py2exe, there's still an infinite recursion involving functions getsourcefile, getmodule and getabsfile in module inspect.py. I was able to fix this infinite recursion by 1) changing the declaration of getabsfile & getmodule to: def getabsfile(object, filename=None): def getmodule(object, filename=None): 2) including the "filename" parameter in all calls to getabsfile inside of function getmodule. 3) having getabsfile return the absolute and normalized filename if not null. Perhaps this change helps to clean up the 'ugliness' introduced in version 45822. Kind regards, Don Quijote ---------------------------------------------------------------------- >Comment By: Don Quijote (dq_searchlores) Date: 2006-07-20 14:36 Message: Logged In: YES user_id=1118684 A possible simple fix: In function getabsfile(), test _filename explicitly with: ...abspath(_filename is not None or getsourcefile... In your case, _filename is ''. This is the value returned from getfile(), when using attribute .co_filename from the code object. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-07-20 08:59 Message: Logged In: YES user_id=33168 Confirmed this is bad: inspect.getmodule(compile('a=10','','single')) ---------------------------------------------------------------------- Comment By: Connelly (connelly) Date: 2006-07-20 08:40 Message: Logged In: YES user_id=1039782 I tried pje's Revision 50526 and this still causes infinite recursion with: >>> inspect.getmodule(compile('a=10','','single')) ---------------------------------------------------------------------- Comment By: Phillip J. Eby (pje) Date: 2006-07-10 21:05 Message: Logged In: YES user_id=56214 Fixed in revision 50526. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-07-05 03:53 Message: Logged In: YES user_id=33168 Phillip any comments? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1516184&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com