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

Apparently read-only BF files aren't allowed. #88

Open
rsharris opened this issue Jul 2, 2019 · 1 comment
Open

Apparently read-only BF files aren't allowed. #88

rsharris opened this issue Jul 2, 2019 · 1 comment

Comments

@rsharris
Copy link

rsharris commented Jul 2, 2019

I'm using a package that uses pybloomfilter. That package is poorly documented and when I guess wrong at some command-line parameters it used pybloomfilter to start overwriting the test bloom filter file it had included in the package.

So after re-downloading the package, I disabled write access for the test files before trying again. This time I got the command-line parameters right, and it tried to use pybloomfilter to read the existing BF file.

But the open called from line 325 in pybloomfilter.pyx doesn't appear to give the caller any way to specify a read-only file. So in cinit at line 52 and/or line 57 and/or line 62 it decides the filemode is read-write. And then os.access (correctly) refuses to open the file, and the OSError("Insufficient permissions...") exception is raised.

Is a read-only BF an unanticipated use case?

@mizvyt
Copy link

mizvyt commented Oct 25, 2019

Not supported as of the latest commits. Added as a feature in the following PRs quite a lengthy time ago:
#59
#83

But since this repository seems to be unmaintained, try following the Python 3 fork:
https://github.com/prashnts/pybloomfiltermmap3

I've raised an issue there and collectively we may be able to add this feature.

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