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
pathconverter: Add file:// prefix to paths converted to absolute #1620
Conversation
This is useful if a post-processing program is unable to understand absolute non-URI locations, e.g. by interpreting them relative to a host and erroring out instead of defaulting to the local filesystem, if no host (base URI) is known.
This currently breaks existing tests so those would need to be cleaned up first. I'll have to evaluate this as recall there was a reason why I didn't do this. Assuming tests get fixed and I don't come up with a reason forcing |
Tests should be fixed now, but the workflow needs another trigger. |
Yep, thanks! I'll try to evaluate the change this weekend. |
I guess I overestimated my ability to convert windows paths to file URLs. Sorry, I'll fix it tomorrow. :-) |
No worries, that's why we have tests 🙂. |
normpath should already return an absolute path, unless base_path is not absolute, which would seem like a user error and guessing paths wouldn't have helped there anyway.
Added another commit. Let me know what you think. Btw., I wondered what |
I will have to look at this closely. I have projects relying on this support, and I'll have to assess potential breakage and such. I'll let you know when I have a chance to run this through various implementations. I'll run it through various browsers and through various in-app webviews. It is maybe some of these app-specific scenarios that I'm worried about breakage. Particularly this project generates in-app docs and such that are displayed via some webview on various platforms: https://github.com/facelessuser/Rummage. Some of these webview implementations are finicky to say the least. This may not be a quick review, but I need to make sure it doesn't break anything I'm currently using it for as that was the whole reason behind me creating the extension in the first place. |
For reference, this is the change that added this: #408 Originally, it was added the default protocol notation. Here you are doing the other option and forcing What I do know, is the original default protocol did not always work, so striping (as we currently do) or adding |
Opt-in is fine. Added some commits with new tests and documentation. |
Windows is failing as you really need |
Yes, I misunderstood how the function works on Windows. |
No worries, I had to learn about these corner cases myself as well. |
@gir-bot lgtm |
Thank you, @facelessuser! |
This is useful if a post-processing program is unable to understand absolute non-URI locations, e.g. by interpreting them relative to a host and erroring out instead of defaulting to the local filesystem, if no host (base URI) is known.