[Python-Dev] [Distutils] PEP 365 (Adding the pkg_resources module)

Paul Moore p.f.moore at gmail.com
Wed Mar 19 19:34:02 CET 2008


On 19/03/2008, Guido van Rossum <guido at python.org> wrote:
> On Mon, Mar 17, 2008 at 2:19 PM, zooko <zooko at zooko.com> wrote:
>  >  4.  The standard Python library includes a tool to find and read
>  >  resources (other than Python modules) that came bundled in a Python
>  >  package.
>
> I think we're pretty close to this already. PEP 302 defines a
>  getdata() method. Hopefully most PEP 302 implementations support it.
>  The only thing missing IMO is a little function that does what
>  getdata() does when there is no __loader__ object (i.e. when the
>  default "import-from-filesystem" import method is used).

I'm currently working on an addition to pkgutil to provide this type
of function. I'm considering going a little further (adding functions
to get a file-like object, test for existence, and list available
resources, modelled on the pkg_resources functions - but these extra
ones are not supported by the loader protocol, so I'm undecided as to
whether it's worth it, I'll see how complex the code gets).

Once I have a patch, I'll post it to the tracker. What's the best
approach? Code a patch for 3.0 and backport, or code for 2.6 and let
the merging process do its stuff?

Paul.


More information about the Python-Dev mailing list