Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#18827 closed Bug (fixed)

Exclude __pycache__ from module detection

Reported by: aaugustin Owned by: nobody
Component: Python 3 Version: master
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 claudep 3 years ago.
Use pkgutil to list packages

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by claudep

Use pkgutil to list packages

comment:1 Changed 3 years ago by claudep

  • Has patch set
  • Triage Stage changed from Unreviewed to Accepted

Related tickets: #8280, #15084

comment:2 Changed 3 years ago by bhuztez

  • Cc bhuztez@… added

also #18603

comment:3 Changed 2 years ago by ramiro

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

comment:4 Changed 2 years ago by Claude Paroz <claude@…>

In 34a736b7521def321b2104d541e634134c5d1c62:

Used pkgutil to get list of backend modules

Refs #18827.

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