Pathlib: preserve trailing slash

To summarise my view with an example: users should be able to safely refactor os.stat(some_string) to pathlib.Path(some_string).stat() without changing the result of the stat(). Only trailing slashes (and arguably empty strings) make that refactor strictly unsafe; in all other cases pathlib’s normalization is sufficiently conservative.

1 Like