cado-nfs-client.py: with python 2, an else clause marked as "we should never get here" is used
Imported issue: Initially reported by Cyril Bouvier in https://gforge.inria.fr/tracker/?group_id=2065&aid=21648
The cado-nfs-client.py script is ""buggy"" under the following condition:
- it is run with python2
- the server adress starts with https
- the command line option
--externdl
is not used (default behaviour)
Note: the fact that wget or curl is present does not change the problem (see below).
If the command line option --externdl
is not used, the method _urlopen
is called by the get_file
and upload_results methods. It then calls _urlopen_maybe_https
method. Inside this method, the else clause starting at line 918 is used with Python2 when the server url starts with https.
The problem is that the comments of this clause clearly state "We should never get here" !
And indeed, it seems that the wrapper around urllib used by this part of the code is buggy: for now, the only platform where problems were observed is OS X (the downloads does not seem to work, the uploads take a very long time, c60 takes 15min of wall clock time to be factored with less 1min of actual cpu time).
The comments of line 918 also state that "we use wget or curl as fallback under Python2". This is not true !
The script indeed tries to detect wget or curl in line 1582 and set HAVE_WGET and HAVE_CURL.
But they are never used. In the get_file method, settings[""USE_EXTERNAL_DL""] is False by default (if --externdl is not used), so wget or curl is not used, the wrapper method _urlopen is.
One very easy way to fix part of the problem is to have --externdl by default on Python 2. But it does not solve everything. The method _urlopen is also called by the upload_results method which have not wget or curl fallbacks.