🌐 AI搜索 & 代理 主页
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 and others added 3 commits July 24, 2025 16:56
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@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 <nathan.goldbaum@gmail.com>

* BUG: remove unnecessary Py_DECREF

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>

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

---------

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@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)
@scttstrck
Copy link

Is there any chance to get this back ported into the 2.2.x branch to fix usage with Python 3.10?

@seberg
Copy link
Member

seberg commented Sep 29, 2025

@scttstrck we could backport if it helps you, but we are not in the habit of making bug-fix releases for 2.n-1, so by itself that would probably not be helpful?

IndifferentArea pushed a commit to IndifferentArea/numpy that referenced this pull request Dec 7, 2025
* BUG: fix datetime/timedelta hash memory leak

* get metadata directly from scalar object

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>

* BUG: remove unnecessary Py_DECREF

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>

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

---------

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
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

6 participants