Skip to content

Conversation

@rishihg
Copy link

@rishihg rishihg commented Sep 9, 2025

Summary

This PR updates pytic.py to use yaml.SafeLoader when loading YAML configuration files.

Background

  • In PyYAML < 5.1, yaml.load() without a Loader argument was allowed.
  • In PyYAML ≥ 6.0 (now required for Python 3.12+), yaml.load() requires an explicit Loader.
  • Without this change, importing configurations with PyTic raises:

TypeError: load() missing 1 required positional argument: 'Loader'

Fix

Replaced:

cfg = yaml.load(ymlfile)

with:

cfg = yaml.load(ymlfile, Loader=yaml.SafeLoader)

Benefits

Restores compatibility with PyYAML 6+ and Python 3.12+

Backward compatible with older PyYAML

Prevents runtime errors for users on modern environments

Notes

This is a minimal change, does not affect any existing functionality, and follows PyYAML’s recommendation for safe parsing.

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