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)