mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-05 06:00:58 +03:00
Use os.path.realpath consistently when os.fspath is used
This commit is contained in:
parent
a276cf2c9f
commit
a118a82c30
|
@ -2385,7 +2385,7 @@ class Image:
|
||||||
filename = ""
|
filename = ""
|
||||||
open_fp = False
|
open_fp = False
|
||||||
if is_path(fp):
|
if is_path(fp):
|
||||||
filename = os.fspath(fp)
|
filename = os.path.realpath(os.fspath(fp))
|
||||||
open_fp = True
|
open_fp = True
|
||||||
elif fp == sys.stdout:
|
elif fp == sys.stdout:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -230,7 +230,7 @@ class FreeTypeFont:
|
||||||
)
|
)
|
||||||
|
|
||||||
if is_path(font):
|
if is_path(font):
|
||||||
font = os.fspath(font)
|
font = os.path.realpath(os.fspath(font))
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
font_bytes_path = font if isinstance(font, bytes) else font.encode()
|
font_bytes_path = font if isinstance(font, bytes) else font.encode()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user