Subprocess - Windows

Subprocess - Windows

MichaelT_123
Advisor Advisor
1,312 Views
3 Replies
Message 1 of 4

Subprocess - Windows

MichaelT_123
Advisor
Advisor

Hi TF360,

 

It has just happened...

"...\AppData\Local\Autodesk\webdeploy\production\2....dc77\Python\lib\subprocess.py"

has started generating the error:

OSError: [WinError 6] The handle is invalid

 

The underlying subprocess code has worked perfectly for a long time, and it is so simple that it can not be wrong! It still operates outside F360 environ as it should.

 

Something has happened in not too distant past (~24h)… sneaky MS update…?

 

Sincerely

MichaelT

MichaelT
0 Likes
1,313 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor

I have experience creating scripts using Subprocess.
https://forums.autodesk.com/t5/fusion-360-ri-ben-yu/3dcad-zhong-jianfairuno3dna-dian-qu-xianwoinpoto... 
It is running without problems.


In the past, when Fusion360 Update was executed, there was an experience that what was processed correctly resulted in an error.
After completing the update, restart Fusion360 and try to execute the script (add-in) again.

0 Likes
Message 3 of 4

MichaelT_123
Advisor
Advisor

Thank you Kandennti-san,

 

I have closed the gap of understanding the issue to the stage that the subprocess runs as it should now.

The culprit was a bug in Python implementation which sneaked to my PC while I was sleeping,.. sometime during the last ~48 hours.

This ‘fresh’ bug was reported on Python site under the title:

“subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone”

Ref: https://bugs.python.org/issue37380

Including one of:

stdin=subprocess.DEVNULL

stdin=subprocess.PIPE

as Popen argument fixed (by-passed) the bug.

 

With Regards

MichaelT

MichaelT
Message 4 of 4

kandennti
Mentor
Mentor
0 Likes