File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -172,17 +172,20 @@ the :mod:`glob` module.)
172
172
password directory through the built-in module :mod: `pwd `. An initial ``~user ``
173
173
is looked up directly in the password directory.
174
174
175
- On Windows, :envvar: `HOME ` and :envvar: ` USERPROFILE ` will be used if set,
176
- otherwise a combination of :envvar: `HOMEPATH ` and :envvar: `HOMEDRIVE ` will be
177
- used. An initial ``~user `` is handled by stripping the last directory component
178
- from the created user path derived above.
175
+ On Windows, :envvar: `USERPROFILE ` will be used if set, otherwise a combination
176
+ of :envvar: `HOMEPATH ` and :envvar: `HOMEDRIVE ` will be used. An initial
177
+ ``~user `` is handled by stripping the last directory component from the created
178
+ user path derived above.
179
179
180
180
If the expansion fails or if the path does not begin with a tilde, the path is
181
181
returned unchanged.
182
182
183
183
.. versionchanged :: 3.6
184
184
Accepts a :term: `path-like object `.
185
185
186
+ .. versionchanged :: 3.8
187
+ No longer uses :envvar: `HOME ` on Windows.
188
+
186
189
.. index ::
187
190
single: $ (dollar); environment variables expansion
188
191
single: % (percent); environment variables expansion (Windows)
Original file line number Diff line number Diff line change @@ -236,6 +236,10 @@ now return ``False`` instead of raising :exc:`ValueError` or its subclasses
236
236
characters or bytes unrepresentable at the OS level.
237
237
(Contributed by Serhiy Storchaka in :issue: `33721 `.)
238
238
239
+ :func: `~os.path.expanduser ` on Windows now prefers the :envvar: `USERPROFILE `
240
+ environment variable and does not use :envvar: `HOME `, which is not normally set
241
+ for regular user accounts.
242
+
239
243
240
244
ncurses
241
245
-------
@@ -672,6 +676,10 @@ Changes in the Python API
672
676
:exc: `dbm.gnu.error ` or :exc: `dbm.ndbm.error `) instead of :exc: `KeyError `.
673
677
(Contributed by Xiang Zhang in :issue: `33106 `.)
674
678
679
+ * :func: `~os.path.expanduser ` on Windows now prefers the :envvar: `USERPROFILE `
680
+ environment variable and does not use :envvar: `HOME `, which is not normally
681
+ set for regular user accounts.
682
+
675
683
676
684
CPython bytecode changes
677
685
------------------------
You can’t perform that action at this time.
0 commit comments