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

No module named 'fcntl' #1

Open
imbmf opened this issue Mar 13, 2019 · 4 comments
Open

No module named 'fcntl' #1

imbmf opened this issue Mar 13, 2019 · 4 comments

Comments

@imbmf
Copy link

imbmf commented Mar 13, 2019

Hi,
on windows 10 64 -bit i am getting this error:
import fcntl
ModuleNotFoundError: No module named 'fcntl'

@essamzaroura
Copy link

any solution

@altugozcelikkale
Copy link

Same here with Windows 7 64 bit. This answer at StackOverflow provides an explanation. It seems fcntl module is not available on Windows. restatic won't work on Windows unless there is a workaround, or dependency to that module is removed in a future version.

@altugozcelikkale
Copy link

A temporary and potentially dangerous hack, but it allows restatic to launch at least...

Create a file named fcntl.py with the following content and place it in a place python can find it.

def fcntl(fd, op, arg=0):
    return 0

def ioctl(fd, op, arg=0, mutable_flag=True):
    if mutable_flag:
        return 0
    else:
        return ""

def flock(fd, op):
    return

def lockf(fd, operation, length=0, start=0, whence=0):
    return

LOCK_EX = 2
LOCK_NB = 4

Adapted from: https://stackoverflow.com/a/25471508/5541079

I didn't test the functionality, but it looks like use of fnctl in the code is quite localized. It is used only during startup to ensure single app instance. So I don't think the functionality is affected by this hack. Needless to say, your mileage may vary. Please try at your own risk.

@imbmf
Copy link
Author

imbmf commented Jul 3, 2019

@altugozcelikkale GUI starts now with this fix!

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

Successfully merging a pull request may close this issue.

3 participants