This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients brett.cannon, eric.snow, pitrou, r.david.murray
Date 2012-04-16.18:10:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334599849.02.0.985236124135.issue14551@psf.upfronthosting.co.za>
In-reply-to
Content
Well, if you want backward compatibility, you pretty much have to keep it as is, don't you?

This is the only time I've used load_source, and it was used because we didn't want to bother mucking with the path but did want to load the module whose file system location we knew.

SourceFileLoader(name, path).load_source() is OK, but it does not qualify as an obvious API for loading a module not on the path whose file system path one knows.  I'm OK with there not being an obvious API for that as long as there *is* an API for it.

To be clear: importlib.import_module(name) lets you load a module that *is* on the path, so it seems logical that there would be a corresponding function (load_file?) that would take a complete path and thereby allow you to load a module *not* on sys.path.  But there is by no means a *requirement* for such a function in my mind, as long as it can be done somehow.
History
Date User Action Args
2012-04-16 18:10:49r.david.murraysetrecipients: + r.david.murray, brett.cannon, pitrou, eric.snow
2012-04-16 18:10:49r.david.murraysetmessageid: <1334599849.02.0.985236124135.issue14551@psf.upfronthosting.co.za>
2012-04-16 18:10:48r.david.murraylinkissue14551 messages
2012-04-16 18:10:48r.david.murraycreate