urllib.unquote() does not exist in Python 3, causes crash

Bug #1414055 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restfulclient (Ubuntu)
Fix Released
Undecided
Dimitri John Ledkov

Bug Description

While porting Apport to python3-launchpadlib, I stumbled over

Traceback (most recent call last):
  File "apport/crashdb_impl/launchpad.py", line 1245, in test_1_download
    r = self.crashdb.download(self.get_segv_report())
  File "apport/crashdb_impl/launchpad.py", line 318, in download
    for attachment in filter_filename(b.attachments):
  File "apport/crashdb_impl/launchpad.py", line 46, in filter_filename
    f = attachment.data.open()
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 426, in open
    return HostedFileBuffer(self, mode, content_type, filename)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 1085, in __init__
    filename = urllib.unquote(path.split("/")[-1])
AttributeError: 'module' object has no attribute 'unquote'

In Python 3, this is urllib.parse.unquote(), thus this needs a conditional import.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: python3-lazr.restfulclient 0.13.4-3
ProcVersionSignature: Ubuntu 3.18.0-9.10-generic 3.18.2
Uname: Linux 3.18.0-9-generic x86_64
ApportVersion: 2.15.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Jan 23 16:50:18 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-11-20 (64 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20141119)
PackageArchitecture: all
SourcePackage: lazr.restfulclient
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

simple reproducer. works with python 2, crashes like that in python 3.

Changed in lazr.restfulclient (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
Changed in lazr.restfulclient (Ubuntu):
status: New → In Progress
Changed in lazr.restfulclient (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lazr.restfulclient - 0.13.4-4

---------------
lazr.restfulclient (0.13.4-4) experimental; urgency=medium

  * Decode headers before comparison (LP: #1414075)
  * Fix urllib unquote imports (LP: #1414055)

 -- Dimitri John Ledkov <email address hidden> Thu, 12 Feb 2015 23:40:09 +0000

Changed in lazr.restfulclient (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.