From: Zhiju Fan Date: Fri, 11 Jan 2019 05:04:44 +0000 (+0800) Subject: BaseTools:Double carriage return inserted from Trim.py on Python3 X-Git-Tag: edk2-stable201903~218 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=62cb98c254c8c24f610a427c948ca68ba43d7882 BaseTools:Double carriage return inserted from Trim.py on Python3 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 Tested-by: Laszlo Ersek Tested-by: Ard Biesheuvel Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- 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 @@ -205,7 +205,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong): 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))