Django

Code

Ticket #8239 (closed: fixed)

Opened 4 months ago

Last modified 4 months ago

django.core.management uses "from imp import find_module"

Reported by: Guido van Rossum <guido@python.org> Assigned to: nobody
Milestone: 1.0 Component: Core framework
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The early lookup of imp.find_module causes problems when run under Google App Engine, which doesn't support this function. It would be better to just import the imp module (which exists in a near-empty state in App Engine) and use imp.find_module later on -- then the failures aren't quite so fatal, and easier to debug.

Attachments

mgt.diff (1.0 kB) - added by Guido van Rossum <guido@python.org> on 08/11/08 14:20:22.
patch

Change History

08/11/08 14:20:22 changed by Guido van Rossum <guido@python.org>

  • attachment mgt.diff added.

patch

08/11/08 14:33:15 changed by mtredinnick

  • needs_better_patch changed.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • milestone set to 1.0.

"Not quite so fatal" sounds like "only a little pregnant". It's sort of a binary situation.

Is this an improvement to aid debugging or a fix for the GAE problem? If not the latter, is there something else we can do to help there as well? Patch looks reasonable to do either way -- but I prefer that style of import and use in any case, so I'm probably biased in addition to just simply having good taste in code style -- but I'm not sure what extent of the problem you're trying to fix here.

08/11/08 15:16:10 changed by Guido van Rossum <guido@python.org>

It's not just a debugging fix -- the code that uses find_module() doesn't actually ever get invoked in my app. (Don't ask me why, I don't understand that area very well.)

IOW it's not binary at all.

08/15/08 16:49:42 changed by Guido van Rossum <guido@python.org>

ping?

08/17/08 12:35:34 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [8425]) Fixed #8239 -- Google App Engine has a restricted "imp" module, which doesn't include one of the methods we use when constructing management help commands. So postpone the resolving of the method name until when we actually need it (which isn't run as part of GAE). Patch from Guido van Rossum.


Add/Change #8239 (django.core.management uses "from imp import find_module")




Change Properties
Action