-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issues with string destination handling in `{Graph,Result}.seria…
…lize` Change `{Graph,Result}.serialize` to only handle string destinations as URIs if the schema is `file` and to treat it as operating system paths in all other cases. This is for the following reasons: - `Result.serialize` was treating URI paths as OS paths which only works for some cases, for special charachters and percentage encoding it does not work. - Many valid Unix and Windows paths parse using `urlparse` and have no netloc, e.g. `C:\some\path` and `some:/path`, however they should be treated as paths and not as URIs. - `Graph` and `Result` should behave consistently. Some caveats in this change: - non-file URIs will now be treated as OS paths which may result in slightly confusing error messages, such as `FileNotFoundError: [Errno 2] No such file or directory: 'http://example.com/'` if http://example.com/ is passed. - some valid file URIs (e.g. `file:/path/to/file` from https://datatracker.ietf.org/doc/html/rfc8089) are also valid Posix paths but will be treated as file-URIs instead of Posix paths. For `Graph.serialize` this ambiguity can be avoided by using `pathlib.Path`, but for `Result.serialize` there is currently no way to avoid it, though I will work on #1834 soon and in that provide a way to avoid the ambiguity there also.
- Loading branch information
Showing
10 changed files
with
555 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
flake8 | ||
flakeheaven; python_version >= '3.8.0' | ||
flakeheaven >= 2.1.3; python_version >= '3.8.0' | ||
pep8-naming |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.