Ned Deily <n...@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: O_CREAT 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 group own‐ ership (group ID) is set either to the effective group ID of the process or to the group ID of the parent directory (depending on file system type and mount options, and the mode of the parent directory, see the mount options bsdgroups and sysvgroups described in mount(8)). The Open Group Base Specifications (Issue 6, 2004) for open(1) has this rationale: "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 <rep...@bugs.python.org> <http://bugs.python.org/issue7408> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com