Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#18827 closed Bug (fixed)

Exclude __pycache__ from module detection

Reported by: Aymeric Augustin Owned by: nobody
Component: Python 3 Version: dev
Severity: Normal Keywords:
Cc: bhuztez@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you make a typo in the database backend you get this error message on Python 3:

Try using django.db.backends.XXX, where XXX is one of:
    '__pycache__', 'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'

At least __pycache__ should be filtered out. Maybe dummy too.

It would be nice to check if this pattern occurs in other places in Django.

(One more reason not to attempt listing modules in a package...)

Attachments (1)

18827-1.diff (900 bytes ) - added by Claude Paroz 12 years ago.
Use pkgutil to list packages

Download all attachments as: .zip

Change History (5)

by Claude Paroz, 12 years ago

Attachment: 18827-1.diff added

Use pkgutil to list packages

comment:1 by Claude Paroz, 12 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

Related tickets: #8280, #15084

comment:2 by bhuztez, 12 years ago

Cc: bhuztez@… added

also #18603

comment:3 by Ramiro Morales, 12 years ago

Resolution: fixed
Status: newclosed

comment:4 by Claude Paroz <claude@…>, 12 years ago

In 34a736b7521def321b2104d541e634134c5d1c62:

Used pkgutil to get list of backend modules

Refs #18827.

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