psycopg2.ProgrammingError: autocommit cannot be used inside a transaction

Bug #891249 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Django
Fix Released
Unknown
python-oops-tools
Fix Released
High
Gavin Panella

Bug Description

When running tests I get:

Creating test database for alias 'default'...
Traceback (most recent call last):
  File "bin/test", line 49, in <module>
    djangorecipe.test.main('oopstools.settings', 'oopstools')
  File ".../eggs/djangorecipe-0.19.2-py2.7.egg/djangorecipe/test.py", line 16, in main
    management.execute_manager(settings, argv=argv)
  File ".../parts/django/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File ".../parts/django/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ".../parts/django/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ".../parts/django/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File ".../eggs/South-0.7.3_r929-py2.7.egg/south/management/commands/test.py", line 8, in handle
    super(Command, self).handle(*args, **kwargs)
  File ".../parts/django/django/core/management/commands/test.py", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File ".../parts/django/django/test/simple.py", line 359, in run_tests
    old_config = self.setup_databases()
  File ".../parts/django/django/test/simple.py", line 296, in setup_databases
    test_db_name = connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
  File ".../eggs/South-0.7.3_r929-py2.7.egg/south/hacks/django_1_0.py", line 96, in wrapper
    f(*args, **kwargs)
  File ".../parts/django/django/db/backends/creation.py", line 351, in create_test_db
    self._create_test_db(verbosity, autoclobber)
  File ".../parts/django/django/db/backends/creation.py", line 416, in _create_test_db
    self.set_autocommit()
  File ".../parts/django/django/db/backends/creation.py", line 472, in set_autocommit
    self.connection.connection.autocommit = True
psycopg2.ProgrammingError: autocommit cannot be used inside a transaction

Related branches

Revision history for this message
Diogo Matsubara (matsubara) wrote :

See https://code.djangoproject.com/ticket/16250. There's an incompatibility between Django 1.3 and python-psycopg2 2.4.2 (oneiric version). Suggested workaround is to use a previous version of python-psycopg2 or to update to django trunk since this won't be in the next point release and AFAICT there's no 1.4 release yet.

Changed in django:
status: Unknown → Fix Released
Gavin Panella (allenap)
Changed in python-oops-tools:
status: Triaged → Fix Committed
assignee: nobody → Gavin Panella (allenap)
Changed in python-oops-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.