From 470280e3b4061f32dd4fc3712f5a2a6ae5557f6d Mon Sep 17 00:00:00 2001 From: Kevin Deldycke <kevin@nexedi.com> Date: Mon, 30 Jan 2006 14:40:17 +0000 Subject: [PATCH] Use shutil to correct the same problem as the one discribe here: http://mail.python.org/pipermail/python-list/2005-February/266553.html git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5418 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/bin/genbt5list | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/product/ERP5/bin/genbt5list b/product/ERP5/bin/genbt5list index a84a4a49f7..ab8f81091a 100755 --- a/product/ERP5/bin/genbt5list +++ b/product/ERP5/bin/genbt5list @@ -35,6 +35,7 @@ import tarfile import os import sys import tempfile +import shutil property_list = ('title', 'version', 'description', 'license', 'dependency_list', 'copyright_list') @@ -59,9 +60,9 @@ def readBusinessTemplate(tar): property_dict[name_list[2]] = text finally: f.close() - + return property_dict - + def generateInformation(fd): os.write(fd, '<?xml version="1.0"?>\n') os.write(fd, '<repository>\n') @@ -90,9 +91,9 @@ def generateInformation(fd): info('done\n') finally: tar.close() - + os.write(fd, '</repository>\n') - + def main(): if len(sys.argv) < 2: dir_list = ['.'] @@ -112,7 +113,7 @@ def main(): os.remove(path) raise else: - os.rename(path, 'bt5list') + shutil.move(path, 'bt5list') os.chdir(cwd) main() -- 2.30.9