Version: 3.0.0a4 (using KDE KDE 3.1) Installed from: RedHat RPMs OS: Linux after creating a new python project (well, 'importing' one actually) in Gideon 3.0.0a4 and running the python resulting the 'current directory' from the point of view of the python program is my home directory, NOT the project directory where the python program is. This creates problems with importing python scripts in that project. my project is in '/home/stuart/mtg2' the mtg2.py python returns '/home/stuartw' from the call os.getcwd() and I cannot import scripts in that directory or subdirectories setup with relative python load paths. this applies also when a shell windows is used to exectute the program.
Verified. This should be easy to fix, but should it be? I don't do much script programming so I'd like some feedback here.. Is it preferable to set the current directory to the directory of the executing script? I think it's too close to the release to fiddle around with settings for this, but a sane default wouldn't hurt.
I can confirm this for kdevelop 3.0.0b2 from the SuSE 9.0 rpms. I would prefer your suggestion to set the current directory to the directory of the executing program.
I'll take a look at this.
Subject: Re: python project does not set current directory correctly On Friday 30 January 2004 23:37, you wrote: > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > You are a voter for the bug, or are watching someone who is. > > http://bugs.kde.org/show_bug.cgi?id=57461 > ------- Additional Comments From a.lucas@tu-bs.de 2004-01-30 11:37 ------- > I'll take a look at this. Fantastic to hear! this bug is a big show-stopper for any serious python work. Regards, Stuart W
Sorry, I have null phyton knowlage and canot reproduce. Please give a step by step description on how to reproduce. And with which template/files.
This is trivially reproducible, but this doesn't mean it's a bug. I looked around a bit, and we do the exact same thing for Perl, Python, Ruby and Bash. Their scripts are all executed with "current working directory" set to $HOME. Seeing how I know no python either, I asked a bit in #python-cleese on freenode, and got this answer: "This isn't a python thing, it's a program-behavior thing :) If someone writes a program that expects to be executed in a particular directory, then it will do unexpected things when it is not run in that directory. The author of the bug report is blaming kdevelop for violating his expectations." Which confirms my "suspicion" that while this might be a nice option to have for whatever reason while you're developing, our current lack isn't really a bug. So, I'm filing this as a wish.
I think we implemented this in 3.4
still dont know how to change the current directory for execution