From 1c22a93535ccd47efb9748c2df44869d9065970f Mon Sep 17 00:00:00 2001 From: Benjamin Stein Date: Tue, 2 Apr 2024 19:33:27 -0700 Subject: [PATCH] Update listdir() in sample code to take correct args (#2261) Executing this code (Python 3.11, MacOS) returns error `TypeError: listdir: path should be string, bytes, os.PathLike, integer or None, not TemporaryDirectory` Using the string name of the dir works better. --- website/docs/tutorial/code-executors.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/tutorial/code-executors.ipynb b/website/docs/tutorial/code-executors.ipynb index 6a8d4398751..53ee0a9cd5f 100644 --- a/website/docs/tutorial/code-executors.ipynb +++ b/website/docs/tutorial/code-executors.ipynb @@ -198,7 +198,7 @@ "source": [ "import os\n", "\n", - "print(os.listdir(temp_dir))\n", + "print(os.listdir(temp_dir.name))\n", "# We can see the output scatter.png and the code file generated by the agent." ] },