Skip to content

Conversation

@zx3777
Copy link
Contributor

@zx3777 zx3777 commented Oct 18, 2025

This fixes an AttributeError: module 'mmap' has no attribute 'PROT_READ' that occurs when running the script on a Windows system.

The mmap.PROT_READ attribute is not available in Python on Windows. This commit adds an OS check to use the Windows-compatible mmap.ACCESS_READ parameter instead, making the tool cross-platform.

This fixes an `AttributeError: module 'mmap' has no attribute 'PROT_READ'` that occurs when running the script on a Windows system.

The `mmap.PROT_READ` attribute is not available in Python on Windows. This commit adds an OS check to use the Windows-compatible `mmap.ACCESS_READ` parameter instead, making the tool cross-platform.
@johnoneil
Copy link
Owner

This is pretty interesting as I really haven't run on windows for many years. I filed a separate issue to add windows to the basic CI I'm now running. #84

I think the black formatter is asking for a change in code format. I think that can be fixed by just doing:

pip install black
black .

I'm open to suggestions about formatters and linters. I just chose black and ruff recently because they were easy to use. I only added CI recently as an experiment to get more experience in newer python workflows.

@johnoneil johnoneil merged commit 7b5b329 into johnoneil:master Oct 19, 2025
1 check passed
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 this pull request may close these issues.

2 participants