chiark / gitweb /
Do not close the gcodeFile in the interpreter when it gets cancelled
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Mon, 16 Feb 2015 18:40:06 +0000 (13:40 -0500)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Mon, 16 Feb 2015 18:40:06 +0000 (13:40 -0500)
This can cause issues because the calling function handles the closing
of the files (in this case load() instead of _load()) and the gcodeFile
could also be a list or a bigDataStorage which do not have a close() method.
Fixes issue #91

Cura/util/gcodeInterpreter.py

index 4e51ef33cd0254f108a941633f839ca869c08d85..6556f360303abb8febe52a04676e06acf7274cc3 100644 (file)
@@ -120,7 +120,6 @@ class gcode(object):
                                        if self.progressCallback is not None:
                                                if self.progressCallback(float(gcodeFile.tell()) / float(self._fileSize)):
                                                        #Abort the loading, we can safely return as the results here will be discarded
-                                                       gcodeFile.close()
                                                        return
                                        currentLayer = [currentPath]
                                line = line[0:line.find(';')]