-
-
Notifications
You must be signed in to change notification settings - Fork 181
MountFS fixes #487
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
MountFS fixes #487
Conversation
* Don't allow files/dirs to be created inside MountFS's internal MemoryFS * Change MountFS's .mounts attribute to a dict instead of a list of tuples * Add a MountFS.unmount method * Add associated unit-tests
coveralls
commented
Jun 20, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lurch , thanks a lot for this, sorry it went under my radar! I think it looks fine apart from the one change I requested (it's probably me being paranoid/thinking too hard about edge cases).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason a list
was in use here was to preserve ordering of mounted files. Sure, a dict
is fine for newer Python versions but I'd think this would change behaviour on Python 2.7. I think using collections.OrderedDict
would work instead (and we can drop that when we move the code to PyFilesystem3).
Type of changes
Checklist
Description
Addresses issues outlined #486
It's a long time since I've done any PyFilesystem development, so this should should be considered "WIP code", comments welcome... (e.g. I'm not sure if the
unmount
method is actually useful?)This should be reviewed with care as the "bugfixes" this includes (the first two bullet-points above) subtly change the API of MountFS.