Use os.getgroups() rather than grp.getgrall() to get groups. Rename also the test to test_chown_gid().
Attach a file by drag & drop or click to upload