[Django] #24903: Backport assertRaisesMessage fix

9 views
Skip to first unread message

Django

unread,
Jun 3, 2015, 6:55:23 AM6/3/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
----------------------------------+----------------------------------------
Reporter: MoritzS | Owner: nobody
Type: Bug | Status: new
Component: Testing | Version: 1.8
framework |
Severity: Normal | Keywords: test assert raises message
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+----------------------------------------
In https://bugs.python.org/issue24134 python changed the behaviour of
`assertRaises` that breaks django's `assertRaisesMessage`.
Unfortunately this bug is not fixed in python's 2.7.10 release, so I think
the fixes on django's side should be backported at least to 1.8 because
right now it's not possible to use `assertRaisesMessage` as context
manager with 2.7.10.

Following commits contain the fixes on django's side:
c2bc1cefdcbbf074408f4a4cace88b315cf9d652
a0175724b086127a4e13612042961d3ba88d6bd9
e89c3a46035e9fe17c373a6c9cd63b9fd631d596

--
Ticket URL: <https://code.djangoproject.com/ticket/24903>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 3, 2015, 6:56:22 AM6/3/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------

Reporter: MoritzS | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: test assert raises | Triage Stage:
message | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by MoritzS):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

> In https://bugs.python.org/issue24134 python changed the behaviour of
> `assertRaises` that breaks django's `assertRaisesMessage`.
> Unfortunately this bug is not fixed in python's 2.7.10 release, so I
> think the fixes on django's side should be backported at least to 1.8
> because right now it's not possible to use `assertRaisesMessage` as
> context manager with 2.7.10.
>
> Following commits contain the fixes on django's side:
> c2bc1cefdcbbf074408f4a4cace88b315cf9d652
> a0175724b086127a4e13612042961d3ba88d6bd9
> e89c3a46035e9fe17c373a6c9cd63b9fd631d596

New description:

In https://bugs.python.org/issue24134 cpython changed the behaviour of


`assertRaises` that breaks django's `assertRaisesMessage`.

Unfortunately this bug is not fixed in cpython's 2.7.10 release, so I


think the fixes on django's side should be backported at least to 1.8
because right now it's not possible to use `assertRaisesMessage` as
context manager with 2.7.10.

Following commits contain the fixes on django's side:
c2bc1cefdcbbf074408f4a4cace88b315cf9d652
a0175724b086127a4e13612042961d3ba88d6bd9
e89c3a46035e9fe17c373a6c9cd63b9fd631d596

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:1>

Django

unread,
Jun 3, 2015, 7:32:41 AM6/3/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: test assert raises | Triage Stage:
message | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

I'm fairly sure that change was reverted in 2.7.10. Are you sure you're
running the final version and not the release candidate? Django's test
suite passes for me on 2.7.10.

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:2>

Django

unread,
Jun 3, 2015, 7:42:02 AM6/3/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: test assert raises | Triage Stage:
message | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by MoritzS):

{{{
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
$ tar -xf Python-2.7.10.tar.xz
$ grep -n 'is _sentinel' Python-2.7.10/Lib/unittest/case.py
472: if callableObj is _sentinel:
992: if callable_obj is _sentinel:
}}}
I took it straight from the official download, so I think that's the final
version.

The changes got reverted here:
https://hg.python.org/cpython/rev/0c93868f202e
Unfortunately that got merged into the 2.7 branch just after the 2.7.10
release.

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:3>

Django

unread,
Jun 3, 2015, 9:55:59 AM6/3/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: assigned

Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: test assert raises | Triage Stage: Accepted
message |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* owner: nobody => timgraham
* status: new => assigned
* stage: Unreviewed => Accepted


Comment:

Okay, that's a bit odd. The Windows installer seems to contain the revert
but the gzip tarball doesn't. I'll try to figure out what's going on.

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:4>

Django

unread,
Jun 9, 2015, 4:03:47 PM6/9/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: assigned
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: test assert raises | Triage Stage: Accepted
message |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

From bitdancer in #python-dev regarding merging of fixes to the release
branches of Python:
the way it is supposed to work is that issue like that get marked as
"release blocker" in the tracker, and the release manager makes sure they
are dealt with before cutting the release. Things do slip through the
cracks, though, and once they do the need to go into NEWS.

And as to why the Windows version contains the fix:
things being different between different builds of the release is a bug
in the release process. I'm not sure what happened there.

I'll fix this on 1.8 and 1.7. 1.4 isn't affected.
[https://github.com/django/django/pull/4841 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:5>

Django

unread,
Jun 9, 2015, 5:55:49 PM6/9/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: closed

Component: Testing framework | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: test assert raises | Triage Stage: Accepted
message |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"8bc18ebf0fc7d82dda266812a1920d179c54223c" 8bc18eb]:
{{{
#!CommitTicketReference repository=""
revision="8bc18ebf0fc7d82dda266812a1920d179c54223c"
[1.8.x] Fixed #24903 -- Fixed assertRaisesMessage on Python 2.7.10.

A regression in Python 2.7.10 rc1 wasn't reverted in the final
release: https://bugs.python.org/issue24134

Backport of two commits from master:
* c2bc1cefdcbbf074408f4a4cace88b315cf9d652
* e89c3a46035e9fe17c373a6c9cd63b9fd631d596
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:6>

Django

unread,
Jun 9, 2015, 5:55:50 PM6/9/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: closed
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: test assert raises | Triage Stage: Accepted
message |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"207da07d5988dc80439a10810ba28fc1fba42fe3" 207da07]:
{{{
#!CommitTicketReference repository=""
revision="207da07d5988dc80439a10810ba28fc1fba42fe3"
[1.7.x] Fixed #24903 -- Fixed assertRaisesMessage on Python 2.7.10.

A regression found in in Python 2.7.10 rc1 wasn't reverted for the final
release: https://bugs.python.org/issue24134

Backport of two commits from master:
* c2bc1cefdcbbf074408f4a4cace88b315cf9d652

* e89c3a46035e9fe17c373a6c9cd63b9fd631d596
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:7>

Django

unread,
Jun 9, 2015, 5:57:52 PM6/9/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: closed
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: test assert raises | Triage Stage: Accepted
message |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"90c59db7a3e1c9725ed6e3683ef8beba4eb77333" 90c59db]:
{{{
#!CommitTicketReference repository=""
revision="90c59db7a3e1c9725ed6e3683ef8beba4eb77333"
Forwardported release notes for refs #24903.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:8>

Django

unread,
Aug 16, 2015, 3:27:34 PM8/16/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: closed
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: test assert raises | Triage Stage: Accepted
message |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by bouke):

I ran into this issue with Django 1.4 on Python 2.7.10 as well. Any chance
on merging it into Django 1.4?

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:9>

Django

unread,
Aug 16, 2015, 3:30:04 PM8/16/15
to django-...@googlegroups.com
#24903: Backport assertRaisesMessage fix
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner: timgraham
Type: Bug | Status: closed
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: test assert raises | Triage Stage: Accepted
message |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

As Django 1.4 will be unsupported in a month and half (October 1), I don't
think it's a priority.

--
Ticket URL: <https://code.djangoproject.com/ticket/24903#comment:10>

Reply all
Reply to author
Forward
0 new messages