| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with the minor name convention update
Sorry, something went wrong.
|
Looks like we just need the NEWS entry - click "Details" next to the failed check for info on it (or run PCbuild/blurb.bat to create it locally). Text should be something like ``Fixes :func:os.normpath to handle embedded null characters without truncating the path.` and put it under Library. |
Sorry, something went wrong.
…1HMym.rst Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
Sorry, @finnagin and @zooba, I could not cleanly backport this to 3.11 due to a conflict. |
Sorry, something went wrong.
|
Sorry, @finnagin and @zooba, I could not cleanly backport this to 3.12 due to a conflict. |
Sorry, something went wrong.
|
GH-107981 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
|
GH-107982 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Following the suggestion from this comment in the original issue this PR adds a new function _Py_normpathAndSize which behaves like _Py_normpath but also takes a pointer which it will use to store the length of the final normalized path. This new function is then used in os__path_normpath_impl to pass the above mentioned length into PyUnicode_FromWideChar instead of -1.
Additionally, this adds a test to check that normpath is not truncating paths containing a null character as well as changes test_addpackage_import_bad_pth_file in test_site.py which was using a null character to make a bad path, specifically it was using the string 'abc\x00def'. The problem is that before this change this was being truncated for parts of the test so the string it was actually using in those parts was 'abc'. Upon making the normpath changes it started throwing the error ValueError: embedded null character so I changed the test to use 'abc<>$$**:://def' instead.