From 27bbab9582eb3a1a9fca8f2b203e88b1682fcdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 23 Mar 2020 16:04:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Don't=20mess=20with=20EOL=20styl?= =?UTF-8?q?e=20of=20GCODE=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue with lag in progress reporting on files that have CRLF EOLs. See also https://community.octoprint.org/t/curious-issue-with-print-progress/16304/ --- src/octoprint/util/comm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 67191a7af..a6dfc1e24 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -4078,7 +4078,7 @@ class PrintingGcodeFileInformation(PrintingFileInformation): """ PrintingFileInformation.start(self) with self._handle_mutex: - self._handle = bom_aware_open(self._filename, encoding="utf-8", errors="replace") + self._handle = bom_aware_open(self._filename, encoding="utf-8", errors="replace", newline="") self._pos = self._handle.tell() if self._handle.encoding.endswith("-sig"): # Apparently we found an utf-8 bom in the file.