![](https://secure.gravatar.com/avatar/3d5a540f00cbb2cc4e09ae5913fa781a.jpg?s=120&d=mm&r=g)
On 14 July 2000, Bastian Kleineidam said:
the findall function in sdist.py gives an error when a broken link is found. The responsible function call is os.stat().
I replaced the stat() calls with os.path.{isfile,islink,isdir}. This is somewhat more robust. The new findall is now a member function of the sdist class so I can use self.announce to warn about broken links.
I've looked into this a bit and decided it's a feature. (Ie., it'd be too hard to fix it properly.) It boils down to this: the 'findall()' routine in sdist.py isn't the only place that pokes about the filesystem looking for stuff; to do this right, we would have to detect dangling links in all such places. (The only other place I can think of offhand is in built_py.py, where we turn the packages listed in the 'packages' list into a list of filenames.) Or we could have a single function or class whose job it is to walk the filesystem looking for stuff: that's probably the right way, and the filesystem-searching code in sdist.py is general enough that it wouldn't take much to extract it and make it into something useful across the whole of the Distutils. But, on reflection, I'm not going to bother. In an ideal world, we'd warn about dangling links and then skip them. In a bad world, we'd include dangling links in tarballs. Blowing up when we hit dangling links isn't the best, but it isn't the worst either. Greg PS. what an appropriate fortune for this post... -- Greg Ward - maladjusted nerd gward@python.net http://starship.python.net/~gward/ Save energy: be apathetic.