Closed dmchurch closed 2 years ago
Thanks for reporting @dmchurch! I'll try to get a fixed pushed today
Fixed: https://github.com/SWI-Prolog/packages-mqi/commit/b24dd213c027e49764577347c8ef0405b30d4ddc
Looks like tempfile.NamedTemporaryFile can't be used since it doesn't allow the file to be reopened on Windows as the swiplserver library will try to do when the path is passed to it.
So I went with just using a guid:
tempDir = gettempdir()
tempFile = os.path.join(tempDir, str(uuid.uuid1()) + ".txt")
There was another place a predictable filename was being used (in a test that is off by default) so I fixed that too.
On a multi-user system, running the MQI test suite fails if you're the second user to do that.
The problem is in
test_write_output_to_file_in_embedded_mode
, here:https://github.com/SWI-Prolog/packages-mqi/blob/6a25a6896c2c716c13cf186ec3ee6b16cf18e09a/python/test_prologserver.py#L1231
Recommend you use
tempfile.NamedTemporaryFile
in thewith
clause instead of crafting the path manually.