Different Errors running pipe test

I’ve switched back to 3.3.3. (Had I known that version 3.4.x had known problems with macros, I wouldn’t have switched back to that version yesterday.)

Running Audacity 3.3.3 immediately after installing it generates a bunch of 'Unable to load the “mod-___” module for a variety of modules. Presumably this is due to having installed 3.3.3 on top of the 3.4.1 install and parts of 3.4.1 not getting properly cleaned out. I’ll completely remove Audacity and reinstall it again to see if that still happens…

In the process of completely uninstalling Audacity I noticed that I had Audacity folders in both C:\Program Files (x86) and C:\Program Files. I’m not sure how/when that happened. Presumably it happened when I installed one of the older versions yesterday. I did default installations so presumably one of the older versions installed into C:\Program Files (x86).

I’ve removed all traces of Audacity I could find and did a clean, default installation of Audacity 3.3.3 and enabled the mod-script-pipe module and restarted Audacity., confirmed the ToSrvPipe and FromSrvPipe exist. (Those are really unclean names for the named pipes. Any chance that a parallel set that are clearly named as being to/from Audacity could be created at some point? I get the need to leave the existing pipe names in place so older code doesn’t get broken. But having two sets that are work in parallel seem like it should work.)

Running pipe_test.py:

pipe-test.py, running on windows
Write to “\.\pipe\ToSrvPipe”
Read from “\.\pipe\FromSrvPipe”
– Both pipes exist. Good.
Traceback (most recent call last):
File “C:\DevProjects\Audacity\pipe_test.py”, line 44, in
TOFILE = open(TONAME, ‘w’)
^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘\\.\pipe\ToSrvPipe’

Running pipe_test.py a second time got the same results.

Running pipe_test.py a third time got these results:

pipe-test.py, running on windows
Write to “\.\pipe\ToSrvPipe”
Read from “\.\pipe\FromSrvPipe”
– Both pipes exist. Good.
– File to write to has been opened
– File to read from has now been opened too

Send: >>>
Help: Command=Help
Rcvd: <<<

{ “id”:“Help”, “name”:“Help”, “params”:
[
{ “key”:“Command”, “type”:“string”, “default”:“Help” },
{ “key”:“Format”, “type”:“enum”, “default”:“JSON”, “enum”:
[ “JSON”, “LISP”, “Brief” ] } ],
“url”:“Extra_Menu:_Scriptables_II#help”,
“tip”:“Gives help on a command.” }
BatchCommand finished: OK

Send: >>>
Help: Command=“GetInfo”
Rcvd: <<<

{ “id”:“GetInfo”, “name”:“Get Info”, “params”:
[
{ “key”:“Type”, “type”:“enum”, “default”:“Commands”, “enum”:
[ “Commands”, “Menus”, “Preferences”, “Tracks”, “Clips”, “Envelopes”, “Labels”, “Boxes” ] },
{ “key”:“Format”, “type”:“enum”, “default”:“JSON”, “enum”:
[ “JSON”, “LISP”, “Brief” ] } ],
“url”:“Extra_Menu:_Scriptables_II#get_info”,
“tip”:“Gets information in JSON format.” }
BatchCommand finished: OK

Audacity was untouched between runs of pipe_test.py.

Does Audacity need a little time after starting before it can accept commands? If so, how long does it need?

I continued to run pipe_test.py and it worked fine until the 15th run at which point it was back at the initial error results:

pipe-test.py, running on windows
Write to “\.\pipe\ToSrvPipe”
Read from “\.\pipe\FromSrvPipe”
– Both pipes exist. Good.
Traceback (most recent call last):
File “C:\DevProjects\Audacity\pipe_test.py”, line 44, in
TOFILE = open(TONAME, ‘w’)
^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘\\.\pipe\ToSrvPipe’

Since I only used pipe_test.py for these tests, I think I can rule out my code as the problem.

Since I only used a clean, default install of Audacity 3.3.3 (on Windows 11), I think we can rule out the problem being caused by left over parts of the Audacity 3.4.1 install.

The problem seems to be that the named pipes are a bit unstable in Audacity 3.3.3 for some reason.

The only macro commands I’ve run are the Command=Help and Command=“GetInfo” from pipe_test.py.

If scripting was working in the older version, and then it stopped working in the older version, that suggests that the problem lies elsewhere on your computer.

The code I’ve been writing is new code and not something I’ve run with older versions of Audacity. I started on either version 3.3.3 or 3.4.0 and upgraded to 3.4.1 when I initially hit problems with the named pipes.

Steve, have you tried taking the code in pipe_test.py and putting it into a loop to see if it reliable worked for you?