Solved ports-mgmt/fastest_sites fails with ValueError: too many values to unpack


New Member

Reaction score: 2
Messages: 9

I recently decided to try to speed up synth using ports-mgmt/fastest_sites. It does test a number of sites but then fails:

 => Checking servers for MASTER_SITE_PORTS_JP (3 servers)

 => Checking servers for MASTER_SITE_FEDORA_LINUX (6 servers)
Traceback (most recent call last):
  File "/usr/local/bin/fastest_sites", line 164, in <module>
    latency_list = FindFastest(varname, sitelist)
  File "/usr/local/bin/fastest_sites", line 110, in FindFastest
    AsyncConnect(url, callback)
  File "/usr/local/bin/fastest_sites", line 53, in __init__
  File "/usr/local/bin/fastest_sites", line 64, in ParseURL
    (scheme, remainder) = self._url.split(":", 2)
ValueError: too many values to unpack

I am running on Release 11.1.

uname -a
FreeBSD Dad 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017  amd64

This also occurs on another system running Release 10.3.

Any thoughts on what may cause this?



Reaction score: 1,415
Messages: 1,909

This appears to be a bug in ports-mgmt/fastest_sites. It can't parse entries with a second : like
The port hasn't seen an update in a while and the last maintainer timeout was 2 years. Not sure if it's abandoned. Try contacting the maintainer. EDIT: Nevermind. Filed a bug myself: PR 224854

Anyway applying this patch to the port seems to fix it:
diff --git a/ports-mgmt/fastest_sites/Makefile b/ports-mgmt/fastest_sites/Makefile
index d9e6149ccf18..0fdd0223de95 100644
--- a/ports-mgmt/fastest_sites/Makefile
+++ b/ports-mgmt/fastest_sites/Makefile
@@ -2,7 +2,7 @@
 PORTNAME=	fastest_sites
 PORTVERSION=	20110317
 CATEGORIES=	ports-mgmt
diff --git a/ports-mgmt/fastest_sites/files/ b/ports-mgmt/fastest_sites/files/
new file mode 100644
index 000000000000..bf96331e013b
--- /dev/null
+++ b/ports-mgmt/fastest_sites/files/
@@ -0,0 +1,11 @@
+---	2018-01-03 06:06:26 UTC
+@@ -61,7 +61,7 @@ class AsyncConnect(asyncore.dispatcher):
+   def ParseURL(self):
+     #print "Url: %s" % self._url
+-    (scheme, remainder) = self._url.split(":", 2)
++    (scheme, remainder) = self._url.split(":", 1)
+     (host, unused_path) = urllib.splithost(remainder)
+     self._host = host
+     self._port = AsyncConnect.schemes[scheme.lower()]
or here:


New Member

Messages: 2

ValueError: too many values to unpack

Python functions can return multiple variables . These variables can be stored in variables directly. This is a unique property of Python , other programming languages such as C++ or Java do not support this by default.

The valueerror: too many values to unpack occurs during a multiple-assignment where you either don't have enough objects to assign to the variables or you have more objects to assign than variables. If for example myfunction() returned an iterable with three items instead of the expected two then you would have more objects than variables necessary to assign to.