Pythoscope crashes on --init

Bug #922540 reported by Viciu on 2012-01-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pythoscope
Medium
Michal Kwiatkowski

Bug Description

ERROR: Oops, it seems that an internal Pythoscope error occurred. Please file a bug report at https://bugs.launchpad.net/pythoscope

Traceback (most recent call last):
  File "/usr/local/bin/pythoscope", line 9, in <module>
    load_entry_point('pythoscope==0.4.3', 'console_scripts', 'pythoscope')()
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/__init__.py", line 184, in main
    init_project(project_path)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/__init__.py", line 112, in init_project
    inspect_project_statically(project)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/__init__.py", line 55, in inspect_project_statically
    return add_and_update_modules(project) + \
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/__init__.py", line 37, in add_and_update_modules
    static.inspect_module(project, modpath)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py", line 130, in inspect_module
    return inspect_code(project, path, read_file_contents(path))
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py", line 139, in inspect_code
    visitor = descend(tree, ModuleVisitor)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 20, in descend
    visitor.visit(tree)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 155, in visit
    self.visit_node(tree)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 169, in visit_node
    getattr(self, method)(results)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 191, in _visit_all
    self.visit(results['nodes'])
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 158, in visit
    self.visit(subtree)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 155, in visit
    self.visit_node(tree)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 169, in visit_node
    getattr(self, method)(results)
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py", line 201, in _visit_function
    body=results['body'])
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py", line 97, in visit_function
    self.objects.append(create_definition(name, args, body, Function))
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py", line 74, in create_definition
    is_generator=is_generator_definition(code))
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py", line 66, in is_generator_definition
    return is_generator_code(function_code_from_definition(definition))
  File "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py", line 52, in function_code_from_definition
    consts = compile_without_warnings(unindent(str(definition))).co_consts
  File "/usr/lib/python2.6/lib2to3/pytree.py", line 228, in __str__
    return unicode(self).encode("ascii")
  File "/usr/lib/python2.6/lib2to3/pytree.py", line 265, in __unicode__
    return u"".join(map(unicode, self.children))
  File "/usr/lib/python2.6/lib2to3/pytree.py", line 265, in __unicode__
    return u"".join(map(unicode, self.children))
  File "/usr/lib/python2.6/lib2to3/pytree.py", line 265, in __unicode__
    return u"".join(map(unicode, self.children))
  File "/usr/lib/python2.6/lib2to3/pytree.py", line 265, in __unicode__
    return u"".join(map(unicode, self.children))
  File "/usr/lib/python2.6/lib2to3/pytree.py", line 371, in __unicode__
    return self.prefix + unicode(self.value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 37: ordinal not in range(128)

I installed pythoscope with pip.
The version is pythoscope==0.4.3

Michal Kwiatkowski (ruby) wrote :

Thanks for the report Wiktor!

Please try the trunk version by doing:

    $ bzr branch lp:pythoscope
    $ cd pythoscope/
    $ python setup.py install

and report if the error still remains.

Changed in pythoscope:
assignee: nobody → Michal Kwiatkowski (ruby)
importance: Undecided → Medium
milestone: none → 0.5-usability
Download full text (5.0 KiB)

Thanks, indeed it works with 0.5 version. I'm looking forward to have it on pip.

Wiktor

2012/1/27, Michal Kwiatkowski <email address hidden>:
> Thanks for the report Wiktor!
>
> Please try the trunk version by doing:
>
> $ bzr branch lp:pythoscope
> $ cd pythoscope/
> $ python setup.py install
>
> and report if the error still remains.
>
> ** Changed in: pythoscope
> Importance: Undecided => Medium
>
> ** Changed in: pythoscope
> Milestone: None => 0.5-usability
>
> ** Changed in: pythoscope
> Assignee: (unassigned) => Michal Kwiatkowski (ruby)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/922540
>
> Title:
> Pythoscope crashes on --init
>
> Status in Pythoscope, the unit test generator:
> New
>
> Bug description:
> ERROR: Oops, it seems that an internal Pythoscope error occurred.
> Please file a bug report at https://bugs.launchpad.net/pythoscope
>
> Traceback (most recent call last):
> File "/usr/local/bin/pythoscope", line 9, in <module>
> load_entry_point('pythoscope==0.4.3', 'console_scripts',
> 'pythoscope')()
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/__init__.py",
> line 184, in main
> init_project(project_path)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/__init__.py",
> line 112, in init_project
> inspect_project_statically(project)
> File
> "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/__init__.py",
> line 55, in inspect_project_statically
> return add_and_update_modules(project) + \
> File
> "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/__init__.py",
> line 37, in add_and_update_modules
> static.inspect_module(project, modpath)
> File
> "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py",
> line 130, in inspect_module
> return inspect_code(project, path, read_file_contents(path))
> File
> "/usr/local/lib/python2.6/dist-packages/pythoscope/inspector/static.py",
> line 139, in inspect_code
> visitor = descend(tree, ModuleVisitor)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 20, in descend
> visitor.visit(tree)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 155, in visit
> self.visit_node(tree)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 169, in visit_node
> getattr(self, method)(results)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 191, in _visit_all
> self.visit(results['nodes'])
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 158, in visit
> self.visit(subtree)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 155, in visit
> self.visit_node(tree)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 169, in visit_node
> getattr(self, method)(results)
> File "/usr/local/lib/python2.6/dist-packages/pythoscope/astvisitor.py",
> line 201, in _visit_function
> body=result...

Read more...

Michal Kwiatkowski (ruby) wrote :

OK, then setting this bug to "Fix Committed".

Changed in pythoscope:
status: New → Fix Committed
Sebastian Oliva (tian2992) wrote :

Please push the fix to Pip.

Thanks!

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

Other bug subscribers