[Distutils] copy_file semantics changed?

Bastian Kleineidam calvin@cs.uni-sb.de
Thu, 22 Jun 2000 02:23:54 +0200 (CEST)


Hi,

I noticed the following Traceback with bdist_rpm command:
Traceback (innermost last):
  File "setup.py", line 120, in ?
    data_files = [('share/locale/de/LC_MESSAGES',
  File "/usr/lib/python1.5/site-packages/distutils/core.py", line 112, in
setup
    dist.run_commands ()
  File "setup.py", line 47, in run_commands
    self.run_command (cmd)
  File "/usr/lib/python1.5/site-packages/distutils/dist.py", line 788, in
run_command
    cmd_obj.run ()
  File "/usr/lib/python1.5/site-packages/distutils/command/install.py",
line 474, in run
    outputs[counter] = outputs[counter][root_len:]
TypeError: unsliceable object
Bad exit status from /var/tmp/rpm-tmp.56627 (%install)
error: command 'rpm' failed with exit status 1

Reason is that file_util.py:copy_file does not return the copyied file
name any more (it used to I think) but instead a boolean value for
successful copying.
This is not good because it breaks the get_outputs() functions of
install commands (see the above traceback). For example get_outputs() of
install_data looks like [0, 0, 0].

I suggest that you change back to the old behaviour:
if copy_file fails, throw an exception
else return target file name (even if you copied nothing because the
target file was newer)

Bastian Kleineidam