Opened 18 years ago
Last modified 18 years ago
#2968 closed defect
2nd/3rd arguments for __import__ are '' (empty string) instead of {} (empty dictionary) — at Initial Version
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
According to Python library reference, the 2nd/3rd arguments of import should be a dictionary
(whatever globals() or locals() returns), but (empty strings) are used instead in some part of the code.
It's not fatal because current CPython implementation does not care what type those argument are,
however, it may change in future, or in alternative Python implementation such as IronPython or Jython
(actually, Jython raises ValueError for import(mod, , , [])).
Relevant files include: conf/init.py, core/management.py, core/urlresolvers.py, db/init.py,
template/init.py, template/context.py, template/loader.py, templatetags/init.py, test/doctest.py,
test/simple.py, views/debug.py, contrib/auth/init.py, core/cache/init.py, core/handlers/base.py,
core/serializers/init.py, db/models/loading.py, template/loaders/app_directories.py,
contrib/admin/views/doc.py, and contrib/admin/views/template.py.
Patch to fix import args