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

it can not work on windows #7

Open
yanzixiang opened this issue Feb 12, 2025 · 1 comment
Open

it can not work on windows #7

yanzixiang opened this issue Feb 12, 2025 · 1 comment

Comments

@yanzixiang
Copy link

Got an error like this
AttributeError: module 'mmap' has no attribute 'MAP_SHARED'

after change this line

         self.raw = mmap.mmap(fd, fullsize, mmap.MAP_SHARED, mmap.PROT_READ)

to

           if sys.platform.startswith('win'):
                # Windows
                self.raw = mmap.mmap(fd, fullsize, access=mmap.ACCESS_READ)
            else:
                # Unix-like
                self.raw = mmap.mmap(fd, fullsize, mmap.MAP_SHARED, mmap.PROT_READ)

got an error like this
return struct.unpack_from('>H', self.raw,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

Could you assist in resolving this issue?

@vandry vandry closed this as completed in f7df936 Feb 16, 2025
@vandry
Copy link
Owner

vandry commented Feb 16, 2025

Your first change looks reasonable at a glance, but I have no means of testing it since I do not have that operating system to test with.

@vandry vandry reopened this Feb 16, 2025
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

2 participants