Export to GitHub

geodjango-basic-apps - issue #5

invalid time_zone setting causes strange stacktrace in geographic_admin


Posted on Feb 15, 2009 by Helpful Bear

What steps will reproduce the problem? 1. install geographic_admin and make sure it is all working 2. edit settings.py to change TIME_ZONE to an invalid value eg. TIME_ZONE='abcdefg' 3. python manage.py shell


What is the expected output? What do you see instead? a django python shell

instead I get a mysterious stack trace: geo@tux:~/geographic_admin$ python manage.py shell Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/home/geo/lib/python/django/core/management/init.py", line 340, in execute_manager utility.execute() File "/home/geo/lib/python/django/core/management/init.py", line 295, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/geo/lib/python/django/core/management/base.py", line 192, in run_from_argv self.execute(*args, **options.dict) File "/home/geo/lib/python/django/core/management/base.py", line 219, in execute output = self.handle(*args, **options) File "/home/geo/lib/python/django/core/management/base.py", line 348, in handle return self.handle_noargs(**options) File "/home/geo/lib/python/django/core/management/commands/shell.py", line 18, in handle_noargs loaded_models = get_models() File "/home/geo/lib/python/django/db/models/loading.py", line 136, in get_models self._populate() File "/home/geo/lib/python/django/db/models/loading.py", line 57, in _populate self.load_app(app_name, True) File "/home/geo/lib/python/django/db/models/loading.py", line 72, in load_app mod = import(app_name, {}, {}, ['models']) File "/home/geo/geographic_admin/world/models.py", line 6, in <module> from django.contrib.gis.db import models File "/home/geo/lib/python/django/contrib/gis/db/models/init.py", line 5, in <module> from django.contrib.gis.db.models.manager import GeoManager File "/home/geo/lib/python/django/contrib/gis/db/models/manager.py", line 2, in <module> from django.contrib.gis.db.models.query import GeoQuerySet File "/home/geo/lib/python/django/contrib/gis/db/models/query.py", line 5, in <module> from django.contrib.gis.db.backend import SpatialBackend File "/home/geo/lib/python/django/contrib/gis/db/backend/init.py", line 12, in <module> from django.contrib.gis.db.backend.postgis import create_spatial_db, get_geo_where_clause, SpatialBackend File "/home/geo/lib/python/django/contrib/gis/db/backend/postgis/init.py", line 4, in <module> from django.contrib.gis.db.backend.postgis.adaptor import PostGISAdaptor File "/home/geo/lib/python/django/contrib/gis/db/backend/postgis/adaptor.py", line 5, in <module> from django.contrib.gis.db.backend.postgis.query import GEOM_FROM_WKB File "/home/geo/lib/python/django/contrib/gis/db/backend/postgis/query.py", line 14, in <module> POSTGIS_VERSION, MAJOR_VERSION, MINOR_VERSION1, MINOR_VERSION2 = postgis_version_tuple() File "/home/geo/lib/python/django/contrib/gis/db/backend/postgis/management.py", line 45, in postgis_version_tuple version = postgis_lib_version() File "/home/geo/lib/python/django/contrib/gis/db/backend/postgis/management.py", line 25, in postgis_lib_version return _get_postgis_func('postgis_lib_version') File "/home/geo/lib/python/django/contrib/gis/db/backend/postgis/management.py", line 13, in _get_postgis_func cursor.execute('SELECT %s()' % func) File "/home/geo/lib/python/django/db/backends/util.py", line 19, in execute return self.cursor.execute(sql, params) psycopg2.ProgrammingError: current transaction is aborted, commands ignored

until end of transaction block

What version of the product are you using? On what operating system? geographic_admin revision 115 django 1.0.2 ubuntu 8.04 LTS postgresql 8.3.5-0ubuntu0.8.04 python-psycopg2 2.0.6-3 output of SELECT postgis_full_version(); POSTGIS="1.3.5" GEOS="3.0.3-CAPI-1.4.2" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS


Please provide any additional information below. the only settings I have changed in settings.py are the DATABASE_USER and TIME_ZONE when I change the timezone back to TIME_ZONE = 'America/Vancouver' everything works fine.

Other commands to manage.py also give the same stack trace. If I comment out the 'world' installed app I can get a shell as expected.

Comment #1

Posted on Feb 15, 2009 by Helpful Bear

I forgot to put my python version python 2.5.2-0ubuntu1

Status: New

Labels:
Type-Defect Priority-Medium