Message233104
| 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:55 | scoder | set | recipients:
+ scoder, eric.araujo, dstufft |
| 2014年12月26日 10:30:55 | scoder | set | messageid: <1419589855.59.0.704259891528.issue23114@psf.upfronthosting.co.za> |
| 2014年12月26日 10:30:55 | scoder | link | issue23114 messages |
| 2014年12月26日 10:30:53 | scoder | create |
|