Skip to content

Fix build book script#230

Merged
sahil-kale merged 1 commit into
mainfrom
more-build-fixes
Jan 4, 2026
Merged

Fix build book script#230
sahil-kale merged 1 commit into
mainfrom
more-build-fixes

Conversation

@sahil-kale
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 4, 2026 07:26
@sahil-kale sahil-kale merged commit 4510bb9 into main Jan 4, 2026
@sahil-kale sahil-kale deleted the more-build-fixes branch January 4, 2026 07:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issues with the build book script, specifically addressing Unicode decoding errors during subprocess execution and improving LaTeX document formatting.

Key Changes:

  • Enhanced error handling in run_command() function with dynamic encoding detection and tolerant error handling
  • Added LaTeX packages and configurations to improve document layout and URL handling
  • Reorganized import statements for better code structure

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/build_book.py Fixed Unicode decoding errors by implementing dynamic encoding detection, adding proper error handlers, and improving output streaming with try-finally block
src/main.tex Added LaTeX packages (microtype, xurl, etoolbox) and configurations to fix headheight warnings, improve typography, and handle long URLs in bibliography

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build_book.py
encoding=encoding,
errors="replace", # or "backslashreplace" if you want to see the bytes escaped
bufsize=1, # line-buffered (best effort)
universal_newlines=True,
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameters text=True (line 53) and universal_newlines=True (line 57) are redundant. Both parameters do the same thing - they enable text mode for subprocess output. In Python 3.7+, text is the preferred parameter name, while universal_newlines is the legacy alias. Only one should be specified to avoid confusion and redundancy.

Suggested change
universal_newlines=True,

Copilot uses AI. Check for mistakes.
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