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 — importlib.metadata test fails on Windows if symlinks aren't allowed · Issue #114107 · python/cpython

importlib.metadata test fails on Windows if symlinks aren't allowed #114107

New issue
Copy link
New issue
Copy link
Closed
Closed
importlib.metadata test fails on Windows if symlinks aren't allowed#114107
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@encukou
encukou
opened on Jan 16, 2024
Issue body actions

From the AMD64 Windows11 Refleaks 3.x buildbot:

test_packages_distributions_symlinked_top_level (test.test_importlib.test_main.PackagesDistributionsTest.test_packages_distributions_symlinked_top_level)
Distribution is resolvable from a simple top-level symlink in RECORD. ... ERROR
======================================================================
ERROR: test_packages_distributions_symlinked_top_level (test.test_importlib.test_main.PackagesDistributionsTest.test_packages_distributions_symlinked_top_level)
Distribution is resolvable from a simple top-level symlink in RECORD.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "b:\uildarea\3.x.ware-win11.refleak\build\Lib\test\test_importlib\test_main.py", line 424, in test_packages_distributions_symlinked_top_level
    fixtures.build_files(files, self.site_dir)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "b:\uildarea\3.x.ware-win11.refleak\build\Lib\test\test_importlib\_path.py", line 70, in build
    create(contents, _ensure_tree_maker(prefix) / name)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "b:\uildarea\3.x.ware-win11.refleak\build\Lib\functools.py", line 911, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "b:\uildarea\3.x.ware-win11.refleak\build\Lib\test\test_importlib\_path.py", line 91, in _
    path.symlink_to(content)
    ~~~~~~~~~~~~~~~^^^^^^^^^
  File "b:\uildarea\3.x.ware-win11.refleak\build\Lib\pathlib\__init__.py", line 806, in symlink_to
    os.symlink(target, self, target_is_directory)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 1314] A required privilege is not held by the client: '.symlink.target' -> 'b:\\uildworker_temp\\test_python_sby1_qjd\\tmp16dtmklg\\symlinked'

The test needs to be skipped when symlinks are not supported.

Linked PRs

  • gh-114107: Fix importlib.metadata symlink test if symlinks aren't supported #114108
  • gh-114107: test.pythoninfo logs Windows Developer Mode #114121
  • [3.11] gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121) #114128
  • [3.12] gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121) #114129

Activity

  1. encukou
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jan 16, 2024
  2. encukou
    added a commit that references this issue on Jan 16, 2024

    pythongh-114107: Fix symlink test if symlinks aren't supported

    49e78cd
  3. encukou commented on Jan 16, 2024

    @encukou
    encukou
    on Jan 16, 2024
    MemberAuthor
    More actions

    This breaks a stable buildbot of a tier 1 platform. Per PEP-11, buildbot failures a any breakage should be fixed or reverted immediately.

    I plan to skip the test with a test.support helper; later we can find a fix more compatible with the importlib_resources external repo.

  4. Yhg1s
    added a commit that references this issue on Jan 16, 2024

    gh-114107: Fix importlib.resources symlink test if symlinks aren't su…

    c361a1f
  5. vstinner
    added a commit that references this issue on Jan 16, 2024

    pythongh-114107: test.pythoninfo logs Windows Developer Mode

    f44a442
  6. vstinner commented on Jan 16, 2024

    @vstinner
    vstinner
    on Jan 16, 2024
    Member
    More actions

    On python/buildmaster-config#454 I asked how to know if the Windows Developer Mode is enabled or not. I wrote #114121 which reads a registry value to log the state in test.pythoninfo.

  7. vstinner
    added a commit that references this issue on Jan 16, 2024

    gh-114107: test.pythoninfo logs Windows Developer Mode (#114121)

    c77f552
  8. miss-islington
    added 2 commits that reference this issue on Jan 16, 2024

    pythongh-114107: test.pythoninfo logs Windows Developer Mode (pythonG…

    dcfa187

    pythongh-114107: test.pythoninfo logs Windows Developer Mode (pythonG…

    2af3cb9
  9. vstinner
    added 2 commits that reference this issue on Jan 16, 2024

    [3.11] gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121

    ddc9e34

    [3.12] gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121

    1d5bca6
  10. itamaro commented on Jan 17, 2024

    @itamaro
    itamaro
    on Jan 17, 2024
    Contributor
    More actions

    Is this issue good to close now?

  11. encukou commented on Jan 17, 2024

    @encukou
    encukou
    on Jan 17, 2024
    MemberAuthor
    More actions

    @jaraco, do you have any comments?
    I know importlib_resources is maintained as a backport repo, but I don't know the details of the workflow. As it is, the fix might cause issues in importlib_resources.

  12. vstinner commented on Jan 17, 2024

    @vstinner
    vstinner
    on Jan 17, 2024
    Member
    More actions

    Build 648 of AMD64 Windows11 Refleaks 3.x passed. test.pythoninfo:

    support_os_helper.can_symlink: False
    windows.is_admin: 0
    

    Ah, the Windows developer mode was not logged after my change. Maybe the registry key does not always exist on Windows 10.

    Is this issue good to close now?

    I let @encukou and @jaraco decide. At least, I can say that test_packages_distributions_symlinked_top_level() of Lib/test/test_importlib/test_main.py only exists in the main branch and was fixed.

  13. kulikjak
    added 2 commits that reference this issue on Jan 22, 2024

    pythongh-114107: Fix importlib.resources symlink test if symlinks are…

    befef99

    pythongh-114107: test.pythoninfo logs Windows Developer Mode (python#…

    f68e8ba
  14. aisk
    added 2 commits that reference this issue on Feb 11, 2024

    pythongh-114107: Fix importlib.resources symlink test if symlinks are…

    e5e6c2a

    pythongh-114107: test.pythoninfo logs Windows Developer Mode (python#…

    9189996
  15. jaraco
    changed the title [-]importlib.resources test fails on Windows if symlinks aren't allowed[/-] [+]importlib.metadata test fails on Windows if symlinks aren't allowed[/+] on Mar 20, 2024
  16. jaraco commented on Aug 13, 2024

    @jaraco
    jaraco
    on Aug 13, 2024
    Member
    More actions

    Sorry for the delay in review. I only just today managed to stumble on the notification.

    I see I've already found the change in importlib.metadata tests and they've been ported to importlib_metadata, so it's all good.

    Thanks both for your help on this matter.

  17. jaraco
    closed this as completedon Aug 13, 2024
  18. Glyphack
    added 2 commits that reference this issue on Sep 2, 2024

    pythongh-114107: Fix importlib.resources symlink test if symlinks are…

    12c03d5

    pythongh-114107: test.pythoninfo logs Windows Developer Mode (python#…

    52b1664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.