René's URL Explorer Experiment


Title: dev_environment.py: a locked file during symlinking leaves the extension half-linked with no recovery hint · Issue #9239 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: dev_environment.py: a locked file during symlinking leaves the extension half-linked with no recovery hint · Issue #9239 · IfcOpenShell/IfcOpenShell

X Title: dev_environment.py: a locked file during symlinking leaves the extension half-linked with no recovery hint · Issue #9239 · IfcOpenShell/IfcOpenShell

Description: When dev_environment.py fails while replacing a package directory with a symlink, it aborts on a raw traceback and leaves the extension in a partially-linked state that Blender cannot import. Nothing in the output indicates what went wro...

Open Graph Description: When dev_environment.py fails while replacing a package directory with a symlink, it aborts on a raw traceback and leaves the extension in a partially-linked state that Blender cannot import. Nothi...

X Description: When dev_environment.py fails while replacing a package directory with a symlink, it aborts on a raw traceback and leaves the extension in a partially-linked state that Blender cannot import. Nothi...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9239

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"dev_environment.py: a locked file during symlinking leaves the extension half-linked with no recovery hint","articleBody":"When `dev_environment.py` fails while replacing a package directory with a symlink, it aborts on a raw traceback and leaves the extension in a partially-linked state that Blender cannot import. Nothing in the output indicates what went wrong or that re-running the script fixes it.\n\n### What happened\n\nBlender 4.5, Bonsai installed minutes earlier via offline installation:\n\n```\nSymlinking extension to the git repo...\nLinking ...\\extensions\\user_default\\bonsai\\__init__.py -> ...\\src\\bonsai\\bonsai\\__init__.py.\nLinking ...\\site-packages\\bonsai -> ...\\src\\bonsai\\bonsai.\nLinking ...\\site-packages\\ifcopenshell -> ...\\src\\ifcopenshell-python\\ifcopenshell.\nTraceback (most recent call last):\n  File \"...\\dev_environment.py\", line 229, in \u003cmodule>\n    main()\n  File \"...\\dev_environment.py\", line 192, in main\n    shutil.rmtree(path)\n  File \"...\\shutil.py\", line 808, in rmtree\n    return _rmtree_unsafe(path, onexc)\n  File \"...\\shutil.py\", line 636, in _rmtree_unsafe\n    onexc(os.unlink, fullname, err)\n  File \"...\\shutil.py\", line 634, in _rmtree_unsafe\n    os.unlink(fullname)\nPermissionError: [WinError 5] Access is denied: '...\\site-packages\\ifcopenshell\\_ifcopenshell_wrapper.cp311-win_amd64.pyd'\n```\n\n`rmtree` had already deleted all but 10 files of `site-packages/ifcopenshell` before hitting the 54 MB `.pyd`, and the symlink was never created — so `import ifcopenshell` was broken in Blender until the script was run again.\n\nInvestigating afterwards, the lock was transient and already gone: no process had the `.pyd` loaded as a module, Blender was not running, the file was not read-only (`Archive` only), the ACL granted `FullControl`, and opening it exclusively for `ReadWrite` with no sharing succeeded. Re-running the script completed without any intervention. The extension had been installed at 08:39 and the script run immediately after, so an antivirus scan of freshly written native binaries is the likely holder. (Deleting a file held as a mapped image or by a scanner returns `WinError 5`, not the `WinError 32` one might expect.)\n\n### Why this is worth handling\n\nhttps://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/bonsai/scripts/dev_environment.py#L175-L187\n\n```python\n    for path, dest in symlinks:\n        print(f\"Linking {path} -> {dest}.\")\n        if path.is_dir():\n            if path.is_symlink():\n                path.unlink()\n            else:\n                shutil.rmtree(path)\n```\n\n`rmtree` is only reachable when the target is still a real directory — that is, on the **first** run after installing the extension. Every later run finds a symlink and takes `path.unlink()` instead. So the one branch with no error handling is also the one that always runs while the extension's binaries are newly written and most likely to be held by a scanner. New contributors following the setup instructions hit it under precisely the worst conditions, on their first attempt.\n\n### Suggested changes\n\n1. **Retry `rmtree` on `PermissionError`** with a short backoff, rather than aborting on the first failure. In this case the lock cleared on its own well within a few seconds.\n\n2. **Report the partial state and the remedy.** Wrapping the symlink loop so a failure prints something like:\n\n   > Failed while replacing `\u003cpath>`. The extension is now partially linked and Blender will not import it until this completes. This is usually a file lock (Blender running, or an antivirus scanning a fresh install) — re-running this script is safe and will finish the job.\n\n   would have made the situation self-explanatory. The recovery genuinely is just \"run it again\", but that is not discoverable from a `shutil` traceback.\n\n3. **Preflight check that Blender is not running.** It was not the cause here, but it is the most common cause of a locked file at this step and is cheap to detect.\n\n4. Minor, while in the area: `rmtree` on Windows also fails on read-only files, which an `onexc` handler that clears the read-only bit and retries would cover.\n\nWorth preserving deliberately: the script copies the `*_wrapper*` binaries into the repo **before** any deletion happens, which is why nothing was actually lost when this aborted. That ordering is load-bearing and could use a comment saying so.\n\nEnvironment: Windows 10, Blender 4.5, Bonsai installed via offline installation (`extensions/user_default/bonsai`). Unrelated to #9227 / #9228, which cover `PACKAGE_PATH` detection in the same script.\n\nHappy to open a PR for 1 and 2 if the approach looks right.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-08-03T14:01:30Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9239"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7fe9b041-6093-a03d-bc11-c1029f38e6bd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA60A:2FE7CE:59AA48:7AA8FF:6B04C782
html-safe-nonce5f1523c53e93549ab07d30285163d40a8613bce1e1a0b89a42fa32de2659a2d4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjBBOjJGRTdDRTo1OUFBNDg6N0FBOEZGOjZCMDRDNzgyIiwidmlzaXRvcl9pZCI6IjMyNjQ5MjgzNzEzMjk0NTI4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3f2616d9d85f9479975f3b642a4061335af0c181061eddddc3ae5897e196b1ee
hovercard-subject-tagissue:5050638700
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/9239/issue_layout
twitter:imagehttps://opengraph.githubassets.com/85505a4b7aa5c61df08562af5ade88eab63163a247970824a0ad407619aa1a2b/IfcOpenShell/IfcOpenShell/issues/9239
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/85505a4b7aa5c61df08562af5ade88eab63163a247970824a0ad407619aa1a2b/IfcOpenShell/IfcOpenShell/issues/9239
og:image:altWhen dev_environment.py fails while replacing a package directory with a symlink, it aborts on a raw traceback and leaves the extension in a partially-linked state that Blender cannot import. Nothi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametheoryshaw
hostnamegithub.com
expected-hostnamegithub.com
None85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/9239#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F9239
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F9239
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/9239
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/9239
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/9239
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests938 (938)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9239
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9239
#9240https://github.com/IfcOpenShell/IfcOpenShell/pull/9240
dev_environment.py: a locked file during symlinking leaves the extension half-linked with no recovery hinthttps://github.com/IfcOpenShell/IfcOpenShell/issues/9239#top
#9240https://github.com/IfcOpenShell/IfcOpenShell/pull/9240
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
Severity:Minorhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Severity%3AMinor%22
https://github.com/theoryshaw
theoryshawhttps://github.com/theoryshaw
on Aug 3, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9239#issue-5050638700
https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/bonsai/scripts/dev_environment.py#L175-L187https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/bonsai/scripts/dev_environment.py#L175-L187
#9227https://github.com/IfcOpenShell/IfcOpenShell/issues/9227
#9228https://github.com/IfcOpenShell/IfcOpenShell/pull/9228
theoryshawhttps://github.com/theoryshaw
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
Severity:Minorhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Severity%3AMinor%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Aug 3, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9239#event-28892164276
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9239
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9239
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
Severity:Minorhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Severity%3AMinor%22
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.