diff -Nru printrun-2.0.0~rc7/debian/changelog printrun-2.0.0~rc7/debian/changelog --- printrun-2.0.0~rc7/debian/changelog 2022-01-13 20:16:28.000000000 +0000 +++ printrun-2.0.0~rc7/debian/changelog 2023-12-17 22:55:15.000000000 +0000 @@ -1,3 +1,9 @@ +printrun (2.0.0~rc7-1ubuntu0.1) jammy; urgency=medium + + * Apply upstream patch to fix TypeError on Python 3.10+. (LP: #1975947) + + -- Sudip Mukherjee Sun, 17 Dec 2023 22:55:15 +0000 + printrun (2.0.0~rc7-1build1) jammy; urgency=medium * No-change rebuild with Python 3.10 as default version diff -Nru printrun-2.0.0~rc7/debian/control printrun-2.0.0~rc7/debian/control --- printrun-2.0.0~rc7/debian/control 2020-12-13 18:38:15.000000000 +0000 +++ printrun-2.0.0~rc7/debian/control 2023-12-17 17:05:45.000000000 +0000 @@ -1,7 +1,8 @@ Source: printrun Section: misc Priority: optional -Maintainer: Debian 3-D Printing Packages <3dprinter-general@lists.alioth.debian.org> +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian 3-D Printing Packages <3dprinter-general@lists.alioth.debian.org> Uploaders: Rock Storm , Build-Depends: cython3, debhelper-compat (= 13), diff -Nru printrun-2.0.0~rc7/debian/patches/2006_Fix-a-TypeError-on-Python-3.10.patch printrun-2.0.0~rc7/debian/patches/2006_Fix-a-TypeError-on-Python-3.10.patch --- printrun-2.0.0~rc7/debian/patches/2006_Fix-a-TypeError-on-Python-3.10.patch 1970-01-01 01:00:00.000000000 +0100 +++ printrun-2.0.0~rc7/debian/patches/2006_Fix-a-TypeError-on-Python-3.10.patch 2023-12-17 22:54:28.000000000 +0000 @@ -0,0 +1,133 @@ +Description: Pen, DrawLines and others take integers, fix a TypeError on Python 3.10+ +Origin: upstream, https://github.com/kliment/Printrun/commit/faade5b9f33779a9b08286498a15eefd0abd13e0 +Bug: https://github.com/kliment/Printrun/issues/1225 +Bug-Debian: https://bugs.debian.org/1010400 +Bug-Ubuntu: https://launchpad.net/bugs/1975947 +Last-Update: 2023-12-17 +--- + +--- printrun-2.0.0~rc7.orig/printrun/gui/graph.py ++++ printrun-2.0.0~rc7/printrun/gui/graph.py +@@ -147,7 +147,7 @@ class Graph(BufferedCanvas): + xscale = float(self.width - 1) / (self.xbars - 1) + for x in range(self.xbars + 1): + x = x * xscale +- dc.DrawLine(x, 0, x, self.height) ++ dc.DrawLine(int(x), 0, int(x), self.height) + + # draw horizontal bars + spacing = self._calculate_spacing() # spacing between bars, in degrees +@@ -159,7 +159,7 @@ class Graph(BufferedCanvas): + # y_pos = y*(float(self.height)/self.ybars) + degrees = y * spacing + y_pos = self._y_pos(degrees) +- dc.DrawLine(0, y_pos, self.width, y_pos) ++ dc.DrawLine(0, int(y_pos), self.width, int(y_pos)) + label = str(y * spacing) + label_y = y_pos - font.GetPointSize() / 2 + self.layoutText(label, 1, label_y, gc) +@@ -219,7 +219,7 @@ class Graph(BufferedCanvas): + for temperature in temperature_list: + y_pos = self._y_pos(temperature) + if x_pos > 0: # One need 2 points to draw a line. +- dc.DrawLine(lastxvalue, lastyvalue, x_pos, y_pos) ++ dc.DrawLine(int(lastxvalue), int(lastyvalue), int(x_pos), int(y_pos)) + + lastxvalue = x_pos + x_pos += x_add +@@ -292,7 +292,7 @@ class Graph(BufferedCanvas): + + def layoutText(self, text, x, y, gc): + ext = gc.GetTextExtent(text) +- rc = self.layoutRect(wx.Rect(x, y, *ext)) ++ rc = self.layoutRect(wx.Rect(int(x), int(y), int(ext[0]), int(ext[1]))) + # print('layoutText', text, rc.TopLeft) + return rc + +--- printrun-2.0.0~rc7.orig/printrun/gui/xybuttons.py ++++ printrun-2.0.0~rc7/printrun/gui/xybuttons.py +@@ -192,7 +192,7 @@ class XYButtons(FocusCanvas): + return None + + def drawPartialPie(self, gc, center, r1, r2, angle1, angle2): +- p1 = wx.Point(center.x + r1 * math.cos(angle1), center.y + r1 * math.sin(angle1)) ++ p1 = wx.Point(int(center.x + r1 * math.cos(angle1)), int(center.y + r1 * math.sin(angle1))) + + path = gc.CreatePath() + path.MoveToPoint(p1.x, p1.y) +--- printrun-2.0.0~rc7.orig/printrun/gviz.py ++++ printrun-2.0.0~rc7/printrun/gviz.py +@@ -192,7 +192,7 @@ class Gviz(wx.Panel, BaseViz): + self.filament_width = extrusion_width # set it to 0 to disable scaling lines with zoom + self.update_basescale() + self.scale = self.basescale +- penwidth = max(1.0, self.filament_width * ((self.scale[0] + self.scale[1]) / 2.0)) ++ penwidth = max(1, int(self.filament_width * ((self.scale[0] + self.scale[1]) / 2.0))) + self.translate = [0.0, 0.0] + self.mainpen = wx.Pen(wx.Colour(0, 0, 0), penwidth) + self.arcpen = wx.Pen(wx.Colour(255, 0, 0), penwidth) +@@ -292,17 +292,17 @@ class Gviz(wx.Panel, BaseViz): + + self.translate = [x - (x - self.translate[0]) * factor, + y - (y - self.translate[1]) * factor] +- penwidth = max(1.0, self.filament_width * ((self.scale[0] + self.scale[1]) / 2.0)) ++ penwidth = max(1, int(self.filament_width * ((self.scale[0] + self.scale[1]) / 2.0))) + for pen in self.penslist: + pen.SetWidth(penwidth) + self.dirty = True + wx.CallAfter(self.Refresh) + + def _line_scaler(self, x): +- return (self.scale[0] * x[0], +- self.scale[1] * x[1], +- self.scale[0] * x[2], +- self.scale[1] * x[3],) ++ return (int(self.scale[0] * x[0]), ++ int(self.scale[1] * x[1]), ++ int(self.scale[0] * x[2]), ++ int(self.scale[1] * x[3]),) + + def _arc_scaler(self, x): + return (self.scale[0] * x[0], +@@ -326,7 +326,7 @@ class Gviz(wx.Panel, BaseViz): + def repaint_everything(self): + width = self.scale[0] * self.build_dimensions[0] + height = self.scale[1] * self.build_dimensions[1] +- self.blitmap = wx.Bitmap(width + 1, height + 1, -1) ++ self.blitmap = wx.Bitmap(int(width) + 1, int(height) + 1, -1) + dc = wx.MemoryDC() + dc.SelectObject(self.blitmap) + dc.SetBackground(wx.Brush((250, 250, 200))) +@@ -336,19 +336,19 @@ class Gviz(wx.Panel, BaseViz): + if grid_unit > 0: + for x in range(int(self.build_dimensions[0] / grid_unit) + 1): + draw_x = self.scale[0] * x * grid_unit +- dc.DrawLine(draw_x, 0, draw_x, height) ++ dc.DrawLine(int(draw_x), 0, int(draw_x), int(height)) + for y in range(int(self.build_dimensions[1] / grid_unit) + 1): + draw_y = self.scale[1] * (self.build_dimensions[1] - y * grid_unit) +- dc.DrawLine(0, draw_y, width, draw_y) ++ dc.DrawLine(0, int(draw_y), int(width), int(draw_y)) + dc.SetPen(wx.Pen(wx.Colour(0, 0, 0))) + + if not self.showall: + # Draw layer gauge + dc.SetBrush(wx.Brush((43, 144, 255))) +- dc.DrawRectangle(width - 15, 0, 15, height) ++ dc.DrawRectangle(int(width) - 15, 0, 15, int(height)) + dc.SetBrush(wx.Brush((0, 255, 0))) + if self.layers: +- dc.DrawRectangle(width - 14, (1.0 - (1.0 * (self.layerindex + 1)) / len(self.layers)) * height, 13, height - 1) ++ dc.DrawRectangle(int(width) - 14, int((1.0 - (1.0 * (self.layerindex + 1)) / len(self.layers)) * height), 13, int(height) - 1) + + if self.showall: + for i in range(len(self.layersz)): +@@ -410,7 +410,7 @@ class Gviz(wx.Panel, BaseViz): + dc = wx.PaintDC(self) + dc.SetBackground(wx.Brush(self.bgcolor)) + dc.Clear() +- dc.DrawBitmap(self.blitmap, self.translate[0], self.translate[1]) ++ dc.DrawBitmap(self.blitmap, int(self.translate[0]), int(self.translate[1])) + if self.paint_overlay: + self.paint_overlay(dc) + diff -Nru printrun-2.0.0~rc7/debian/patches/series printrun-2.0.0~rc7/debian/patches/series --- printrun-2.0.0~rc7/debian/patches/series 2020-12-13 18:38:15.000000000 +0000 +++ printrun-2.0.0~rc7/debian/patches/series 2023-12-17 22:55:15.000000000 +0000 @@ -1,2 +1,3 @@ 2004_fix-desktop-files.patch 2005_fix-build-sequence.patch +2006_Fix-a-TypeError-on-Python-3.10.patch