Skip to content

it can not work on windows #7

@yanzixiang

Description

@yanzixiang

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions