Upgrade to python3 is blocked by the unit tests failures. This bug will track fixes to unit tests needed to make them pass in the python3 environment.
In bug 1362323, :jotes kindly prepared the analysis of the current state of things:
There are 21 types of failures/errors that occur during a test-run on Python 3. Failures/errors sorted by number of occurrences:
118 times - TypeError: object of type 'map' has no len()
53 times - django.db.utils.DataError: invalid regular expression: quantifier operand invalid
14 times - TypeError: can only concatenate list (not "dict_values") to list
11 times - django.http.request.RawPostDataException: You cannot access body after reading from request's data stream
7 times - TypeError: 'dict_values' object is not subscriptable
5 times - TypeError: a bytes-like object is required, not 'str'
4 times - AttributeError: 'bytes' object has no attribute 'traceback'
3 times - TypeError: 'filter' object is not subscriptable
3 times - TypeError: '>=' not supported between instances of 'MagicMock' and 'int'
3 times - assert b'Bad Request: Request must be AJAX' == 'Bad Request: Request must be AJAX' + where b'Bad Request: Request must be AJAX' = <HttpResponseBadRequest status_code=400, "text/html; charset=utf-8">.content
2 times - TypeError: 'odict_values' object is not subscriptable
2 times - KeyError: 'has_next'
1 times - AssertionError: DoesNotExist not raised
1 times - TypeError: argument of type 'ResourceQuerySet' is not iterable
1 times - AssertionError: assert 'p' == 'cl' - p + cl
1 times - AssertionError: assert odict_keys(['...a', 'search']) == ['tag', 'type'...ta', 'search'] Use -v to get the full diff
1 times - ValueError: must have exactly one of create/read/write/append mode
1 times - TypeError: 'odict_items' object is not subscriptable
1 times - AssertionError: assert '^(?s:.)\Z' == '^.$' - ^(?s:.)\Z + ^.$
1 times - pontoon.base.models.DoesNotExist: Translation matching query does not exist.
1 times - TypeError: sequence item 0: expected str instance, bytes found
Detailed analysis of them per file:
There's a chance that some bigger problems/exceptions are hidden, but I don't think thats a blocker right now.