Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1011 (closed defect: invalid)

Opened 11 years ago

Last modified 7 years ago

Using sys.settrace causes odd errors

Reported by: jpellerin Owned by: anonymous
Priority: normal Milestone: 1.0
Component: TurboGears Version: 1.0b1
Severity: normal Keywords:
Cc:

Description

Using sys.settrace with any function, even one that does nothing, causes some very odd errors:

Traceback (most recent call last):
  File "bar/controllers.py", line 9, in ?
    import turbogears
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/__init__.py", line 8, in ?
    from turbogears import controllers, view, database, validators, command, \
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/__init__.py", line 7, in ?
    from turbogears.widgets.links import *
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/links.py", line 60, in ?
    class SyntaxHighlighterDesc(CoreWD):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/links.py", line 62, in SyntaxHighlighterDesc
    for_widget = SyntaxHighlighter()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/meta.py", line 142, in widget_init
    func(self, *args, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/links.py", line 46, in __init__
    location=js_location.bodybottom)]
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/meta.py", line 142, in widget_init
    func(self, *args, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/widgets/base.py", line 531, in __init__
    if location not in js_location:
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/util.py", line 39, in __cmp__
    assert self.EnumType is other.EnumType, "Only values from the same enum are comparable"
AttributeError: 'EnumValue' object has no attribute 'EnumType'

To reproduce:

  1. Quickstart an app
  2. Add the following code to the top of app/controllers.py:
    import sys
    
    class dummy:
        def f(self, f, w, a):
            return self.f    
    d = dummy()
    sys.settrace(d.f)
    
  3. Import or run app/controllers.py

Attachments

sample-project.tar.gz Download (60.0 KB) - added by jorge.vargas 11 years ago.
the problem is in the turbogears import. this code doesn't presents the error.

Change History

Changed 11 years ago by jorge.vargas

the problem is in the turbogears import. this code doesn't presents the error.

comment:1 Changed 11 years ago by jorge.vargas

  • Version changed from 0.9a6 to 1.0b1
  • Milestone set to 1.0b3

still present

comment:2 Changed 11 years ago by nyenyec

I see this too, when I try to run TurboGears through the PyDev? debugger and try to step over the

import turbogears

line.

comment:3 Changed 11 years ago by alberto

  • Milestone changed from 1.0b3 to 1.1

comment:4 Changed 11 years ago by alberto

  • Milestone changed from 1.1 to __unclassified__

Batch moved into unclassified from 1.1 to properly track progress on the later

comment:5 Changed 9 years ago by Chris Arndt

  • Status changed from new to closed
  • Resolution set to invalid

I am not able to reproduce this anymore with either the 1.0 or the 1.1 branch. Closing ticket as invalid.

comment:6 Changed 7 years ago by chrisz

  • Milestone changed from __unclassified__ to 1.0
Note: See TracTickets for help on using tickets.