Opened 7 years ago

Closed 6 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


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 . 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 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by adsworth

comment:1 Changed 7 years ago by Aymeric Augustin

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/; the changes in the other files look reasonable.

comment:2 Changed 7 years ago by adsworth

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/ do need to be reviewed by someone who knows more about the caching. IMHO, that solution works as expected.

comment:3 Changed 6 years ago by Claude Paroz

Resolution: fixed
Status: newclosed

This is now fixed in master.

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