|
[Rivet-svn] rivet: Tweak for /tmp on different filesystemRivet Mercurial rivet at projects.hepforge.orgTue Jul 10 16:15:01 BST 2018
details: https://rivet.hepforge.org/hg/rivet/rev/d70c30b8b5a2 branches: release-2-6-x changeset: 6375:d70c30b8b5a2 user: Andy Buckley <andy at insectnation.org> date: Tue Jul 10 16:02:11 2018 +0100 description: Tweak for /tmp on different filesystem diffs (20 lines): --- a/bin/rivet-mkanalysis Tue Jul 10 14:54:29 2018 +0100 +++ b/bin/rivet-mkanalysis Tue Jul 10 16:02:11 2018 +0100 @@ -141,14 +141,13 @@ logging.info("Getting data file from HepData at %s" % hdurl) tmpfile = urlretrieve(hdurl)[0] # - import tarfile, os - print tmpfile + import tarfile, shutil tar = tarfile.open(tmpfile, mode="r") fnames = tar.getnames() if len(fnames) > 1: - logging.warning("Found more than one file in downloaded archive. Writing first only") + logging.warning("Found more than one file in downloaded archive. Treating first as canonical") tar.extractall() - os.rename(fnames[0], "%s.yoda" % ANANAME) + shutil.move(fnames[0], "%s.yoda" % ANANAME) except Exception as e: logging.warning("Problem encountered retrieving from HepData: %s" % hdurl) logging.warning("No reference data file written")
More information about the Rivet-svn mailing list |