Opened 7 years ago

Closed 7 years ago

#9528 closed (invalid)

Oracle (cx_Oracle 4.4) exception raises AttributeError (no attribute message) with some errors

Reported by: erny Owned by: erny
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords: Oracle
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by kmtracey)

  • Description: Django requires the exception to have "message" attribute, but some errors don't. The real error is hidden and difficult to get.
  • How to reproduce:
    • install cx_Oracle: sudo easy_install cx_Oracle #requires python-setuptools
    • in your settings.py, use:
            * DATABASE_ENGINE = 'oracle'
            * DATABASE_NAME = 'XE'  # your dbname here
            * DATABASE_USER = 'testuser' # your user here
            * DATABASE_PASSWORD = 'password' # your password here
            * DATABASE_HOST = 'localhost'    # your db host
            * DATABASE_PORT = ''       # leave empty if default port 1521 
            * DEFAULT_TABLESPACE = 'NONEXISTING'  # use some invalid tablespace
            * DEFAULT_INDEX_TABLESPACE = 'NONEXISTING' # here also
      
    • with an empty database, run syncdb: ./manage syncdb

Traceback:

...
  File "/opt/csa-1.0.0-beta/parts/django/django/core/management/commands/syncdb.py", line 80, in handle_noargs
    cursor.execute(statement)
  File "/opt/csa-1.0.0-beta/parts/django/django/db/backends/oracle/base.py", line 364, in execute
    if e.message.code == 1400 and type(e) != IntegrityError:
AttributeError: DatabaseError instance has no attribute 'message'

Attachments (1)

oracle_attribute_error.diff (812 bytes) - added by erny 7 years ago.
Patch for "AttributeError: DatabaseError instance has no attribute 'message'"

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by erny

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I should have put the settings.py part into brackets.

comment:2 Changed 7 years ago by kmtracey

  • Description modified (diff)

Fixed formatting.

Changed 7 years ago by erny

Patch for "AttributeError: DatabaseError instance has no attribute 'message'"

comment:3 Changed 7 years ago by erny

  • Has patch set
  • Owner changed from nobody to erny
  • Status changed from new to assigned

comment:4 Changed 7 years ago by erny

  • Keywords Oracle added

comment:5 Changed 7 years ago by erny

  • Resolution set to invalid
  • Status changed from assigned to closed

The patch is not valid. It was made against trunk, but trunk does work correctly.

Note: See TracTickets for help on using tickets.
Back to Top