When setting breakpoints outside the initially run file, Pycharm opens what appears to be a read-only copy of the file rather than stepping through the actual source code file. Is there any way to prevent this?
For example, I am working in foo.py that imports a library bar.py which is another file in the same directory as foo.py. If I set a breakpoint in bar.py after running debug on foo.py Pycharm will stop in a read-only copy of bar.py rather than bar.py itself. If I try to make any edits it will give me the "Non-project Files Protection" error, and if I ignore this and edit anyway I get strange unsynced changes/errors between this read-only file and the source.
I'd understand if Pycharm were opening a read-only file for something like numpy or some other external dependency, but bar.py is my own source code and I want to make edits to fixes I find while debugging right there rather than opening up the source separately, searching for the same line, and then fixing. Of course I expect to have to rerun the debugger after making changes, but this is a fair nuscence compared to other IDEs I've used for other languages. Maybe it is an unavoidable python issue with compilation at runtime?