chayapan / geodjango-basic-apps

Automatically exported from code.google.com/p/geodjango-basic-apps
0 stars 0 forks source link

invalid time_zone setting causes strange stacktrace in geographic_admin #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by greg.aum...@gmail.com on 15 Feb 2009 at 8:35

GoogleCodeExporter commented 9 years ago
I forgot to put my python version
python  2.5.2-0ubuntu1

Original comment by greg.aum...@gmail.com on 15 Feb 2009 at 8:46