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 scoder
Recipients dstufft, eric.araujo, scoder
Date 2014-12-26.10:30:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419589855.59.0.704259891528.issue23114@psf.upfronthosting.co.za>
In-reply-to
Content
distutils uses this code to validate the input in "Command.__init__()":

        # late import because of mutual dependence between these classes
        from distutils.dist import Distribution

        if not isinstance(dist, Distribution):
            raise TypeError, "dist must be a Distribution instance"

(Lib/distutils/cmd.py, after line 50)

This fails if the calling code uses the stdlib Distribution type (e.g. with a module global import) but setuptools was only imported afterwards and replaced "distutils.dist.Distribution" with its own implementation. In this case, the above code will get hold of the setuptools implementation and the isinstance() check will fail as both classes are not compatible.

I guess this is a problem more in setuptools than in distutils, but a) this isinstance() check has a general code smell and b) pip and setuptools are automatically installed in a specific (impacted) version in Py2.7.9 and Py3.4, which makes this problem quite pressing for the stdlib side.
History
Date User Action Args
2014-12-26 10:30:55scodersetrecipients: + scoder, eric.araujo, dstufft
2014-12-26 10:30:55scodersetmessageid: <1419589855.59.0.704259891528.issue23114@psf.upfronthosting.co.za>
2014-12-26 10:30:55scoderlinkissue23114 messages
2014-12-26 10:30:53scodercreate