Skip to content

Use UTF-8 for gallery YAML files - #7993

Open
Ghraven wants to merge 1 commit into
microsoft:mainfrom
Ghraven:fix/gallery-directive-utf8
Open

Use UTF-8 for gallery YAML files#7993
Ghraven wants to merge 1 commit into
microsoft:mainfrom
Ghraven:fix/gallery-directive-utf8

Conversation

@Ghraven

@Ghraven Ghraven commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • Read gallery directive YAML data files with encoding="utf-8".

Problem

The docs gallery directive can load YAML from a file passed to the directive, but Path.read_text() currently uses the platform default encoding. Gallery metadata is repo documentation content, so decoding it explicitly as UTF-8 avoids locale-dependent docs builds on Windows or other non-UTF-8 environments.

Before / After

Before: gallery YAML file decoding depended on the local platform default encoding.

After: gallery YAML files are decoded as UTF-8.

Verification

  • python -m py_compile python/docs/src/_extension/gallery_directive.py

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.

1 participant