Does Python respect symlinks?

3k Views Asked by At

I'm have difficulty finding any docs describing Python's expected symlink behavior.

I've tried testing it myself but I'm getting weird results - sometimes it appears to work for a while then stops working.

Anyway, I have a situation where MoinMoin keeps it's data files and plugin modules in the same directory but I need to keep the data files outside my git repository (I'm using Openshift PaaS) so it persists. So I want to create this symlink:

~/data/plugins/theme/ -> ~/repo/plugins/theme/

Should I expect this to work?

1

There are 1 best solutions below

3
On BEST ANSWER

Should work just fine - symlinks are handled on the OS level, meaning as long as python isn't trying to determine if something is a symlink or not, calling an open on it should just open the file it's pointing to.

Is there anything in particular that isn't working? What are you seeing when it stops working?