Ronald Oussoren added the comment:
The touch method combines the mode you specify with the active umask (set by
os.umask()). This is fairly standard behaviour for Unix APIs that accept a
file mode.
This is documented at:
https://docs.python.org/3/library/pathlib.html#pathlib.Path.touch
--
New submission from Savo Vuksan :
The touch function of the Path Object in the Pathlib module seems to ignore the
write bit for the second octal number for the groups permission in the mode
parameter
In the provided script you can see that the output prints
-rwxr-xr--
but it should be
-rwxrwx