Bug 383940 - Python debugger: default working directory is different
Summary: Python debugger: default working directory is different
Status: RESOLVED FIXED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: general (show other bugs)
Version: 5.1.80
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 09:12 UTC by Gregor Mi
Modified: 2017-10-12 22:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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