This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [doc] Add a section to Windows FAQ explaining os.symlink
Type: enhancement Stage: needs patch
Components: Documentation, Windows Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: brian.curtin Nosy List: adam.woodbeck, brian.curtin, eryksun, ingrid, jesstess
Priority: normal Keywords: patch

Created on 2010-12-02 18:42 by brian.curtin, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
issue10608.patch ingrid, 2014-08-13 14:46 review
Messages (3)
msg123099 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-12-02 18:42
A section in the Windows FAQ should better explain the recent addition of os.symlink and how it can be used, along with examples.

If a user just sits down and hits Start>Run>python, os.symlink will almost positively not be available. I'll need to briefly explain privileges, which one is needed, how it can be obtained, and how to properly write code on Windows to make use of os.symlink.

There is documentation of os.symlink itself, but it's more of a developer reference to match the rest of the os module documentation. A beginner would likely need more information, but that information isn't right for Doc/library/os.rst.
msg225281 - (view) Author: (ingrid) * Date: 2014-08-13 14:46
I tried writing a section aimed at beginners, please let me know if you think any information should be added or removed.
msg408045 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2021-12-08 21:02
Ingrid's patch misses the requirement to log off after adding a privilege to the current account. A new access token is required, from a fresh logon. 

Privileges can also be added to groups, not just to individual user accounts. Thus the symlink privilege can be granted to a standard group or well-known group, such as "Users" or "Authenticated Users".

Python 3.8+ supports the system's developer mode, which allows unprivileged symlink creation. This is just for developer tools, such as Git. Developer mode should not be relied on for regular scripts and applications. 

In POSIX, symlinks are widely used to reduce the burden of software maintenance. In Windows, however, symlinks are not reliably available, due to limited file system support (primarily NTFS, ReFs) and the requirement for a privilege that standard users lack by default. Another significant problem in Windows is the behavior of the shell API (shell32.dll), which eagerly resolves a symlink to its target and thus breaks many use cases for symlinks (e.g. virtual environments). Given these problems, using symlinks may actually increase the maintenance burden in Windows. Applications have to support a fallback path for Windows -- such as hard linking, copying, or launchers -- when symlinks either aren't available or for use cases that are unreliable (e.g. due to the way symlinks are accessed in the GUI shell).
History
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54817
2021-12-08 21:02:12eryksunsetnosy: + eryksun
messages: + msg408045
2021-12-08 14:50:05iritkatrielsettitle: Add a section to Windows FAQ explaining os.symlink -> [doc] Add a section to Windows FAQ explaining os.symlink
type: behavior -> enhancement
versions: + Python 3.11, - Python 2.7, Python 3.4, Python 3.5
2014-08-13 14:46:22ingridsetfiles: + issue10608.patch

nosy: + ingrid, jesstess
messages: + msg225281

keywords: + patch
2014-06-17 12:46:48BreamoreBoysetversions: + Python 2.7, Python 3.4, Python 3.5, - Python 3.2
2011-07-05 14:29:53adam.woodbecksetnosy: + adam.woodbeck
2011-01-04 04:11:42brian.curtinlinkissue9332 superseder
2010-12-02 18:42:11brian.curtincreate