fieldOfView / Cura-OctoPrintPlugin

Cura plugin which enables printing directly to OctoPrint and monitoring the process
GNU Affero General Public License v3.0
493 stars 74 forks source link

Add explicit conversion from float to int #257

Closed gferon closed 2 years ago

gferon commented 2 years ago

I'm the packager of cura on Fedora, and I noticed that with the combination of Python 3.10, Cura 4.11+ and the latest version of this plugin, switching to the Monitor tab results in a crash.

Current thread 0x00007fa61491c740 (most recent call first):
  File "/usr/lib/python3.10/site-packages/cura/CrashHandler.py", line 396 in _logInfoWidget
  File "/usr/lib/python3.10/site-packages/cura/CrashHandler.py", line 182 in _createDialog
  File "/usr/lib/python3.10/site-packages/cura/CrashHandler.py", line 86 in __init__
  File "/usr/bin/cura", line 159 in exceptHook
  File "/usr/lib/python3.10/site-packages/cura/PrinterOutput/Models/PrintJobOutputModel.py", line 157 in updateTimeTotal
  File "/home/gabriel/.local/share/cura/4.12/plugins/OctoPrintPlugin/OctoPrintPlugin/OctoPrintOutputDevice.py", line 874 in _onRequestFinished
  File "/usr/lib/python3.10/site-packages/cura/PrinterOutput/NetworkedPrinterOutputDevice.py", line 370 in _handleOnFinished

At some point in time, I suppose the C++ bindings library dropped an implicit conversion somewhere in the code path.

This should be good enough to fix the issue!

fieldOfView commented 2 years ago

Looks good, thanks!

undg commented 2 years ago

When this path is expected to land in cura marketplace? I'm experiencing the same issue on Arch and it's annoying as hell :)