GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-127183: Add `_ctypes.CopyComPointer` tests by junkmd · Pull Request #127184 · python/cpython

Conversation

@junkmd

@junkmd junkmd commented Nov 23, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I would like to backport this to 3.12 and 3.13 as well.
This is internal-only, so I don’t think it needs a NEWS entry.

  • Issue: Add tests to verify the behavior of _ctypes.CopyComPointer. #127183

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels Nov 23, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Nov 23, 2024
Add tests to verify the behavior of _ctypes.CopyComPointer. #127183
Closed
junkmd added 4 commits November 24, 2024 10:15
@junkmd
Make create_shelllink_persist top level function.
f3e7afb
@junkmd
Add CopyComPointerTests.
c28e7c4
@junkmd
Add more tests.
79f7055
@junkmd
Update tests.
638487b
@junkmd
junkmd force-pushed the add_copy_com_pointer_tests branch from f48bcf1 to 638487b Compare November 24, 2024 01:15
encukou
encukou reviewed Nov 25, 2024
View reviewed changes

@encukou encukou left a comment

Copy link
Copy Markdown
Member

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.

Thank you.
I see CopyComPointer is undocumented. Would you be willing to add some documentation for it as well?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_ctypes/test_win32_com_foreign_func.py Outdated
dst_orig = create_shelllink_persist(self.IPersist)
dst = self.IPersist()
CopyComPointer(dst_orig, byref(dst))
dst_orig.Release() # The refcount of `dst_orig` is 1 here.

@encukou encukou Nov 25, 2024

Copy link
Copy Markdown
Member

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.

Could the refcount be checked using Release's return value?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

junkmd reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@junkmd junkmd Nov 25, 2024

Copy link
Copy Markdown
Contributor Author

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.

Indeed, since this assertion is not costly, it is better to simply call assertEqual than to leave a comment about it.
I have changed these lines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@junkmd
Add assertions for Release's return value.
a9d2805
@junkmd

junkmd commented Nov 25, 2024

Copy link
Copy Markdown
Contributor Author

Would you be willing to add some documentation for it as well?

That's my intention, but as discussed in gh-126686, I believe publicizing it is also necessary for proper documentation.

Before moving forward with documentation or publicizing, I want to backport this test to 3.13 and 3.12, where CopyComPointer, albeit private, already exists.
Therefore, I aim to keep this PR in a state where it can be merged as-is when miss-islington backports it.

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou added skip news needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Nov 25, 2024
@encukou
encukou merged commit c7f1e3e into python:main Nov 25, 2024
@bedevere-app bedevere-app Bot removed the awaiting review label Nov 25, 2024
@miss-islington-app

miss-islington-app Bot commented Nov 25, 2024

Copy link
Copy Markdown

Thanks @junkmd for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 25, 2024
@junkmd @miss-islington
pythongh-127183: Add _ctypes.CopyComPointer tests (pythonGH-127184)
8ff7119
* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e)

Co-authored-by: Jun Komoda <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 25, 2024

Copy link
Copy Markdown

GH-127251 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Nov 25, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 25, 2024
@junkmd @miss-islington
pythongh-127183: Add _ctypes.CopyComPointer tests (pythonGH-127184)
c334007
* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e)

Co-authored-by: Jun Komoda <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 25, 2024

Copy link
Copy Markdown

GH-127252 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Nov 25, 2024
@encukou

encukou commented Nov 25, 2024

Copy link
Copy Markdown
Member

Makes sense. Thank you for the test!

junkmd reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@junkmd
junkmd deleted the add_copy_com_pointer_tests branch November 25, 2024 14:10
This was referenced Nov 25, 2024
Make CopyComPointer public and add to ctypes doc. #127255
Closed
gh-127255: Make CopyComPointer public and add to ctypes doc. #127275
Merged
encukou pushed a commit that referenced this pull request Nov 26, 2024
@miss-islington @junkmd
[3.13] gh-127183: Add _ctypes.CopyComPointer tests (GH-127184) (GH-…
0f77357
…127251)

gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)

* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e)

Co-authored-by: Jun Komoda <[email protected]>
encukou pushed a commit that referenced this pull request Nov 26, 2024
@miss-islington @junkmd
[3.12] gh-127183: Add _ctypes.CopyComPointer tests (GH-127184) (GH-…
08531ac
…127252)

gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)

* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e)

Co-authored-by: Jun Komoda <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
@junkmd @ebonnal
pythongh-127183: Add _ctypes.CopyComPointer tests (pythonGH-127184)
0d22de4
* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@junkmd @encukou
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.