[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnulib-tool.py: Append, don't replace existing VCS ignore fi
From: |
Eric Blake |
Subject: |
Re: [PATCH] gnulib-tool.py: Append, don't replace existing VCS ignore files |
Date: |
Mon, 11 Sep 2017 06:55:00 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/11/2017 06:49 AM, Darshit Shah wrote:
> * pygnulib/GLImport.py(_update_ignorelist_): Append the ignore data to
> any existing VCS ignore files instead of replacing them
> ---
> pygnulib/GLImport.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
> index 4352a7ec5..b0e3ec655 100644
> --- a/pygnulib/GLImport.py
> +++ b/pygnulib/GLImport.py
> @@ -726,9 +726,9 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
> if not self.config['dryrun']:
> print('Updating %s (backup in %s)' %
> (srcpath, backupname))
> - shutil.move(srcpath, backupname)
> + shutil.copy2(srcpath, backupname)
> result = string()
> - with codecs.open(srcpath, 'wb', 'UTF-8') as file:
> + with codecs.open(srcpath, 'a', 'UTF-8') as file:
Shouldn't you use 'ab' to force the append in binary rather than text
mode, since the old code was using 'wb'?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature