-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
test_shutil fails when gid name is missing #70255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
./python.exe -m test -j3 -v test_shutil The above test fails when id name is missing. The fail message is Following is the results from console "id" command, when the failure happens. uid=1336551206(athukora) gid=203135016 groups=203135016,402(com.apple.sharepoint.group.2),12(everyone),62(netaccounts),80(admin),401(com.apple.sharepoint.group.1),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),398(com.apple.access_screensharing),399(com.apple.access_ssh) And again when I change user to sudo the "id" command returns the following and test get passed. PS: We tried to debug this a bit and found the bug is possibly in Modules/grpmodule.c, may be at method grp_getgrall_impl. Adding "PyString_AsString(v);" before if command " PyList_Append(d, v) != 0" will fix the issue in test. But we have no idea how its working with this change. |
This reported bug occurred in Mac OS. |
We looked at this at the PyLadies Sprint in Helsinki. If this behaviour is expected and desired, then the test should be fixed to handle cases where the name is missing and the KeyError is raised. |
I have the same issue on my work macbook which has some form of network login configured. The primary group id of my user account there cannot be found in the group database and cannot be resolved to a name. I'm not sure why that is but I am pretty sure there is no obligation that a gid must be resolvable to a name. I submitted a PR to just skip the last part of the test_shutil/chown if the uid/gid cannot be resolved to a name. |
This seems complete, can it be closed? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: