Skip to content

Conversation

@MatzeB
Copy link
Contributor

@MatzeB MatzeB commented Mar 16, 2020

There is no guarantee that the users primary uid or gid can be resolved
in the unix group/account databases. Skip the last part of the chown
test if we cannot resolve the gid or uid to a name.

https://bugs.python.org/issue26067

There is no guarantee that the users primary uid or gid can be resolved
in the unix group/account databases. Skip the last part of the chown
test if we cannot resolve the gid or uid to a name.
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@MatzeB

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

# In case the uid/gid cannot be resolved.
user = None
group = None
if user is not None and group is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do try/except KeyError: pass/else here instead of doing the assignments and None checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to keep the try/except scope as small as possible in case some of the other commands raise. Anyway will change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, just realized what you meant here, re-submitted.

@@ -0,0 +1 @@
- Do not fail test_shutil test_chown test when uid or gid of user cannot be resolved to a name. No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Do not fail test_shutil test_chown test when uid or gid of user cannot be resolved to a name.
Do not fail test_shutil test_chown test when uid or gid of user cannot be resolved to a name.

@DinoV DinoV merged commit 5226894 into python:master Mar 17, 2020
@bedevere-bot
Copy link

@DinoV: Please replace # with GH- in the commit message next time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants