Opened 13 years ago

Closed 12 years ago

#16997 closed Bug (fixed)

some contrib.session tests fail in Python3

Reported by: adsworth Owned by: adsworth
Component: Python 3 Version: 1.3
Severity: Normal Keywords:
Cc: adsworth Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The attached patch fixes contrib.sessions so that all tests pass.

I've had to modify 2 tests. In Python 3 dict.values returns a dict_values view instead of a list. See http://docs.python.org/whatsnew/2.7.html#pep-3106-dictionary-views . So comparing dict.values() with [] will always fail. Wrapping dict.values() in a list call works as expected and has no side effects in py2.x

Attachments (1)

fix-contib-session-py3.patch (4.2 KB ) - added by adsworth 13 years ago.

Download all attachments as: .zip

Change History (4)

by adsworth, 13 years ago

comment:1 by Aymeric Augustin, 13 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

Currently, in the py3k branch, the sessions tests result in: failures=6, errors=43. With the patch, this goes down to: failures=6, errors=1.

I'm not sufficiently familiar with the py3k branch to validate the changes in django/core/cache/backends/base.py; the changes in the other files look reasonable.

comment:2 by adsworth, 13 years ago

It seems that some of the other py3 patches I've submitted correct the remaining errors in the sessions package.

The changes in django/core/cache/backends/base.py do need to be reviewed by someone who knows more about the caching. IMHO, that solution works as expected.

comment:3 by Claude Paroz, 12 years ago

Resolution: fixed
Status: newclosed

This is now fixed in master.

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