You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Avoid using checked-in fixtures for `Path.hexdigest` tests
git automatically converts Unix-style line endings to Windows-style endings when checking out on a Windows platform. This changes the hash of text-mode binary files we use for testing `Path.hexdigest`.
To avoid this, we simply write some data on-the fly during the test instead of relying on checked-in fixtures.
- Close file handle in `temp_file` context manager
`NamedTemporaryFile` actually opens the created file automatically. To be consistent with `temp_directory` and the rest of the Path class, we return a Path instead. This means we now have an inaccessible open file handle. Callers then usually re-open the file manually using the path, creating a second open file handle.
This is not a problem on UNIX systems, as the same file can have multiple open handles from the same process - this is not the case on Windows however: https://docs.python.org/3.9/library/tempfile.html#tempfile.NamedTemporaryFile
- Avoid some permissions issues
b"Phasellus congue commodo erat quis eleifend. Nulla semper velit eget mauris ultricies laoreet.\n Sed orci tellus, venenatis vitae egestas vel, vehicula eget odio.",
0 commit comments