← 返回首页
[3.11] GH-77403: Fix tests which fail when PYTHONUSERBASE is not norm… · python/cpython@c5ecfa0 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit c5ecfa0

Browse files
[3.11] GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917) (GH-93969)
(cherry picked from commit b1ae4af) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Automerge-Triggered-By: GH:iritkatriel
1 parent 5084a64 commit c5ecfa0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎Lib/test/test_site.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ def test_get_path(self):
206206
scheme = 'osx_framework_user'
207207
else:
208208
scheme = os.name + '_user'
209-
self.assertEqual(site._get_path(site._getuserbase()),
209+
self.assertEqual(os.path.normpath(site._get_path(site._getuserbase())),
210210
sysconfig.get_path('purelib', scheme))
211211

212212
@unittest.skipUnless(site.ENABLE_USER_SITE, "requires access to PEP 370 "
213213
"user-site (site.ENABLE_USER_SITE)")
214214
@support.requires_subprocess()
215215
def test_s_option(self):
216216
# (ncoghlan) Change this to use script_helper...
217-
usersite = site.USER_SITE
217+
usersite = os.path.normpath(site.USER_SITE)
218218
self.assertIn(usersite, sys.path)
219219

220220
env = os.environ.copy()

‎Lib/test/test_sysconfig.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def test_user_similar(self):
370370
base = base.replace(sys.base_prefix, sys.prefix)
371371
if HAS_USER_BASE:
372372
user_path = get_path(name, 'posix_user')
373-
expected = global_path.replace(base, user, 1)
373+
expected = os.path.normpath(global_path.replace(base, user, 1))
374374
# bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
375375
# whereas posix_prefix does.
376376
if name == 'platlib':

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.