2

I am working with pydev (latest version) and the debugger is not working anymore (specifically breakpoints do not work). I get a strange error:

pydev debugger: starting Traceback (most recent call last):

with no further text. ...

I am working with stackless python 2.7 and pyside (almost latest version). The breakpoints that are not working are not within stackless tasklets.

Anyone know the cause or a fix?

OK, (slightly embarassed) i have had a similar problem in the past, posted here and got extensive help here

I used that post to pinpoint the problem to this method:

def __getattr__(self, name):
    if name in self._code_:
        func = self.getfunction(name)
        setattr(self, name, func)
        return func 
    else:
        return super(AtomicProcess, self).__getattr__(name)

I would like to use this or a similar method to set the attribute at the latest possible time (when it is called).I added the super call to possibly fix the problem, but no dice.

  • Does anyone know what causes the problem in this method?
  • Does anyone have a fix that achieves the late initialization but avoids the pydev problem?

Also I should mention that my code runs without problem but that the debugger seems to go into some infinite recursion in the method above, recovers and ignores breakpoints after this method.

Cheers, Lars

PS: anyone? Are pydev developers following stackoverflow or is there another place i might try?

Community
  • 1
  • 1
Lars
  • 1,869
  • 2
  • 14
  • 26

1 Answers1

1

It seems it's something as the previous issue although I'm not sure what (if you can pass me the code I can take a look at it, but without it, the only thing I can do is point to the last thread we had).

Keep in mind that if you have a recursion exception, this is something that breaks the Python debugging facility... What you can do as a workaround in the meanwhile is using the remote debugger to improve on that.

I do have a hunch thought: My guess is that you access something in 'self' which is calling __getattr__ again... (which generates a recursion and breaks the debugger).

Another possible thing: instead of using the 'super' idiom in: super(AtomicProcess, self).__getattr__(name), use the superclass directly: Superclass.__getattr__(self, name)...

Cheers,

Fabio

Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78
  • Thanks for your suggestions, I have changed the code to not use the __getattr__ anymore. The code is hard to reduce to a simple case. – Lars Oct 19 '12 at 23:29
  • However the problem only occurs when debugging, otherwise the code runs normally. Also the super call isn't the problem (i just added it to try to solve the problem, which did not work:-). Are you working on pydev? Hope this helps the pydev people samewhat anyway. – Lars Oct 19 '12 at 23:37
  • Unfortunately, there's little the debugger can do when a recursion exception is thrown because of a bug in Python itself (which breaks the debugger). If you were able not to use `__getattr__ , that's a win for anyways -- attribute access remains slower and although it seems simple, it's usually not -- as you've seen firsthand yourself :) -- and yes, I work on PyDev. – Fabio Zadrozny Oct 22 '12 at 16:10