[issue7408] test_distutils fails on Mac OS X 10.5
report at bugs.python.org
Sun Nov 29 22:58:11 CET 2009
Ned Deily <nad at acm.org> added the comment:
This does seem to be a long standing Unix*-flavor behavior difference.
The open(2) man page on OS X (and presumably FreeBSD) reads:
When a new file is created, it is given the group of the directory
which contains it.
The Linux open(2) page has:
If the file does not exist it will be created. The owner
(user ID) of
the file is set to the effective user ID of the process. The
ership (group ID) is set either to the effective group ID of
or to the group ID of the parent directory (depending on file
and mount options, and the mode of the parent directory, see
options bsdgroups and sysvgroups described in mount(8)).
The Open Group Base Specifications (Issue 6, 2004) for open(1) has this
"The POSIX.1-1990 standard required that the group ID of a newly created
file be set to the group ID of its parent directory or to the effective
group ID of the creating process. FIPS 151-2 required that
implementations provide a way to have the group ID be set to the group
ID of the containing directory, but did not prohibit implementations
also supporting a way to set the group ID to the effective group ID of
the creating process. Conforming applications should not assume which
group ID will be used. If it matters, an application can use chown() to
set the group ID after the file is created, or determine under what
conditions the implementation will set the desired group ID."
So the portable solution is to change the test to not assume which group
ID is used.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list