Use os.path.realpath consistently when os.fspath is used

This commit is contained in:
Andrew Murray 2024-02-08 18:35:37 +11:00
parent a276cf2c9f
commit a118a82c30
2 changed files with 2 additions and 2 deletions

View File

@ -2385,7 +2385,7 @@ class Image:
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:

View File

@ -230,7 +230,7 @@ class FreeTypeFont:
)
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: