Replace use of os.path.join (which exhibits platform dependent behaviour) with posixpath.join where necessary #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
os.path.join is used to form an url-like path (forward slash separators).
However, os.path.join separates by backslash on windows
Instead of using os.path (which the os module sets as 'import posixpath as path' or 'import ntpath as path', depending on platform), import posixpath directly and always get the correct behaviour (forward slash separators).
Below is an example of the current behaviour:
'upload' action request from test_basic_external_adapter.py::test_upload_action_new_file:
On windows, the actions.upload.href field contains a backslash (myorg\myrepo), as result of os.path.join use, and the test fails.
After this PR, forward slashes (myorg/myrepo) are generated.
Some call sites use os.path.join correctly (For instance, to form arguments to the open() function), and are not modified by the PR.