Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 450698 - net-nntp/sabnzbd-0.7.9 - requires Python 2.5, 2.6 or 2.7
Summary: net-nntp/sabnzbd-0.7.9 - requires Python 2.5, 2.6 or 2.7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Justin Bronder (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 09:04 UTC by Kfir Ozer
Modified: 2013-01-11 20:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kfir Ozer 2013-01-07 09:04:19 UTC
sabnzbd won't start, complains that python 2.x is not installed

Reproducible: Always

Steps to Reproduce:
1. eselect python3 as the default python
2. /etc/init.d/sabnzbd start

Actual Results:  
sabnzbd won't start

Expected Results:  
sabnzbd starts

when I start sabnzbd with:

/etc/init.d/sabnzbd start

I get the following output:
----------------------
* Caching service dependencies ...                                                                                              [ ok ]
 * Starting SABnzbd ...
  File "SABnzbd.py", line 20
    print "Sorry, requires Python 2.5, 2.6 or 2.7."
                                                  ^
SyntaxError: invalid syntax
 * start-stop-daemon: failed to start `/usr/bin/sabnzbd'                                                                         [ !! ]
 * ERROR: sabnzbd failed to start
---
------------------------------------------------

that is because my default python is v3.

the thing is that if I edit the file /usr/share/sabnzbd/SABnzbd.py

and change the first line from 

#!/usr/bin/python -OO

to

#!/usr/bin/python2.7 -OO

I still get that error.

so I removed the version check, which means I commented out these lines:

if sys.version_info < (2, 5):
    print "Sorry, requires Python 2.5, 2.6 or 2.7."
    sys.exit(1)

then I  get the following error:

  print "Sorry, requires Python module Cheetah 2.0rc7 or higher.

I tried to recompile Cheetah. it didn't resolve the issue!


when I revert the SABnzbd.py file, and change the default system python to version 2.7 instead of 3.2. sabnzbd works properly.
Comment 1 Justin Bronder (RETIRED) gentoo-dev 2013-01-10 00:14:14 UTC
Can you try applying the following to /usr/bin/sabnzbd?

diff -u -r1.1 sabnzbd
--- files/sabnzbd	3 Jan 2013 20:02:32 -0000	1.1
+++ files/sabnzbd	10 Jan 2013 00:11:31 -0000
@@ -1,3 +1,14 @@
 #!/bin/sh
 
-cd /usr/share/sabnzbd && python SABnzbd.py $*
+pyexe=python2.7
+
+if [ ! -x /usr/bin/${pyexe} ]; then
+    pyexe=python2.6
+fi
+
+if [ ! -x /usr/bin/${pyexe} ]; then
+    echo "No suitable python executable found in /usr/sbin (python2.6 || python2.7)"
+    exit 1
+fi
+
+cd /usr/share/sabnzbd && /usr/bin/${pyexe} SABnzbd.py $*
Comment 2 Chris Lucas 2013-01-11 04:47:21 UTC
(In reply to comment #1)
> Can you try applying the following to /usr/bin/sabnzbd?

I had the same issue (my default version of python is 3.2), this patch fixes it. Executing /usr/bin/sabnzbd directly and starting it as a daemon both work.
Comment 3 Justin Bronder (RETIRED) gentoo-dev 2013-01-11 19:54:33 UTC
  11 Jan 2013; Justin Bronder <jsbronder@gentoo.org> files/sabnzbd:
  Wrap sabnzbd.py with either python2.7 or python2.6. Resolves #450698.

Thanks for testing.
Comment 4 Kfir Ozer 2013-01-11 20:58:30 UTC
yay! it resolves the problem. thanks