Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8239 closed (fixed)

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

Reported by: Guido van Rossum <guido@…> Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (1)

mgt.diff (1.0 KB ) - added by Guido van Rossum <guido@…> 16 years ago.
patch

Download all attachments as: .zip

Change History (6)

by Guido van Rossum <guido@…>, 16 years ago

Attachment: mgt.diff added

patch

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

"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.

comment:2 by Guido van Rossum <guido@…>, 16 years ago

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.

comment:3 by Guido van Rossum <guido@…>, 16 years ago

ping?

comment:4 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(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.

comment:5 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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