This comment would lead one to believe the script will run with python 3 but problems remain:
# Optionally uses ipaddress (python 3 builtin) or py2-ipaddress (package)# for netblock analysis.
After running 2to3-3.7 on commit 6BC5C06D additional manual revisions were required per the attached patch. A subtle certificate validation problem exists, not enough time to fix so disabled it. Have good CA files in both system and Python directories and openssl s_client has no problem.
OUTPUT_CANDIDATES = True
is broken, wasn't prepared to spend the time hacking it.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
The TLS certificate validation problem could be the result of running with torsocks. Two years+ ago updateFallbackDirs.py ran fine this way, but much code has been added and changed since. Did not try running over direct connection.
We don't have CI for this script yet, so we can easily make changes that break some platforms. (I might wait to merge this patch until we have CI for python 2 and 3.)
The TLS certificate validation problem could be the result of running with torsocks. Two years+ ago updateFallbackDirs.py ran fine this way, but much code has been added and changed since. Did not try running over direct connection.
Running the script over Tor was never supported, because the script is designed to measure direct consensus download speeds. We documented this requirement in April 2016:
# This script should be run from a stable, reliable network connection,# with no other network activity (and not over tor).# If this is not possible, please disable:# PERFORM_IPV4_DIRPORT_CHECKS and PERFORM_IPV6_DIRPORT_CHECKS
I am not sure about the https change, the only https URL I can see is:
ONIONOO = 'https://onionoo.torproject.org/'
This URL validates fine in my (Tor) browser.
I also see this note in the Python 2 urllib2 documentation:
Note The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
this is where it happens; on searching found many folk adapting python 2 to 3 baffled by similar behaviors; didn't have time to dig deeper
This URL validates fine in my (Tor) browser.
and with "torsocks openssl s_client -connect xxx", works fine
I also see this note in the Python 2 urllib2 documentation:
{{{
Note The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
}}}
https://docs.python.org/2/library/urllib2.html
I would not recommend keeping TLS disabled, was just tired after hours of hacking at it and trying to get the script running in an environment where compiling Python3 was the path of least resistance. Should be fixable but is probably a couple of hours of searching and hacking. While I respect Python I've vowed to do everything I would use Python for in modern C++ going forward, don't have enough space in my brain to be good at both.
Mark some tickets as postfreeze-ok, to indicate that I think they are okay to accept in 0.4.0 post-freeze. Does not indicate that they are all necessary to do postfreeze.
After #29101 (moved) closes, we can check the security implications, then apply your patch to fallback-scripts. We might also get CI working before we merge any more script changes (#28797 (moved)).
(Removing tags, because this ticket no longer has any connection to tor releases.)
I tried to make minimal changes to get the 3 fallback scripts working with python 3.6 and later. I also made sure I maintained compatibility with python 2. We should see if any of the CI fails, it has a lot more python versions.
We might fix check_existing and OUTPUT_CANDIDATES modes in #31021 (moved), but they aren't a high priority, because we don't use them very often.
Trac: Actualpoints: N/Ato 0.5 Status: needs_information to needs_review