﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23381	Context manager should determine their initial state at __enter__, not __init__	Thomas Chaumeny	nobody	"Some context manager use __init__ to determine their initial state and __exit__ to restore that state. The correct way to use context manager is to determine the initial state within the __enter__ method. This is especially dangerous when using `ContextDecorator` where initialization time can be different from ""entering"" time.

Flawed context managers are `django.utils.translation.override` (which leads to a bug following the use of `ContextDecorator`) and `django.utils.timezone.override`. The pull request below fix them both and updates a test to demonstrate the failure with `django.utils.translation.override`."	Bug	closed	Utilities	1.6	Normal	fixed			Ready for checkin	1	0	0	0	0	0
