launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25463
[Merge] ~cjwatson/launchpad:py3-codehosting-print-function into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-codehosting-print-function into launchpad:master.
Commit message:
Port lp.codehosting to print_function
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/392036
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-codehosting-print-function into launchpad:master.
diff --git a/lib/lp/codehosting/__init__.py b/lib/lp/codehosting/__init__.py
index 3bbee21..f41a997 100644
--- a/lib/lp/codehosting/__init__.py
+++ b/lib/lp/codehosting/__init__.py
@@ -7,6 +7,8 @@ NOTE: Importing this package will load any system Bazaar plugins, as well as
all plugins in the bzrplugins/ directory underneath the rocketfuel checkout.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'get_brz_path',
diff --git a/lib/lp/codehosting/bzrutils.py b/lib/lp/codehosting/bzrutils.py
index bd1dc4b..e3f50fd 100644
--- a/lib/lp/codehosting/bzrutils.py
+++ b/lib/lp/codehosting/bzrutils.py
@@ -7,6 +7,8 @@ Much of the code in here should be submitted upstream. The rest is code that
integrates between Breezy's infrastructure and Launchpad's infrastructure.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'add_exception_logging_hook',
diff --git a/lib/lp/codehosting/codeimport/dispatcher.py b/lib/lp/codehosting/codeimport/dispatcher.py
index 2d4d4b9..2ab170f 100644
--- a/lib/lp/codehosting/codeimport/dispatcher.py
+++ b/lib/lp/codehosting/codeimport/dispatcher.py
@@ -8,6 +8,8 @@ imports need to be processed and launching child processes to handle
them.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'CodeImportDispatcher',
diff --git a/lib/lp/codehosting/codeimport/foreigntree.py b/lib/lp/codehosting/codeimport/foreigntree.py
index 0e9b292..e0fbe43 100644
--- a/lib/lp/codehosting/codeimport/foreigntree.py
+++ b/lib/lp/codehosting/codeimport/foreigntree.py
@@ -3,6 +3,8 @@
"""Support for CVS branches."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['CVSWorkingTree']
diff --git a/lib/lp/codehosting/codeimport/tarball.py b/lib/lp/codehosting/codeimport/tarball.py
index 173df65..edabfbb 100644
--- a/lib/lp/codehosting/codeimport/tarball.py
+++ b/lib/lp/codehosting/codeimport/tarball.py
@@ -3,6 +3,8 @@
"""Create and extract tarballs."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['create_tarball', 'extract_tarball', 'TarError']
diff --git a/lib/lp/codehosting/codeimport/tests/helpers.py b/lib/lp/codehosting/codeimport/tests/helpers.py
index 46fb2b8..8c07f02 100644
--- a/lib/lp/codehosting/codeimport/tests/helpers.py
+++ b/lib/lp/codehosting/codeimport/tests/helpers.py
@@ -3,6 +3,8 @@
"""Helpers for lp.codehosting.codeimport tests."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
diff --git a/lib/lp/codehosting/codeimport/tests/servers.py b/lib/lp/codehosting/codeimport/tests/servers.py
index a868e88..e3c3ae2 100644
--- a/lib/lp/codehosting/codeimport/tests/servers.py
+++ b/lib/lp/codehosting/codeimport/tests/servers.py
@@ -3,6 +3,8 @@
"""Server classes that know how to create various kinds of foreign archive."""
+from __future__ import absolute_import, print_function
+
__all__ = [
'BzrServer',
'CVSServer',
diff --git a/lib/lp/codehosting/codeimport/tests/test_dispatcher.py b/lib/lp/codehosting/codeimport/tests/test_dispatcher.py
index 0f18ef7..a6dc82e 100644
--- a/lib/lp/codehosting/codeimport/tests/test_dispatcher.py
+++ b/lib/lp/codehosting/codeimport/tests/test_dispatcher.py
@@ -3,6 +3,8 @@
"""Tests for the code import dispatcher."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
diff --git a/lib/lp/codehosting/codeimport/tests/test_foreigntree.py b/lib/lp/codehosting/codeimport/tests/test_foreigntree.py
index debe923..161f83b 100644
--- a/lib/lp/codehosting/codeimport/tests/test_foreigntree.py
+++ b/lib/lp/codehosting/codeimport/tests/test_foreigntree.py
@@ -3,6 +3,8 @@
"""Tests for foreign branch support."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import os
diff --git a/lib/lp/codehosting/codeimport/tests/test_uifactory.py b/lib/lp/codehosting/codeimport/tests/test_uifactory.py
index 3659161..5c93900 100644
--- a/lib/lp/codehosting/codeimport/tests/test_uifactory.py
+++ b/lib/lp/codehosting/codeimport/tests/test_uifactory.py
@@ -3,6 +3,8 @@
"""Tests for `LoggingUIFactory`."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from lp.codehosting.codeimport.uifactory import LoggingUIFactory
diff --git a/lib/lp/codehosting/codeimport/tests/test_worker.py b/lib/lp/codehosting/codeimport/tests/test_worker.py
index 9daf357..b9d89c8 100644
--- a/lib/lp/codehosting/codeimport/tests/test_worker.py
+++ b/lib/lp/codehosting/codeimport/tests/test_worker.py
@@ -3,6 +3,8 @@
"""Tests for the code import worker."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import logging
diff --git a/lib/lp/codehosting/codeimport/tests/test_workermonitor.py b/lib/lp/codehosting/codeimport/tests/test_workermonitor.py
index 9aaa3f3..2810f86 100644
--- a/lib/lp/codehosting/codeimport/tests/test_workermonitor.py
+++ b/lib/lp/codehosting/codeimport/tests/test_workermonitor.py
@@ -3,6 +3,8 @@
"""Tests for the CodeImportWorkerMonitor and related classes."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'nuke_codeimport_sample_data',
diff --git a/lib/lp/codehosting/codeimport/uifactory.py b/lib/lp/codehosting/codeimport/uifactory.py
index 4550b0e..2b8bfd8 100644
--- a/lib/lp/codehosting/codeimport/uifactory.py
+++ b/lib/lp/codehosting/codeimport/uifactory.py
@@ -3,6 +3,8 @@
"""A UIFactory useful for code imports."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['LoggingUIFactory']
diff --git a/lib/lp/codehosting/codeimport/worker.py b/lib/lp/codehosting/codeimport/worker.py
index 5aacf29..361de2f 100644
--- a/lib/lp/codehosting/codeimport/worker.py
+++ b/lib/lp/codehosting/codeimport/worker.py
@@ -3,6 +3,8 @@
"""The code import worker. This imports code from foreign repositories."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'BazaarBranchStore',
diff --git a/lib/lp/codehosting/codeimport/workermonitor.py b/lib/lp/codehosting/codeimport/workermonitor.py
index 80cbe4b..8265dd3 100644
--- a/lib/lp/codehosting/codeimport/workermonitor.py
+++ b/lib/lp/codehosting/codeimport/workermonitor.py
@@ -3,6 +3,8 @@
"""Code to talk to the database about what the worker script is doing."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = []
diff --git a/lib/lp/codehosting/inmemory.py b/lib/lp/codehosting/inmemory.py
index a387cdb..19aca1e 100644
--- a/lib/lp/codehosting/inmemory.py
+++ b/lib/lp/codehosting/inmemory.py
@@ -3,6 +3,8 @@
"""In-memory doubles of core codehosting objects."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'InMemoryFrontend',
diff --git a/lib/lp/codehosting/puller/__init__.py b/lib/lp/codehosting/puller/__init__.py
index 48ec941..a7e963e 100644
--- a/lib/lp/codehosting/puller/__init__.py
+++ b/lib/lp/codehosting/puller/__init__.py
@@ -1,6 +1,8 @@
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['get_lock_id_for_branch_id', 'mirror']
diff --git a/lib/lp/codehosting/puller/scheduler.py b/lib/lp/codehosting/puller/scheduler.py
index 2b47363..0102839 100644
--- a/lib/lp/codehosting/puller/scheduler.py
+++ b/lib/lp/codehosting/puller/scheduler.py
@@ -1,6 +1,8 @@
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'BadMessage',
diff --git a/lib/lp/codehosting/puller/tests/__init__.py b/lib/lp/codehosting/puller/tests/__init__.py
index 59223a3..184af86 100644
--- a/lib/lp/codehosting/puller/tests/__init__.py
+++ b/lib/lp/codehosting/puller/tests/__init__.py
@@ -3,6 +3,8 @@
"""Common code for the puller tests."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import os
diff --git a/lib/lp/codehosting/puller/tests/test_acceptance.py b/lib/lp/codehosting/puller/tests/test_acceptance.py
index 305e52b..3db947a 100644
--- a/lib/lp/codehosting/puller/tests/test_acceptance.py
+++ b/lib/lp/codehosting/puller/tests/test_acceptance.py
@@ -3,6 +3,8 @@
"""End-to-end tests for the branch puller."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = []
diff --git a/lib/lp/codehosting/puller/tests/test_errors.py b/lib/lp/codehosting/puller/tests/test_errors.py
index 18ae10e..bd9abfa 100644
--- a/lib/lp/codehosting/puller/tests/test_errors.py
+++ b/lib/lp/codehosting/puller/tests/test_errors.py
@@ -3,6 +3,8 @@
"""Unit tests for the error presentation in worker.py."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import os
diff --git a/lib/lp/codehosting/puller/tests/test_scheduler.py b/lib/lp/codehosting/puller/tests/test_scheduler.py
index 34d53b6..738f76a 100644
--- a/lib/lp/codehosting/puller/tests/test_scheduler.py
+++ b/lib/lp/codehosting/puller/tests/test_scheduler.py
@@ -1,6 +1,8 @@
# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import logging
@@ -572,7 +574,7 @@ class TestPullerMasterIntegration(PullerBranchTestCase):
# do this manually, and instead the test automatically gave us the
# full error.
error = getattr(failure, 'error', 'No stderr stored.')
- print error
+ print(error)
return failure
def makePullerMaster(self, cls=scheduler.PullerMaster, script_text=None,
diff --git a/lib/lp/codehosting/puller/tests/test_worker.py b/lib/lp/codehosting/puller/tests/test_worker.py
index addfcbb..c9dad6e 100644
--- a/lib/lp/codehosting/puller/tests/test_worker.py
+++ b/lib/lp/codehosting/puller/tests/test_worker.py
@@ -3,6 +3,8 @@
"""Unit tests for worker.py."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import gc
diff --git a/lib/lp/codehosting/puller/tests/test_worker_formats.py b/lib/lp/codehosting/puller/tests/test_worker_formats.py
index b065ffa..6d60ce3 100644
--- a/lib/lp/codehosting/puller/tests/test_worker_formats.py
+++ b/lib/lp/codehosting/puller/tests/test_worker_formats.py
@@ -3,6 +3,8 @@
"""Tests for the puller's support for various Bazaar formats."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from breezy.branch import Branch
diff --git a/lib/lp/codehosting/puller/worker.py b/lib/lp/codehosting/puller/worker.py
index 0767cb8..cdb7c5c 100644
--- a/lib/lp/codehosting/puller/worker.py
+++ b/lib/lp/codehosting/puller/worker.py
@@ -1,6 +1,8 @@
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import socket
diff --git a/lib/lp/codehosting/rewrite.py b/lib/lp/codehosting/rewrite.py
index f59520b..43f608e 100644
--- a/lib/lp/codehosting/rewrite.py
+++ b/lib/lp/codehosting/rewrite.py
@@ -4,6 +4,8 @@
"""Implementation of the dynamic RewriteMap used to serve branches over HTTP.
"""
+from __future__ import absolute_import, print_function
+
import time
from breezy import urlutils
diff --git a/lib/lp/codehosting/scanner/buglinks.py b/lib/lp/codehosting/scanner/buglinks.py
index 116fb90..ece2d0e 100644
--- a/lib/lp/codehosting/scanner/buglinks.py
+++ b/lib/lp/codehosting/scanner/buglinks.py
@@ -3,6 +3,8 @@
"""Bugs support for the scanner."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'BugBranchLinker',
diff --git a/lib/lp/codehosting/scanner/bzrsync.py b/lib/lp/codehosting/scanner/bzrsync.py
index 3bbbc97..f452b2c 100755
--- a/lib/lp/codehosting/scanner/bzrsync.py
+++ b/lib/lp/codehosting/scanner/bzrsync.py
@@ -5,6 +5,8 @@
"""Import version control metadata from a Bazaar branch into the database."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
diff --git a/lib/lp/codehosting/scanner/email.py b/lib/lp/codehosting/scanner/email.py
index bcd8221..96cc3d8 100644
--- a/lib/lp/codehosting/scanner/email.py
+++ b/lib/lp/codehosting/scanner/email.py
@@ -3,6 +3,8 @@
"""Email code for the branch scanner."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'send_removed_revision_emails',
diff --git a/lib/lp/codehosting/scanner/events.py b/lib/lp/codehosting/scanner/events.py
index aa071f0..02fb140 100644
--- a/lib/lp/codehosting/scanner/events.py
+++ b/lib/lp/codehosting/scanner/events.py
@@ -3,6 +3,8 @@
"""Events generated by the scanner."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'NewMainlineRevisions',
diff --git a/lib/lp/codehosting/scanner/mergedetection.py b/lib/lp/codehosting/scanner/mergedetection.py
index c73cd52..26a23c7 100644
--- a/lib/lp/codehosting/scanner/mergedetection.py
+++ b/lib/lp/codehosting/scanner/mergedetection.py
@@ -3,6 +3,8 @@
"""The way the branch scanner handles merges."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'auto_merge_branches',
diff --git a/lib/lp/codehosting/scanner/tests/test_buglinks.py b/lib/lp/codehosting/scanner/tests/test_buglinks.py
index 935af50..aa220e9 100644
--- a/lib/lp/codehosting/scanner/tests/test_buglinks.py
+++ b/lib/lp/codehosting/scanner/tests/test_buglinks.py
@@ -3,6 +3,8 @@
"""Tests for creating BugBranch items based on Breezy revisions."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from breezy.revision import Revision
diff --git a/lib/lp/codehosting/scanner/tests/test_bzrsync.py b/lib/lp/codehosting/scanner/tests/test_bzrsync.py
index 36b4512..83f8e65 100644
--- a/lib/lp/codehosting/scanner/tests/test_bzrsync.py
+++ b/lib/lp/codehosting/scanner/tests/test_bzrsync.py
@@ -3,6 +3,8 @@
# Copyright 2009-2019 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
import datetime
import os
import random
diff --git a/lib/lp/codehosting/scanner/tests/test_email.py b/lib/lp/codehosting/scanner/tests/test_email.py
index a403251..3148e8b 100644
--- a/lib/lp/codehosting/scanner/tests/test_email.py
+++ b/lib/lp/codehosting/scanner/tests/test_email.py
@@ -3,6 +3,8 @@
"""Tests for the scanner's email generation."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import email
diff --git a/lib/lp/codehosting/scanner/tests/test_mergedetection.py b/lib/lp/codehosting/scanner/tests/test_mergedetection.py
index c0cb7ad..75775a2 100644
--- a/lib/lp/codehosting/scanner/tests/test_mergedetection.py
+++ b/lib/lp/codehosting/scanner/tests/test_mergedetection.py
@@ -3,6 +3,8 @@
"""Tests for the scanner's merge detection."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import logging
diff --git a/lib/lp/codehosting/scripts/modifiedbranches.py b/lib/lp/codehosting/scripts/modifiedbranches.py
index fd67f09..5ea0255 100644
--- a/lib/lp/codehosting/scripts/modifiedbranches.py
+++ b/lib/lp/codehosting/scripts/modifiedbranches.py
@@ -3,6 +3,8 @@
"""Implementation of the Launchpad script to list modified branches."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['ModifiedBranchesScript']
@@ -124,6 +126,6 @@ class ModifiedBranchesScript(LaunchpadScript):
self.update_locations(self.process_location(location))
for location in sorted(self.locations):
- print location
+ print(location)
self.logger.info("Done.")
diff --git a/lib/lp/codehosting/scripts/tests/test_modifiedbranches.py b/lib/lp/codehosting/scripts/tests/test_modifiedbranches.py
index a42696f..f7c9d2c 100644
--- a/lib/lp/codehosting/scripts/tests/test_modifiedbranches.py
+++ b/lib/lp/codehosting/scripts/tests/test_modifiedbranches.py
@@ -3,6 +3,8 @@
"""Test the modified branches script."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from datetime import datetime
diff --git a/lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py b/lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py
index 5f9443f..d268b8f 100644
--- a/lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py
+++ b/lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py
@@ -1,6 +1,8 @@
# Copyright 2011-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
diff --git a/lib/lp/codehosting/sftp.py b/lib/lp/codehosting/sftp.py
index 3c9dfb7..d99dcc6 100644
--- a/lib/lp/codehosting/sftp.py
+++ b/lib/lp/codehosting/sftp.py
@@ -12,6 +12,8 @@ The Bazaar Transport is special in two ways:
We call such a transport a "Twisted Transport".
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'avatar_to_sftp_server',
diff --git a/lib/lp/codehosting/sshserver/daemon.py b/lib/lp/codehosting/sshserver/daemon.py
index 5ae3b9b..3d6a429 100644
--- a/lib/lp/codehosting/sshserver/daemon.py
+++ b/lib/lp/codehosting/sshserver/daemon.py
@@ -3,6 +3,8 @@
"""Glues the codehosting SSH daemon together."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'ACCESS_LOG_NAME',
diff --git a/lib/lp/codehosting/sshserver/session.py b/lib/lp/codehosting/sshserver/session.py
index ef7825a..482dd4f 100644
--- a/lib/lp/codehosting/sshserver/session.py
+++ b/lib/lp/codehosting/sshserver/session.py
@@ -3,6 +3,8 @@
"""SSH session implementations for the codehosting SSH server."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'launch_smart_server',
diff --git a/lib/lp/codehosting/sshserver/tests/test_daemon.py b/lib/lp/codehosting/sshserver/tests/test_daemon.py
index 0bd9a25..e9b1314 100644
--- a/lib/lp/codehosting/sshserver/tests/test_daemon.py
+++ b/lib/lp/codehosting/sshserver/tests/test_daemon.py
@@ -3,6 +3,8 @@
"""Tests for the codehosting SSH server glue."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from lazr.sshserver.auth import (
diff --git a/lib/lp/codehosting/sshserver/tests/test_session.py b/lib/lp/codehosting/sshserver/tests/test_session.py
index da06fc8..fb07cea 100644
--- a/lib/lp/codehosting/sshserver/tests/test_session.py
+++ b/lib/lp/codehosting/sshserver/tests/test_session.py
@@ -3,6 +3,8 @@
"""Tests for SSH session support on the codehosting SSH server."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from twisted.conch.interfaces import ISession
diff --git a/lib/lp/codehosting/tests/helpers.py b/lib/lp/codehosting/tests/helpers.py
index 71d4a52..143dbbd 100644
--- a/lib/lp/codehosting/tests/helpers.py
+++ b/lib/lp/codehosting/tests/helpers.py
@@ -3,6 +3,8 @@
"""Common helpers for codehosting tests."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'AvatarTestCase',
diff --git a/lib/lp/codehosting/tests/servers.py b/lib/lp/codehosting/tests/servers.py
index 68c4a73..ad46357 100644
--- a/lib/lp/codehosting/tests/servers.py
+++ b/lib/lp/codehosting/tests/servers.py
@@ -3,6 +3,8 @@
"""Server used in codehosting acceptance tests."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
diff --git a/lib/lp/codehosting/tests/test_acceptance.py b/lib/lp/codehosting/tests/test_acceptance.py
index 85ec8c0..b753e3c 100644
--- a/lib/lp/codehosting/tests/test_acceptance.py
+++ b/lib/lp/codehosting/tests/test_acceptance.py
@@ -3,6 +3,8 @@
"""Acceptance tests for the codehosting server."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import os
diff --git a/lib/lp/codehosting/tests/test_breezy.py b/lib/lp/codehosting/tests/test_breezy.py
index c9cf83d..da1309f 100644
--- a/lib/lp/codehosting/tests/test_breezy.py
+++ b/lib/lp/codehosting/tests/test_breezy.py
@@ -3,6 +3,8 @@
"""Launchpad-specific tests of Breezy behaviour."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from lp.testing import TestCase
diff --git a/lib/lp/codehosting/tests/test_bzrutils.py b/lib/lp/codehosting/tests/test_bzrutils.py
index a78d35f..4c14d73 100644
--- a/lib/lp/codehosting/tests/test_bzrutils.py
+++ b/lib/lp/codehosting/tests/test_bzrutils.py
@@ -3,6 +3,8 @@
"""Tests for bzrutils."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import gc
diff --git a/lib/lp/codehosting/tests/test_format_comparison.py b/lib/lp/codehosting/tests/test_format_comparison.py
index de06e64..2f067c8 100644
--- a/lib/lp/codehosting/tests/test_format_comparison.py
+++ b/lib/lp/codehosting/tests/test_format_comparison.py
@@ -3,6 +3,8 @@
"""Unit tests for comparing Bazaar formats."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import unittest
diff --git a/lib/lp/codehosting/tests/test_lpserve.py b/lib/lp/codehosting/tests/test_lpserve.py
index 81294cc..a190816 100644
--- a/lib/lp/codehosting/tests/test_lpserve.py
+++ b/lib/lp/codehosting/tests/test_lpserve.py
@@ -3,6 +3,8 @@
"""Tests for the lp-serve plugin."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from breezy import errors
diff --git a/lib/lp/codehosting/tests/test_rewrite.py b/lib/lp/codehosting/tests/test_rewrite.py
index 4dab145..16be709 100644
--- a/lib/lp/codehosting/tests/test_rewrite.py
+++ b/lib/lp/codehosting/tests/test_rewrite.py
@@ -3,6 +3,8 @@
"""Tests for the dynamic RewriteMap used to serve branches over HTTP."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import os
diff --git a/lib/lp/codehosting/tests/test_sftp.py b/lib/lp/codehosting/tests/test_sftp.py
index 3ea1309..d827421 100644
--- a/lib/lp/codehosting/tests/test_sftp.py
+++ b/lib/lp/codehosting/tests/test_sftp.py
@@ -3,6 +3,8 @@
"""Tests for the transport-backed SFTP server implementation."""
+from __future__ import absolute_import, print_function
+
from contextlib import closing
import os
diff --git a/lib/lp/codehosting/tests/test_upgrade.py b/lib/lp/codehosting/tests/test_upgrade.py
index 3326d16..775a179 100644
--- a/lib/lp/codehosting/tests/test_upgrade.py
+++ b/lib/lp/codehosting/tests/test_upgrade.py
@@ -1,6 +1,8 @@
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
diff --git a/lib/lp/codehosting/upgrade.py b/lib/lp/codehosting/upgrade.py
index 2159871..343083b 100755
--- a/lib/lp/codehosting/upgrade.py
+++ b/lib/lp/codehosting/upgrade.py
@@ -10,6 +10,8 @@ Repositories that have no tree references are always upgraded to the standard
actually have tree references are converted to RepositoryFormat2aSubtree.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['Upgrader']
diff --git a/lib/lp/codehosting/vfs/__init__.py b/lib/lp/codehosting/vfs/__init__.py
index fd82790..66fbbee 100644
--- a/lib/lp/codehosting/vfs/__init__.py
+++ b/lib/lp/codehosting/vfs/__init__.py
@@ -3,6 +3,8 @@
"""A virtual filesystem for hosting Bazaar branches."""
+from __future__ import absolute_import, print_function
+
__all__ = [
'AsyncLaunchpadTransport',
'branch_id_to_path',
diff --git a/lib/lp/codehosting/vfs/branchfs.py b/lib/lp/codehosting/vfs/branchfs.py
index c984771..47b7da8 100644
--- a/lib/lp/codehosting/vfs/branchfs.py
+++ b/lib/lp/codehosting/vfs/branchfs.py
@@ -40,6 +40,7 @@ hooks into operations like `mkdir` and ask the `LaunchpadServer` to make a
branch if appropriate.
"""
+from __future__ import absolute_import, print_function
__metaclass__ = type
__all__ = [
@@ -706,7 +707,7 @@ class LaunchpadServer(_BaseLaunchpadServer):
"updating a Launchpad branch", request.oopsid)
# Twisted's log.err used to write to stderr but it doesn't now so
# we will write to stderr as well as log.err.
- print >> sys.stderr, repr(fault)
+ print(repr(fault), file=sys.stderr)
log.err(repr(fault))
return fault
return deferred.addCallback(got_path_info).addErrback(handle_error)
diff --git a/lib/lp/codehosting/vfs/branchfsclient.py b/lib/lp/codehosting/vfs/branchfsclient.py
index 3307830..aade58e 100644
--- a/lib/lp/codehosting/vfs/branchfsclient.py
+++ b/lib/lp/codehosting/vfs/branchfsclient.py
@@ -6,6 +6,8 @@
This code talks to the internal XML-RPC server for the branch filesystem.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'BranchFileSystemClient',
diff --git a/lib/lp/codehosting/vfs/hooks.py b/lib/lp/codehosting/vfs/hooks.py
index f0dc274..044add8 100644
--- a/lib/lp/codehosting/vfs/hooks.py
+++ b/lib/lp/codehosting/vfs/hooks.py
@@ -4,6 +4,8 @@
"""Implementations for the `seen_new_branch_hook` of `BranchFileSystemClient`.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = ['SetProcTitleHook']
diff --git a/lib/lp/codehosting/vfs/tests/test_branchfs.py b/lib/lp/codehosting/vfs/tests/test_branchfs.py
index 9e0896b..64cc6d9 100644
--- a/lib/lp/codehosting/vfs/tests/test_branchfs.py
+++ b/lib/lp/codehosting/vfs/tests/test_branchfs.py
@@ -3,6 +3,8 @@
"""Tests for the branch filesystem."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import codecs
diff --git a/lib/lp/codehosting/vfs/tests/test_branchfsclient.py b/lib/lp/codehosting/vfs/tests/test_branchfsclient.py
index 3417608..e05fce6 100644
--- a/lib/lp/codehosting/vfs/tests/test_branchfsclient.py
+++ b/lib/lp/codehosting/vfs/tests/test_branchfsclient.py
@@ -3,6 +3,8 @@
"""Tests for branchfsclient."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from testtools.twistedsupport import AsynchronousDeferredRunTest
diff --git a/lib/lp/codehosting/vfs/tests/test_filesystem.py b/lib/lp/codehosting/vfs/tests/test_filesystem.py
index 3e03e94..abf5197 100644
--- a/lib/lp/codehosting/vfs/tests/test_filesystem.py
+++ b/lib/lp/codehosting/vfs/tests/test_filesystem.py
@@ -3,6 +3,8 @@
"""Tests for the virtual filesystem presented by Launchpad codehosting."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
import stat
diff --git a/lib/lp/codehosting/vfs/tests/test_hooks.py b/lib/lp/codehosting/vfs/tests/test_hooks.py
index c6ad986..b1bfa07 100644
--- a/lib/lp/codehosting/vfs/tests/test_hooks.py
+++ b/lib/lp/codehosting/vfs/tests/test_hooks.py
@@ -3,6 +3,8 @@
"""Tests for the hooks in lp.codehosting.vfs.hooks."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from lp.codehosting.vfs.hooks import SetProcTitleHook
diff --git a/lib/lp/codehosting/vfs/tests/test_transport.py b/lib/lp/codehosting/vfs/tests/test_transport.py
index 45c155a..3f01473 100644
--- a/lib/lp/codehosting/vfs/tests/test_transport.py
+++ b/lib/lp/codehosting/vfs/tests/test_transport.py
@@ -3,6 +3,8 @@
"""Tests for the Launchpad code hosting Bazaar transport."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from breezy.tests import per_transport
diff --git a/lib/lp/codehosting/vfs/tests/test_transport_extensions.py b/lib/lp/codehosting/vfs/tests/test_transport_extensions.py
index 56b587f..e6c90b2 100644
--- a/lib/lp/codehosting/vfs/tests/test_transport_extensions.py
+++ b/lib/lp/codehosting/vfs/tests/test_transport_extensions.py
@@ -3,6 +3,8 @@
"""Tests for extensions in codehosting.vfs.transport."""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
from breezy.transport.memory import MemoryTransport
diff --git a/lib/lp/codehosting/vfs/transport.py b/lib/lp/codehosting/vfs/transport.py
index f4248f7..03192cb 100644
--- a/lib/lp/codehosting/vfs/transport.py
+++ b/lib/lp/codehosting/vfs/transport.py
@@ -8,6 +8,8 @@ module contains utilities for implementing virtual filesystems using
breezy.transport classes.
"""
+from __future__ import absolute_import, print_function
+
__metaclass__ = type
__all__ = [
'AsyncVirtualServer',