I'm a big fan of PyCharm but I'm having an issue with remote debugging and path mappings that only happens on Windows, not when I use a similar setup on Mac. Has anyone else run into this? Thanks!
PyCharm 3.1.3 on Windows 7 x64 (also tested on OS X 10.9)
My main problem:
If the remote path is also a valid local path, the path mapping is ignored and the remote version is opened instead of the one out of my PyCharm project folder.
Why this is a problem for me:
When I debug, it opens the installed/remote version of the source - and any edits or changes I make there are not saved in my original source. With large amounts of files open it becomes difficult to keep track of the correct files and avoid losing changes when you recopy sources.
My project must be executed from a "installed" server location, not the source folder. Normally the server only has compiled .pyc files but I can copy my sources to the server folder. But when the server is localhost (or even if the paths just happen to be available locally) it wants to open the server's copy of the files even if I have a path mapping that looks correct such as:
Local path: d:\sources\project\lib\
Remote path: c:\Program Files\MyProduct\lib\
When I do this same setup on Mac, it works fine. Even though the "remote" path is also available it uses the path mappings and opens the version from my project/source folder.
For now I'm using Python Tools for Visual Studio (PTVS) to do debugging, although I prefer PyCharm overall. I don't have this path mapping problem with VS - it reliably recognizes the source file, even if only the pyc is available on the server.
In PyCharm, when only the pyc is available to server the debug server sees a different path. Instead of the "true" server path like c:\Program Files\MyProduct\lib\foo.pyc, it gets the web server directory plus the base filename like c:\inetpub\wwwdata\foo.pyc. This sort of works with path mapping autodetect until the moment you have two different source directories, lib1 and lib2, then you're forced to do the 'guess' option manually on each file.