Public bug reported:

Ubuntu 20.04.2 LTS
speedtest-cli 2.1.2-2

Expected result:
When calling "speedtest-cli" without parameters, the program should run without 
problems. It should automatically find the nearest speedtest server and perform 
a speedtest of the internet connection.

Actual result:
Speedtest crashes with the following error:

# speedtest-cli 
Retrieving speedtest.net configuration...
Traceback (most recent call last):
File "/usr/bin/speedtest-cli", line 11, in <module>
load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')()
File "/usr/lib/python3/dist-packages/speedtest.py", line 1986, in main
shell()
File "/usr/lib/python3/dist-packages/speedtest.py", line 1872, in shell
speedtest = Speedtest(
File "/usr/lib/python3/dist-packages/speedtest.py", line 1091, in __init__
self.get_config()
File "/usr/lib/python3/dist-packages/speedtest.py", line 1173, in get_config
ignore_servers = list(
ValueError: invalid literal for int() with base 10: ''

The error is caused by the following line in speedtest.py:

1173            ignore_servers = list(
1174                map(int, server_config['ignoreids'].split(','))
1175            )

This will raise an exception if server_config['ignoreids'] is an empty
string, because the function int() mapped to an empty string will
generate a ValueError.

This has already been fixed upstream by replacing the line with:

1177    ignore_servers = [
1178        int(i) for i in server_config['ignoreids'].split(',') if i
1179    ]

Here " if i " at the end to the line makes sure that int() is only
called if server_config['ignoreids'] is not empty.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: speedtest-cli 2.1.2-2 [modified: 
usr/lib/python3/dist-packages/speedtest.py]
ProcVersionSignature: Ubuntu 5.4.0-73.82-generic 5.4.106
Uname: Linux 5.4.0-73-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.17
Architecture: amd64
CasperMD5CheckResult: skip
Date: Sat May 22 11:31:10 2021
InstallationDate: Installed on 2019-04-30 (752 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
PackageArchitecture: all
SourcePackage: speedtest-cli
UpgradeStatus: Upgraded to focal on 2020-04-25 (391 days ago)

** Affects: speedtest-cli (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal third-party-packages

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

Title:
  speedtest-cli crashes when called without parameter --exclude

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/speedtest-cli/+bug/1929269/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to