[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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

Copy link
Contributor

GPery 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

Copy link

the-knights-who-say-ni commented Aug 7, 2018

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!

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

GPery commented Aug 7, 2018

New account, only now signed the CLA 👍

Copy link
Contributor

benjaminp commented Aug 8, 2018

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

Copy link
Contributor

benjaminp left a comment

Looks good. Just two more nits.

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

benjaminp Aug 9, 2018

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

GPery Aug 9, 2018

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

GPery Aug 9, 2018

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

benjaminp Aug 9, 2018

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

GPery Aug 9, 2018

Choose a reason for hiding this comment

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

Fixed

GPery force-pushed the fix-issue-34353-master branch from 2875629 to cb9b170 Compare Aug 9, 2018
benjaminp merged commit b92c526 into python:master Aug 10, 2018
yahya-abou-imran pushed a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 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.

None yet

4 participants