Skip to content

Commit 32a5b37

Browse files
authored
Move to Python 3. Python3.6 causing multiple issues with newer Ubuntu versions >= 18.04 (EFForg#19987)
Fixes EFForg#19023, EFForg#18951
1 parent 047435d commit 32a5b37

File tree

27 files changed

+47
-47
lines changed

27 files changed

+47
-47
lines changed

browser-dist/edge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Written for transparency and reproducibility on Edge upload
33
# See browser-dist.md for more info
44

5-
VERSION=`python3.6 -c "import json ; print(json.loads(open('../chromium/manifest.json').read())['version'])"`
5+
VERSION=`python3 -c "import json ; print(json.loads(open('../chromium/manifest.json').read())['version'])"`
66
crx_cws="../pkg/https-everywhere-$VERSION-cws.crx"
77
crx_eff="../pkg/https-everywhere-$VERSION-eff.crx"
88

browser-dist/opera.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if [ -n "$1" ]; then
8484
git submodule update --recursive -f
8585
fi
8686

87-
VERSION=`python3.6 -c "import json ; print(json.loads(open('../chromium/manifest.json').read())['version'])"`
87+
VERSION=`python3 -c "import json ; print(json.loads(open('../chromium/manifest.json').read())['version'])"`
8888

8989
echo "Building version" $VERSION
9090

@@ -100,8 +100,8 @@ cp -a ../../chromium/* ./
100100
# Turn the Firefox translations into the appropriate Chrome format:
101101
rm -rf _locales/
102102
mkdir _locales/
103-
python3.6 ../../utils/chromium-translations.py ../../translations/ _locales/
104-
python3.6 ../../utils/chromium-translations.py ../../src/chrome/locale/ _locales/
103+
python3 ../../utils/chromium-translations.py ../../translations/ _locales/
104+
python3 ../../utils/chromium-translations.py ../../src/chrome/locale/ _locales/
105105
do_not_ship="*.py *.xml"
106106
rm -f $do_not_ship
107107

@@ -111,7 +111,7 @@ cp ../../lib-wasm/pkg/*.js wasm
111111

112112
cd ../..
113113

114-
python3.6 ./utils/merge-rulesets.py || exit 5
114+
python3 ./utils/merge-rulesets.py || exit 5
115115

116116
cp src/chrome/content/rules/default.rulesets.json pkg/crx-opera/rules/default.rulesets.json
117117

@@ -128,7 +128,7 @@ cd ../..
128128

129129
# Remove the 'applications' manifest key from the crx version of the extension, change the 'author' string to a hash, and add the "update_url" manifest key
130130
# "update_url" needs to be present to avoid problems reported in https://bugs.chromium.org/p/chromium/issues/detail?id=805755
131-
python3.6 -c "import json; m=json.loads(open('pkg/crx-opera/manifest.json').read()); m['author']={'email': 'eff.software.projects@gmail.com'}; del m['applications']; open('pkg/crx-opera/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
131+
python3 -c "import json; m=json.loads(open('pkg/crx-opera/manifest.json').read()); m['author']={'email': 'eff.software.projects@gmail.com'}; del m['applications']; open('pkg/crx-opera/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
132132

133133
# If the --remove-update-channels flag is set, remove all out-of-band update channels
134134
if $REMOVE_UPDATE_CHANNELS; then

docs/en_US/ruleset-update-channels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ You will need python 3.6 on your system or available via docker for the next ste
123123

124124
Next, run
125125

126-
python3.6 utils/merge-rulesets.py
126+
python3 utils/merge-rulesets.py
127127

128128
You should see the following output:
129129

hooks/precommit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if [ "$CHANGED_RULESETS" ]; then
3939
continue
4040
fi
4141

42-
python3.6 test/validations/special/run.py --quiet $FILE
42+
python3 test/validations/special/run.py --quiet $FILE
4343
RESULT=$?
4444

4545
if [ $RESULT -ne 0 ]; then

install-dev-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if type apt-get>/dev/null 2>&1; then
4141
CHROMEDRIVER="chromium-driver"
4242
fi
4343
$SUDO_SHIM apt-get install -y libxml2-dev libxml2-utils libxslt1-dev \
44-
python3.6-dev $BROWSERS zip sqlite3 python3-pip libcurl4-openssl-dev xvfb \
44+
python3-dev $BROWSERS zip sqlite3 python3-pip libcurl4-openssl-dev xvfb \
4545
nodejs \
4646
npm \
4747
libssl-dev git curl $CHROMEDRIVER

make.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if [ -n "$1" ]; then
8585
git submodule update --recursive -f
8686
fi
8787

88-
VERSION=`python3.6 -c "import json ; print(json.loads(open('chromium/manifest.json').read())['version'])"`
88+
VERSION=`python3 -c "import json ; print(json.loads(open('chromium/manifest.json').read())['version'])"`
8989

9090
echo "Building version" $VERSION
9191

@@ -104,8 +104,8 @@ cp -a ../../chromium/* ./
104104
# Turn the Firefox translations into the appropriate Chrome format:
105105
rm -rf _locales/
106106
mkdir _locales/
107-
python3.6 ../../utils/chromium-translations.py ../../translations/ _locales/
108-
python3.6 ../../utils/chromium-translations.py ../../src/chrome/locale/ _locales/
107+
python3 ../../utils/chromium-translations.py ../../translations/ _locales/
108+
python3 ../../utils/chromium-translations.py ../../src/chrome/locale/ _locales/
109109
do_not_ship="*.py *.xml"
110110
rm -f $do_not_ship
111111

@@ -115,7 +115,7 @@ cp ../../lib-wasm/pkg/*.js wasm
115115

116116
cd ../..
117117

118-
python3.6 ./utils/merge-rulesets.py || exit 5
118+
python3 ./utils/merge-rulesets.py || exit 5
119119

120120
cp src/chrome/content/rules/default.rulesets pkg/crx-cws/rules/default.rulesets
121121

@@ -134,16 +134,16 @@ cp -a src/META-INF pkg/xpi-eff
134134

135135
# Remove the 'applications' manifest key from the crx version of the extension, change the 'author' string to a hash, and add the "update_url" manifest key
136136
# "update_url" needs to be present to avoid problems reported in https://bugs.chromium.org/p/chromium/issues/detail?id=805755
137-
python3.6 -c "import json; m=json.loads(open('pkg/crx-cws/manifest.json').read()); m['author']={'email': 'eff.software.projects@gmail.com'}; del m['applications']; m['update_url'] = 'https://clients2.google.com/service/update2/crx'; open('pkg/crx-cws/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
138-
python3.6 -c "import json; m=json.loads(open('pkg/crx-eff/manifest.json').read()); m['author']={'email': 'eff.software.projects@gmail.com'}; del m['applications']; open('pkg/crx-eff/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
137+
python3 -c "import json; m=json.loads(open('pkg/crx-cws/manifest.json').read()); m['author']={'email': 'eff.software.projects@gmail.com'}; del m['applications']; m['update_url'] = 'https://clients2.google.com/service/update2/crx'; open('pkg/crx-cws/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
138+
python3 -c "import json; m=json.loads(open('pkg/crx-eff/manifest.json').read()); m['author']={'email': 'eff.software.projects@gmail.com'}; del m['applications']; open('pkg/crx-eff/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
139139
# Remove the 'update_url' manifest key from the xpi version of the extension delivered to AMO
140-
python3.6 -c "import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); del m['applications']['gecko']['update_url']; m['applications']['gecko']['id'] = 'https-everywhere@eff.org'; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
140+
python3 -c "import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); del m['applications']['gecko']['update_url']; m['applications']['gecko']['id'] = 'https-everywhere@eff.org'; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
141141

142142
# If the --remove-extension-update flag is set, ensure the extension is unable to update
143143
if $REMOVE_EXTENSION_UPDATE; then
144144
echo "Flag --remove-extension-update specified. Removing the XPI extensions' ability to update."
145-
python3.6 -c "import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); m['applications']['gecko']['update_url'] = 'https://127.0.0.1'; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
146-
python3.6 -c "import json; m=json.loads(open('pkg/xpi-eff/manifest.json').read()); m['applications']['gecko']['update_url'] = 'https://127.0.0.1'; open('pkg/xpi-eff/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
145+
python3 -c "import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); m['applications']['gecko']['update_url'] = 'https://127.0.0.1'; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
146+
python3 -c "import json; m=json.loads(open('pkg/xpi-eff/manifest.json').read()); m['applications']['gecko']['update_url'] = 'https://127.0.0.1'; open('pkg/xpi-eff/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
147147
fi
148148

149149
# If the --remove-update-channels flag is set, remove all out-of-band update channels

test/chromium.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ else
3737
./make.sh
3838
echo "running tests"
3939
CRX_NAME="`ls -tr pkg/*.crx | tail -1`"
40-
$XVFB_RUN python3.6 test/script.py Chrome $CRX_NAME
40+
$XVFB_RUN python3 test/script.py Chrome $CRX_NAME
4141
fi

test/fetch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ "$TO_BE_TESTED" ]; then
1919
# Do the actual test, using https-everywhere-checker.
2020
OUTPUT_FILE=`mktemp`
2121
trap 'rm "$OUTPUT_FILE"' EXIT
22-
python3.6 $RULETESTFOLDER/src/https_everywhere_checker/check_rules.py $RULETESTFOLDER/http.checker.config $TO_BE_TESTED 2>&1 | tee $OUTPUT_FILE
22+
python3 $RULETESTFOLDER/src/https_everywhere_checker/check_rules.py $RULETESTFOLDER/http.checker.config $TO_BE_TESTED 2>&1 | tee $OUTPUT_FILE
2323
# Unfortunately, no specific exit codes are available for connection
2424
# failures, so we catch those with grep.
2525
if [[ `cat $OUTPUT_FILE | grep ERROR | wc -l` -ge 1 ]]; then

test/firefox.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ else
5858

5959
PATH=/home/user/geckodriver:$PATH
6060
if [ -n "$FIREFOX" ]; then
61-
$XVFB_RUN python3.6 test/script.py Firefox "$PROFILE_DIRECTORY" $FIREFOX
61+
$XVFB_RUN python3 test/script.py Firefox "$PROFILE_DIRECTORY" $FIREFOX
6262
else
63-
$XVFB_RUN python3.6 test/script.py Firefox "$PROFILE_DIRECTORY"
63+
$XVFB_RUN python3 test/script.py Firefox "$PROFILE_DIRECTORY"
6464
fi
6565
fi

test/manual.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# coverage for their rules, and performs a network "fetch" test to alert the
44
# contributor of potential problems.
55

6-
exec python3.6 test/rules/src/https_everywhere_checker/check_rules.py test/rules/manual.checker.config "$@"
6+
exec python3 test/rules/src/https_everywhere_checker/check_rules.py test/rules/manual.checker.config "$@"

0 commit comments

Comments
 (0)