← oracle_full

rich_3480

resolved RESOLVED UNSUBMITTED PASS · None tool calls · 0 s · Textualize/rich

Task input

fix infinite loop in append

Fixes https://github.com/Textualize/rich/issues/3479

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Patch

--- a/rich/text.py
+++ b/rich/text.py
@@ -998,7 +998,7 @@ def append(
                 self._text.append(text.plain)
                 self._spans.extend(
                     _Span(start + text_length, end + text_length, style)
-                    for start, end, style in text._spans
+                    for start, end, style in text._spans.copy()
                 )
                 self._length += len(text)
         return self
@@ -1020,7 +1020,7 @@ def append_text(self, text: "Text") -> "Text":
         self._text.append(text.plain)
         self._spans.extend(
             _Span(start + text_length, end + text_length, style)
-            for start, end, style in text._spans
+            for start, end, style in text._spans.copy()
         )
         self._length += len(text)
         return self

Test output

show
........................................................................ [ 66%]
.....................................                                    [100%]
109 passed in 0.19s