Closed jonrkarr closed 3 years ago
This is something that has been bothering me for a while as well. To a large extent this is legacy behaviour. I am thinking of making this configurable in .pys_usercfg.ini
. Refer to the nocwd branch.
Indeed this is a legacy behaviour that was necessary when Windows had no consistently defined "home" variable and and mktemp was considered insecure. I'm fine with making this an optional behaviour, however, for this to be portable we'll have to modify the parser to use TemporaryFile, NamedTemporaryFile etc. I'll open another issue for that.
Thanks! We worked around this; its easy to work around once you realize that PySCeS is doing this. I mentioned this because others would likely prefer this mode as well.
Implemented in #42.
Importing PySCeS and calling some methods causes the current working directory to change. Generally, importing Python modules doesn't have side effects like this. As a result, this behavior is unexpected, which could confusion users. This behavior requires codes that import PySCeS to work around this by undoing PySCeS' changing of the current working directory. More conventional behavior would be for PySCeS not to change the current working. PySCeS can read/write data from the configured directories without changing the current working directory, or methods which need to change the current working directory could undo their changes.