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!
