Skip to content

Doesn't seem to work on Windows #1

@nizwiz

Description

@nizwiz

I've tried this with the following two python files:

callee.py:

import socklocks

if __name__ == '__main__':
    with socklocks.SocketLock('my_test_lock'):
        print('Callee')

caller.py:

import socklocks
import subprocess
import os
import time
import sys

if __name__ == '__main__':
    with socklocks.SocketLock('my_test_lock'):
        proc = subprocess.Popen(fr'python {os.path.join(os.getcwd(), "callee.py")}', stdout = sys.stdout, stderr = sys.stderr, text = True)
        time.sleep(5)
        print("Caller")

And upon running caller.py, I get this:

Callee
[5 sec break]
Caller

But from my understading of SocketLock's purpose, the callee should wait for the caller to exit the lock context before it can enter. Have I done anything wrong?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions