#1011: Using sys.settrace causes odd errors
------------------------+---------------------------------------------------
 Reporter:  jpellerin   |       Owner:  anonymous
     Type:  defect      |      Status:  new      
 Priority:  normal      |   Milestone:           
Component:  TurboGears  |     Version:  0.9a6    
 Severity:  normal      |    Keywords:           
------------------------+---------------------------------------------------
 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

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1011>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to