From 55e4114fb3e5bf2cec25d488159cebd4ca44e5c7 Mon Sep 17 00:00:00 2001 From: Aos Dabbagh <25783780+aos@users.noreply.github.com> Date: Thu, 15 Aug 2024 00:57:39 -0400 Subject: [PATCH] fix: Update writePython3Bin docs Was trying out the recommended example for `writePython3Bin` and it failed with: ``` Traceback (most recent call last): File "/nix/store/gcmhfm7mslpndjasfhvs66f1ca24vxim-test_py3/bin/test_py3", line 4, in y = yaml.load(""" TypeError: load() missing 1 required positional argument: 'Loader' ``` Looks like `yaml.load(input)` was deprecated in 5.1: https://msg.pyyaml.org/load `nixos-24.05` uses `6.0.1` so we're in the clear. --- pkgs/build-support/writers/scripts.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/writers/scripts.nix b/pkgs/build-support/writers/scripts.nix index bceac1b0c959..edc61403dfa7 100644 --- a/pkgs/build-support/writers/scripts.nix +++ b/pkgs/build-support/writers/scripts.nix @@ -597,7 +597,7 @@ rec { # writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } '' # import yaml # - # y = yaml.load(""" + # y = yaml.safe_load(""" # - test: success # """) # print(y[0]['test']) @@ -615,7 +615,7 @@ rec { # writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } '' # import yaml # - # y = yaml.load(""" + # y = yaml.safe_load(""" # - test: success # """) # print(y[0]['test'])