Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1167 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Problem with savisit and PostgreSQL?

Reported by: mikl Owned by: anonymous
Priority: high Milestone: 1.0b2
Component: SQLAlchemy Version: 1.0b1
Severity: normal Keywords:
Cc:

Description (last modified by jorge.vargas) (diff)

Hi guys,

I've been experimenting a bit with TG 1.0b1 and PostgreSQL, and I've found a problem with the standard Identity code (with SQLAlchemy).

SQLAlchemy causes all DateTime? columns to be created in Postgres as a "timestamptz" column - which, as the name implies, also contains the timezone. So when SQLAlchemy return the data, we get a time-tuple, WITH the timezone.

This causes problems, since the datetime.now() used in much of the SA based identity code is timezone-naive. Thus, when I run the code, I get this traceback:

raceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 103, in _run
    applyFilters('before_main')
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/filters/__init__.py", line 151, in applyFilters
    method()
  File "/usr/lib/python2.4/site-packages/TurboGears-1.0b1-py2.4.egg/turbogears/visit/api.py", line 140, in before_main
    visit= _manager.visit_for_key( visit_key )
  File "/usr/lib/python2.4/site-packages/TurboGears-1.0b1-py2.4.egg/turbogears/visit/savisit.py", line 42, in visit_for_key
    if not visit or visit.expiry < now:
TypeError: can't compare offset-naive and offset-aware datetimes

Change History

comment:1 Changed 13 years ago by jorge.vargas

  • Priority changed from normal to high
  • Component changed from unassigned to SQLAlchemy
  • Description modified (diff)
  • Milestone set to 1.0b2

comment:2 Changed 13 years ago by elvelind

  • Status changed from new to closed
  • Resolution set to fixed

fixed in 2068

Note: See TracTickets for help on using tickets.