Closed jonaswvd closed 1 year ago
Hey, thanks for providing this. I see that it's only from the windows client side where I have to use that Popen function since the OS level functions aren't there on windows; fork/exec/...
And, I see it's the pipes that are what weren't being closed; they aren't used as I have sockets for communication with my subprocess (java in the IOM case). I wasn't able to reproduce what you posted, exactly, but I saw some similar messages when running some of this with unittest. So that let me better see what I was missing; seeing it was the unused pipes. I also had one occurance of this in my STDIO access method, since that is now supported from a windows client (only for SSH), so I fixed that case similarly.
I just pushed changes to the main branch to address this. Since I wasn't seeing the same thing you were, can you pull from main and run your test case again and see if I've address what you are seeing? Here's the easy way to get this:
pip uninstall -y saspy pip install git+https://git@github.com/sassoftware/saspy.git
Thanks! Tom
That seems to have done the trick, thank you!
Fantastic, and thanks for finding that. Guess we can close this. This will be incorporated in the next release I publish. But for now, you should be good with this. Thanks! Tom
Running saspy 4.3.3 with local SAS 9.4 windows installation generates 3 ResourceWarnings: python example_file.py -Walways
example_file.py:
sascfg_personal.py:
Print of ResourceWarningns and setup info generated by running following (using PYTHONTRACEMALLOC=1 for tracing where unclosed files are opened); python print_stuff.py -Walways PYTHONTRACEMALLOC=1
print_stuff.py
prints:
Specifically the line:
in SASsessionIOM()._endsas() generates the 3 x ResourceWarnings.
Can be fixed by inserting:
or
just before self.pid = None.