[Distutils] copy_file semantics changed?

Greg Ward gward@python.net
Thu, 22 Jun 2000 21:32:59 -0400

On 22 June 2000, Bastian Kleineidam said:
> I noticed the following Traceback with bdist_rpm command:
> Traceback (innermost last):
>   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.

~#@!$^~@#@#%!#^$#!  My mistake: I got confused over copy_file's
interface, obviously.

> 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)

That assumes that I changed the interface to return boolean arbitrarily.
I did not: I believe there is code that depends on it returning
boolean.  And now there is also code that depends on it returning the
output filename.  Damn!  Time to grep the source for copy_file and see
how it's *really* used...

(and also time to write those regression tests!)

Greg Ward - nerd                                        gward@python.net
A man wrapped up in himself makes a very small package.