Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#8239 closed (fixed) uses "from imp import find_module"

Reported by: Guido van Rossum <guido@…> Owned by: nobody
Component: Core (Other) Version: master
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


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@…> 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by Guido van Rossum <guido@…>

Attachment: mgt.diff added


comment:1 Changed 12 years ago by Malcolm Tredinnick

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 Changed 12 years ago by Guido van Rossum <guido@…>

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 Changed 12 years ago by Guido van Rossum <guido@…>


comment:4 Changed 12 years ago by Malcolm Tredinnick

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 Changed 9 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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