Menu

#427 Path rewriting should be set in pydevd.settrace

open
None
5
2010-03-09
2010-02-22
No

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

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2010-02-25

    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

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-02-25
    • status: open --> pending
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-02-25

    Sorry, just took a better look at the code and that's not it... I'll analyze it a bit more...

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-02-25

    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.

     
  • Valentine Gogichashvili

    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.

     
  • Valentine Gogichashvili

    • status: pending --> open
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-03-09
    • labels: 595098 -->
    • summary: Path rewriting stopped working --> Path rewriting should be set in pydevd.settrace
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-03-09

    Ok, changing the title and moving to feature requests.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.