Skip to content

Commit

Permalink
Use os.path.realpath consistently when os.fspath is used
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 8, 2024
1 parent a276cf2 commit a118a82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,7 @@ def save(self, fp, format=None, **params) -> None:
filename = ""
open_fp = False
if is_path(fp):
filename = os.fspath(fp)
filename = os.path.realpath(os.fspath(fp))
open_fp = True
elif fp == sys.stdout:
try:
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def load_from_bytes(f):
)

if is_path(font):
font = os.fspath(font)
font = os.path.realpath(os.fspath(font))
if sys.platform == "win32":
font_bytes_path = font if isinstance(font, bytes) else font.encode()
try:
Expand Down

0 comments on commit a118a82

Please sign in to comment.