https://github.com/python/cpython/commit/b2126530499e7712a0f193b240d287c6249ed1f0
commit: b2126530499e7712a0f193b240d287c6249ed1f0
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: gpshead <[email protected]>
date: 2025-05-22T21:38:04Z
summary:

[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 <[email protected]>

files:
M Doc/library/hashlib.rst

diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index ff15a08a792ed2..1c5d951560e247 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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to