-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Developer friendly: tell me which root path cannot be opened. #340
Comments
Positive result is already showing here: https://ci.appveyor.com/project/willmcgugan/pyfilesystem2/builds/26516343/job/oot4vwg0m48g3u97
Where I clearly know what's going on. |
Could you try to explain in more detail what you actually mean, please? |
I would like to know what is 'root path' inside the error. and With the root path printed as below,
I know what's going wrong. |
Ahhh, I see. But looking at where that error is coming from https://github.com/PyFilesystem/pyfilesystem2/blob/master/fs/osfs.py#L140 it seems that the |
Example has been give above. From the message of the raised exception, I do not know. |
You've given an example of the error message - I was asking for an example of the code leading up to the error message. |
I will share something about pypifs a bit later. Could I question why would not the message reveal which root path cannot be opened? |
@lurch , for your information, pypifs try to make static files inside python package available to other packages to read via python filesystem 2. Here is the initial prototype. I knew this is a bit extreme issue where there are alternatives, as I mentioned in the above texts, debug, print could have been applied. Or try... catch in our offspring packages can also be taken, so as to show what pyfilesystem2 complains about. Now, if we count around the number of developers of fs2 derived systems, let's say N; And count the time T in doing: Step 1) to read the log and found CreateFailure message, Step 2) add print/debug/try..catch, Step 3) re-test. This issue could save S = N * T from the developers in your ecosystem. And this save S could be invested in: a. make the pyfs2 derived package better Taking one step back, if the wider perception of this issue is too trivial, I am happy to withdraw the changes. It is not the end of world without it, is it? |
@chfw I don't fully grasp your use case either, but extending the error message is trivial. If it's useful to you, let's go with it. 👍 |
The detailed code is as follows, pypifs try to figure out where the python package is installed, meaning its physical file path. Then delegate OSFS to handle file read, write and other file/dir related operations. Because, python is cross platform, the package path could be windows path, hence it is not straight forward..
Surely, with hindsight, what I should have done is to print/try ... catch it and find out what's going wrong. Because you guys are very approachable, especially @althonos on jinja2-fsloader, I would like to bring up this trivial issue here. |
I don't see why you couldn't have a |
Hi all
It would be very helpful to display the root path, for which osfs cannot open it. I knew you would argue, "please add break point or print it, dude". What I am facing here is: MacOS, Linux and Linux system path here. I do not have always three OS at the same time. If OSFS would be nicely to tell what is the root path, it will save me a lot time in taking the assumed advice: adding break point or print it.
I am sending a PR through.
https://dev.azure.com/moremoban/moban/_build/results?buildId=670
The text was updated successfully, but these errors were encountered: