[ python-Bugs-1052827 ] filelist.findall should use os.lstat

SourceForge.net noreply at sourceforge.net
Sat Oct 23 19:25:25 CEST 2004


Bugs item #1052827, was opened at 2004-10-23 10:25
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1052827&group_id=5470

Category: Distutils
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Geoffrey T. Dairiki (dairiki)
Assigned to: Nobody/Anonymous (nobody)
Summary: filelist.findall should use os.lstat

Initial Comment:
On unix platforms, if one has a dangling symlink
anywhere in ones source directory tree (and a
MANIFEST.in file), 'setup.py sdist' will fail. 
('OSError: [Errno 2] No such file or directory' on the
dangling symlink.)

A fix for this is for filefind.findall to use
os.lstat() instead of os.stat() (when lstat is available.) 

(Another possible fix would be to catch the
OSError(ENOENT) exception and either ignore it or
render it as a warning.)


Appendix A

Details on how to reproduce the bug:

In your top-level source directory (the one with a
setup.py):

1. Create a dangling symlink.  ('ln -s foo bar',
assuming the file 'foo' doesn't exist.)

2. Do a 'touch MANIFEST.in'

3. Run 'python setup.py sdist'

The command should fail with:

'error: bar: No such file or directory'
    




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1052827&group_id=5470


More information about the Python-bugs-list mailing list