Package: python-pip
Version: 1.1-2
Followup-For: Bug #677801

Here is a patch with the proposed fixes found in the upstream bug report.
It tests if urlparse has the now gone attribute (with latest python 2 & 3
 versions) uses_fragment before using it.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-pip depends on:
ii  python                2.7.3~rc2-1
ii  python-pkg-resources  0.6.24-1
ii  python-setuptools     0.6.24-1
ii  python2.6             2.6.7-4

Versions of packages python-pip recommends:
ii  build-essential  11.5
pn  python-dev-all   <none>

python-pip suggests no packages.

-- no debconf information
Description: fix the improper use of urllib.parse.uses_fragment
Since  Python >= 2.7.3, 3.2.3 the module urlparse/urllib.parse (python3) do not
have a uses_fragment attribute. This patch tests if it exists before using it.
Origin: upstream
Bug: https://github.com/pypa/pip/issues/552
Bug-Debian: http://bugs.debian.org/677801
Last-Update: 2012-06-19

--- python-pip-1.1.orig/pip/vcs/__init__.py
+++ python-pip-1.1/pip/vcs/__init__.py
@@ -19,7 +19,9 @@ class VcsSupport(object):
     def __init__(self):
         # Register more schemes with urlparse for various version control systems
         urlparse.uses_netloc.extend(self.schemes)
-        urlparse.uses_fragment.extend(self.schemes)
+        # Python >= 2.7.4, 3.3 doesn't have uses_fragment
+        if getattr(urlparse, 'uses_fragment', None):
+            urlparse.uses_fragment.extend(self.schemes)
         super(VcsSupport, self).__init__()
 
     def __iter__(self):
--- python-pip-1.1.orig/pip/vcs/bazaar.py
+++ python-pip-1.1/pip/vcs/bazaar.py
@@ -20,8 +20,10 @@ class Bazaar(VersionControl):
 
     def __init__(self, url=None, *args, **kwargs):
         super(Bazaar, self).__init__(url, *args, **kwargs)
-        urlparse.non_hierarchical.extend(['lp'])
-        urlparse.uses_fragment.extend(['lp'])
+        # Python >= 2.7.4, 3.3 doesn't have uses_fragment or non_hierarchical
+        if getattr(urlparse, 'uses_fragment', None):
+            urlparse.uses_fragment.extend(self.schemes)
+            urlparse.non_hierarchical.extend(['lp'])
 
     def parse_vcs_bundle_file(self, content):
         url = rev = None

Reply via email to