LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.81k stars 1.16k forks source link

Fix SameFileError exception on axis GUI #2786

Closed dwrobel closed 11 months ago

dwrobel commented 11 months ago

Fixes the following exception: reload file Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib64/python3.12/tkinter/init.py", line 1948, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "/usr/bin/axis", line 2356, in task_run reload_file() File "/usr/bin/axis", line 1911, in reload_file shutil.copyfile(loaded_file, tempfile) File "/usr/lib64/python3.12/shutil.py", line 240, in copyfile raise SameFileError("{!r} and {!r} are the same file".format(src, dst)) shutil.SameFileError: '/tmp/tmp0ym0r2bm/axis.ngc' and '/tmp/tmp0ym0r2bm/axis.ngc' are the same file

This is 100% reproducible when you try stop then play again the same file twice.