diff --git a/CHANGELOG b/CHANGELOG
index 8bdb5b8d..d0a878c7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ Not released yet
 
 - #474: Start using setuptools_scm for tag based versioning.
 - #506: With `-a`: do not show additional environments header if there are none
+- #518: Forward `USERPROFILE` by default on Windows.
 
 2.7.0
 -----
diff --git a/tox/config.py b/tox/config.py
index 406cc5de..a1b1cbf6 100755
--- a/tox/config.py
+++ b/tox/config.py
@@ -489,6 +489,7 @@ def tox_addoption(parser):
             passenv.add("COMSPEC")      # needed for distutils cygwincompiler
             passenv.add("TEMP")
             passenv.add("TMP")
+            passenv.add("USERPROFILE")  # needed for `os.path.expanduser()`.
         else:
             passenv.add("TMPDIR")
         for spec in value:

USERPROFILE is not automatically forwarded on Windows
Hi there!

Given the following `tox.ini`:

```ini
[tox]
skipsdist = true

[testenv]
commands =
  python -c 'import os.path; print(os.path.expanduser("~"))'
```

Then, on Windows, this will incorrectly print `~`.

If you add a `passenv` section to forward `USERPROFILE`, then it gives the right output:

```ini
[tox]
skipsdist = true

[testenv]
passenv =
  USERPROFILE
commands =
  python -c 'import os.path; print(os.path.expanduser("~"))'
```

This prints `C:\Users\...` as you would expect.

If I'm not mistaken, I believe `HOME` is forwarded by default on other systems, I would assume `USERPROFILE` should also be forwarded by default on Windows.

I'll gladly work on a patch if you're willing to accept such a contribution!
diff --git a/tests/test_config.py b/tests/test_config.py
index 4eac45e6..5a87159f 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -864,6 +864,7 @@ class TestConfigTestEnv:
             assert "COMSPEC" in envconfig.passenv
             assert "TEMP" in envconfig.passenv
             assert "TMP" in envconfig.passenv
+            assert "USERPROFILE" in envconfig.passenv
         else:
             assert "TMPDIR" in envconfig.passenv
         assert "PATH" in envconfig.passenv

pip install -e .[dev]
parse_log_pytest
pytest
pytest pytest-timeout
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
distlib==0.3.9
filelock==3.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
platformdirs==2.4.0
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-timeout==2.1.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
-e git+https://github.com/tox-dev/tox.git@cf1a1c00386ce42ff9c1d21744c1fab97853bc2c#egg=tox
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
virtualenv==20.17.1
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: tox
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - distlib==0.3.9
      - filelock==3.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - platformdirs==2.4.0
      - pytest-timeout==2.1.0
      - virtualenv==20.17.1
prefix: /opt/conda/envs/tox

tests/test_config.py::TestConfigTestEnv::test_passenv_as_multiline_list[win32]
tests/test_config.py::TestVenvConfig::test_force_dep_with_url tests/test_config.py::TestIniParser::test_getbool
tests/test_config.py::TestVenvConfig::test_config_parsing_minimal tests/test_config.py::TestVenvConfig::test_config_parsing_multienv tests/test_config.py::TestVenvConfig::test_envdir_set_manually tests/test_config.py::TestVenvConfig::test_envdir_set_manually_with_substitutions tests/test_config.py::TestVenvConfig::test_force_dep_version tests/test_config.py::TestVenvConfig::test_is_same_dep tests/test_config.py::TestConfigPlatform::test_config_parse_platform tests/test_config.py::TestConfigPlatform::test_config_parse_platform_rex tests/test_config.py::TestConfigPlatform::test_config_parse_platform_with_factors[win] tests/test_config.py::TestConfigPlatform::test_config_parse_platform_with_factors[lin] tests/test_config.py::TestConfigPackage::test_defaults tests/test_config.py::TestConfigPackage::test_defaults_distshare tests/test_config.py::TestConfigPackage::test_defaults_changed_dir tests/test_config.py::TestConfigPackage::test_project_paths tests/test_config.py::TestParseconfig::test_search_parents tests/test_config.py::TestParseconfig::test_explicit_config_path tests/test_config.py::test_get_homedir tests/test_config.py::TestGetcontextname::test_blank tests/test_config.py::TestGetcontextname::test_jenkins tests/test_config.py::TestGetcontextname::test_hudson_legacy tests/test_config.py::TestIniParserAgainstCommandsKey::test_command_substitution_from_other_section tests/test_config.py::TestIniParserAgainstCommandsKey::test_command_substitution_from_other_section_multiline tests/test_config.py::TestIniParserAgainstCommandsKey::test_command_substitution_from_other_section_posargs tests/test_config.py::TestIniParserAgainstCommandsKey::test_command_section_and_posargs_substitution tests/test_config.py::TestIniParserAgainstCommandsKey::test_command_env_substitution tests/test_config.py::TestIniParser::test_getstring_single tests/test_config.py::TestIniParser::test_missing_substitution tests/test_config.py::TestIniParser::test_getstring_fallback_sections tests/test_config.py::TestIniParser::test_getstring_substitution tests/test_config.py::TestIniParser::test_getlist tests/test_config.py::TestIniParser::test_getdict tests/test_config.py::TestIniParser::test_getstring_environment_substitution tests/test_config.py::TestIniParser::test_getstring_environment_substitution_with_default tests/test_config.py::TestIniParser::test_value_matches_section_substituion tests/test_config.py::TestIniParser::test_value_doesn_match_section_substitution tests/test_config.py::TestIniParser::test_getstring_other_section_substitution tests/test_config.py::TestIniParser::test_argvlist tests/test_config.py::TestIniParser::test_argvlist_windows_escaping tests/test_config.py::TestIniParser::test_argvlist_multiline tests/test_config.py::TestIniParser::test_argvlist_quoting_in_command tests/test_config.py::TestIniParser::test_argvlist_comment_after_command tests/test_config.py::TestIniParser::test_argvlist_command_contains_hash tests/test_config.py::TestIniParser::test_argvlist_positional_substitution tests/test_config.py::TestIniParser::test_argvlist_quoted_posargs tests/test_config.py::TestIniParser::test_argvlist_posargs_with_quotes tests/test_config.py::TestIniParser::test_positional_arguments_are_only_replaced_when_standing_alone tests/test_config.py::TestIniParser::test_posargs_are_added_escaped_issue310 tests/test_config.py::TestIniParser::test_substitution_with_multiple_words tests/test_config.py::TestIniParser::test_getargv tests/test_config.py::TestIniParser::test_getpath tests/test_config.py::TestIniParserPrefix::test_basic_section_access tests/test_config.py::TestIniParserPrefix::test_fallback_sections tests/test_config.py::TestIniParserPrefix::test_value_matches_prefixed_section_substituion tests/test_config.py::TestIniParserPrefix::test_value_doesn_match_prefixed_section_substitution tests/test_config.py::TestIniParserPrefix::test_other_section_substitution tests/test_config.py::TestConfigTestEnv::test_commentchars_issue33 tests/test_config.py::TestConfigTestEnv::test_defaults tests/test_config.py::TestConfigTestEnv::test_sitepackages_switch tests/test_config.py::TestConfigTestEnv::test_installpkg_tops_develop tests/test_config.py::TestConfigTestEnv::test_specific_command_overrides tests/test_config.py::TestConfigTestEnv::test_whitelist_externals tests/test_config.py::TestConfigTestEnv::test_changedir tests/test_config.py::TestConfigTestEnv::test_ignore_errors tests/test_config.py::TestConfigTestEnv::test_envbindir tests/test_config.py::TestConfigTestEnv::test_envbindir_jython[jython] tests/test_config.py::TestConfigTestEnv::test_envbindir_jython[pypy] tests/test_config.py::TestConfigTestEnv::test_envbindir_jython[pypy3] tests/test_config.py::TestConfigTestEnv::test_passenv_as_multiline_list[linux2] tests/test_config.py::TestConfigTestEnv::test_passenv_as_space_separated_list[win32] tests/test_config.py::TestConfigTestEnv::test_passenv_as_space_separated_list[linux2] tests/test_config.py::TestConfigTestEnv::test_passenv_with_factor tests/test_config.py::TestConfigTestEnv::test_passenv_from_global_env tests/test_config.py::TestConfigTestEnv::test_passenv_glob_from_global_env tests/test_config.py::TestConfigTestEnv::test_changedir_override tests/test_config.py::TestConfigTestEnv::test_install_command_setting tests/test_config.py::TestConfigTestEnv::test_install_command_must_contain_packages tests/test_config.py::TestConfigTestEnv::test_install_command_substitutions tests/test_config.py::TestConfigTestEnv::test_pip_pre tests/test_config.py::TestConfigTestEnv::test_pip_pre_cmdline_override tests/test_config.py::TestConfigTestEnv::test_simple tests/test_config.py::TestConfigTestEnv::test_substitution_error tests/test_config.py::TestConfigTestEnv::test_substitution_defaults tests/test_config.py::TestConfigTestEnv::test_substitution_notfound_issue246 tests/test_config.py::TestConfigTestEnv::test_substitution_positional tests/test_config.py::TestConfigTestEnv::test_substitution_noargs_issue240 tests/test_config.py::TestConfigTestEnv::test_substitution_double tests/test_config.py::TestConfigTestEnv::test_posargs_backslashed_or_quoted tests/test_config.py::TestConfigTestEnv::test_rewrite_posargs tests/test_config.py::TestConfigTestEnv::test_rewrite_simple_posargs tests/test_config.py::TestConfigTestEnv::test_take_dependencies_from_other_testenv[envlist0-deps0] tests/test_config.py::TestConfigTestEnv::test_take_dependencies_from_other_testenv[envlist1-deps1] tests/test_config.py::TestConfigTestEnv::test_take_dependencies_from_other_section tests/test_config.py::TestConfigTestEnv::test_multilevel_substitution tests/test_config.py::TestConfigTestEnv::test_recursive_substitution_cycle_fails tests/test_config.py::TestConfigTestEnv::test_single_value_from_other_secton tests/test_config.py::TestConfigTestEnv::test_factors tests/test_config.py::TestConfigTestEnv::test_factor_ops tests/test_config.py::TestConfigTestEnv::test_default_factors tests/test_config.py::TestConfigTestEnv::test_factors_in_boolean tests/test_config.py::TestConfigTestEnv::test_factors_in_setenv tests/test_config.py::TestConfigTestEnv::test_factor_use_not_checked tests/test_config.py::TestConfigTestEnv::test_factors_groups_touch tests/test_config.py::TestConfigTestEnv::test_period_in_factor tests/test_config.py::TestConfigTestEnv::test_ignore_outcome tests/test_config.py::TestGlobalOptions::test_notest tests/test_config.py::TestGlobalOptions::test_verbosity tests/test_config.py::TestGlobalOptions::test_substitution_jenkins_default tests/test_config.py::TestGlobalOptions::test_substitution_jenkins_context tests/test_config.py::TestGlobalOptions::test_sdist_specification tests/test_config.py::TestGlobalOptions::test_env_selection tests/test_config.py::TestGlobalOptions::test_py_venv tests/test_config.py::TestGlobalOptions::test_default_environments tests/test_config.py::TestGlobalOptions::test_envlist_expansion tests/test_config.py::TestGlobalOptions::test_envlist_cross_product tests/test_config.py::TestGlobalOptions::test_envlist_multiline tests/test_config.py::TestGlobalOptions::test_minversion tests/test_config.py::TestGlobalOptions::test_skip_missing_interpreters_true tests/test_config.py::TestGlobalOptions::test_skip_missing_interpreters_false tests/test_config.py::TestGlobalOptions::test_defaultenv_commandline tests/test_config.py::TestGlobalOptions::test_defaultenv_partial_override tests/test_config.py::TestHashseedOption::test_default tests/test_config.py::TestHashseedOption::test_passing_integer tests/test_config.py::TestHashseedOption::test_passing_string tests/test_config.py::TestHashseedOption::test_passing_empty_string tests/test_config.py::TestHashseedOption::test_setenv tests/test_config.py::TestHashseedOption::test_noset tests/test_config.py::TestHashseedOption::test_noset_with_setenv tests/test_config.py::TestHashseedOption::test_one_random_hashseed tests/test_config.py::TestHashseedOption::test_setenv_in_one_testenv tests/test_config.py::TestSetenv::test_getdict_lazy tests/test_config.py::TestSetenv::test_getdict_lazy_update tests/test_config.py::TestSetenv::test_setenv_uses_os_environ tests/test_config.py::TestSetenv::test_setenv_default_os_environ tests/test_config.py::TestSetenv::test_setenv_uses_other_setenv tests/test_config.py::TestSetenv::test_setenv_recursive_direct tests/test_config.py::TestSetenv::test_setenv_overrides tests/test_config.py::TestSetenv::test_setenv_with_envdir_and_basepython tests/test_config.py::TestSetenv::test_setenv_ordering_1 tests/test_config.py::TestSetenv::test_setenv_cross_section_subst_issue294 tests/test_config.py::TestSetenv::test_setenv_cross_section_subst_twice tests/test_config.py::TestSetenv::test_setenv_cross_section_mixed tests/test_config.py::TestIndexServer::test_indexserver tests/test_config.py::TestIndexServer::test_parse_indexserver tests/test_config.py::TestIndexServer::test_multiple_homedir_relative_local_indexservers tests/test_config.py::TestConfigConstSubstitutions::test_replace_pathsep_unix[:] tests/test_config.py::TestConfigConstSubstitutions::test_replace_pathsep_unix[;] tests/test_config.py::TestConfigConstSubstitutions::test_pathsep_regex tests/test_config.py::TestParseEnv::test_parse_recreate tests/test_config.py::TestCmdInvocation::test_help tests/test_config.py::TestCmdInvocation::test_version tests/test_config.py::TestCmdInvocation::test_listenvs tests/test_config.py::TestCmdInvocation::test_listenvs_verbose_description tests/test_config.py::TestCmdInvocation::test_listenvs_all tests/test_config.py::TestCmdInvocation::test_listenvs_all_verbose_description tests/test_config.py::TestCmdInvocation::test_listenvs_all_verbose_description_no_additional_environments tests/test_config.py::TestCmdInvocation::test_config_specific_ini tests/test_config.py::TestCmdInvocation::test_no_tox_ini tests/test_config.py::TestCmdInvocation::test_override_workdir tests/test_config.py::TestCmdInvocation::test_showconfig_with_force_dep_version tests/test_config.py::test_env_spec[-e tests/test_config.py::TestCommandParser::test_command_parser_for_word tests/test_config.py::TestCommandParser::test_command_parser_for_posargs tests/test_config.py::TestCommandParser::test_command_parser_for_multiple_words tests/test_config.py::TestCommandParser::test_command_parser_for_substitution_with_spaces tests/test_config.py::TestCommandParser::test_command_parser_with_complex_word_set tests/test_config.py::TestCommandParser::test_command_with_runs_of_whitespace tests/test_config.py::TestCommandParser::test_command_with_split_line_in_subst_arguments tests/test_config.py::TestCommandParser::test_command_parsing_for_issue_10
tox/config.py CHANGELOG
tox/config.py CHANGELOG