Path rewriting should be set in pydevd.settrace
Brought to you by:
fabioz
In version 1.5.5.2010021623 client to server path rewriting stopped working. The debugging host, when being connected open up an open file dialog where he tries to open file with an invalid path:
data/valgog/pyb/src/example/C:/home/valog/pyb/src/example/s.py
In pydevd_file_utils.py is changed so:
PATHS_FROM_CLIENT_TO_SERVER = [( "C:\\Home\\valgog\\pyb\\src\\example\\", '/data/valgog/pyb/src/example/' )]
And now I cannot call the s.py like
python s.py
but have to always use a full file path name like /data/valgog/pyb/src/example/s.py so the dubugger finds the correct client prefix...
There was no such a problem in version 1.5.4 and in some previous nightly buld versions of 1.5.5
Can you make an experiment for me:
in pydevd_file_utils.py (in plugins/org.python.pydev.debug_xxx/pysrc/pydevd_file_utils.py)
Change the function _NormFile removing the call to "normcase" and let me know if it works (but leave the rPath there) -- it seems that the _NormFile is not properly making the full path (it's removing the first '/', although I checked it here and it seems to work for me, but there may be some particularity in your linux version).
I'm posting how the code should be (but the sourceforge tracker may make the indentation in the code bad)
def _NormFile(filename):
try:
return NORM_FILENAME_CONTAINER[filename]
except KeyError:
r = rPath(filename)
#cache it for fast access later
NORM_FILENAME_CONTAINER[filename] = r
return r
Sorry, just took a better look at the code and that's not it... I'll analyze it a bit more...
Ok, I believe it's fixed now (but as I wasn't able to reproduce it, I'm not 100% certain).
Please get the latest nightly build (1.5.5.2010022521) and check if it works for you.
Yes, it works now.
Actually what do you think about making it possible to pass PATHS_FROM_ECLIPSE_TO_PYTHON as parameter to the pydevd.settrace() call or make it possible to assign the values before the call to the to pydevd.settrace(). By now it is not possible, as the functionality depends on the value of the PATHS_FROM_ECLIPSE_TO_PYTHON, optimizing the functionality away in case the structure is empty.
Ok, changing the title and moving to feature requests.