Py2exe error messages

Giles Brown giles_brown at
Sun Nov 2 12:28:47 CET 2003

"Ray" <sunking77 at> wrote in message news:<mailman.322.1067729524.702.python-list at>...
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
> C:\Python22>python py2exe --icon EXE icon
> Traceback (most recent call last):
>   File "", line 7, in ?
>     scripts = [""],
>   File "C:\Python22\distutils\", line 101, in setup
>     _setup_distribution = dist = klass(attrs)
>   File "C:\Python22\distutils\", line 130, in __init__
>     setattr(self, method_name, getattr(self.metadata, method_name))
> AttributeError: DistributionMetadata instance has no attribute
> 'get___doc__'
> This is the error message I'm getting when I try to run

Hmmm.  Have you taken a good look at the distutils/ code?

On my 2.2.2 installation the nearest match (which strangely isn't
line exactly on line 130) is this chunk of code:

        # Store the distribution meta-data (name, version, author, and so
        # forth) in a separate object -- we're getting to have enough
        # information here (and enough command-line options) that it's
        # worth it.  Also delegate 'get_XXX()' methods to the 'metadata'
        # object in a sneaky and underhanded (but efficient!) way.
        self.metadata = DistributionMetadata()
        for basename in self.metadata._METHOD_BASENAMES:
            method_name = "get_" + basename
            setattr(self, method_name, getattr(self.metadata, method_name))

Don't know if I'm teach grandma to suck eggs here, but this
code it constructing a metadata sub-object and "stealing" certain
"get" functions from it to pass off as its own.  The list of
attributes that it is prepared to get is taken from 
Distribution._METHOD_BASENAMES (in the same file).

Looking at the version of this from my installation I see:

class DistributionMetadata:
    """Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.

    _METHOD_BASENAMES = ("name", "version", "author", "author_email",
                         "maintainer", "maintainer_email", "url",
                         "license", "description", "long_description",
                         "keywords", "platforms", "fullname", "contact",
                         "contact_email", "licence")

This leads to the question where is the loop in the extract above
getting the "__doc__" from that is using to build the method name?

You may want to inspect your the distutils code in your python installation
(and maybe put a few print statements into it) to investigate.

Hope this helps.

More information about the Python-list mailing list