Skip to content

gh-136759: Rename lock.h to pylock.h #137041

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

Merged
merged 2 commits into from
Jul 24, 2025
Merged

Conversation

aisk
Copy link
Member

@aisk aisk commented Jul 23, 2025

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

Thanks!

@colesbury colesbury added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 23, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit f265080 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F137041%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 23, 2025
@emmatyping
Copy link
Member

I thought it would be good to review OSS code to see if there are any third-party projects that have a file "pylock.h", as we probably don't want to break those projects either. Fortunately I was not able to find anything that obviously conflicts.

Pixar's OpenUSD repository does have a file that is name-equivalent on case-insensitive filesystems like NTFS on Windows: https://github.com/PixarAnimationStudios/OpenUSD/blob/d0d5c33d5655f206a02b58311efa841890fb3894/pxr/base/tf/pyLock.h. However, this file is only included as #include <pxr/base/tf/pyLock.h>, so it shouldn't conflict.

There were no matches on pypi.org data either. I ran the following ClickHouse query against the https://py-code.org data to verify that:

SELECT    
 project_name,
 countIf(distinct project_name, notEquals(extractAll(path, 'pylock\.(h|hh|hpp|c|cc|cpp)'), [])) AS has_pylock
from      pypi
where     skip_reason = ''
group by project_name
order by has_pylock desc;

This came back with every row having 0 count.

@kumaraditya303 kumaraditya303 merged commit ec02db5 into python:main Jul 24, 2025
131 of 132 checks passed
@kumaraditya303 kumaraditya303 added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jul 24, 2025
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Thanks @aisk for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @aisk and @kumaraditya303, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ec02db5caa546cb4759999453bd6efc1d517b95c 3.13

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 24, 2025
Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.
(cherry picked from commit ec02db5)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Jul 24, 2025

GH-137072 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jul 24, 2025
@aisk aisk deleted the lock-header-rename branch July 24, 2025 11:32
@aisk
Copy link
Member Author

aisk commented Jul 24, 2025

I'll try to resolve the backport conflict for 3.13.

@bedevere-app
Copy link

bedevere-app bot commented Jul 24, 2025

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 24, 2025
kumaraditya303 pushed a commit that referenced this pull request Jul 24, 2025
Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.
(cherry picked from commit ec02db5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants