[debexpo-devel] patch: deal gracefully with incomplete uploads

Serafeim Zanikolas serzan at hellug.gr
Fri Feb 20 22:40:46 CET 2009


On Wed, Feb 18, 2009 at 07:43:26PM +0000, Jonny Lamb wrote [edited]:
> On Mon, Feb 16, 23:59:27 +0000, Serafeim Zanikolas wrote:
> > -                os.remove(file)
> > +                os.path.exists(file) and os.remove(file)
> 
> I don't like this. This is the kind of thing I write in shell scripts
> and feel bad about doing so. I'd prefer if debexpo was more pythonic.

I won't argue over matters of style, but the check has to be there or else it
fails with OSError when an upload is missing the upstream orig file (and
presumably any other file).

> > +        # Check for missing files
> > +        missing_files = [f for f in toinstall if not os.path.exists(f)]
> > +        if missing_files:
> > +            self._reject('The following files are listed in the .changes ' +
> > +                         'file but have not been uploaded:\n\n%s' %
> > +                         "\n".join(missing_files))
> > +
> 
> Isn't this already in the checkfiles plugin?

That's correct. Somehow I managed to make an upload (using a dput modified for
breaking debexpo) that makes it throw an exception in debexpo-import:433
(shutil.move) but I can't reproduce it now :-/

-S



More information about the debexpo-devel mailing list