From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 22 May 2025 21:38:04 +0000 (+0200) Subject: [3.13] Avoid `__file__` in `hashlib` example (GH-134540) (#134550) X-Git-Tag: v3.13.4~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2126530499e7712a0f193b240d287c6249ed1f0;p=thirdparty%2FPython%2Fcpython.git [3.13] Avoid `__file__` in `hashlib` example (GH-134540) (#134550) Avoid `__file__` in `hashlib` example (GH-134540) (cherry picked from commit 9b292ff0223dab0f999d5c1e13355552fd7cd528) Co-authored-by: Josh Cannon --- diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index ff15a08a792e..1c5d951560e2 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -284,7 +284,7 @@ a file or file-like object. Example: >>> import io, hashlib, hmac - >>> with open(hashlib.__file__, "rb") as f: + >>> with open("library/hashlib.rst", "rb") as f: ... digest = hashlib.file_digest(f, "sha256") ... >>> digest.hexdigest() # doctest: +ELLIPSIS