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 — os.chmod() does not follow symlinks on Windows · Issue #59616 · python/cpython

os.chmod() does not follow symlinks on Windows #59616

New issue
Copy link
New issue
Copy link
Closed
Closed
os.chmod() does not follow symlinks on Windows#59616
Copy link
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

atsuoishimoto
mannequin
opened on Jul 21, 2012
Issue body actions
BPO 15411
Nosy @atsuoishimoto, @tjguk, @asvetlov, @zware
Files
  • chmod_symlink_win32.patch
  • chmod_symlink_win32_2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2012-07-21.08:31:23.124>
    labels = ['type-feature', 'library', 'OS-windows']
    title = 'os.chmod() does not follow symlinks on Windows'
    updated_at = <Date 2019-04-26.19:53:54.688>
    user = 'https://github.com/atsuoishimoto'

    bugs.python.org fields:

    activity = <Date 2019-04-26.19:53:54.688>
    actor = 'BreamoreBoy'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2012-07-21.08:31:23.124>
    creator = 'ishimoto'
    dependencies = []
    files = ['26462', '26464']
    hgrepos = []
    issue_num = 15411
    keywords = ['patch']
    message_count = 3.0
    messages = ['165996', '166003', '223300']
    nosy_count = 4.0
    nosy_names = ['ishimoto', 'tim.golden', 'asvetlov', 'zach.ware']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue15411'
    versions = ['Python 3.5']

    Linked PRs

    • gh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod() on Windows #113049

    Activity

    1. atsuoishimoto commented on Jul 21, 2012

      @atsuoishimoto
      atsuoishimotomannequin
      on Jul 21, 2012
      MannequinAuthor
      More actions

      os.chmod() should check symlinks if followsymlinks option is True on Windows.

      This is a cause of failure of test case

      test.test_shutil.TestShutil.test_copymode_follow_symlinks

      (bpo-13837)

    2. atsuoishimoto
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      OS-windows
      type-featureA feature request or enhancementA feature request or enhancement
      on Jul 21, 2012
    3. atsuoishimoto commented on Jul 21, 2012

      @atsuoishimoto
      atsuoishimotomannequin
      on Jul 21, 2012
      MannequinAuthor
      More actions

      Patch updated. Check symlinks only if supported by platform.

    4. BreamoreBoy commented on Jul 16, 2014

      @BreamoreBoy
      BreamoreBoymannequin
      on Jul 16, 2014
      Mannequin
      More actions

      Can we have a patch review on this please as it's holding up bpo-13837.

    5. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    6. serhiy-storchaka
      added 2 commits that reference this issue on Dec 13, 2023

      pythongh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod(…

      15c667b

      pythongh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod(…

      0d117a1
    7. serhiy-storchaka commented on Dec 13, 2023

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 13, 2023
      Member
      More actions

      Unfortunately, the patch by @atsuoishimoto is too old and cannot be applied to the current code. The difference is so larger, that it is easier to write a new code from scratch than try to resolve conflicts iteratively.

      Which I did. My PR uses a different approach. Instead of resolving the symlink path, it opens a handle and changes file attributes by the handle (it is the recommended way). In future it may be possible to implement also os.fchmod().

      Reacted by Steve Dower and Atsuo Ishimoto
    8. serhiy-storchaka
      added a commit that references this issue on Dec 14, 2023

      gh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod() on W…

      29f7eb4
    9. serhiy-storchaka commented on Dec 14, 2023

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 14, 2023
      Member
      More actions

      Now os.chmod() supports follow_symlinks=True on Windows. But by default it does not follow symlinks. Few versions later (in 3.15 or later) we can change the default. It will allow users to use os.lchmod() or os.chmod(follow_symlinks=False) if they need the old behavior, and it will work in several versions.

    10. serhiy-storchaka
      closed this as completedon Dec 14, 2023
    11. corona10
      added a commit that references this issue on Dec 15, 2023

      pythongh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod(…

      4f84b76
    12. aisk
      added a commit that references this issue on Feb 11, 2024

      pythongh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod(…

      ec13685
    13. Glyphack
      added a commit that references this issue on Sep 2, 2024

      pythongh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod(…

      2f01618
    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

      OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        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.