There is a problem with the fix for issue 309 (commit 3322).
The fix_python_script function which was added attempts to check for a python executable in the file’s shebang, and modify the command to run python manually using the -E switch (which suppresses the functionality of the PYTHON* variables mentioned in the ticket).
However, the regular expression that is used to parse the shebang is flawed, and in my script’s case results in python being executed with the empty string as the filename argument (and thus failing to run the user script).
The result is the following output in the completion e-mail from sab:
Stage Script
/usr/bin/python: can't find '__main__.py' in ''
I propose a different fix, which I have created a patch for.
This solution runs the child process with all PYTHON* variables removed from the environment, avoiding the issue without modifying the command being executed.
Problem with Python user scripts under OS X
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Re: Problem with Python user scripts under OS X
We already implemented a solution for the next release.
Re: Problem with Python user scripts under OS X
Could you tell me the revision so I could test it with my script?
Re: Problem with Python user scripts under OS X
I can’t find a commit which fixes this, and the trunk seems to have the same problem.
Re: Problem with Python user scripts under OS X
ciaran,
we don't use svn on assembla.com anymore, we have moved to launchpad.
https://bugs.launchpad.net/sabnzbd/+bug/554042
The fix is not merged in 0.5.x branch for now.
we don't use svn on assembla.com anymore, we have moved to launchpad.
https://bugs.launchpad.net/sabnzbd/+bug/554042
The fix is not merged in 0.5.x branch for now.
Last edited by shypike on April 6th, 2010, 9:45 am, edited 1 time in total.