Title: Travis can't build the 3.8 branch right now
Type: Stage: resolved
Components: Build Versions: Python 3.8
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ammar2, brandtbucher, pablogsal
Priority: normal Keywords: patch

Created on 2020-12-05 06:30 by brandtbucher, last changed 2020-12-07 23:45 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23652 brandtbucher, 2020-12-05 06:32
PR 23685 merged pablogsal, 2020-12-07 20:13
Messages (9)
msg382555 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2020-12-05 06:30
Travis seems to be using the wrong Python executable for (at least) the "make -j4 regen-all" step on the 3.8 branch. I have a hunch it's using the system python3 executable (3.5?). It causes the following failure when building:

python3 ./Tools/scripts/ ./Include/graminit.h ./Include/
  File "./Tools/clinic/", line 1772
    filename_new = f"{filename}.new"
SyntaxError: invalid syntax
Makefile:574: recipe for target 'clinic' failed
make: *** [clinic] Error 1

Recent examples:

I know Travis has been fairly problematic for us in the past.
msg382659 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2020-12-07 17:25
Pablo, maybe you can shed some light on this. It looks like the PEG parser PR explicitly sets PYTHON_FOR_REGEN=python3.8 using pyenv in .travis.yml for the master (and now 3.9) branches. The change was made in the we-like-parsers repo here:

Should we be doing this in the other branches as well?
msg382670 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-12-07 18:36
I am a bit confused....why is this failing now?
msg382671 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2020-12-07 18:49
It has been failing for some time. It's just not a required check, so it's easy to miss on a backport branch.

I think the addition of an f-string in PR 23371 a few weeks ago is what started making this fail (since the system python can't run clinic anymore). It looks like it has been failing ever since.
msg382672 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2020-12-07 18:56
So I suppose we can either:

- set PYTHON_FOR_REGEN to something 3.6+ on these backport branches
- use some other string formatting for that one line

I sort of prefer the second, since I *think* this is the only thing keeping older Pythons from working here.
msg382673 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2020-12-07 19:01
From a quick glance at

It looks like travis on 3.8 last passed at around 19 days ago

The culprit commit is likely from 19 days ago since it added the first bit of f-string syntax to, it was committed directly without a PR which is likely why this wasn't caught.
msg382674 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2020-12-07 19:03
Oh whoops, got sniped by Brandt while investigating :)
msg382680 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-12-07 20:11
I would suggest to use some other string formatting for that one line. The reason is that technically (although very unlikely) downstream consumers could be relying on some old PYTHON_FOR_REGEN in the Makefile for 3.8 and I would not like to change that in a patch release.
msg382698 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-12-07 23:45
New changeset b6d6f5367da1f2e3f749c358ae8563c56a0cc395 by Pablo Galindo in branch '3.8':
bpo-42574: Use format() instead of f-string in Tools/clinic/ to allow using older Python versions (GH-23685)
Date User Action Args
2020-12-07 23:45:38pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-12-07 23:45:27pablogsalsetmessages: + msg382698
2020-12-07 20:13:23pablogsalsetpull_requests: + pull_request22548
2020-12-07 20:11:00pablogsalsetmessages: + msg382680
2020-12-07 19:03:14ammar2setmessages: + msg382674
2020-12-07 19:01:17ammar2setnosy: + ammar2
messages: + msg382673
2020-12-07 18:56:12brandtbuchersetmessages: + msg382672
2020-12-07 18:49:09brandtbuchersetmessages: + msg382671
2020-12-07 18:36:02pablogsalsetmessages: + msg382670
2020-12-07 17:25:13brandtbuchersetnosy: + pablogsal
messages: + msg382659
2020-12-05 06:32:11brandtbuchersetkeywords: + patch
stage: patch review
pull_requests: + pull_request22522
2020-12-05 06:30:39brandtbuchercreate