[Distutils] two bugs
Bastian Kleineidam
calvin@cs.uni-sb.de
Sat, 3 Jun 2000 17:20:33 +0200 (CEST)
Hello,
I discovered a minor glitch in install_data.py, line 59, in
get_outputs(self):
replace
return self.outfiles
with
return self.outfiles or []
to ensure a list is returned and not the None object.
Another bug I found:
When I run
# python setup.py sdist bdist_rpm
I get the following traceback:
[snipped]
running bdist_rpm
writing 'build/bdist.linux2-i686/rpm/SPECS/linkchecker.spec'
Traceback (innermost last):
File "setup.py", line 100, in ?
data_files = [('locale/de/LC_MESSAGES',
File "/usr/lib/python1.5/site-packages/distutils/core.py", line 111, in setup
dist.run_commands ()
File "setup.py", line 32, in run_commands
self.run_command (cmd)
File "/usr/lib/python1.5/site-packages/distutils/dist.py", line 757, in run_command
cmd_obj.run ()
File "/usr/lib/python1.5/site-packages/distutils/command/bdist_rpm.py", line 290, in run
source = sdist.get_archive_files()[0]
TypeError: unsubscriptable object
Here is why:
bdist_rpm.py:283: sdist = self.reinitialize_command ('sdist')
now sdist is _not_ finalized
bdist_rpm.py:288: self.run_command('sdist')
now sdist is _still_ not finalized! this is because we have run
'sdist' before and wrote this in the cache:
dist.py:751: if self.have_run.get (command):
return
and therefore sdist.get_archive_files() returns None which is not
subscriptable
I have no fix for this bug. Probly you should insert
in Distribution.reinitialize_command() the line
self.have_run[commandname] = 0
before the return.
Bastian