Skip to content

bpo-36583: Do not swallow exceptions in the _ssl module. #12756

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 10, 2019

@tirkarthi
Copy link
Member

I think the relevant issue is https://bugs.python.org/issue36583 ?

https://bugs.python.org/issue339827 returns 404 but @bedevere-bot seems to have accepted it. Seems to be known issue : python/bedevere#15

@serhiy-storchaka serhiy-storchaka changed the title bpo-339827: Do not swallow exceptions in the _ssl module. bpo-36583: Do not swallow exceptions in the _ssl module. Apr 10, 2019
@serhiy-storchaka
Copy link
Member Author

Thanks @tirkarthi. I have no idea from where this number came. I just pasted it from the clipboard, but seems something messed.

PyObject *cadata_ascii = NULL;

if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE) == 0) {
if (PyUnicode_Check(cadata)) {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change the order of checks here? What was wrong with the original code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing wrong, but it seems to me that checking for unicode string prior to checking for bytes-like objects is more common. If you prefer, I'll return the former order. This will minimize the diff.

@brettcannon brettcannon added the type-feature A feature request or enhancement label Apr 17, 2019
@serhiy-storchaka serhiy-storchaka merged commit 65fb2c0 into python:master May 31, 2019
@serhiy-storchaka serhiy-storchaka deleted the ssl-no-swallow-exceptions branch May 31, 2019 07:39
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants