Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 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: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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

Download all attachments as: .zip

Change History (6)

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

patch

comment:1 Changed 6 years ago by mtredinnick

  • milestone set to 1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

ping?

comment:4 Changed 6 years ago by mtredinnick

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

(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 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.