#4743 closed (invalid)
MySQLdb version check is flakey
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
when I try to execute the following command gives me an error:
python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/lib/python2.5/site-packages/django/core/management.py", line 1672, in execute_manager
execute_from_command_line(action_mapping, argv)
File "/usr/lib/python2.5/site-packages/django/core/management.py", line 1571, in execute_from_command_line
action_mapping[action](int(options.verbosity), options.interactive)
File "/usr/lib/python2.5/site-packages/django/core/management.py", line 486, in syncdb
from django.db import connection, transaction, models, get_creation_module
File "/usr/lib/python2.5/site-packages/django/db/__init__.py", line 11, in <module>
backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, [''])
File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/base.py", line 20, in <module>
raise ImportError, "MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__
ImportError: MySQLdb-1.2.1p2 or newer is required; you have 1.2.2
Note the last line
Change History (5)
comment:1 by , 18 years ago
| Component: | Uncategorized → Database wrapper |
|---|---|
| Owner: | changed from to |
| Summary: | python manage.py syncdb → MySQLdb version check is flakey |
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 18 years ago
comment:3 by , 18 years ago
Hmm, submitter said (in IRC chat) that python -c "import MySQLdb;print MySQLdb.version_info" returns (1,2,2,'final',0).
But testing that against the version code in SVN (django.db.backends.mysql.base) works fine:
>>> version = (1,2,2,'final',0)
>>> (version < (1,2,1) or (version[:3] == (1, 2, 1) and
(len(version) < 5 or version[3] != 'final' or version[4] < 2)))
False
So I'm not sure how it's raising the error. admin@javadn, are you using the SVN version?
comment:4 by , 18 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
Chris: you have to be careful interpreting the output here. This is the Fedora 7 bug (not a Django bug). You can tell because the output from that print statement does not include any spaces after the commas. So Python isn't formatting the tuple for output. It's returning a string and display that literally. The string in the Fedora 7 rpm does not include spaces (apparently they don't believe in backwards compatibility or good typography practices).
What you really want to ask for when querying people about this is type(version_info) or repr(version_info). Tuple, good; string, bad.
I'm going to close this as invalid. It's not our bug and hopefully Fedora will fix it soon.
Are you by chance using Fedora 7?.
If so, take a look at this message on django-users: http://groups.google.com/group/django-users/browse_thread/thread/6f99db48473b9eba/8b1d734cd1cb9b40?lnk=gst&q=fedora&rnum=1&hl=en#8b1d734cd1cb9b40