bpo-32729 socket error handling change (GH-5458) by rkdls · Pull Request #5458 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation21 Commits7 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

rkdls

@the-knights-who-say-ni

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.

Thanks again to your contribution and we look forward to looking at it!

@WildCard65

@rkdls rkdls changed the title[3.x] socket error handling change (GH-5458) [3.x] bpo - 32729 socket error handling change (GH-5458)

Jan 31, 2018

@rkdls

I added bpo issue (32729) and signed up CLA.

@WildCard65

@rkdls Remove the "[3.x] " bit from the PR's title, and the spaces around "-" and it'll satisfy the issue number for @bedevere-bot

@Mariatta

Thanks. In the PR title, the pattern that bedevere will recognize is bpo-NNNN such as bpo-32729 .
If you edit yours to remove the space around the dash, then it'll satisfy the issue number check

@rkdls rkdls changed the title[3.x] bpo - 32729 socket error handling change (GH-5458) bpo-32729 socket error handling change (GH-5458)

Jan 31, 2018

@rkdls

@WildCard65

The bottom of this PR lists all the requirements your PR needs.

tiran

Choose a reason for hiding this comment

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

@@ -591,8 +591,9 @@ def readinto(self, b):
self._timeout_occurred = True
raise
except error as e:
if e.args[0] in _blocking_errnos:
return None
if e.args:

Choose a reason for hiding this comment

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

You can write the check in one line, if e.args and e.args[0] in _blocking_errnos:

Choose a reason for hiding this comment

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

you right.
I changed. Thank you

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@rkdls

@rkdls

@rkdls

I have made the requested changes; please review again

@bedevere-bot

Thanks for making the requested changes!

@tiran: please review the changes made to this pull request.

tiran

@@ -591,7 +591,8 @@ def readinto(self, b):
self._timeout_occurred = True
raise
except error as e:
if e.args[0] in _blocking_errnos:

Choose a reason for hiding this comment

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

Please drop the surplus newline

@rkdls

@rkdls

@tiran Thanks for commenting.
deleted line.

serhiy-storchaka

@@ -591,7 +591,7 @@ def readinto(self, b):
self._timeout_occurred = True
raise
except error as e:
if e.args[0] in _blocking_errnos:
if e.args and e.args[0] in _blocking_errnos:

Choose a reason for hiding this comment

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

Why not use e.errno?

In what cases e.args is empty? Maybe this is an error which should be fixed?

Choose a reason for hiding this comment

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

I check out the error Msg, but nothing is get.

But if i check the error type like bellow,
2018-02-02 3 23 37

It is TimeoutError which is not caught in previous timeout except clause.
2018-02-02 3 26 19

The empty case what you asked me is a TimeoutError not caught in timeout previous except clause

Choose a reason for hiding this comment

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

Please don't use images for text information. They are hard to read by blind people and are disappeared in email clients.

Choose a reason for hiding this comment

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

Thus the actual bug is that TimeoutError is not caught in previous except clause?

Choose a reason for hiding this comment

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

Oh sorry for images.
and yes. you right. TimeoutError not caught

USER added 2 commits

February 3, 2018 16:24

@rkdls

It's not a handling issue.