Opened 20 months ago

Closed 20 months ago

Last modified 20 months 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 Changed 20 months ago by bmispelon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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 Changed 20 months ago by aaugustin

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