this basically removes the content-encoding header.
many thanks to @rmohr for reporting this issue in
https://github.com/schmir/pypiserver/pull/42:
,----
| it seems that since pip>=1.5, pip checks the response header of archives
| for Content-Encoding.
|
| This is what pypiserver currently guesses when you try to download a
| tar.gz archive:
|
| ('Content-Type', 'application/x-tar')
| ('Content-Encoding', 'gzip')
|
| What pip now does is decompressing the archive because of the
| Content-Encoding, without removing the .gz. Then it tries to untar
| it. Because of the filename it tries to decompress the tar archive
| again.
|
| This is what pypi returns:
|
| $ wget -S https://pypi.python.org/packages/source/p/pytz/pytz-2013.9.tar.gz
| [...]
| Content-Type: application/x-gzip
| Accept-Ranges: bytes
| [...]
|
| The patch below returns the same types as pypi does.
`----
The fix in commit 7f97612 for supporting the package naming used by the
pytz module caused a regression if the package name contained a dash
followed by a number. We fix this by splitting on all dashes followed by
numbers and recreating the package name from all components but the
last.
If the overwrite command line options is used, existing package files
can be overwritten during upload. By default existing package files will
not be overwritten.
looks like a pip/virtualenv bootstrapping problem:
,----
| Downloading/unpacking pytest>=2.3
|
| Exception:
|
| Traceback (most recent call last):
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/basecommand.py", line 139, in main
|
| status = self.run(options, args)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/commands/install.py", line 266, in run
|
| requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/req.py", line 1026, in prepare_files
|
| url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/index.py", line 125, in find_requirement
|
| page = self._get_page(main_index_url, req)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/index.py", line 353, in _get_page
|
| return HTMLPage.get_page(link, req, cache=self.cache)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/index.py", line 471, in get_page
|
| resp = urlopen(url)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/download.py", line 143, in __call__
|
| response = self.get_opener(scheme=scheme).open(url)
|
| File "/home/travis/build/schmir/pypiserver/.tox/py25/lib/python2.5/site-packages/pip-1.3.1-py2.5.egg/pip/download.py", line 201, in get_opener
|
| raise NoSSLError()
|
| NoSSLError:
|
| ###################################################################
|
| ## You don't have an importable ssl module. You are most ##
|
| ## likely using Python 2.5, which did not include ssl ##
|
| ## support by default. In this state, we can not provide ##
|
| ## ssl certified downloads from PyPI. ##
|
| ## ##
|
| ## You can do one of 2 things: ##
|
| ## 1) Install this: https://pypi.python.org/pypi/ssl/ ##
|
| ## (It provides ssl support for older Pythons ) ##
|
| ## 2) Use the --insecure option to allow this insecurity ##
|
| ## ##
|
| ## For more details, go to the "SSL Certificate Verification" ##
|
| ## section located here: ##
|
| ## http://www.pip-installer.org/en/latest/logic.html ##
|
| ## ##
|
| ###################################################################
|
`----
The main line repo
(c1b9386dff)
currently lists duplicate entries on the "/simple" index page if the
package name contains hyphens and if both a source file and egg file are
uploaded. One index entry contains hyphens in the name which matches the
source file name and the other entry contains underscores in the name
which matches the egg file. Clicking both links lead to pages which list
the same files (both the source file and the egg file).
The previous fix
(c6966afeed)
mostly fixed this problem but it did not account for package names that
included an underscore. Change the "/simple" index to use the name from
a non-egg file, since this name should not have hyphens converted to
underscores as egg files do. If there are only egg files, use the egg
file name.
...on the "/simple" listing.
On the "/simple" listing page, names with hyphens and names with
underscores are currently both pointing to the same set of files due to
the use of `pypiserver.core.normalize_pkgname`. Make a change to display
only names with hyphens on the "/simple" listing page to avoid
duplication.