GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-86179: Implement realpath() on Windows during getpath.py calculations by zooba · Pull Request #113033 · python/cpython

Conversation

@zooba

@zooba zooba commented Dec 12, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: venv on Windows with symlinks is broken if invoked with -I #86179

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zooba added 4 commits December 12, 2023 00:17
@zooba
[WIP] Figuring out why sys._base_executable isn't resolved
8987eeb
@zooba
Implement realpath for Windows
01b1f82
@zooba
Merge remote-tracking branch 'upstream/main' into pythongh-86179
d01aa34
@zooba
Revert sysconfig change
c69f931
@zooba
zooba requested a review from vsajip as a code owner December 12, 2023 20:57
@bedevere-app bedevere-app Bot added the awaiting core review label Dec 12, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 12, 2023
venv on Windows with symlinks is broken if invoked with -I #86179
Closed
@zooba
NEWS
902a093
@zooba zooba added OS-windows needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Dec 12, 2023
zooba and others added 3 commits December 12, 2023 23:14
@zooba
Merge branch 'main' into pythongh-86179
d37c113
@zooba
Merge remote-tracking branch 'upstream/main' into pythongh-86179
01bd133
@zooba
Add missed realpath and simplify sysconfig
d579fa0
@zooba
zooba requested a review from FFY00 as a code owner December 13, 2023 17:48
zooba added 2 commits December 13, 2023 19:41
@zooba
Alternate fix
6f77da3
@zooba
Update test
823d0dd
pfmoore
pfmoore reviewed Dec 13, 2023
View reviewed changes
Comment thread Modules/getpath.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@zooba
Fix error handling
11b229c
@zooba
zooba enabled auto-merge (squash) December 13, 2023 23:26
@zooba
zooba merged commit fddc829 into python:main Dec 13, 2023
@bedevere-app bedevere-app Bot removed the awaiting core review label Dec 13, 2023
@miss-islington-app

miss-islington-app Bot commented Dec 13, 2023

Copy link
Copy Markdown

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Dec 13, 2023

Copy link
Copy Markdown

Sorry, @zooba, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker fddc829236d7b29a522a2160e57b2d7ca23b9b95 3.12
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned zooba Dec 13, 2023
@miss-islington-app

miss-islington-app Bot commented Dec 13, 2023

Copy link
Copy Markdown

Sorry, @zooba, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker fddc829236d7b29a522a2160e57b2d7ca23b9b95 3.11
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Dec 14, 2023

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows11 Non-Debug 3.x has failed when building commit fddc829.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/914/builds/3204) and take a look at the build logs.
  4. Check if the failure is related to this commit (fddc829) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/914/builds/3204

Failed tests:

  • test_embed
  • test_venv

Failed subtests:

  • test_init_is_python_build_with_home - test.test_embed.InitConfigTests.test_init_is_python_build_with_home

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "B:\uildarea\3.x.ware-win11.nondebug\build\Lib\test\test_venv.py", line 269, in test_prefixes
    self.assertEqual(out.strip(), expected.encode(), prefix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'b:\\uildarea\\3.x.ware-win11.nondebug\\build' != b'B:\\uildarea\\3.x.ware-win11.nondebug\\build' : base_prefix


Traceback (most recent call last):
  File "B:\uildarea\3.x.ware-win11.nondebug\build\Lib\test\test_venv.py", line 290, in test_sysconfig
    self.assertEqual(out.strip(), expected, err)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'b:\\uildarea\\3.x.ware-win11.nondebug\\build\\Makefile' != 'B:\\uildarea\\3.x.ware-win11.nondebug\\build\\Makefile'
- b:\uildarea\3.x.ware-win11.nondebug\build\Makefile
? ^
+ B:\uildarea\3.x.ware-win11.nondebug\build\Makefile
? ^
 : 


Traceback (most recent call last):
  File "B:\uildarea\3.x.ware-win11.nondebug\build\Lib\test\test_embed.py", line 1397, in test_init_is_python_build_with_home
    self.check_all_configs("test_init_is_python_build", config,
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           api=API_COMPAT, env=env)
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "B:\uildarea\3.x.ware-win11.nondebug\build\Lib\test\test_embed.py", line 812, in check_all_configs
    self.check_config(configs, expected_config)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "B:\uildarea\3.x.ware-win11.nondebug\build\Lib\test\test_embed.py", line 738, in check_config
    self.assertEqual(config, expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
AssertionError: {'_co[129 chars] 0, 'faulthandler': 0, 'tracemalloc': 0, 'perf[2127 chars]': 1} != {'_co[129 chars] 0, 'int_max_str_digits': 4300, 'cpu_count': -[2130 chars]': 0}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   '_is_python_build': 1,
   'argv': [''],
   'base_exec_prefix': 'B:\\uildarea\\3.x.ware-win11.nondebug\\build',
   'base_executable': 'b:\\uildarea\\3.x.ware-win11.nondebug\\build\\PCbuild\\amd64\\_testembed.exe',
   'base_prefix': 'B:\\uildarea\\3.x.ware-win11.nondebug\\build',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'code_debug_ranges': 1,
   'configure_c_stdio': 0,
   'cpu_count': -1,
   'dev_mode': 0,
   'dump_refs': 0,
   'dump_refs_file': None,
   'exec_prefix': 'B:\\uildarea\\3.x.ware-win11.nondebug\\build',
   'executable': 'b:\\uildarea\\3.x.ware-win11.nondebug\\build\\PCbuild\\amd64\\_testembed.exe',
   'faulthandler': 0,
   'hash_seed': 0,
   'home': 'B:\\uildarea\\3.x.ware-win11.nondebug\\build',
   'import_time': 0,
   'inspect': 0,
   'install_signal_handlers': 1,
   'int_max_str_digits': 4300,
   'interactive': 0,
   'isolated': 0,
   'legacy_windows_stdio': 0,
   'malloc_stats': 0,
   'module_search_paths': ['b:\\uildarea\\3.x.ware-win11.nondebug\\build\\PCbuild\\amd64\\python313.zip',
                           'B:\\uildarea\\3.x.ware-win11.nondebug\\build\\PCbuild\\amd64',
                           'B:\\uildarea\\3.x.ware-win11.nondebug\\build\\Lib',
                           'b:\\uildarea\\3.x.ware-win11.nondebug\\build\\PCbuild\\amd64\\python313.zip',
-                          'B:\\uildarea\\3.x.ware-win11.nondebug\\build\\PCbuild\\amd64',
?                           ^
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zooba
zooba deleted the gh-86179 branch December 14, 2023 00:34
@zooba

zooba commented Dec 14, 2023

Copy link
Copy Markdown
Member Author

The failure is because the realpath implementation will convert drive names to uppercase, which causes case-sensitive path comparisons in the tests to fail. I'm pretty sure this was reported somewhere else for os.path.realpath as well, so I guess we need to do one more comparison before returning in both cases and not return case-only changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Dec 14, 2023

Copy link
Copy Markdown

GH-113121 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Dec 14, 2023
zooba added a commit to zooba/cpython that referenced this pull request Dec 14, 2023
@zooba
pythongh-86179: Implement realpath() on Windows for getpath.py calcul…
23703a9
…ations (pythonGH-113033)
@Yhg1s

Yhg1s commented Jan 16, 2024

Copy link
Copy Markdown
Member

This seems to have introduced a new test failure, but only when running tests in an installed Python and using the unversioned binary (bin/python3 rather than bin/python3.13). Rolling back the changes in this PR makes both tests pass.

% /tmp/testinstall/bin/python3.13 -m test test_venv
Using random seed: 3548105807
0:00:00 load avg: 0.25 Run 1 test sequentially
0:00:00 load avg: 0.25 [1/1] test_venv

== Tests result: SUCCESS ==

1 test OK.

Total duration: 3.6 sec
Total tests: run=29 skipped=3
Total test files: run=1/1
Result: SUCCESS
% /tmp/testinstall/bin/python3 -m test test_venv
Using random seed: 3358697499
0:00:00 load avg: 0.06 Run 1 test sequentially
0:00:00 load avg: 0.06 [1/1] test_venv
test test_venv failed -- Traceback (most recent call last):
  File "/tmp/testinstall/lib/python3.13/test/test_venv.py", line 332, in test_sysconfig_symlinks
    self.assertEqual(out.strip(), expected, err)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '/tmp/testinstall/bin/python3.13' != '/tmp/testinstall/bin/python3'
- /tmp/testinstall/bin/python3.13
?                             ---
+ /tmp/testinstall/bin/python3
 :

test_venv failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_venv

Total duration: 3.7 sec
Total tests: run=29 failures=1 skipped=3
Total test files: run=1/1 failed=1
Result: FAILURE
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zooba

zooba commented Jan 16, 2024

Copy link
Copy Markdown
Member Author

Rather than rolling back the (primarily Windows-only) change, better to skip the test.

I'll need to take some time to learn how venv/symlinks work on POSIX in order to diagnose and fix. As it's just a test, it may be faster if we can pull in someone who already knows that side of things.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@FFY00

FFY00 commented Jan 16, 2024

Copy link
Copy Markdown
Member

You can ping me on Discord, or an issue to discuss the POSIX behaviors.

zooba reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zooba

zooba commented Jan 16, 2024

Copy link
Copy Markdown
Member Author

I'll push a PR to skip that part of the test so it's not blocking the release. If we want to test venv later, we can figure it out then.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@zooba @aisk
pythongh-86179: Implement realpath() on Windows for getpath.py calcul…
1af21d5
…ations (pythonGH-113033)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@zooba @Glyphack
pythongh-86179: Implement realpath() on Windows for getpath.py calcul…
390b1fa
…ations (pythonGH-113033)
@ZeroIntensity ZeroIntensity removed the needs backport to 3.11 only security fixes label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pfmoore pfmoore pfmoore left review comments
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner
@FFY00 FFY00 Awaiting requested review from FFY00 FFY00 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@zooba zooba

Labels

OS-windows

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@zooba @bedevere-bot @Yhg1s @FFY00 @pfmoore @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.