New submission from Adam Bielański <abg...@gmail.com>: There's a bug in module lib\pstats.py, line 150.
Let me paste a little piece of surrounding code: class Stats: (....) def add(self, *arg_list): if not arg_list: return self if len(arg_list) > 1: self.add(*arg_list[1:]) #Line 150, the problem is right here! other = arg_list[0] (... do some processing with first item from arg_list ...) This is the code for adding profiling stats from multiple files (names are on arg_list) so that they can be displayed in cumulated and readable form. As you can see it chops off the first item from the list and then uses recursion to process the rest of it. It's no wonder then that when you profiled a little too many function calls, you're bound to see RuntimeError with 'maximum recursion depth exceeded' message when you try using this. IMO this should be done with iteration instead, like: def add(self, *arg_list): if not arg_list: return self for other in arg_list: #Preserved variable name only for sake of comparison with previous snippet (... do some processing with each item from arg_list, merging results in some rightful manner ...) You can find a patch for this issue in the attachment. ---------- components: Library (Lib) files: pstats.patch keywords: patch messages: 119311 nosy: Adam.Bielański priority: normal severity: normal status: open title: maximum recursion depth exceeded in lib\pstats.py type: crash versions: Python 2.6 Added file: http://bugs.python.org/file19322/pstats.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10166> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com