Hi!
I get an AttributeError while trying PostgreSql 8.4beta1 (compiled
from 'master' branch of the official git repository). See:

python2.4 src/dynamicware/manage.py test xx.FeedRetrieverServiceTest
Creating test database...
Traceback (most recent call last):
  File "src/dynamicware/manage.py", line 35, in ?
    execute_manager(settings)
  File "/path/to/project/Django-1.0.2/django/core/management/
__init__.py", line 340, in execute_manager
    utility.execute()
  File "/path/to/project/Django-1.0.2/django/core/management/
__init__.py", line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/path/to/project/Django-1.0.2/django/core/management/base.py",
line 192, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/path/to/project/Django-1.0.2/django/core/management/base.py",
line 219, in execute
    output = self.handle(*args, **options)
  File "/path/to/project/Django-1.0.2/django/core/management/commands/
test.py", line 33, in handle
    failures = test_runner(test_labels, verbosity=verbosity,
interactive=interactive)
  File "/path/to/project/Django-1.0.2/django/test/simple.py", line
142, in run_tests
    connection.creation.create_test_db(verbosity, autoclobber=not
interactive)
  File "/path/to/project/Django-1.0.2/django/db/backends/creation.py",
line 310, in create_test_db
    test_database_name = self._create_test_db(verbosity, autoclobber)
  File "/path/to/project/Django-1.0.2/django/db/backends/creation.py",
line 341, in _create_test_db
    cursor = self.connection.cursor()
  File "/path/to/project/Django-1.0.2/django/db/backends/__init__.py",
line 56, in cursor
    cursor = self._cursor(settings)
  File "/path/to/project/Django-1.0.2/django/db/backends/
postgresql_psycopg2/base.py", line 92, in _cursor
    self.__class__._version = get_version(cursor)
  File "/path/to/project/Django-1.0.2/django/db/backends/postgresql/
version.py", line 19, in get_version
    major, minor = VERSION_RE.search(version).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

The devserver works ok.

I think I've tracked down the problem: the RE used to get the version
of PostgreSql. On django/db/backends/postgresql/version.py:
VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\.')

So, PostgreSQL 8.3 (Ubuntu 8.10) returns this version string:
"PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real
(Ubuntu 4.3.2-1ubuntu11) 4.3.2"

But PostgreSql 8.4beta1 returns:
"PostgreSQL 8.4beta1 on i686-pc-linux-gnu, compiled by GCC gcc (Ubuntu
4.3.2-1ubuntu12) 4.3.2, 32-bit"

With the folowing VERSION_RE the test worked OK with PGSQL 8.3 and
8.4beta:

VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\D')

Is this a bug? Should I file a bug report?
I hope you find this helpfull. Sory for my English and thanks in
advance!

Horacio

(this is the diff against Django-1.0.2)

--- a/Django-1.0.2/django/db/backends/postgresql/version.py
+++ b/Django-1.0.2/django/db/backends/postgresql/version.py
@@ -4,7 +4,7 @@ Extracts the version of the PostgreSQL server.

 import re

-VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\.')
+VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\D')

 def get_version(cursor):
     """


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to