diff options
author | Pedro Lamas <pedrolamas@gmail.com> | 2022-09-06 19:04:14 +0300 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2022-09-12 04:43:43 +0300 |
commit | f4440267e63dd372265fb223dc428ae3a83bf314 (patch) | |
tree | 4f94cdd8170307a3b58b865dbaff070cbf065a6a | |
parent | 30d25834c559d4055633284ef13d0ed6dbea27ad (diff) |
virtual_sdcard: read new lines as-is
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
-rw-r--r-- | klippy/extras/virtual_sdcard.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index daf19db9d..5c5a956fd 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -3,7 +3,7 @@ # Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net> # # 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) |