virtual_sdcard: read new lines as-is
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
parent
30d25834c5
commit
f4440267e6
|
@ -3,7 +3,7 @@
|
||||||
# Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
|
# Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
|
||||||
#
|
#
|
||||||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
# 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']
|
VALID_GCODE_EXTS = ['gcode', 'g', 'gco']
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ class VirtualSD:
|
||||||
if fname not in flist:
|
if fname not in flist:
|
||||||
fname = files_by_lower[fname.lower()]
|
fname = files_by_lower[fname.lower()]
|
||||||
fname = os.path.join(self.sdcard_dirname, fname)
|
fname = os.path.join(self.sdcard_dirname, fname)
|
||||||
f = open(fname, 'r')
|
f = io.open(fname, 'r', newline='')
|
||||||
f.seek(0, os.SEEK_END)
|
f.seek(0, os.SEEK_END)
|
||||||
fsize = f.tell()
|
fsize = f.tell()
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
|
|
Loading…
Reference in New Issue