Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83634

Re: I must be missing something obvious in installing Python 3.4.2...

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'else:': 0.03; 'argument': 0.05; 'subject:Python': 0.06; '64-bit': 0.07; 'init': 0.07; 'none,': 0.07; 'subject:missing': 0.07; 'args)': 0.09; 'try:': 0.09; 'python': 0.11; 'bug': 0.12; 'windows': 0.15; '"w")': 0.16; '122,': 0.16; '278,': 0.16; 'exception:': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'ignoring': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'mimetypes': 0.16; 'path.': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'setuptools': 0.16; 'skip:" 70': 0.16; 'tjg': 0.16; 'true:': 0.16; 'typeerror:': 0.16; 'variations': 0.16; 'win7': 0.16; 'wrote:': 0.18; 'skip:f 30': 0.19; 'command': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'looks': 0.24; 'skip:" 30': 0.26; 'least': 0.26; 'downloaded': 0.26; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'fixed': 0.29; 'andrew': 0.30; 'characters': 0.30; 'code': 0.31; '"")': 0.31; '255,': 0.31; 'file': 0.32; 'run': 0.32; 'another': 0.32; 'url:python': 0.33; '(most': 0.33; 'skip:_ 10': 0.34; 'skip:d 20': 0.34; 'except': 0.35; 'skip:s 30': 0.35; 'skip:u 20': 0.35; 'machine.': 0.36; 'url:org': 0.36; 'two': 0.37; 'window': 0.38; 'to:addr:python- list': 0.38; 'skip:_ 40': 0.38; 'recent': 0.39; 'launch': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'break': 0.61; 'charset:windows-1252': 0.65; 'skip:r 30': 0.69; 'from:addr:mail': 0.83; '128,': 0.84; '3.4': 0.84
Date Mon, 12 Jan 2015 20:52:08 +0000
From Tim Golden <mail@timgolden.me.uk>
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
MIME-Version 1.0
To python-list@python.org
Subject Re: I must be missing something obvious in installing Python 3.4.2...
References <ec7b8633-3b02-42b3-89e4-ef002ebd78e6@googlegroups.com>
In-Reply-To <ec7b8633-3b02-42b3-89e4-ef002ebd78e6@googlegroups.com>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17640.1421095928.18130.python-list@python.org> (permalink)
Lines 68
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1421095928 news.xs4all.nl 2952 [2001:888:2000:d::a6]:36478
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83634

Show key headers only | View raw



On 12/01/2015 18:02, Andrew Koenig wrote:
> Downloaded and installed 64-bit Python 3.4 and pywin32-219. Both installed smoothly on my 64-bit Win7 machine. I added C:\Python34 to the search path.
>
> If I launch a Windows command window and run
>
>          python -m ensurepip
>
> I get the following:
>
> Ignoring indexes: https://pypi.python.org/simple/
> Downloading/unpacking setuptools
> Cleaning up...
> Exception:
> Traceback (most recent call last):
>    File "C:\Users\ark\AppData\Local\Temp\tmpe3ckts9f\pip-1.5.6-py2.py3-none-any.w
> hl\pip\basecommand.py", line 122, in main
>      status = self.run(options, args)
>    File "C:\Users\ark\AppData\Local\Temp\tmpe3ckts9f\pip-1.5.6-py2.py3-none-any.w
> hl\pip\commands\install.py", line 278, in run
>      requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
> e=self.bundle)
>    File "C:\Users\ark\AppData\Local\Temp\tmpe3ckts9f\pip-1.5.6-py2.py3-none-any.w
> hl\pip\req.py", line 1177, in prepare_files
>      url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
>    File "C:\Users\ark\AppData\Local\Temp\tmpe3ckts9f\pip-1.5.6-py2.py3-none-any.w
> hl\pip\index.py", line 209, in find_requirement
>      file_locations, url_locations = self._sort_locations(locations)
>    File "C:\Users\ark\AppData\Local\Temp\tmpe3ckts9f\pip-1.5.6-py2.py3-none-any.w
> hl\pip\index.py", line 128, in _sort_locations
>      sort_path(os.path.join(path, item))
>    File "C:\Users\ark\AppData\Local\Temp\tmpe3ckts9f\pip-1.5.6-py2.py3-none-any.w
> hl\pip\index.py", line 109, in sort_path
>      if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
>    File "C:\Python34\lib\mimetypes.py", line 287, in guess_type
>      init()
>    File "C:\Python34\lib\mimetypes.py", line 348, in init
>      db.read_windows_registry()
>    File "C:\Python34\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

Ouch! That looks like another variation on a bug of which we've fixed at 
least two variations to do with reading mimetypes from the Windows 
registry. Can you see what the following code produces, please:

<code>
import winreg as _winreg

hkcr = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, "")

with open("classes.txt", "w") as f:
     i = 0
     while True:
         try:
             ctype = _winreg.EnumKey(hkcr, i)
         except EnvironmentError:
             break
         else:
             f.write("%s -> %r\n" % (type(ctype), ctype))

         i += 1

</code>

TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

I must be missing something obvious in installing Python 3.4.2... Andrew Koenig <ark@acm.org> - 2015-01-12 10:02 -0800
  Re: I must be missing something obvious in installing Python 3.4.2... Chris Angelico <rosuav@gmail.com> - 2015-01-13 05:36 +1100
    Re: I must be missing something obvious in installing Python 3.4.2... Andrew Koenig <ark@acm.org> - 2015-01-12 12:51 -0800
  Re: I must be missing something obvious in installing Python 3.4.2... Tim Golden <mail@timgolden.me.uk> - 2015-01-12 20:52 +0000
    Re: I must be missing something obvious in installing Python 3.4.2... Andrew Koenig <ark@acm.org> - 2015-01-12 13:45 -0800
      Re: I must be missing something obvious in installing Python 3.4.2... Tim Golden <mail@timgolden.me.uk> - 2015-01-12 22:00 +0000
        Re: I must be missing something obvious in installing Python 3.4.2... Andrew Koenig <ark@acm.org> - 2015-01-12 14:35 -0800
          Re: I must be missing something obvious in installing Python 3.4.2... Andrew Koenig <ark@acm.org> - 2015-01-12 15:12 -0800
            Re: I must be missing something obvious in installing Python 3.4.2... Tim Golden <mail@timgolden.me.uk> - 2015-01-13 06:08 +0000
              Re: I must be missing something obvious in installing Python 3.4.2... cjgohlke@gmail.com - 2015-01-12 23:05 -0800
                Re: I must be missing something obvious in installing Python 3.4.2... Tim Golden <mail@timgolden.me.uk> - 2015-01-13 08:18 +0000

csiph-web