Skip to content

Truncate oversized stdout outputs in chap07 and chap08 notebooks - #17

Closed
AllenDowney with Copilot wants to merge 2 commits into
v3from
copilot/fix-unable-to-render-code-block-error
Closed

AllenDowney with Copilot wants to merge 2 commits into
v3from
copilot/fix-unable-to-render-code-block-error

Conversation

Copilot AI commented Oct 14, 2026 •

Copy link
Copy Markdown

The GitHub notebook preview shows "Unable to render code block" for chap07.ipynb and chap08.ipynb. The notebooks run fine on Colab, which matches an output-size problem: these are the only two with very large saved stdout outputs.

I haven't been able to reproduce the preview failure, so the cause is inferred from file size and not confirmed.

  • soln/chap07.ipynb (2.3 MB → 58 KB)
    • The for line in open('words.txt'): print(word) cell had saved the entire word list, about 1.5 MB across two stdout streams.
    • It now has a single stream holding the first 20 lines followed by ....
  • soln/chap08.ipynb (445 KB → 71 KB)
    • The Dracula name-regex cell had saved about 350 KB of matched text across two stdout streams.
    • It now has a single stream holding the first 20 lines followed by ....

The rest of both notebooks is unchanged, and the diff is deletions plus the two replacement streams. The truncated outputs no longer show the full word list or the full regex matches. I did not re-run the notebooks.

Copilot AI linked an issue Oct 14, 2026 that may be closed by this pull request
Co-authored-by: AllenDowney <1882093+AllenDowney@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unable to render code block error for chapters 7 and 8 Truncate oversized stdout outputs in chap07 and chap08 notebooks Oct 14, 2026
Copilot AI requested a review from AllenDowney October 14, 2026 15:32
@AllenDowney

Copy link
Copy Markdown
Owner

Superseded by d585312, which strips the outputs no build renders (chap07 is now 55 KB, chap08 67 KB), and make tests now checks for it. Closing.

@AllenDowney AllenDowney closed this Nov 6, 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.

'Unable to render code block' error

2 participants