Ability to select python runtime for the script file

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • 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.
Post Reply
elurin
Newbie
Newbie
Posts: 9
Joined: September 14th, 2011, 5:02 pm

Ability to select python runtime for the script file

Post by elurin »

Currently the post processing script file option does not allow for selecting the python runtime for the post processing.
I can change the default python binding from Python 2 to 3 on the OS, but if there are two scripts and one is in Python 3 and the other in 2 then it won't work. Also this can cause issues for other applications.

Is there anyway to change this in a configuration file?
User avatar
sander
Release Testers
Release Testers
Posts: 9070
Joined: January 22nd, 2008, 2:22 pm

Re: Ability to select python runtime for the script file

Post by sander »

Can't you steer it via the shebang in the first line of the python script?
elurin
Newbie
Newbie
Posts: 9
Joined: September 14th, 2011, 5:02 pm

Re: Ability to select python runtime for the script file

Post by elurin »

Misunderstood it at first, I have added to make it work #!/usr/bin/python3
Last edited by elurin on August 5th, 2020, 8:45 am, edited 1 time in total.
User avatar
safihre
Administrator
Administrator
Posts: 5523
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Ability to select python runtime for the script file

Post by safihre »

Indeed what Sanderjo says. We don't select interpreters, we just run the file by simply calling it's path.
It's the shebang that selects the interpreter.
Only on Windows we prepend "python" in front of it, since it doesn't support shebangs.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9070
Joined: January 22nd, 2008, 2:22 pm

Re: Ability to select python runtime for the script file

Post by sander »

elurin wrote: August 5th, 2020, 8:26 am Could do that, but it is not ideal.
Why not? Only the script itselfs knows what it needs: python2 or python3.
elurin
Newbie
Newbie
Posts: 9
Joined: September 14th, 2011, 5:02 pm

Re: Ability to select python runtime for the script file

Post by elurin »

sander wrote: August 5th, 2020, 8:44 am
elurin wrote: August 5th, 2020, 8:26 am Could do that, but it is not ideal.
Why not? Only the script itselfs knows what it needs: python2 or python3.
Yes, changed my answer, misunderstood what was meant with shebang.
Post Reply