Bug#677801: AttributeError: 'module' object has no attribute 'uses_fragment'
Package: python-pip Version: 1.1-3 Followup-For: Bug #677801 Dear Maintainer, On my system it works only outside virtualenv... Another words: I can reporoduce this on my systems in virtualenvs. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.4.0 (SMP w/8 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/dash Versions of packages python-pip depends on: ii python2.7.3~rc2-1 ii python-pkg-resources 0.6.24-1 ii python-setuptools 0.6.24-1 ii python2.6 2.6.8-0.1 Versions of packages python-pip recommends: ii build-essential 11.5 pn python-dev-all none python-pip suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#677801: AttributeError: 'module' object has no attribute 'uses_fragment'
On Wed, Jun 27, 2012 at 07:00:50PM +0200, Marek Hobler wrote: Package: python-pip Version: 1.1-3 Followup-For: Bug #677801 Dear Maintainer, On my system it works only outside virtualenv... Another words: I can reporoduce this on my systems in virtualenvs. It's not a problem of python-pip. For new venvs it's a problem of python-virtualenv that contains an embedded source of pip 1.1 in /usr/share/python-virtualenv/pip-1.1.tar.gz For old venvs I'm afraid there can be no proper solution aside from installing the new pip version (unreleased yet) with easy_install. -- WBR, wRAR signature.asc Description: Digital signature
Bug#677801: AttributeError: 'module' object has no attribute 'uses_fragment'
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 python2.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
Bug#677801: AttributeError: 'module' object has no attribute 'uses_fragment'
Package: python-pip Version: 1.1-2 Severity: grave Justification: renders package unusable With or without arguments, pip fails with this message: gueux@elcaca:8856:20:~$ pip Traceback (most recent call last): File /usr/bin/pip, line 9, in module load_entry_point('pip==1.1', 'console_scripts', 'pip-2.7')() File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 337, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 2279, in load_entry_point return ep.load() File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 1989, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File /usr/lib/python2.7/dist-packages/pip/__init__.py, line 11, in module from pip.basecommand import command_dict, load_command, load_all_commands, command_names File /usr/lib/python2.7/dist-packages/pip/basecommand.py, line 12, in module from pip.download import urlopen File /usr/lib/python2.7/dist-packages/pip/download.py, line 15, in module from pip.vcs import vcs File /usr/lib/python2.7/dist-packages/pip/vcs/__init__.py, line 81, in module vcs = VcsSupport() File /usr/lib/python2.7/dist-packages/pip/vcs/__init__.py, line 22, in __init__ urlparse.uses_fragment.extend(self.schemes) AttributeError: 'module' object has no attribute 'uses_fragment' -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (990, 'unstable'), (600, 'testing'), (500, 'stable'), (300, '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 python2.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 -- Félix signature.asc Description: Digital signature