Skip to content

Graceful handling of instance deletion in python#4637

Closed
aothms wants to merge 4 commits intov0.8.0from
tfk-shared-pointer-storage
Closed

Graceful handling of instance deletion in python#4637
aothms wants to merge 4 commits intov0.8.0from
tfk-shared-pointer-storage

Conversation

@aothms
Copy link
Copy Markdown
Member

@aothms aothms commented May 8, 2024

Accessing an instance that got deleted now raises a catchable exception. Still need to let this percolate a bit in order to make this a bit more backwards compatible on the C++ side of things.

>>> import ifcopenshell
>>> f = ifcopenshell.file()
>>> inst = f.createIfcWall('a')
>>> inst2 = f.by_guid('a')
>>> f.remove(inst)
>>> inst2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\tkrij\miniconda3\envs\ifopsh08\lib\site-packages\ifcopenshell\entity_instance.py", line 307, in __repr__
    return repr(self.wrapped_data)
  File "C:\Users\tkrij\miniconda3\envs\ifopsh08\lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 8045, in __repr__
    return _ifcopenshell_wrapper.entity_instance___repr__(self)
RuntimeError: No longer availabe

@aothms aothms marked this pull request as draft May 8, 2024 08:28
@Moult
Copy link
Copy Markdown
Contributor

Moult commented Oct 26, 2025

Bump :)

@aothms
Copy link
Copy Markdown
Member Author

aothms commented Jan 6, 2026

Closed in favour of #7534

@aothms aothms closed this Jan 6, 2026
@Moult Moult mentioned this pull request Jan 27, 2026
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.

2 participants