[issue45789] Python execution broken after update via Windows Store

2022-02-09 Thread firewave


firewave  added the comment:

A few weeks ago I was able to re-install Python 3.9 and 3.10 after manually 
removing the 
%LocalAppData%\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.* and 
disabling/enabling the applinks manually and uninstalling/installing a few 
times to get rid of all left-over applinks on the disk.

I still had two entries by "App Installer" for python.exe and python3.exe in 
the UI. But I assume those have been there for ages now.

But as soon as the next update was installed both version broke again.

So I tried the same again and uninstalling and manually deleting the folders is 
no longer enough. I still have applinks in that folder which I cannot delete. 
And I can no longer install the apps at all. They fail with

Installation Failure: Windows failed to install the following update with error 
0x80070020: 9P7QFQMJRFP7-PythonSoftwareFoundation.Python.3.9.

So now it's completely broken.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2022-02-09 Thread firewave


firewave  added the comment:

I figured it out.

I tried to delete the files using PowerShell and I got the following:

Remove-Item : Cannot remove item 
C:\Users\Username\AppData\Local\Microsoft\WindowsApps\python.exe: The
process cannot access the file 
'C:\Users\Username\AppData\Local\Microsoft\WindowsApps\python.exe' because it
is being used by another process.

Using the "Resource Monitor" via the "CPU" tab and "Associated Handles" I was 
able the process which was using those. Somehow the handle search in "Process 
Explorer" was not returning this.

After closing the process I was able to remove the files and install Python 
again.

So it is exactly as I suspected before. When an update/uninstall is performed 
and the files are in use they cannot be updated/removed.

It should probably check this early and fail in case the files are in use so it 
doesn't perform a partial operation leaving the app unusable/not installable.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2022-02-09 Thread firewave


firewave  added the comment:

Actually "Process Explorer" finds the handle as well. No idea why it didn't 
come up in my last search.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-11 Thread firewave


New submission from firewave :

I have Python 3.9 installed from the Windows Store and use it in CMake scripts.

After the recent update to 3.92288.0 Python executions suddenly started failing 
with "Access is denied". I assumed I was using a wrong or cached path but that 
didn't turn out to be the case.

It did find the executable in the (apparently) correct folder "C:/Program 
Files/WindowsApps/PythonSoftwareFoundation.Python.3.9_3.9.2288.0_x64__qbz5n2kfra8p0/python3.9.exe".

I tried running that via the command-line and it failed with "Access is 
denied." as well. It appears to be related to "C:/Program Files/WindowsApps" 
requiring Administrator permissions.

Also just running "python3.9.exe" (which exists in the PATH) no longer works. 
It fails with "The system cannot find the file 
C:\Users\\AppData\Local\Microsoft\WindowsApps\python3.9.exe."

So it seems the update messed something up.

I had Python 3.9 installed and working fine for some version now. I ran into 
something similar in the past and had to uninstall and install it again to fix 
the problem.

I am using Windows 10 Version 21H1 (OS Build 19043.1348).

--
components: Windows
messages: 406176
nosy: firewave, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python execution broken after update via Windows Store
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-11 Thread firewave


firewave  added the comment:

I checked them and they look fine. I have Python 3.10 installed as well so the 
non-suffix and "3" suffix-only executable refer to that. All the "3.9" suffix 
ones point to the "Python 3.9" entries and are enabled.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

Thanks a lot for all the details.

I used the script to check all the 3.9 appexec links and only the "python3.9" 
one points to the wrong executable.

Version: 3
Package ID: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
Entry Point: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0!Python
App Type: 0
Target Path:
C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\python3.9.exe

Version: 3
Package ID: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
Entry Point: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0!Pip
App Type: 0
Target Path:
C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2288.0_x64__qbz5n2kfra8p0\pip3.9.exe

Could it be possible that it might not be able to replace that link when it is 
currently in use?

Also the "Reliability Monitor" shows a warning to install the "Python 3.9" app 
but I never saw anything about it in the "Windows Store".

Installation Failure: Windows failed to install the following update with error 
0x80073D02: 9P7QFQMJRFP7-PythonSoftwareFoundation.Python.3.9.

A day later the success entry is found.

Installation Successful: Windows successfully installed the following update: 
9P7QFQMJRFP7-PythonSoftwareFoundation.Python.3.9

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

The python3.9.exe file in the WindowsApps folder looks like a real executable 
and not a link. The script also backs that

python3 read_appexec.py "c:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2288.0_x64__qbz5n2kfra8p0\python3.9.exe"
Traceback (most recent call last):
  File "s:\Downloads\read_appexec.py", line 74, in 
link = read_appexec_link(sys.argv[1])
  File "s:\Downloads\read_appexec.py", line 66, in read_appexec_link
raise ctypes.WinError(ctypes.get_last_error())
OSError: [WinError 4390] The file or directory is not a reparse point.

Although I did this as Administrator so I can successfully list the directory I 
am not able to run that executable. It fails with "Access is denied.". Others 
are working fine.

idle3.9.exe - works
pip3.9.exe - works
python.exe - Access is denied.
python3.9.exe - Access is denied.
pythonw.exe - Access is denied.
pythonw3.9.exe - works

I opened both pythonw* files in the old "Dependency Walker" and it loaded them 
both fine and the dependencies appear to be identical by just taking a short 
look beside it not showing anything suspicious in them. The non-suffix version 
didn't run with "Failure starting the process. Access is denied (5).".

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

The "python3.9.exe" link is that one also points to the earlier version. All 
other links are fine.

Also all those files are 0 bytes - even the working ones.

Since I cannot even run the actual executable there seems to be an issue with 
the executables on top of the broken appexec link.

I also checked the actual executables and they are binary identical as well as 
having the identical permissions and timestamps.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

That didn't work. The link is wrong on the disk and that setting just controls 
the usage of it not the creation.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2021-11-16 Thread firewave


firewave  added the comment:

Today 3.9.2544.0 was automatically installed on my system. Interestingly it did 
not update the broken "python3.9.exe" appexec links. The timestamp is still 
from the last update and the links still point to 3.9.2032.0. All other links 
were updated.

--

___
Python tracker 
<https://bugs.python.org/issue45789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com