Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#8706 closed (fixed)

Django lists *.pyo files as available database backends if you compiled Django in optimized mode

Reported by: viktor@… Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


One can compile the whole Django package as optimized .pyo files or use it from a script executed by python -OO, which turns on creation of .pyo file. There is a line in db/ that lists the available backends:

available_backends = [f for f in os.listdir(backend_dir) if not f.startswith('_') and not f.startswith('.') and not f.endswith('.py') and not f.endswith('.pyc')]

It lists util.pyo and creation.pyo as available backends. The list should be filtered to include only directories instead. For example:

available_backends = [f for f in os.listdir(backend_dir) if os.path.isdir(os.path.join(backend_dir, f)]

Change History (4)

comment:1 Changed 8 years ago by mtredinnick

  • milestone 1.0 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Not 1.0 material. That list is only used for diagnostics; this can wait.

comment:2 Changed 7 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 years ago by mtredinnick

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

(In [9930]) Fixed #8706 -- Improved the way we detect available database backends.

Thanks, victor@….

comment:4 Changed 5 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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