← mined_oracle

rich_2209

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

Task input

(not found in data/tasks.jsonl)

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Patch

--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Fall back to `sys.__stderr__` on POSIX systems when trying to get the terminal size (fix issues when Rich is piped to another process)
 - Fixed markup escaping issue https://github.com/Textualize/rich/issues/2187
 - Safari - Box appearing around SVG export https://github.com/Textualize/rich/pull/2201
+- Fixed recursion error in Jupyter progress bars https://github.com/Textualize/rich/issues/2047
 
 ## [12.2.0] - 2022-04-05
 
--- a/rich/file_proxy.py
+++ b/rich/file_proxy.py
@@ -1,5 +1,5 @@
 import io
-from typing import List, Any, IO, TYPE_CHECKING
+from typing import IO, TYPE_CHECKING, Any, List
 
 from .ansi import AnsiDecoder
 from .text import Text
@@ -48,7 +48,7 @@ class FileProxy(io.TextIOBase):
         return len(text)
 
     def flush(self) -> None:
-        buffer = self.__buffer
-        if buffer:
-            self.__console.print("".join(buffer))
-            del buffer[:]
+        output = "".join(self.__buffer)
+        if output:
+            self.__console.print(output)
+        del self.__buffer[:]

Test output

show
...                                                                      [100%]
3 passed in 0.10s