kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.36k stars 995 forks source link

Yet another float/int fix for Python 3.10+, don't assume every problem is unicode related #1303

Closed hroncok closed 1 year ago

hroncok commented 1 year ago

Fixes https://github.com/kliment/Printrun/issues/1302

Still testing.

kliment commented 1 year ago

Should we catch other errors and report the actual error, rather than letting them drop to the caller?

hroncok commented 1 year ago

Should we catch other errors and report the actual error, rather than letting them drop to the caller?

I think all other errors are bugs in the code. But if you want to stay safe, we can do something like this:

except UnicodeError:
    self.log(_("Attempted to write invalid text..."))
except Exception as e:
    self.log(_("Unhandled exception: %s(%s)"), type(e), e))
kliment commented 1 year ago

All other errors are definitely bugs in the code. This way we can actually find them. I like your proposed solution.

hroncok commented 1 year ago

Added the other except.