Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20913 closed Bug (invalid)

django.utils.unittest is python 3 incompatable

Reported by: plant2@… Owned by: nobody
Component: Python 3 Version: 1.5
Severity: Normal Keywords: python3 unittest
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have seen two incompatibilities:

django.utils.unittest.results imports StringIO directly (moved in python 3.x)
django.utils.unittest.loader uses cmp (built-in in python 2.x)

Django 1.5.1 on python 3.3.1

Change History (2)

comment:1 by Baptiste Mispelon, 11 years ago

Resolution: invalid
Status: newclosed

Hi,

The unittest module shipped by django is a backport of the new unittest2 and is only there for compatibility with old python versions [1].

Therefore, the code in there will only actually be used if you run a python version older than 2.7 so python3 compatibility is not needed.

Thanks.

[1] https://docs.djangoproject.com/en/dev/releases/1.3/#unittest2-support

comment:2 by Aymeric Augustin, 11 years ago

For the same reasons, this backport was removed from Django when it dropped support for Python 2.6.

Note: See TracTickets for help on using tickets.
Back to Top