Cannot pickle '_io.TextIOWrapper' object

I have an older project (Trellis 1.1.0 + Bedrock 1.12.8) now enabled to run with Trellis CLI (trellis init in project root with Trellis CLI 1.7.0 installed on macOS).

trellis up appears to run as expected, but the local site does not load.

trellis provision development results in the following:

- composer (1.7.6) is already installed, skipping.
- ntp (1.6.4) is already installed, skipping.
- logrotate (v0.0.5) is already installed, skipping.
- swapfile (v2.0.22) is already installed, skipping.
- mailhog (2.1.4) is already installed, skipping.

Running command => ansible-playbook dev.yml -e env=development --inventory-file .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory
 [WARNING]: Skipping plugin (/Users/ ... /trellis/.trellis/virtualenv/lib/python3.9/site-packages/ansible/plugins/filter/core.py) as it seems to be
invalid: cannot import name 'environmentfilter' from 'jinja2.filters' (/Users/ ... /trellis/.trellis/virtualenv/lib/python3.9/site-packages/jinja2/filters.py)


PLAY [Set ansible_python_interpreter] **************************************************************************
 [WARNING]: You Ansible version is 2.7.18 but this version of Trellis has only been tested for compatability
with Ansible 2.7.12 -> 2.7.13. It is advisable to check for Trellis updates or downgrade your Ansible version.


TASK [python_interpreter : Get Ubuntu release] *****************************************************************
ERROR! Unexpected Exception, this is probably a bug: cannot pickle '_io.TextIOWrapper' object
to see the full traceback, use -vvv
exit status 250

I reran trellis init in the project root as advised elsewhere, but no change.

Questions: Where do I find information about what should be installed (given the Trellis version in use here) vs what is, how/where to vvv, etc?

Bigger questions: Shouldn’t trellis init have taken care of all requirements? What could have changed in this setup (I believe it did indeed run successfully since trellis initing for the first time some weeks ago), and I have not cherry-picked any Trellis updates?

Running ansible-playbook dev.yml -e env=development -vvv returns:

-bash: /usr/local/bin/ansible-playbook: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/: bad interpreter: No such file or directory

Running python --version,
Returns Python 3.9.13.

Running python3 --version,
Returns Python 3.9.13.

Running ls -l trellis/.trellis/virtualenv/bin/ returns:

-rw-r--r--  1 gilad  staff   8834 Jun 21 18:07 Activate.ps1
-rw-r--r--  1 gilad  staff   1949 Jun 21 18:07 activate
-rw-r--r--  1 gilad  staff    898 Jun 21 18:07 activate.csh
-rw-r--r--  1 gilad  staff   2038 Jun 21 18:07 activate.fish
-rwxr-xr-x  1 gilad  staff   5906 Jun 21 18:08 ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-config -> ansible
-rwxr-xr-x  1 gilad  staff  11745 Jun 21 18:08 ansible-connection
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-console -> ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-doc -> ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-galaxy -> ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-inventory -> ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-playbook -> ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-pull -> ansible
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:08 ansible-vault -> ansible
-rwxr-xr-x  1 gilad  staff    294 Jun 21 18:07 easy_install
-rwxr-xr-x  1 gilad  staff    294 Jun 21 18:07 easy_install-3.9
-rwxr-xr-x  1 gilad  staff    285 Jun 21 18:07 pip
-rwxr-xr-x  1 gilad  staff    285 Jun 21 18:07 pip3
-rwxr-xr-x  1 gilad  staff    285 Jun 21 18:07 pip3.10
-rwxr-xr-x  1 gilad  staff    285 Jun 21 18:07 pip3.9
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:07 python -> python3
lrwxr-xr-x  1 gilad  staff     22 Jun 21 18:07 python3 -> /usr/local/bin/python3
lrwxr-xr-x  1 gilad  staff      7 Jun 21 18:07 python3.9 -> python3

Running /usr/local/bin/python3 --version,
Returns Python 3.9.13.

Running trellis exec which python,
Retuns /Users/gilad/Websites/correct-site-dir/trellis/.trellis/virtualenv/bin/python.
And that path ls's as expected.

Running trellis exec python --version,
Returns Python 3.9.13.

So, if I’m reading this correctly, dev.yml is still looking for Python 2.7? What is the recommended fix, given that both python and python3 are actually pointing at 3.9.13?