Pythoscope crashes on point of entry containing recursive structure

Bug #1341352 reported by Will Hartzell-Baird on 2014-07-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pythoscope
Undecided
Unassigned

Bug Description

Upon running pythoscope with a point of entry that results in a recursive structure (that is, a structure that indirectly contains a reference to itself), pythoscope hits the maximum recursion limit and dies.

Here is a portion of the stack trace (which is rather lengthy, under the circumstances):
Traceback (most recent call last):
  File "C:\Python27\Scripts\pythoscope-script.py", line 9, in <module>
    load_entry_point('pythoscope==0.4.3', 'console_scripts', 'pythoscope')()
  File "C:\Python27\lib\site-packages\pythoscope\__init__.py", line 190, in main
    generate_tests(args, force, template)
  File "C:\Python27\lib\site-packages\pythoscope\__init__.py", line 119, in generate_tests
    add_tests_to_project(project, modules, template, force)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 985, in add_tests_to_project
    generator.add_tests_to_project(project, modnames, force)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 705, in add_tests_to_project
    self._add_tests_for_module(module, project, force)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 720, in _add_tests_for_module
    for test_case in self._generate_test_cases(module):
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 725, in _generate_test_cases
    test_case = self._generate_test_case(object, module)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 731, in _generate_test_case
    method_descriptions = resolve_name_duplicates(sorted_test_method_descriptions(self._generate_test_method_descriptions(object, module)))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 546, in sorted_test_method_descriptions
    return sorted(descriptions, key=lambda md: md.name)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 798, in _generate_test_method_descriptions_for_class
    yield self._method_description_from_user_object(user_object)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 832, in _method_description_from_user_object
    assigned_names = assign_names_for(user_object)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 398, in assign_names_for
    return assign_names_to_objects(objects_worth_naming(get_objects_usage_counts(context)))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 329, in get_objects_usage_counts
    return dict(counted(get_contained_objects(context)))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 305, in get_contained_objects
    return get_contained_objects(calls)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 291, in get_contained_objects
    return flatten(map(get_contained_objects, obj))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 311, in get_contained_objects
    return get_those_and_contained_objects(obj.input.values() + [output])
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 322, in get_those_and_contained_objects
    return objs + get_contained_objects(objs)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 291, in get_contained_objects
    return flatten(map(get_contained_objects, obj))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 298, in get_contained_objects
    return get_those_and_contained_objects(obj.contained_objects)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 322, in get_those_and_contained_objects
    return objs + get_contained_objects(objs)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 291, in get_contained_objects
    return flatten(map(get_contained_objects, obj))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 305, in get_contained_objects
    return get_contained_objects(calls)
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 291, in get_contained_objects
    return flatten(map(get_contained_objects, obj))
  File "C:\Python27\lib\site-packages\pythoscope\generator\__init__.py", line 311, in get_contained_objects
    return get_those_and_contained_objects(obj.input.values() + [output])

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers