From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3897D2194D387 for ; Mon, 28 Jan 2019 18:06:46 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2019 18:06:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,535,1539673200"; d="scan'208";a="295229865" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga005.jf.intel.com with ESMTP; 28 Jan 2019 18:06:44 -0800 From: "Feng, Bob C" To: edk2-devel@lists.01.org Cc: Zhiju Fan , Bob Feng , Liming Gao Date: Tue, 29 Jan 2019 10:05:56 +0800 Message-Id: <20190129020610.14300-20-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 In-Reply-To: <20190129020610.14300-1-bob.c.feng@intel.com> References: <20190129020610.14300-1-bob.c.feng@intel.com> MIME-Version: 1.0 Subject: [Patch 19/33] BaseTools:Double carriage return inserted from Trim.py on Python3 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 02:06:46 -0000 Content-Transfer-Encoding: 8bit From: Zhiju Fan https://bugzilla.tianocore.org/show_bug.cgi?id=1379 Line 208 of BaseTools/Source/Python/Trim/Trim.py uses 'NewLines.append(os.linesep)' to insert a new line into the list that will be written to the output file. This causes the '\r\n' inserted with os.linesep to be written as '\r\r\n', causing some assemblers to error. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/Trim/Trim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py index 4b3091bec3..51010bf326 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -203,11 +203,11 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong): # possible? NewLines[LineNumber - 1] = Line else: if LineNumber > (len(NewLines) + 1): for LineIndex in range(len(NewLines), LineNumber-1): - NewLines.append(os.linesep) + NewLines.append(TAB_LINE_BREAK) NewLines.append(Line) LineNumber = None EdkLogger.verbose("Now we have lines: %d" % len(NewLines)) else: NewLines.append(Line) -- 2.20.1.windows.1