Page 1 of 2

[0.8.0Alpha1] Does not start on Windows

Posted: June 6th, 2015, 5:04 am
by firesale
Hello,

I'm trying to start Sabnzbd (freshly unpacked from SABnzbd-0.8.0Alpha1-win32-bin.zip) on Windows 8.1 I get the following error in the error.log

Code: Select all

Traceback (most recent call last):
  File "SABnzbd.py", line 54, in <module>
  File "cherrypy\__init__.pyo", line 70, in <module>
  File "cherrypy\_cptools.pyo", line 245, in <module>
  File "cherrypy\lib\static.pyo", line 7, in <module>
  File "mimetypes.pyo", line 351, in init
  File "mimetypes.pyo", line 254, in read_windows_registry
TypeError: must be string without null bytes or None, not str

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 6th, 2015, 9:22 am
by shypike
Did you already have an existing SABnzbd installation?

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 6th, 2015, 9:42 am
by firesale
shypike wrote:Did you already have an existing SABnzbd installation?
Yes, I had 0.7.20 installed. I tried installing over the old installation, without success. I also tried removing the old installation and installing fresh from SABnzbd-0.8.0Alpha1-win32-setup.exe, with the same result.

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 7th, 2015, 1:51 pm
by shypike
I haven't tested on windows 8.1 yet, but I will soon.
So far, no idea what's going on.

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 2:32 am
by firesale
shypike wrote:I haven't tested on windows 8.1 yet, but I will soon.
So far, no idea what's going on.
No worries! Let me know if there's anything you'd like me to test. ;)

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 1:47 pm
by shypike
Just created a virtual Windows 8.1: no problems found.
Is the Windows 32bit or 64bit?
Which language (like English, French etc.) does Windows use?

It looks very much like an error in the run-time libraries of the Python programming language.
Triggered by a specific MIME definition in Windows.
Which means it will not be easy to diagnose and solve.

Just checking: 0.7.20 does work properly?

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 3:48 pm
by sander
Shypike,

I installed SAB 0.8.x Alpha2 on a Windows 8.1 (no problems, even with Unicode stuff in the registry HKEY_CLASSES_ROOT), and the log says:

Code: Select all

2015-06-09 22:09:56,631::INFO::[SABnzbd:1257] SABnzbd-console.exe-0.8.0Alpha2 (rev=6f644bf850e3edc4243dac02c97a4e225f2e9000)
2015-06-09 22:09:56,651::INFO::[SABnzbd:1265] Platform=Windows-8-6.2.9200 (=Vista+ x64) Class=nt
2015-06-09 22:09:56,680::INFO::[SABnzbd:1270] Python-version = 2.7.8 (default, Jul  2 2014, 19:50:44) [MSC v.1500 32 bit (Intel)]
So: python 2.7.8 (july 2014), whereas python 2.7.10 is available and has mimetypes.py bug fixes / improvements for Windows (see https://hg.python.org/cpython/raw-file/ ... /Misc/NEWS)

Would it be possible to create a python 2.7.10 based SABnzbd version for Windows to see if that solves the problem for the OP?

FWIW: SAB on my Ubuntu runs with python 2.7.10

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 3:58 pm
by firesale
shypike wrote:Just created a virtual Windows 8.1: no problems found.
Is the Windows 32bit or 64bit?
It's 64bit. I've also just tried with Alpha 2 with the same errors.
shypike wrote:Which language (like English, French etc.) does Windows use?
The localization is Norwegian.
Home location: Norway
Format: Norwegian, Bokmål
shypike wrote:It looks very much like an error in the run-time libraries of the Python programming language.
Triggered by a specific MIME definition in Windows.
Which means it will not be easy to diagnose and solve.

Just checking: 0.7.20 does work properly?
Yes, no problems at all with 0.7.20.

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 4:12 pm
by firesale
I just tested 0.8.0Alpha2 on my mediaserver, running Windows 8 (not 8.1) x64 and it works there. Very strange ..

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 4:14 pm
by shypike
sander wrote: Would it be possible to create a python 2.7.10 based SABnzbd version for Windows to see if that solves the problem for the OP?
No, it's not available.
ActiveState hasn't released 2.7.10 yet and the official Windows Python 2.7.10 from python.org is incompatible with OpenSSL.
I think ActiveState is stuck on the OpenSSL problem too.

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 4:15 pm
by shypike
firesale wrote:I just tested 0.8.0Alpha2 on my mediaserver, running Windows 8 (not 8.1) x64 and it works there. Very strange ..
The problem may be determined by the MIME types that are defined on your Windows system.
Apps often install additional MIME types.

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 9th, 2015, 4:25 pm
by sander
@firesale:

Let's try it the other way around:

Install Python 2.7.8 (from https://www.python.org/download/releases/2.7.8/) on your problematic Windows 8.1.
Start python 2.7.8 from the command line (CMD.exe)
Then try these commands:

Code: Select all

import mimetypes
mimetypes.init()
mimetypes.knownfiles
mimetypes.suffix_map['.tgz']
mimetypes.encodings_map['.gz']
mimetypes.types_map['.tgz']


Example output on my system (Linux):

Code: Select all

>>> import mimetypes
>>> mimetypes.init()
>>> mimetypes.knownfiles
['/etc/mime.types', '/etc/httpd/mime.types', '/etc/httpd/conf/mime.types', '/etc/apache/mime.types', '/etc/apache2/mime.types', '/usr/local/etc/httpd/conf/mime.types', '/usr/local/lib/netscape/mime.types', '/usr/local/etc/httpd/conf/mime.types', '/usr/local/etc/mime.types']
>>> mimetypes.suffix_map['.tgz']
'.tar.gz'
>>> mimetypes.encodings_map['.gz']
'gzip'
>>> mimetypes.types_map['.tgz']
'application/x-gtar-compressed'
>>>
Hopefully you get an error on your system because that way there is a way to reproduce it ...


EDIT:

As cherrypy does this, do it too:

Code: Select all

import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg']='image/x-dwg'
mimetypes.types_map['.ico']='image/x-icon'
mimetypes.types_map['.bz2']='application/x-bzip2'
mimetypes.types_map['.gz']='application/x-gzip'

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 10th, 2015, 1:16 am
by firesale
sander wrote:@firesale:

Let's try it the other way around:

Install Python 2.7.8 (from https://www.python.org/download/releases/2.7.8/) on your problematic Windows 8.1.
Start python 2.7.8 from the command line (CMD.exe)
Then try these commands:

Code: Select all

import mimetypes
mimetypes.init()
mimetypes.knownfiles
mimetypes.suffix_map['.tgz']
mimetypes.encodings_map['.gz']
mimetypes.types_map['.tgz']
Here's my output.

Code: Select all

Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetypes
>>> mimetypes.init()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\mimetypes.py", line 351, in init
    db.read_windows_registry()
  File "C:\Python27\lib\mimetypes.py", line 254, in read_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: must be string without null bytes or None, not str
>>> mimetypes.knownfiles
['/etc/mime.types', '/etc/httpd/mime.types', '/etc/httpd/conf/mime.types', '/etc
/apache/mime.types', '/etc/apache2/mime.types', '/usr/local/etc/httpd/conf/mime.
types', '/usr/local/lib/netscape/mime.types', '/usr/local/etc/httpd/conf/mime.ty
pes', '/usr/local/etc/mime.types']
>>> mimetypes.suffix_map['.tgz']
'.tar.gz'
>>> mimetypes.encodings_map['.gz']
'gzip'
>>> mimetypes.types_map['.tgz']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: '.tgz'
>>>
sander wrote:Hopefully you get an error on your system because that way there is a way to reproduce it ...
Certainly looks like I got a few errors. :)
sander wrote:EDIT:

As cherrypy does this, do it too:

Code: Select all

import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg']='image/x-dwg'
mimetypes.types_map['.ico']='image/x-icon'
mimetypes.types_map['.bz2']='application/x-bzip2'
mimetypes.types_map['.gz']='application/x-gzip'
Here's the second output, from the commands above.

Code: Select all

Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetypes
>>> mimetypes.init()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\mimetypes.py", line 351, in init
    db.read_windows_registry()
  File "C:\Python27\lib\mimetypes.py", line 254, in read_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: must be string without null bytes or None, not str
>>> mimetypes.types_map['.dwg']='image/x-dwg'
>>> mimetypes.types_map['.ico']='image/x-icon'
>>> mimetypes.types_map['.bz2']='application/x-bzip2'
>>> mimetypes.types_map['.gz']='application/x-gzip'
>>>
Thanks for your help, guys! :)

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 10th, 2015, 4:26 am
by sander
Aha:

Code: Select all

Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win
32


Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetypes
>>> mimetypes.init()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\mimetypes.py", line 351, in init
    db.read_windows_registry()
  File "C:\Python27\lib\mimetypes.py", line 254, in read_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: must be string without null bytes or None, not str
So with just these two basic mimetypes commands you can generate this error in python 2.7.8. Pure python. No SABnzbd involved. Very useful and interesting!

Next step: install the current python version (= 2.7.10, see https://www.python.org/downloads/release/python-2710/), and try the two commands again, and post back the result.

Re: [0.8.0Alpha1] Does not start on Windows

Posted: June 10th, 2015, 5:26 am
by shypike
I'll see if I can patch Python 2.7.8 with a later version of mimetypes.py