Skip to content
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

bpo-34353: Added sockets to stat.filemode fallback python implementation #8703

Merged
merged 4 commits into from
Aug 10, 2018

Conversation

FortStatement
Copy link
Contributor

@FortStatement FortStatement commented Aug 7, 2018

[bpo-34353](https://www.bugs.python.org/issue34353): Add sockets to stat.filemode fallback python implementation

https://bugs.python.org/issue34353

@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 your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

When your account is ready, please add a comment in this pull request
and a Python core developer will remove the CLA not signed label
to make the bot check again.

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

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

@FortStatement FortStatement changed the title Added sockets to stat.filemode fallback python implementation bpo-34353: Added sockets to stat.filemode fallback python implementation Aug 7, 2018
@FortStatement
Copy link
Contributor Author

New account, only now signed the CLA 👍

@benjaminp
Copy link
Contributor

Could you update Lib/test/test_stat.py to ensure this behavior is tested, too?

Copy link
Contributor

@benjaminp benjaminp left a comment

Choose a reason for hiding this comment

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

Looks good. Just two more nits.

def test_socket(self):
s = socket.socket(socket.AF_UNIX)
s.bind(TESTFN)
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

It would cleaner to either do with socket.socket(socket.AF_UNIX): <rest of function> or use self.addCleanup(s.close) after the first line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't realise you could use socket as a context manager, I'll definitely be using that in the future! Thanks!

@@ -0,0 +1,2 @@
Added the "socket" option in the `stat.filemode()` Python implementation to
match the C implementation. - GPery
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add yourself to Misc/ACKS. Usually, we leave names off NEWS entries, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@FortStatement FortStatement force-pushed the fix-issue-34353-master branch from 2875629 to cb9b170 Compare August 9, 2018 15:46
@benjaminp benjaminp merged commit b92c526 into python:master Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants