Bug 383940

Summary: Python debugger: default working directory is different
Product: [Developer tools] kdev-python Reporter: Gregor Mi <codestruct>
Component: generalAssignee: Sven Brauch <mail>
Status: RESOLVED FIXED    
Severity: normal CC: mail, mail
Priority: NOR    
Version First Reported In: 5.1.80   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Gregor Mi 2017-08-24 09:12:07 UTC
I have a little python 3 test program test1.py

```
import os
print(os.getcwd())
```

Run the program with "Execute Launch" (Python 3, Working Directory: empty) then the output is

```
/home/user1/dev/kdevelop-bugs
```

Now "Debug Launch":

```
/home/user1/
```

This means when the Working Directory is not configured "Execute Launch" uses the directory of the current python file (which is handy if relative files are to be opened) whereas "Debug Launch" uses the home directory. I would expect that both Execute and Debug behave the same way.
Comment 1 Francis Herne 2017-10-07 11:38:10 UTC
Still reproducible with 5.2-git.

I'd agree that the file's directory makes more sense as a default.
Comment 2 Sven Brauch 2017-10-12 22:28:09 UTC
Git commit 21aabdc67af87c3f2fc5b82a5525deee94b33d5e by Sven Brauch.
Committed on 12/10/2017 at 22:28.
Pushed by brauch into branch '5.2'.

debugger: fix default working directory if none specified

M  +8    -1    debugger/pdblauncher.cpp

https://commits.kde.org/kdev-python/21aabdc67af87c3f2fc5b82a5525deee94b33d5e