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

Inconsistent error behavior when URL points to a file rather than a collection. #214

Open
zopyx opened this issue Sep 30, 2015 · 1 comment

Comments

@zopyx
Copy link

zopyx commented Sep 30, 2015

Using DAVFS I can point the connection to a resource rather than a directory and read the resource like this:

handle = DAVFS('https:/.../path/to/foo.txt')
fp = handle.open('.')
print fp.read()
.....

Doing the same with OSFP leads to a ResourceInvalidError

handle = OSFS('/tmp/path/to/foo.txt')

So the behavior is different and inconsistent across the underlaying drivers. Not sure what the right behavior would be. I guess that the behavior of OSFS is correct. The constructors should accept only URLs pointing to a folder or a collection and raise ResourceInvalidError otherwise.

@willmcgugan
Copy link
Member

You may be right about that. Although for network filesystems, the check itself is an overhead.

I'm thinking that maybe it would be best to leave it as is, and document it as 'undefined behaviour'.

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