Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-op for FileLock on Web Assembly Platform #95

Closed
michaelweinold opened this issue May 29, 2024 · 2 comments
Closed

Add no-op for FileLock on Web Assembly Platform #95

michaelweinold opened this issue May 29, 2024 · 2 comments

Comments

@michaelweinold
Copy link

Would it be possible to add a no-op for the FileLock variable on the Web Assembly platform here:

if os.name == "nt":
    FileLock = MsvcrtLock
else:
    FileLock = FcntlLock

Otherwise, using whoosh in Pyodide will throw an error of the kind:

File /lib/python3.11/site-packages/whoosh/util/filelock.py:100, in FcntlLock.acquire(self, blocking)
     97 flags = os.O_CREAT | os.O_WRONLY
     98 self.fd = os.open(self.filename, flags)
--> 100 mode = fcntl.LOCK_EX
    101 if not blocking:
    102     mode |= fcntl.LOCK_NB

AttributeError: module 'fcntl' has no attribute 'LOCK_EX'

This was suggested here:

and is related to:

Copy link
Contributor

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

@michaelweinold
Copy link
Author

...no longer necessary - we have dropped Whoosh from our dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant