This repository was archived by the owner on Jul 16, 2025. It is now read-only.
Fix path_fixes in upload payload#103
Merged
giovanni-guidini merged 1 commit intomasterfrom Mar 10, 2023
Merged
Conversation
Recently testing the CLI with the new upload endpoint I had the following error (when trying to upload the CLI itself) ``` TypeError: keys must be str, int, float, bool or None, not PosixPath Error: Process completed with exit code 1. ``` After some digging I found the keys in question ``` Finding the PosixPath Key languages/languages.c is PosixPath. Origin: .path_fixes.value[languages/languages.c] Key tests/data/files_to_fix_examples/sample.cpp is PosixPath. Origin: .path_fixes.value[tests/data/files_to_fix_examples/sample.cpp] Key tests/data/files_to_fix_examples/sample.go is PosixPath. Origin: .path_fixes.value[tests/data/files_to_fix_examples/sample.go] Key tests/data/files_to_fix_examples/sample.kt is PosixPath. Origin: .path_fixes.value[tests/data/files_to_fix_examples/sample.kt] Key tests/data/files_to_fix_examples/sample.php is PosixPath. Origin: .path_fixes.value[tests/data/files_to_fix_examples/sample.php] Finding the PosixPath ================ END ``` They come from the path_fixes, which are of class Path, but need to be strings. To solve this we simply cast them to string while building the payload. The reason this was not picked up in the unit tests before is that we were already passing strings, not Path as it should be.
dana-yaish
approved these changes
Mar 10, 2023
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Recently testing the CLI with the new upload endpoint I had the following error (when trying to upload the CLI itself)
After some digging I found the keys in question
They come from the path_fixes, which are of class Path, but need to be strings. To solve this we simply cast them to string while building the payload.
The reason this was not picked up in the unit tests before is that we were already passing strings, not Path as it should be.