Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kostayScr
Copy link
Contributor

Fixes lack of a Py_DECREF() call in the datetime/timdelta hash function. Closes #29397.

@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label Jul 22, 2025
Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

I noticed some preexisting issues with error handling and suggested a fix.

Also ping @walshb - FYI there were some error checking and reference counting bugs that were missed in the datetime/timedelta hash PR we merged last year.

@ngoldbaum ngoldbaum added this to the 2.3.2 release milestone Jul 23, 2025
@melissawm melissawm moved this to Pending authors' response in NumPy first-time contributor PRs Jul 23, 2025
@kostayScr
Copy link
Contributor Author

Seems to be in order.

@ngoldbaum
Copy link
Member

Thanks for closing the loop on this @kostayScr. This will be backported to the 2.3 release branch and will be included in NumPy 2.3.2.

@ngoldbaum ngoldbaum merged commit 439f763 into numpy:main Jul 24, 2025
76 checks passed
@github-project-automation github-project-automation bot moved this from Pending authors' response to Completed in NumPy first-time contributor PRs Jul 24, 2025
charris pushed a commit to charris/numpy that referenced this pull request Jul 24, 2025
* BUG: fix datetime/timedelta hash memory leak

* get metadata directly from scalar object

Co-authored-by: Nathan Goldbaum <[email protected]>

* BUG: remove unnecessary Py_DECREF

Co-authored-by: Nathan Goldbaum <[email protected]>

* BUG: remove dtype variable declaration that is not used anymore

---------

Co-authored-by: Nathan Goldbaum <[email protected]>
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 24, 2025
charris added a commit that referenced this pull request Jul 24, 2025
BUG: fix datetime/timedelta hash memory leak (#29411)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

BUG: Memory leak calling hash() on np.datetime64 object
5 participants