@@ -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
@@ -335,14 +335,42 @@ Python in Start and right-click to select Uninstall. Uninstalling will
335
335
remove all packages you installed directly into this Python installation, but
336
336
will not remove any virtual environments
337
337
338
- Known Issues
338
+ Known issues
339
339
------------
340
340
341
+ Redirection of local data, registry, and temporary paths
342
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343
+
341
344
Because of restrictions on Microsoft Store apps, Python scripts may not have
342
- full write access to shared locations such as `` TEMP ` ` and the registry.
345
+ full write access to shared locations such as :envvar: ` TEMP ` and the registry.
343
346
Instead, it will write to a private copy. If your scripts must modify the
344
347
shared locations, you will need to install the full installer.
345
348
349
+ At runtime, Python will use a private copy of well-known Windows folders and the registry.
350
+ For example, if the environment variable :envvar: `%APPDATA% ` is :file: `c:\\ Users\\ <user>\\ AppData\\ `,
351
+ then when writing to :file: `C:\\ Users\\ <user>\\ AppData\\ Local ` will write to
352
+ :file: `C:\\ Users\\ <user>\\ AppData\\ Local\\ Packages\\ PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\ LocalCache\\ Local\\ `.
353
+
354
+ When reading files, Windows will return the file from the private folder, or if that does not exist, the
355
+ real Windows directory. For example reading :file: `C:\\ Windows\\ System32 ` returns the contents of :file: `C:\\ Windows\\ System32 `
356
+ plus the contents of :file: `C:\\ Program Files\\ WindowsApps\\ package_name\\ VFS\\ SystemX86 `.
357
+
358
+ You can find the real path of any existing file using :func: `os.path.realpath `:
359
+
360
+ .. code-block :: python
361
+
362
+ >> > import os
363
+ >> > test_file = ' C:\\ Users\\ example\\ AppData\\ Local\\ test.txt'
364
+ >> > os.path.realpath(test_file)
365
+ ' C:\\ Users\\ example\\ AppData\\ Local\\ Packages\\ PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\ LocalCache\\ Local\\ test.txt'
366
+
367
+ When writing to the Windows Registry, the following behaviors exist:
368
+
369
+ * Reading from ``HKLM\\Software `` is allowed and results are merged with the :file: `registry.dat ` file in the package.
370
+ * Writing to ``HKLM\\Software `` is not allowed if the corresponding key/value exists, i.e. modifying existing keys.
371
+ * Writing to ``HKLM\\Software `` is allowed as long as a corresponding key/value does not exist in the package
372
+ and the user has the correct access permissions.
373
+
346
374
For more detail on the technical basis for these limitations, please consult
347
375
Microsoft's documentation on packaged full-trust apps, currently available at
348
376
`docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes
0 commit comments