diff --git a/src/build/env.py b/src/build/env.py
index e6d22b5..80c42d8 100644
--- a/src/build/env.py
+++ b/src/build/env.py
@@ -92,7 +92,12 @@ class IsolatedEnvBuilder:
 
         :return: The isolated build environment
         """
-        self._path = tempfile.mkdtemp(prefix='build-env-')
+        # Call ``realpath`` to prevent spurious warning from being emitted
+        # that the venv location has changed on Windows. The username is
+        # DOS-encoded in the output of tempfile - the location is the same
+        # but the representation of it is different, which confuses venv.
+        # Ref: https://bugs.python.org/issue46171
+        self._path = os.path.realpath(tempfile.mkdtemp(prefix='build-env-'))
         try:
             # use virtualenv when available (as it's faster than venv)
             if _should_use_virtualenv():

diff --git a/tests/test_env.py b/tests/test_env.py
index 9b5506f..831d725 100644
--- a/tests/test_env.py
+++ b/tests/test_env.py
@@ -112,7 +112,7 @@ def test_isolated_env_log(mocker, caplog, package_test_flit):
         ('INFO', 'Installing packages in isolated environment... (something)'),
     ]
     if sys.version_info >= (3, 8):  # stacklevel
-        assert [(record.lineno) for record in caplog.records] == [105, 102, 193]
+        assert [(record.lineno) for record in caplog.records] == [105, 107, 198]
 
 
 @pytest.mark.isolated

Failing Windows 3.9.9 tests
Can someone with Windows experience take a look at why the Windows 3.9.9 tests are failing? Some context might be found at https://github.com/actions/setup-python/issues/267.
tests/test_env.py::test_isolated_env_log
tests/test_env.py::test_isolation tests/test_env.py::test_isolated_environment_install tests/test_env.py::test_executable_missing_post_creation tests/test_env.py::test_isolated_env_abstract tests/test_env.py::test_isolated_env_has_executable_still_abstract tests/test_env.py::test_isolated_env_has_install_still_abstract tests/test_env.py::test_default_pip_is_never_too_old tests/test_env.py::test_pip_needs_upgrade_mac_os_11[x86_64-20.2.0] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[x86_64-20.3.0] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[x86_64-21.0.0] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[x86_64-21.0.1] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[arm64-20.2.0] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[arm64-20.3.0] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[arm64-21.0.0] tests/test_env.py::test_pip_needs_upgrade_mac_os_11[arm64-21.0.1] tests/test_env.py::test_venv_symlink[True]