#262 Link to (source) Folder issues

Editor (491)


First of all, thank you for a great plugin..! Great

Our python files are stored differently (than the
PYTHONPATH) in our Source repository for some
historical reasons. So, I have to create a link
folder to use the existing structure

I created a Pydev project and added a src folder that
links to a local directory, which is named
differently. Note that the name of the "link" folder
matches with the PYTHONPATH.

For example, my current folder structure on my hard
disk is like this:
- y1
- x11
- x12
I created a link called "x1" and linked it to root.
So, the structure under the Pydev project is like
- x1
- x11
- x12
In my PYTHONPATH, I specified the source folder as:
"root", as the correct PYTHONPATH as required by our
application is "/root" with the first directory in
the PYTHONPATH as "x1" and not "y1".
In Eclipse, this does not seem to recognize the
Python files. Pressing "Force Restore Internal Info"
button also does not seem to help.

Looks like you might have to change the plugin to
look at the link folder name to calculate the module
paths/names (located below the PYTHONPATH).

Also, the package imports are all signalled as errors
due to this problem.

I hope this is not very confusing..!

Should you have any questions, please do not hesitate
to contact me..

Shashi Velur
vshashi at gmail


  • Fabio Zadrozny
    Fabio Zadrozny

    Logged In: YES

    Yeap, pydev does not currently support links... I'll have to
    take a better look at it to see how to fix it (it probably
    won't get into the next version).



  • Fabio Zadrozny
    Fabio Zadrozny

    Logged In: YES

    Also, there is one more note to it... It works if you put
    the link itself in the pythonpath (and not one level before it).

  • Logged In: YES
    Originator: NO

    Dear Fabio

    I'd like to politely ask: could the the priority of this bug could be raised?

    The truth is I'd love to adopt PyDev for our project (and also to promote PyDev to my co-developers), but the lack of support for symbolic links hurts the case for adoption.

    While I'm not an File I/O expert, I've done some crude experiments and it seems the J2SE 5.0 (and above) java.io.File implementation is transparent to symbolic links. In other words, File objects resolve to their targets. For example:

    // a real directory:
    File file1 = new File("/home/jonathan/test/directory");

    // a symbolic link to "/home/jonathan/test/directory":
    File file2 = new File("/home/jonathan/test/directory-link");

    // these should succeed:
    assert(file1.exists() && file1.isDirectory());
    assert(file2.exists() && file2.isDirectory());

    Let me know if I can be of any assistance in fixing this bug. I'm happy to look into patching the code base if you're interested.

    Keep up the good work!

    Jonathan Knowles