Fix compatibility with Python 3.9
I'm trying to run the nightly script directly from LbEnv, which means using Python 3.9 and I encountered a number of issues I'm listing here
-
cgi.escapehas been moved tohtml.escape(see https://docs.python.org/3/whatsnew/3.8.html#api-and-feature-removals) -
LbNightlyTools/BuildMethods.py:492 tries to write a strto a file opened in binary mode -
LbNightlyTools/BuildMethods.py:623 tries to join bytesandstr -
LbNightlyTools/BuildMethods.py:659 tries to join bytesandstr -
LbNightlyTools/Utils.py:733 -> TypeError: a bytes-like object is required, not 'str' -
LbNightlyTools/Utils.py:823 -> infinite loop trying to compute md5sum because iteris invoked to loop over a binary file expecting and emptystras sentinel -
LbRPMTools/LHCbRPMSpecBuilder.py:65 uses cmpthat has been removed in Python 3, see https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
Edited by Marco Clemencic