title: pydev breakpoints not working
body: <p>I am working on a project using python 2.7.2, sqlalchemy 0.7, unittest, eclipse 3.7.2 and pydev 2.4. I am setting breakpoints in python files (unit test files), but they are completely ignored (before, at some point, they worked). By now i have upgraded all related software (see above), started new projects, played around with settings, hypnotized my screen, but nothing works.</p>
  
  <p>The only idea i got from some post is that it has something to de with changing some .py file names to lower case.</p>
  
  <p>Does anyone have any ideas? </p>
  
  <p><strong>added:</strong> I even installed the aptana version of eclipse and copied the <code>.py</code> files to it => same result; breakpoints are still ignored.</p>
  
  <p><strong>still no progress:</strong> I have changed some code that might be seen as unusual and replaced it with a more straightforward solution. </p>
  
  <p><strong>some more info:</strong> it probably has something to do with module unittest:   </p>
  
  <ul>
  <li>breakpoints in my files defining test suites work,  </li>
  <li>breakpoints in the standard unittest files themselves work  </li>
  <li>breakpoints in my tests methods in classes derived from unittest.TestCase do not work  </li>
  <li>breakpoints in my code being tested in the test cases do not work  </li>
  <li>at some point before i could define working breakpoints in test methods or the code being tested  </li>
  <li>some things i changed after that are: started using test suites, changed some filenames to lowercase, ...</li>
  <li>this problem also occurs if my code works without exceptions or test failures.  </li>
  </ul>
  
  <p><strong>what I already tried is:</strong></p>
  
  <ul>
  <li>remove <code>.pyc</code> files  </li>
  <li>define new project and copy only <code>.py</code> files to it  </li>
  <li>rebooted several times in between  </li>
  <li>upgraded to eclipse 3.7.2  </li>
  <li>installed latest pydev on eclipse 3.7.2   </li>
  <li>switch to aptana (and back)   </li>
  <li>removed code that 'manually' added classes to my module  </li>
  <li>fiddled with some configurations </li>
  </ul>
  
  <p><strong>what I can still do is:</strong></p>
  
  <ul>
  <li>start new project with my code, start removing/changing code until breakpoints work and sort of black box figure out if this has something to do with some part of my code</li>
  </ul>
  
  <hr>
  
  <ul>
  <li>Does anyone have any idea what might cause these problems or how they might be solved?  </li>
  <li>Is there any other place i could look for a solution?  </li>
  <li>Do pydev developers look into the questions on stackoverflow?</li>
  <li>Is there an older version of pydev that i might try?  </li>
  </ul>
  
  <p>I have been working with pydev/eclipse for a long time and it works well for me, but without debugging i'd forced to switch IDE.</p>
  
  <p><strong>In answer to Fabio's questions below:</strong></p>
  
  <ul>
  <li>The python version is 2.7.2,</li>
  <li>The sys.gettrace gives None (but I have no idea what in my code could influence that)</li>
  <li>This is the output of the debugger after changing the suggested parameters:</li>
  </ul>
  
  <p><strong>pydev debugger:</strong></p>
  
  <pre><code>starting
  ('Executing file ', 'D:\\.eclipse\\org.eclipse.platform_3.7.0_248562372\\plugins\\org.python.pydev.debug_2.4.0.2012020116\\pysrc\\runfiles.py')
  ('arguments:', "['D:\\\\.eclipse\\\\org.eclipse.platform_3.7.0_248562372\\\\plugins\\\\org.python.pydev.debug_2.4.0.2012020116\\\\pysrc\\\\runfiles.py', 'D:\\\\Documents\\\\Code\\\\Eclipse\\\\workspace\\\\sqladata\\\\src\\\\unit_test.py', '--port', '49856', '--verbosity', '0']")
  ('Connecting to ', '127.0.0.1', ':', '49857')
  ('Connected.',)
  ('received command ', '501\t1\t1.1')
  sending cmd: CMD_VERSION 501    1   1.1
  
  sending cmd: CMD_THREAD_CREATE 103  2   &lt;xml&gt;&lt;thread name="pydevd.reader" id="-1"/&gt;&lt;/xml&gt;
  
  sending cmd: CMD_THREAD_CREATE 103  4   &lt;xml&gt;&lt;thread name="pydevd.writer" id="-1"/&gt;&lt;/xml&gt;
  
  ('received command ', '111\t3\tD:\\Documents\\Code\\Eclipse\\workspace\\sqladata\\src\\testData.py\t85\t**FUNC**testAdjacency\tNone')
  Added breakpoint:d:\documents\code\eclipse\workspace\sqladata\src\testdata.py - line:85 - func_name:testAdjacency
  ('received command ', '122\t5\t;;')
  Exceptions to hook : []
  ('received command ', '124\t7\t')
  ('received command ', '101\t9\t')
  Finding files... done.
  Importing test modules ... testAtomic (testTypes.TypeTest) ... ok
  testCyclic (testTypes.TypeTest) ... 
  </code></pre>
  
  <p>The rest is output of the unit test.</p>
  
  <h2>Continuing from Fabio's answer part 2:</h2>
  
  <p>I have added the code at the start of the program and the debugger stops working at the last line of following the method in sqlalchemy\orm\attributes.py (it is a descriptor, but how or whther it interferes with the debugging is beyond my current knowledge):</p>
  
  <p>class InstrumentedAttribute(QueryableAttribute):
      """Class bound instrumented attribute which adds descriptor methods."""</p>
  
  <pre><code>def __set__(self, instance, value):
      self.impl.set(instance_state(instance), 
                      instance_dict(instance), value, None)
  
  def __delete__(self, instance):
      self.impl.delete(instance_state(instance), instance_dict(instance))
  
  def __get__(self, instance, owner):
      if instance is None:
          return self
  
      dict_ = instance_dict(instance)
      if self._supports_population and self.key in dict_:
          return dict_[self.key]
      else:
          return self.impl.get(instance_state(instance),dict_) #&lt;= last line of debugging
  </code></pre>
  
  <p>From there the debugger steps into the <code>__getattr__</code> method of one of my own classes, derived from a declarative_base() class of sqlalchemy. </p>
  
  <h2>Probably solved (though not understood):</h2>
  
  <p>The problem seemed to be that the <code>__getattr__</code> mentioned above, created something similar to infinite recursion, however the program/unittest/sqlalchemy recovered without reporting any error. I do not understand the sqlalchemy code sufficiently to understand why the <code>__getattr__</code> method was called.<br>
  I changed the <code>__getattr__</code> method to call super for the attribute name for which the recursion occurred (most likely not my final solution) and the breakpoint problem seems gone.
  If i can formulate the problem in a consise manner, i will probably try to get some more info on the google sqlalchemy newsgroup, or at least check my solution for robustness.</p>
  
  <p>Thank you Fabio for your support, the trace_func() function pinpointed the problem for me. </p>