google / google/etils

`epath.Path.touch()` does not update mtime

Open
#629 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
259
Forks
34
Avg merge
57m
Merged PRs (30d)
1

Description

The documentation of [`pathlib.Path.touch`](https://docs.python.org/3/library/pathlib.html#pathlib.Path.touch):

> Create a file at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the file already exists, the function succeeds if exist_ok is true (and its modification time is updated to the current time), otherwise [FileExistsError](https://docs.python.org/3/library/exceptions.html#FileExistsError) is raised.

According to this documentation, `touch()` should update the file's modification time to the current time. However, `epath.Path.touch()` does not match this behaviour.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.