Python env breaking after checkout because of .python-version

Recently, Python build started breaking if the GitHub repository contains a .python-version file.

This file should not have any effect on CircleCI build. The docker-in-docker’s Python version is totally separate from CircleCI’s Python, there is no need to match these.

This will break for example, if the repo contains a .python-version file (which is not 3.9.12 exactly, as of today).

   build_base:
    docker:
      - image: cimg/python:3.9

    steps:
      - checkout
      - setup_remote_docker:
          version: 20.10.11
      - run: python -V; pip -V

There is an issue for this on cimg/python:

My workaround is to delete this file directly after checkout.

      - checkout
      - run: rm .python-version

It fixes in my case, because I don’t need that file, but for people who do, this won’t work. Please consider this a bug. The two environments should be 100% separate.