I rarely use Windows, but if I recall correctly, the default “capacity” of a named pipe on Windows is rather small. I have an unproven theory that mod-script-pipe can break if either of the pipes become full, so Python should attempt to read back from Audacity after each command that is sent so as to receive any data that Audacity may have sent.
This is not generally a problem on Linux because named pipes have a much larger default capacity.
(Name pipes are basically special kinds of “files” on Linux. They’re a bit more “magical” on Windows, and are not even part of the normal filesystem.)
I’m seeing failures with zero messages going in or out of the named pipes other than whatever Audacity might be doing. So while your theory may or may not be valid, it doesn’t seem to have anything to do with the problem I’m seeing.
I can’t test that script as it is Windows specific and I’m on Linux.
The last version that I tested extensively with Python scripting on Windows was Audacity 2.4.2.
If that version has the same problem for you, then the issue is probably not in Audacity.
On the other hand, if pipes work reliably for you with 2.4.2 (and not with recent versions of Audacity, then that’s a strong indication that there’s a regression bug that needs to be logged and fixed.
I’ve seen multiple reports of problems with macros in Audacity 3.4.0 and 3.4.1. (Macros and scripting share a lot of common code). Trouble shooting an issue in scripting would be near impossible when there are know bugs in the way.
Audacity 3.3.3 is a reasonably recent version of Audacity, but has been around long enough that I would have expected this issue to have been reported before it the problem was in Audacity. I haven’t heard of such bugs, but it’s a small minority of Audacity users that use the scripting feature.
Audacity 2.4.2 is the last version that I’ve tested personally on Windows, and have not seen the issue that you are describing.
As I said in my previous post, If that version has the same problem for you, then the issue is probably not in Audacity. On the other hand, if pipes work reliably for you with 2.4.2 (and not with recent versions of Audacity, then that’s a strong indication that there’s a regression bug that needs to be logged and fixed.
You can log the issue yourself on GitHub (Issues · audacity/audacity · GitHub registration required), but it’s more likely to get the developer’s attention if we could be sure that it’s a regression against a previous version.