From f4440267e63dd372265fb223dc428ae3a83bf314 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 6 Sep 2022 17:04:14 +0100 Subject: [PATCH] virtual_sdcard: read new lines as-is Signed-off-by: Pedro Lamas --- klippy/extras/virtual_sdcard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index daf19db9..5c5a956f 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -3,7 +3,7 @@ # Copyright (C) 2018 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, logging +import os, logging, io VALID_GCODE_EXTS = ['gcode', 'g', 'gco'] @@ -177,7 +177,7 @@ class VirtualSD: if fname not in flist: fname = files_by_lower[fname.lower()] fname = os.path.join(self.sdcard_dirname, fname) - f = open(fname, 'r') + f = io.open(fname, 'r', newline='') f.seek(0, os.SEEK_END) fsize = f.tell() f.seek(0)