Code

Opened 3 years ago

Closed 23 months 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 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by adsworth

comment:1 Changed 3 years ago by aaugustin

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

comment:3 Changed 23 months ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

This is now fixed in master.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.