René's URL Explorer Experiment


Title: Use flock() for file locking by expobrain · Pull Request #513 · gitpython-developers/GitPython · GitHub

Open Graph Title: Use flock() for file locking by expobrain · Pull Request #513 · gitpython-developers/GitPython

X Title: Use flock() for file locking by expobrain · Pull Request #513 · gitpython-developers/GitPython

Description: The problem with the original code is that the lock was based on the presence of the lockfile, that is if the lockfile exists the _obtain_lock() fails otherwise it succeed on acquiring the lock. However this was problematic because between the check if the lockfile exists and the creation of the file another process can create the file as well resulting in a double lock, and we don't want to lock the same file twice :-)

Open Graph Description: The problem with the original code is that the lock was based on the presence of the lockfile, that is if the lockfile exists the _obtain_lock() fails otherwise it succeed on acquiring the lock. Ho...

X Description: The problem with the original code is that the lock was based on the presence of the lockfile, that is if the lockfile exists the _obtain_lock() fails otherwise it succeed on acquiring the lock. Ho...

Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/513

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fbc625bd-496d-4019-695e-a6cca5b7581f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9C3A:1A2FF2:22FCFEB:30C930C:69693F59
html-safe-nonce6019c54004bf02116e382a06bbcaf9342909743292cbd9ba6882e4ea0cb77cfb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzNBOjFBMkZGMjoyMkZDRkVCOjMwQzkzMEM6Njk2OTNGNTkiLCJ2aXNpdG9yX2lkIjoiNzQ1OTU5Njk3NjM5MTc5ODYxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac70e650c47814785558267f497d311282fa9e3e05382ca36f08e3669a989b2c7a
hovercard-subject-tagpull_request:85194555
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/513/files
twitter:imagehttps://avatars.githubusercontent.com/u/2404909?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2404909?s=400&v=4
og:image:altThe problem with the original code is that the lock was based on the presence of the lockfile, that is if the lockfile exists the _obtain_lock() fails otherwise it succeed on acquiring the lock. Ho...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released69ac0477df0f87da03b8b06cebd187012d7a930
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/pull/513/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F513%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F513%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/pull/513/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/513/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/513/files
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/513/files
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 169 https://github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/513/files
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
Byronhttps://github.com/Byron
gitpython-developers:masterhttps://github.com/gitpython-developers/GitPython/tree/master
expobrain:masterhttps://github.com/expobrain/GitPython/tree/master
Conversation 11 https://github.com/gitpython-developers/GitPython/pull/513
Commits 11 https://github.com/gitpython-developers/GitPython/pull/513/commits
Checks 0 https://github.com/gitpython-developers/GitPython/pull/513/checks
Files changed https://github.com/gitpython-developers/GitPython/pull/513/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/513/files
Use flock() for file locking https://github.com/gitpython-developers/GitPython/pull/513/files#top
Show all changes 11 commits https://github.com/gitpython-developers/GitPython/pull/513/files
547e6f0 Replaced lock file code with flock() expobrain Sep 12, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/547e6f0e2e9ace80e6d6b08db3c15fe91efe880f
6dfc870 No need to create the lock file beforehand expobrain Sep 14, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/6dfc870cffcfa7ca29e30301fff256e4e5b181f3
1e4eff1 Ignore cache dir of Py.test expobrain Sep 14, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/1e4eff1d7ff660077eb0e05f39f9466c7e00d34e
ae19557 Updated AUTHORS expobrain Sep 14, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/ae19557f8b6e5387b7275d46621535b24ace00d8
f0fcc07 Force GC collection expobrain Sep 19, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/f0fcc072b37d6e773e18ea561ebce8ccba2ba19c
26f9b9f Merge remote-tracking branch 'upstream/master' expobrain Oct 6, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/26f9b9f40144b73d75e739ef5e6552007b6376f8
d437f88 Fixed typo after merge expobrain Oct 6, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/d437f8893f60bfdc703b0d16335f28ad2e799974
ab7a872 Updated file locking for Windows platform expobrain Oct 7, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/ab7a87290149114e080037f8da0871939b1ed7fc
c0b45fa Updated setup to include Windows requirements expobrain Oct 7, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/c0b45fa508a8826a70a0593f3808c8c053b91787
4c9dd7f Forgot to uncomment conditional import expobrain Oct 7, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/4c9dd7fac214bb0f85077cab40d4455cf3113b17
20b4f49 Fix syntax for Python 3.x expobrain Oct 7, 2016 https://github.com/gitpython-developers/GitPython/pull/513/commits/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79
Clear filters https://github.com/gitpython-developers/GitPython/pull/513/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/513/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/513/files
.gitignore https://github.com/gitpython-developers/GitPython/pull/513/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
AUTHORS https://github.com/gitpython-developers/GitPython/pull/513/files#diff-ab6af77435f58cc0c9d4c31dfe05656e45187cc7c7fc02aada401a7642125463
test_util.py https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cd9475c05d282c05d0e479284496813cd7a309a44492e4263a6fbf4bbf9dc794
util.py https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
setup.py https://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
win32-requirements.txt https://github.com/gitpython-developers/GitPython/pull/513/files#diff-ad66ba8a78f5c769b0d0ded927a7bf8b6c779ef21cf0567dcfe38a96c84b5343
.gitignorehttps://github.com/gitpython-developers/GitPython/pull/513/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
View file https://github.com/expobrain/GitPython/blob/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79/.gitignore
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/513/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
AUTHORShttps://github.com/gitpython-developers/GitPython/pull/513/files#diff-ab6af77435f58cc0c9d4c31dfe05656e45187cc7c7fc02aada401a7642125463
View file https://github.com/expobrain/GitPython/blob/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79/AUTHORS
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/513/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-ab6af77435f58cc0c9d4c31dfe05656e45187cc7c7fc02aada401a7642125463
git/test/test_util.pyhttps://github.com/gitpython-developers/GitPython/pull/513/files#diff-cd9475c05d282c05d0e479284496813cd7a309a44492e4263a6fbf4bbf9dc794
View file https://github.com/expobrain/GitPython/blob/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79/git/test/test_util.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/513/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cd9475c05d282c05d0e479284496813cd7a309a44492e4263a6fbf4bbf9dc794
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cd9475c05d282c05d0e479284496813cd7a309a44492e4263a6fbf4bbf9dc794
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cd9475c05d282c05d0e479284496813cd7a309a44492e4263a6fbf4bbf9dc794
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cd9475c05d282c05d0e479284496813cd7a309a44492e4263a6fbf4bbf9dc794
git/util.pyhttps://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
View file https://github.com/expobrain/GitPython/blob/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79/git/util.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/513/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
setup.pyhttps://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
View file https://github.com/expobrain/GitPython/blob/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79/setup.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/513/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/513/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
win32-requirements.txthttps://github.com/gitpython-developers/GitPython/pull/513/files#diff-ad66ba8a78f5c769b0d0ded927a7bf8b6c779ef21cf0567dcfe38a96c84b5343
View file https://github.com/expobrain/GitPython/blob/20b4f49b4e71c90581c68ea7f4cf56160a6bdc79/win32-requirements.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/513/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.