-
Notifications
You must be signed in to change notification settings - Fork 24
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
The readdirSync and readdir functions both have a bug when one filesystem has an empty directory #742
base: master
Are you sure you want to change the base?
Conversation
@magarcia do you have any thoughts on this? |
…ystems and a file exists but has the wrong property (e.g., directory versus file); hit this when fixing failures in cpython test suite
I'm working on getting the cpython test suite to pass (as part of https://github.com/sagemathinc/python-wasm which uses unionfs), and this revealed another bug in unionfs, which I've also fixed here (and added tests). This test in the python test suite:
was supposed to raise
but was instead raising
I traced this (through WebAssembly, WASI, etc.) to how exceptions are raised in unionfs. Basically, unionfs assume that if there is any exception doing anything then it is because of Anyway, I hope this is helpful. I case this never gets looked at and somebody else hits this, I'm maintaining a temporary fork here with these fixes: https://www.npmjs.com/package/@wapython/unionfs -- William |
…ed like this (as far as I know)
I pushed another commit that limits the scope of this change to only ENOTDIR errors. Otherwise, the latest change would cause other problems. |
And also EEXIST errors, as I found when running the cpython test_gzip.py part of their test suite... |
Just want to let you know I've not forgotten about this, but it looks like a potentially significant change and we're blocked on doing releases due to #741 so I feel its a bit moot to dive into until that is resolved. I'm going to try and reach out to @streamich on other channels to see if I can get us unblocked for all the |
Thanks. I understand, and am fine using my slight fork in the meantime. |
@williamstein we've able to do releases again, if you want to pick this back up :) |
A simplified version of this fix, without |
The readdirSync and readdir functions both have a bug when there's 2 filesystems with this.fss[1] having the
directory but it is empty and this.fss[0] not having the directory. In that case checking the
size doesn't work to know if the directory exists. In particular, the fix at
#348 is incorrect. This PR fixes both bugs and adds examples to the test suite.