﻿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
17671	CursorWrapper in Python 2.7 cannot be used as a contextmanager	Michael Manfre	nobody	"The following code pattern for executing raw SQL works fine in Python 2.6.x, but fails in Python 2.7.x.

{{{
from django.db import connection
with connection.cursor() as c:
    c.execute('select 1')
}}}

Python 2.7.x results in

{{{
Traceback (most recent call last):
  File ""C:\projects\web-site\test\withcursor\myapp\tests.py"", line 21, in test_with_cursor
    with connection.cursor() as c:
AttributeError: __exit__
}}}

I was able to reproduce this with a new project using sqlite3 and a new app without any models."	Bug	closed	Database layer (models, ORM)	1.3	Normal	fixed	regression	denisenkom	Accepted	1	0	0	0	0	0
