[Bug 2046639] Re: qt DialogMirror.py argument 1 has unexpected type 'float' while selecting best mirror

Ubuntu Foundations Team Bug Bot 2046639 at bugs.launchpad.net
Sun Dec 17 16:14:13 UTC 2023


The attachment "patch to cast float to int for progress dialog" seems to
be a patch.  If it isn't, please remove the "patch" flag from the
attachment, remove the "patch" tag, and if you are a member of the
~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by
~brian-murray, for any issues please contact him.]

** Tags added: patch

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/2046639

Title:
  qt DialogMirror.py argument 1 has unexpected type 'float' while
  selecting best mirror

Status in software-properties package in Ubuntu:
  New

Bug description:
  While selecting the best mirror in software-properties-qt, there's a
  traceback:

  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/softwareproperties/qt/DialogMirror.py", line 227, in on_report_progress
      self.dialog.setValue(frac*100)
  TypeError: setValue(self, progress: int): argument 1 has unexpected type 'float'

  I didn't investigate thoroughly, but it looks like maybe someone
  updated how progress was being updated but didn't check types or test
  all the way through before releasing.  It can be fixed with a simple
  patch:

  diff --git a/softwareproperties/qt/DialogMirror.py b/softwareproperties/qt/DialogMirror.py
  index 972c4fb..4d1c150 100644
  --- a/softwareproperties/qt/DialogMirror.py
  +++ b/softwareproperties/qt/DialogMirror.py
  @@ -223,7 +223,7 @@ class DialogMirror(QDialog):
     def on_report_progress(self, current, max, borders=(0,1), mod=(0,0)):
         #self.dialog.setLabelText(_("Completed %s of %s tests") % \
         #                       (current + mod[0], max + mod[1]))
  -      frac = borders[0] + (borders[1] - borders[0]) / max * current
  +      frac = int(borders[0] + (borders[1] - borders[0]) / max * current)
         self.dialog.setValue(frac*100)

  
  $ lsb_release -a
  No LSB modules are available.
  Distributor ID:	Ubuntu
  Description:	Ubuntu 23.10
  Release:	23.10
  Codename:	mantic

  $ apt-cache policy pkgname software-properties-qt
  software-properties-qt:
    Installed: 0.99.39
    Candidate: 0.99.39
    Version table:
   *** 0.99.39 500
          500 https://mirror.it.ubc.ca/ubuntu mantic/universe amd64 Packages
          100 /var/lib/dpkg/status
  N: Unable to locate package pkgname

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/2046639/+subscriptions




More information about the foundations-bugs mailing list