Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 06a3a85

Browse files
miss-islingtonthejcannon
andauthoredMay 22, 2025··
[3.14] Avoid __file__ in hashlib example (GH-134540) (#134549)
Avoid `__file__` in `hashlib` example (GH-134540) (cherry picked from commit 9b292ff) Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
1 parent 37c2c8c commit 06a3a85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Doc/library/hashlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ a file or file-like object.
284284
Example:
285285

286286
>>> import io, hashlib, hmac
287-
>>> with open(hashlib.__file__, "rb") as f:
287+
>>> with open("library/hashlib.rst", "rb") as f:
288288
... digest = hashlib.file_digest(f, "sha256")
289289
...
290290
>>> digest.hexdigest() # doctest: +ELLIPSIS

0 commit comments

Comments
 (0)
Please sign in to comment.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant