You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanclass="sig-name descname"><spanclass="pre">execute_python</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">pycode</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/windows/winobject/process.html#WinProcess.execute_python"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#windows.winobject.process.WinProcess.execute_python" title="Link to this definition">¶</a></dt>
580
-
<dd><p>Execute Python code into the remote process.</p>
580
+
<dd><p>Execute Python code in the remote process.</p>
581
581
<p>This function waits for the remote process to end and
582
582
raises an exception if the remote thread raised one</p>
583
+
<divclass="admonition note">
584
+
<pclass="admonition-title">Note</p>
585
+
<p>This method is incompatible with Microsoft Store builds of python, as the interpreter DLLs do not grant execute to Users.
586
+
See workaround: <aclass="reference external" href="https://github.com/hakril/PythonForWindows/tree/master/samples/process/msstore_interpreter_remote_python.py">https://github.com/hakril/PythonForWindows/tree/master/samples/process/msstore_interpreter_remote_python.py</a></p>
<spanclass="sig-name descname"><spanclass="pre">execute_python_unsafe</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">pycode</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/windows/winobject/process.html#WinProcess.execute_python_unsafe"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#windows.winobject.process.WinProcess.execute_python_unsafe" title="Link to this definition">¶</a></dt>
588
-
<dd><p>Execute Python code into the remote process.</p>
593
+
<dd><p>Execute Python code in the remote process.</p>
@@ -596,6 +601,11 @@ <h2><span class="section-number">2.1.3. </span>WinProcess<a class="headerlink" h
596
601
</p>
597
602
</dd>
598
603
</dl>
604
+
<divclass="admonition note">
605
+
<pclass="admonition-title">Note</p>
606
+
<p>This method is incompatible with Microsoft Store builds of python, as the interpreter DLLs do not grant execute to Users.
607
+
See workaround: <aclass="reference external" href="https://github.com/hakril/PythonForWindows/tree/master/samples/process/msstore_interpreter_remote_python.py">https://github.com/hakril/PythonForWindows/tree/master/samples/process/msstore_interpreter_remote_python.py</a></p>
Copy file name to clipboardExpand all lines: docs/source/sample.rst
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,20 @@ Output
69
69
70
70
.. _token_sample:
71
71
72
+
73
+
Microsoft Store Python Injection
74
+
''''''''''''''''''''''''''''''''
75
+
76
+
Python execution in remote process fails with Microsoft Store builds of pythons (`mspython`), as the interpreter DLLs do not grant execute to Users.
77
+
This sample shows a workaround by user https://github.com/dariushoule by copying needed mspython files to a temporary directory and injecting those instead.
Executable is: C:\Users\hakril\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\python.exe
3
+
Trying normal execute_python()
4
+
Exception during proc1.execute_python():
5
+
InjectionFailedError('Injection of <c:\\program files\\windowsapps\\pythonsoftwarefoundation.python.3.13_3.13.496.0_x64__qbz5n2kfra8p0\\vcruntime140.dll> failed')
0 commit comments