[issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x

2011-09-04 Thread Alexander Dutton

Alexander Dutton alexander.dut...@oucs.ox.ac.uk added the comment:

I've come across it as I'm creating a Debian package of the Python package in 
the same tree — I'm happy to be told this is a Bad Idea and that they should be 
in different places.

The broken symlinks are relative and in debian/tmp, and will point to locations 
provided by other Debian packages once my package is installed in the right 
location.

FWIW, I'm getting round it at the moment by walking the directory tree and 
removing the files is os.path.islink(filename) and not 
os.path.exists(os.path.join(filename, os.readlink(filename))).

I'm happy to provide tests and a patch if necessary.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12885
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x

2011-09-02 Thread Alexander Dutton

New submission from Alexander Dutton alexander.dut...@oucs.ox.ac.uk:

If there are any broken symlinks in the same directory as a setup.py when e.g. 
sdist is run, findall() will fall over when attempting to os.stat() the symlink:

Traceback (most recent call last):
  File setup.py, line 81, in run
_sdist.run(self)
  File /usr/lib/python2.6/distutils/command/sdist.py, line 144, in run
self.get_file_list()
  File /usr/lib/python2.6/distutils/command/sdist.py, line 238, in 
get_file_list
self.filelist.findall()
  File /usr/lib/python2.6/distutils/filelist.py, line 47, in findall
self.allfiles = findall(dir)
  File /usr/lib/python2.6/distutils/filelist.py, line 297, in findall
stat = os.stat(fullname)
OSError: [Errno 2] No such file or directory: 
'debian/tmp/usr/share/somepath/somesymlink'

Solutions would include replacing the call to os.stat() with one to os.lstat() 
(probably backwards-incompatible), or trying one and then the other.

This bug is present in Pythons 2.6.6 (Debian 6.0.2) and 2.7 (Fedora 14).

When attempting to reproduce in Python 3.1.2 (on Fedora) no error was 
encountered. However, looking at distutils/filelist.py, the same unadulterated 
call to os.stat() is present. I'll presume that for whatever reason distutils 
in Py3.1.2 never has cause to stat my broken symlink.

--
assignee: tarek
components: Distutils
messages: 143399
nosy: Alexander.Dutton, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils.filelist.findall() fails on broken symlink in Py2.x
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12885
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5862] multiprocessing 'using a remote manager' example errors and possible 'from_address' code leftover

2009-11-19 Thread Alexander Dutton

Changes by Alexander Dutton d...@alexdutton.co.uk:


--
nosy: +alexdutton

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5862
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com