Skip to content

Commit

Permalink
Note that open() seeks to the start of file objects
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 17, 2023
1 parent aec7a8d commit cc84ff5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3156,7 +3156,8 @@ def open(fp, mode="r", formats=None):
:param fp: A filename (string), pathlib.Path object or a file object.
The file object must implement ``file.read``,
``file.seek``, and ``file.tell`` methods,
and be opened in binary mode.
and be opened in binary mode. The file object will also seek to zero
before reading.
:param mode: The mode. If given, this argument must be "r".
:param formats: A list or tuple of formats to attempt to load the file in.
This can be used to restrict the set of formats checked.
Expand Down

0 comments on commit cc84ff5

Please sign in to comment.