@@ -34,7 +34,7 @@ developers using Python for any kind of project.
34
34
35
35
:ref: `windows-store ` is a simple installation of Python that is suitable for
36
36
running scripts and packages, and using IDLE or other development environments.
37
- It requires Windows 10, but can be safely installed without corrupting other
37
+ It requires Windows 10 and above , but can be safely installed without corrupting other
38
38
programs. It also provides many convenient commands for launching Python and
39
39
its tools.
40
40
@@ -348,14 +348,42 @@ Python in Start and right-click to select Uninstall. Uninstalling will
348
348
remove all packages you installed directly into this Python installation, but
349
349
will not remove any virtual environments
350
350
351
- Known Issues
351
+ Known issues
352
352
------------
353
353
354
+ Redirection of local data, registry, and temporary paths
355
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
356
+
354
357
Because of restrictions on Microsoft Store apps, Python scripts may not have
355
- full write access to shared locations such as `` TEMP ` ` and the registry.
358
+ full write access to shared locations such as :envvar: ` TEMP ` and the registry.
356
359
Instead, it will write to a private copy. If your scripts must modify the
357
360
shared locations, you will need to install the full installer.
358
361
362
+ At runtime, Python will use a private copy of well-known Windows folders and the registry.
363
+ For example, if the environment variable :envvar: `%APPDATA% ` is :file: `c:\\ Users\\ <user>\\ AppData\\ `,
364
+ then when writing to :file: `C:\\ Users\\ <user>\\ AppData\\ Local ` will write to
365
+ :file: `C:\\ Users\\ <user>\\ AppData\\ Local\\ Packages\\ PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\ LocalCache\\ Local\\ `.
366
+
367
+ When reading files, Windows will return the file from the private folder, or if that does not exist, the
368
+ real Windows directory. For example reading :file: `C:\\ Windows\\ System32 ` returns the contents of :file: `C:\\ Windows\\ System32 `
369
+ plus the contents of :file: `C:\\ Program Files\\ WindowsApps\\ package_name\\ VFS\\ SystemX86 `.
370
+
371
+ You can find the real path of any existing file using :func: `os.path.realpath `:
372
+
373
+ .. code-block :: python
374
+
375
+ >> > import os
376
+ >> > test_file = ' C:\\ Users\\ example\\ AppData\\ Local\\ test.txt'
377
+ >> > os.path.realpath(test_file)
378
+ ' C:\\ Users\\ example\\ AppData\\ Local\\ Packages\\ PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\ LocalCache\\ Local\\ test.txt'
379
+
380
+ When writing to the Windows Registry, the following behaviors exist:
381
+
382
+ * Reading from ``HKLM\\Software `` is allowed and results are merged with the :file: `registry.dat ` file in the package.
383
+ * Writing to ``HKLM\\Software `` is not allowed if the corresponding key/value exists, i.e. modifying existing keys.
384
+ * Writing to ``HKLM\\Software `` is allowed as long as a corresponding key/value does not exist in the package
385
+ and the user has the correct access permissions.
386
+
359
387
For more detail on the technical basis for these limitations, please consult
360
388
Microsoft's documentation on packaged full-trust apps, currently available at
361
389
`docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes
0 commit comments