[Pydev-cvs] org.python.pydev.debug/pysrc pydevd_file_utils.py, 1.6, 1.7 pydevd.py, 1.97, 1.98
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-08-17 00:26:49
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7013/pysrc Modified Files: pydevd_file_utils.py pydevd.py Log Message: <li><strong>Pydev debugger</strong>Workaround for python bug when filenames don't have absolute paths correctly generated</li> <li><strong>Pydev code-completion</strong>Wild import will only show tokens defined in __all__ (if it's available)</li> <li><strong>Interactive console</strong>: Fixed problem when more attempts to connect were needed</li> <li><strong>Interactive console</strong>Fixed console integration problem with other plugins because of interfaces not properly implemented</li> <li><strong>Code Formatter</strong>: Exponentials handled correctly</li> <li><strong>Launching</strong>: Unit-test and code-coverage may launch multiple folders/files at once</li> <li><strong>Code coverage</strong>: Number format exception no longer given when trying to show lines not executed in the editor and all lines are executed</li> Index: pydevd.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd.py,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** pydevd.py 13 Aug 2008 21:12:24 -0000 1.97 --- pydevd.py 17 Aug 2008 00:26:56 -0000 1.98 *************** *** 635,639 **** if not sys.platform.startswith("java"): ! print >> sys.stderr, 'pydev debugger: warning: psyco not available for debugger speedups' --- 635,639 ---- if not sys.platform.startswith("java"): ! print >> sys.stderr, "pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower)" Index: pydevd_file_utils.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_file_utils.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pydevd_file_utils.py 6 Aug 2008 16:21:41 -0000 1.6 --- pydevd_file_utils.py 17 Aug 2008 00:26:56 -0000 1.7 *************** *** 41,46 **** --- 41,50 ---- import os.path import sys + import traceback + normcase = os.path.normcase basename = os.path.basename + exists = os.path.exists + join = os.path.join try: *************** *** 78,81 **** --- 82,113 ---- NORM_FILENAME_CONTAINER[filename] = r return r + + #Now, let's do a quick test to see if we're working with a version of python that has no problems + #related to the names generated... + try: + if not exists(_NormFile(rPath.func_code.co_filename)): + print >> sys.stderr, '-------------------------------------------------------------------------------' + print >> sys.stderr, 'pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute)' + print >> sys.stderr, 'pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints.' + print >> sys.stderr, 'pydev debugger: Related bug: http://bugs.python.org/issue1666807' + print >> sys.stderr, '-------------------------------------------------------------------------------' + + initial_norm_file = _NormFile + def _NormFile(filename): #Let's redefine _NormFile to work with paths that may be incorrect + ret = initial_norm_file(filename) + if not exists(ret): + #We must actually go on and check if we can find it as if it was a relative path for some of the paths in the pythonpath + for path in sys.path: + ret = initial_norm_file(join(path, filename)) + if exists(ret): + break + else: + print >> sys.stderr, 'pydev debugger: Unable to find real location for: %s' % filename + ret = filename + + return ret + except: + #Don't fail if there's something not correct here -- but at least print it to the user so that we can correct that + traceback.print_exc() |