Packaged 0.5.3 Synology ipkg SplitHost bug (and workaround)
Posted: July 3rd, 2010, 5:47 am
I'm posting this mostly to help other Synolgy users, because the error does not seem to lie in the Python code supplied by the SABNZBdplus project.
I upgraded my SABNZBdplus 0.5.0 to 0.5.3 on my Synology NAS today, by upgrading through the IPKG packages at http://ipkg.nslu2-linux.org/feeds/optwa ... e/Packages
When I started SABNZBdplus I was greeted with a nasty errormessage due to some errors in the package.
Something to do about Python not able to find a function SplitHost. Now, I have no experience with Python whatsoever, but I know a bit about programming.
The function SplitHost, according to the trace, was called in an added file "email.pyo" which appeared to be compiled or otherwise converted to binary. As there was no way to fix the file email.pyo itself, a workaround had to be found.
I managed to fix this by opening misc.py and copying the function split_host as SplitHost.
Retrying showed a new error:
Opening emailer.py showed this on the mentioned line:
Commenting the entire try/catch block (prepend #) fixed the import errors, but probably leaves some nasty emailing fatal error waiting in _prepare_message(). To have some chance of evading this, I modified _prepare_message() to immediately return True;
This fixed (or rather, quite sneakily worked around) the issue: SABNZBdplus 0.5.3 started normally.
I upgraded my SABNZBdplus 0.5.0 to 0.5.3 on my Synology NAS today, by upgrading through the IPKG packages at http://ipkg.nslu2-linux.org/feeds/optwa ... e/Packages
When I started SABNZBdplus I was greeted with a nasty errormessage due to some errors in the package.
Something to do about Python not able to find a function SplitHost. Now, I have no experience with Python whatsoever, but I know a bit about programming.
The function SplitHost, according to the trace, was called in an added file "email.pyo" which appeared to be compiled or otherwise converted to binary. As there was no way to fix the file email.pyo itself, a workaround had to be found.
I managed to fix this by opening misc.py and copying the function split_host as SplitHost.
Retrying showed a new error:
Code: Select all
File "/volume1/opt/share/SABnzbd/sabnzbd/emailer.py", line 218, in <module>
from email.Message import Message
ImportError: No module named Message
Code: Select all
try:
from email.message import Message
from email.header import Header
from email.encoders import encode_quopri
except:
# Python 2.4 uses different names
from email.Message import Message
from email.Header import Header
from email.Encoders import encode_quopri
RE_HEADER = re.compile(r'^([^:]+):(.*)')
def _prepare_message(txt):
(snip)
This fixed (or rather, quite sneakily worked around) the issue: SABNZBdplus 0.5.3 started normally.