Switch to Python 3

Bug #1252474 reported by Bryan Quigley
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ssh-import-id
Fix Released
Medium
Unassigned
ssh-import-id (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

It's a release goal to only ship python 3 for 14.04.

python-requests has a python3-requests, which is the only dependency I see as relevant.

Furthermore, for source changes it appears to only come to this:
- from urllib import quote_plus
+ from urllib.parse import quote_plus

I'm attaching a patch that just changes it to python3. I didn't touch the debian build (and /control) scripts though.

References
Goal page - https://wiki.ubuntu.com/Python/FoundationsTPythonVersions

Related branches

Revision history for this message
Bryan Quigley (bryanquigley) wrote :
Revision history for this message
Bryan Quigley (bryanquigley) wrote :

I thought that was too easy, and it was. Above patch doesn't work at all. My mistake... (the above is just the output of running 2to3 on it)

Revision history for this message
Jackson Doak (noskcaj) wrote :

A (slightly) more complete port is at https://code.launchpad.net/~noskcaj/ssh-import-id/python3 . Can someone please test it?

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Nope, it needs more of a port than that:
ERROR: Ensure that URL is defined in [/etc/ssh/ssh_import_id] is in JSON syntax
2013-11-26 04:57:45,028 ERROR Error executing protocol helper [./ssh-import-id-lp

It's quite easy to test.. you can use any lp name.

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

Here's the real error that is getting caught and the fix:

>>> url = conf.get("URL", None).decode("utf-8") % (quote_plus('andrewsomething'))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'str' object has no attribute 'decode'
>>> conf
{'URL': 'https://launchpad.net/~%s/+sshkeys', '_comment_': 'This file is JSON syntax and will be loaded by ssh-import-id to obtain the URL string, which defaults t
o launchpad.net. The following URL *must* be an https address with a valid, signed certificate!!! %s is the variable that will be filled by the ssh-import-id uti
lity.'}
>>> url = conf.get("URL", None) % (quote_plus('andrewsomething'))
>>> url
'https://launchpad.net/~andrewsomething/+sshkeys'

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks, guys.

Does anyone have a complete, working, tested branch and merge proposal?

Changed in ssh-import-id:
importance: Undecided → Medium
Changed in ssh-import-id (Ubuntu):
importance: Undecided → Medium
Changed in ssh-import-id:
status: New → Triaged
Changed in ssh-import-id (Ubuntu):
status: New → Triaged
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "simple_source_python3.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
tags: removed: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ssh-import-id - 4.1-0ubuntu1

---------------
ssh-import-id (4.1-0ubuntu1) vivid; urgency=medium

  * setup.py:
    - clean up some whitespace and indenting issues
 -- Dustin Kirkland <email address hidden> Mon, 28 Apr 2014 15:12:47 -0700

Changed in ssh-import-id (Ubuntu):
status: Triaged → Fix Released
Changed in ssh-import-id:
status: Triaged → 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.