From: Janne Blomqvist Date: Tue, 21 May 2019 08:37:05 +0000 (+0300) Subject: contrib/mklog: Open files in text mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=36902ed6bdeafc86e1f9b1778a1138b21580cc93;p=gcc.git contrib/mklog: Open files in text mode Due to the python 3 conversion, files should be opened in text mode, matching stdin/stdout. 2019-05-21 Janne Blomqvist * mklog: Open files in text mode. From-SVN: r271459 --- diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 2b6425b9ec2..455d3f80146 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2019-05-21 Janne Blomqvist + + * mklog: Open files in text mode. + 2019-05-21 Janne Blomqvist * mklog: Convert to Python 3. diff --git a/contrib/mklog b/contrib/mklog index 125f52ef11c..be1dc3a27fc 100755 --- a/contrib/mklog +++ b/contrib/mklog @@ -380,7 +380,7 @@ def main(): if len(args) == 1 and args[0] == '-': input = sys.stdin elif len(args) == 1: - input = open(args[0], 'rb') + input = open(args[0]) else: error("too many arguments; for more details run with -h") @@ -442,7 +442,7 @@ def main(): shutil.copymode(args[0], tmp) # Open the temp file, clearing contents. - out = open(tmp, 'wb') + out = open(tmp, 'w') else: tmp = None out = sys.stdout