From 2be059f71a14278f0e99702d5f3bc48665946fe7 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Fri, 10 Apr 2015 08:32:55 +0200 Subject: [PATCH] Change working dir to dir of script. --- src/scriptform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scriptform.py b/src/scriptform.py index 48d2a9f..616223b 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -284,6 +284,8 @@ class FormConfig: def callback_script(self, form, form_values, output_fh=None): # Pass form values to the script through the environment as strings. + os.chdir(os.path.dirname(form.script)) + env = os.environ.copy() for k, v in form_values.items(): env[k] = str(v)