Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing a wheel may fail due to case sensitivity on Windows #1350

Closed
wiggin15 opened this issue May 13, 2018 · 1 comment
Closed

Installing a wheel may fail due to case sensitivity on Windows #1350

wiggin15 opened this issue May 13, 2018 · 1 comment

Comments

@wiggin15
Copy link

Trying to install a package with wrong letter case (on Windows) causes the installation to fail. For example, "Logbook" is a package that is registered with a capital "L", but on Windows we can try to install its whl file with a lower-case "L". This makes "easy_install" fail, like this:

> wget https://files.pythonhosted.org/packages/13/71/3c4903fc0690059b574396e57f3d8bdf2466cd27b0b756bccd56ba7b0110/Logbook-1.3.3-cp27-cp27m-win_amd64.whl
> easy_install logbook-1.3.3-cp27-cp27m-win_amd64.whl
Processing logbook-1.3.3-cp27-cp27m-win_amd64.whl
Installing logbook-1.3.3-cp27-cp27m-win_amd64.whl to c:\cygwin\home\administrator\python\lib\site-packages
Traceback (most recent call last):
  File "c:\cygwin\home\administrator\python\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\cygwin\home\administrator\python\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Cygwin\home\Administrator\python\scripts\easy_install.exe\__main__.py", line 9, in <module>
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\command\easy_install.py", line 2312, in main
    **kw
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "c:\cygwin\home\administrator\python\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "c:\cygwin\home\administrator\python\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "c:\cygwin\home\administrator\python\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\command\easy_install.py", line 412, in run
    self.easy_install(spec, not self.no_deps)
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\command\easy_install.py", line 654, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\command\easy_install.py", line 699, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\command\easy_install.py", line 849, in install_eggs
    return [self.install_wheel(dist_filename, tmpdir)]
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\command\easy_install.py", line 1067, in install_wheel
    os.path.dirname(destination)
  File "c:\cygwin\home\administrator\python\lib\distutils\cmd.py", line 349, in execute
    util.execute(func, args, msg, dry_run=self.dry_run)
  File "c:\cygwin\home\administrator\python\lib\distutils\util.py", line 309, in execute
    func(*args)
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\wheel.py", line 90, in install_as_egg
    wheel_metadata = get_metadata('WHEEL')
  File "c:\cygwin\home\administrator\python\lib\site-packages\setuptools\wheel.py", line 87, in get_metadata
    with zf.open('%s/%s' % (dist_info, name)) as fp:
  File "c:\cygwin\home\administrator\python\lib\zipfile.py", line 961, in open
    zinfo = self.getinfo(name)
  File "c:\cygwin\home\administrator\python\lib\zipfile.py", line 909, in getinfo
    'There is no item named %r in the archive' % name)
KeyError: "There is no item named 'logbook-1.3.3.dist-info/WHEEL' in the archive"

The whl file contains a directory called "Logbook-1.3.3.dist-info" (case sensitive).
pip installs the wheel file successfully.

System information: Windows Server 2012 64-bit, Python 2.7.8, setuptools 39.1.0 and "wheel" 0.31.0

wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 13, 2018
package_name is read from the filename, which can be
case-insensitive (on Windows). zipfile is case-sensitive, so
trying to read the dist-info from it can fail if the filename
case does not match the project name case. Extracting the
files first allows us to read dist-info from the filesystem, which
is also case insensitive on Windows.
Fixes issue pypa#1350
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 14, 2018
package_name is read from the filename, which can be
case-insensitive (on Windows). zipfile is case-sensitive, so
trying to read the dist-info from it can fail if the filename
case does not match the project name case. Extracting the
files first allows us to read dist-info from the filesystem, which
is also case insensitive on Windows.
Fixes issue pypa#1350
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 14, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 14, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 14, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 15, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 15, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 15, 2018
pganssle pushed a commit to Infinidat/setuptools that referenced this issue May 15, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 16, 2018
wiggin15 pushed a commit to Infinidat/setuptools that referenced this issue May 16, 2018
@wiggin15
Copy link
Author

This was fixed by #1360.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant