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-30470: Deprecate invalid ctypes call protection on Windows. #1810
Conversation
@Mariatta, thanks for your PR! By analyzing the history of the files in this pull request, we identified @birkenfeld, @benjaminp and @theller to be potential reviewers. |
@zooba @Haypo or @ned-deily can one of you review please? I'm not sure if I'm doing this right. Thanks :) |
Doc/library/ctypes.rst
Outdated
|
||
Calling :mod:`ctypes` functions is deprecated. Calling a native function | ||
with incorrect arguments is unsupported and can easily cause | ||
information leakage or code execution vulnerabilities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment suggests that ctypes
functions cannot be called, i.e. that the GetModuleHandleA()
call in the next paragraph will soon be unsupported.
Perhaps move this deprecation warning down below the "ctypes
tries to protect you from calling functions with the wrong number of arguments" paragraph (line 164/170) and reword as "This protection against incorrect arguments is deprecated and will be removed."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'd get really specific here with something like "Calling ctypes
functions with incorrect arguments, either number or type, is unsupported and may no longer raise a ValueError."
It might even make more sense to insert the note directly above the paragraph below that says "ctypes tries to protect you...". Or just remove that section and add a note saying "ctypes may raise a ValueError after calling the function if it detects that an invalid number of arguments were passed. This behavior is deprecated, should not be relied upon, and will be removed in Python 3.7"
Thanks @Syeberman and @zooba. I made the change as you suggested. Please check. |
Calling Ctypes functions is deprecated in 3.6.2 and will be removed in 3.7
38036f5
to
e53e4d0
Compare
Resolved the conflict |
LGTM |
…pythonGH-1810) Calling Ctypes functions is deprecated in 3.6.2 and will be removed in 3.7. (cherry picked from commit f931fd1)
Calling Ctypes functions is deprecated in 3.6.2 and will be removed in 3.7