Setuptools - cannot install

Discussion in 'Python' started by tim.hamza@gmail.com, Jan 2, 2014.

  1. Guest

    setuptools 2.0.2, win7 x64, python 3.3.3 (64bit), tried as user (who is admin, and as admin)

    This started happening several versions ago. Could not track down a setuptools support list. Any ideas?

    C:\Users\tim\Desktop\setuptools-2.0.2>python setup.py install
    Traceback (most recent call last):
    File "setup.py", line 17, in <module>
    exec(init_file.read(), command_ns)
    File "<string>", line 8, in <module>
    File "C:\Users\tim\Desktop\setuptools-2.0.2\setuptools\__init__.py", line 11, in <module>
    from setuptools.extension import Extension
    File "C:\Users\tim\Desktop\setuptools-2.0.2\setuptools\extension.py", line 5, in <module>
    from setuptools.dist import _get_unpatched
    File "C:\Users\tim\Desktop\setuptools-2.0.2\setuptools\dist.py", line 15, in <module>
    from setuptools.compat import numeric_types, basestring
    File "C:\Users\tim\Desktop\setuptools-2.0.2\setuptools\compat.py", line 49, in <module>
    from http.server import HTTPServer, SimpleHTTPRequestHandler
    File "C:\Python\lib\http\server.py", line 654, in <module>
    class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
    File "C:\Python\lib\http\server.py", line 839, in SimpleHTTPRequestHandler
    mimetypes.init() # try to read system mime.types
    File "C:\Python\lib\mimetypes.py", line 348, in init
    db.read_windows_registry()
    File "C:\Python\lib\mimetypes.py", line 255, in read_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
    TypeError: OpenKey() argument 2 must be str without null characters or None, not str
     
    , Jan 2, 2014
    #1
    1. Advertising

  2. On Fri, Jan 3, 2014 at 9:26 AM, <> wrote:
    > File "C:\Python\lib\mimetypes.py", line 255, in read_windows_registry
    > with _winreg.OpenKey(hkcr, subkeyname) as subkey:
    > TypeError: OpenKey() argument 2 must be str without null characters or None, not str


    Interestingly, I pulled up that file on my 3.3.0 (Windows) and that
    line is different. May be related to this issue, which was cited in
    the commit summary that effected the change:

    http://bugs.python.org/issue15207

    In 3.3.0, it looks for HKEY_CLASSES_ROOT plus subkey
    r'MIME\Database\Content Type', but in 3.3.3 it's iterating over all
    the subkeys in HKEY_CLASSES_ROOT. (Note that _winreg is simply the
    winreg module or None if it couldn't be imported.) I wonder is it
    possible you have a null character in a key?? It's worth a try.

    >>> import winreg
    >>> hkcr=winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, '')
    >>> for i in range(999999):

    key=winreg.EnumKey(hkcr,i)
    if '\0' in key: print(repr(key))

    If that throws a "No more data available" error without printing any
    keys, then this isn't your problem.

    Alternatively, you could hack C:\Python\lib\mimetypes.py to print out
    subkeyname before attempting to open it. That would at least tell you
    what the offending key is. My suspicion at the moment is that you may
    have a corrupted registry, or else there's something that's possible
    that the winreg module doesn't expect.

    BTW, thanks for the first-line summary of version numbers. Much
    appreciated! So many people don't give that.

    ChrisA
     
    Chris Angelico, Jan 3, 2014
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    443
  2. Hartmut Goebel

    Install man-pages with distutils/setuptools

    Hartmut Goebel, May 17, 2008, in forum: Python
    Replies:
    1
    Views:
    733
    Sebastian 'lunar' Wiesner
    May 17, 2008
  3. Gabriel Genellina

    Re: Easy install / setuptools

    Gabriel Genellina, Jun 3, 2008, in forum: Python
    Replies:
    1
    Views:
    394
    John Nagle
    Jun 3, 2008
  4. Rolf
    Replies:
    3
    Views:
    2,026
  5. John Nagle

    MySQLdb install vs. "setuptools"

    John Nagle, May 30, 2010, in forum: Python
    Replies:
    9
    Views:
    1,139
    David Cournapeau
    May 30, 2010
Loading...

Share This Page