Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-33591: Fix CDLL to accept PathLike objects#7032

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

Already on GitHub?Sign in to your account

Merged
kumaraditya303 merged 9 commits intopython:mainfrommrh1997:fix-issue-33591
Feb 5, 2023

Conversation

mrh1997
Copy link
Contributor

@mrh1997mrh1997 commentedMay 21, 2018
edited by bedevere-bot
Loading

CDLL (and WinDLL, OleDLL, ...) accept now not only str objects but also PathLike objects.

https://bugs.python.org/issue33591

@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 thePSF 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 followthe 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 theCLA not signed label
to make the bot check again.

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

@mrh1997
Copy link
ContributorAuthor

I signed the CLA (my bugtracker name is "mrh1997").
Please remove the "CLA not signed label"

Due to issue23606 (find msvct does not work any more) test_load did notwork any more, as it used MSVCRT for testing DLL loading.Now it uses _ctypes_test library, which is explicitly generated fortesting purposes.
CDLL accepts now not only paths of type 'str' but also of typePathLike (like Path()).
Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

Choose a reason for hiding this comment

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

I'm sorry this PR took so long to review. I dug it up from page 57 of the open PR list, but I think it's pretty close to ready.

I do have some comments:

:class:`ctypes.CDLL`, :class:`ctypes.OleDLL`, :class:`ctypes.WinDLL`,and :class:`ctypes.PyDLL` now accept :term:`path-like objects<path-like object>` as their ``name`` argument. Patch by Robert Hoelzl.

Copy link
Member

@iritkatrieliritkatriel left a comment

Choose a reason for hiding this comment

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

This has merge conflicts now.

@bedevere-bot
Copy link

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 phraseI 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.

@arhadthedevarhadthedev added topic-ctypes stdlibPython modules in the Lib dir labelsFeb 3, 2023
@ghost
Copy link

ghost commentedFeb 3, 2023
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@arhadthedev
Copy link
Member

arhadthedev commentedFeb 3, 2023
edited
Loading

@mrh1997 Could you sign the new CLA by clickingnot signed button in the cpython-cla-bot's message, please?

@arhadthedev
Copy link
Member

Non-Linux tests failed with the following error:

======================================================================ERROR: test_load (test.test_ctypes.test_loading.LoaderTest.test_load)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\a\cpython\cpython\Lib\test\test_ctypes\test_loading.py", line 44, in test_load    CDLL(CTypesTestPathLikeCls())  File "D:\a\cpython\cpython\Lib\ctypes\__init__.py", line 367, in __init__    if '/' in name or '\\' in name:       ^^^^^^^^^^^TypeError: argument of type 'CTypesTestPathLikeCls' is not iterable

I'm investigating it.

@arhadthedev
Copy link
Member

Fixed; there were two missed lines that continued to usename function argument directly instead of stringifiedself._name.

@bedevere-bot
Copy link

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 phraseI 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.

@kumaraditya303kumaraditya303 self-assigned thisFeb 5, 2023
@arhadthedev
Copy link
Member

I have made the requested changes; please review again.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@arhadthedevarhadthedevarhadthedev left review comments

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

@iritkatrieliritkatrieliritkatriel left review comments

@JelleZijlstraJelleZijlstraAwaiting requested review from JelleZijlstra

Assignees

@kumaraditya303kumaraditya303

Labels
stdlibPython modules in the Lib dirtopic-ctypes
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

9 participants
@mrh1997@the-knights-who-say-ni@bedevere-bot@arhadthedev@JelleZijlstra@iritkatriel@kumaraditya303@ezio-melotti@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp