Closed Bug 1513346 Opened 7 years ago Closed 7 years ago

cleanup after python 3 migration

Categories

(Socorro :: General, task, P3)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: jwhitlock)

Details

Attachments

(3 files)

six is a really great library for easing the complexity of migrating from Python 2 to Python 3. Now that we've completed the migration, it behooves us to cleanup the code and remove six-isms. This bug covers that. Probably makes sense to do it directory by directory.
Priority: -- → P3

I'm adjusting the scope here to all Python 3 migration cleanup.

  1. remove usage of six library
  2. switch from mock to unittest.mock
  3. anything else we discover before closing this bug out
Summary: remove usage of six library → cleanup after python 3 migration

Convert most six usage to native Python 3, with the exception of six.reraise.

jwhitlock merged PR #4935: "bug 1513346: Migrate six.reraise to standard raise" in 750dece.

Deployed to stage, and tested with reprocessing https://crash-stats.allizom.org/report/index/594c512e-561d-4d05-92b0-992b20190519. It continues to have the ElasticSearch indexing error (bug 1503344). It results in 2 Sentry events. The first is a KeyError traceback, and the second is the wrapping PolyStorageError. The logs include a traceback, as well as the "error in processing or saving crash 594c512e-561d-4d05-92b0-992b20190519" message.

Deployed to production, six library is no longer used by Socorro code (although it is used by installed packages). Remaining issues that I know about.

  1. Switch from mock to unittest.mock
  2. Switch from class Foo(object): to class Foo:

willkg and I also discussed removing some empty __init__.py files, to use the implicit namespaced packages added in Python 3.3 (see PEP 420). Some could be removed, such as webapp-django/crashstats/*/management/__init__.py, but removing all of them starts breaking tests. We'll stick with the Python 2 convention of always including it for now.

This bug was specifically about removing six-isms which were there to help us migrate from Python 2 to Python 3. Now that six use is gone, we're good, so I'm going to mark this FIXED.

Assignee: willkg → jwhitlock
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: