mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +03:00
Removed use of os.path.realpath
This commit is contained in:
parent
ab496d04ce
commit
2303018ebf
|
@ -2550,7 +2550,7 @@ class Image:
|
|||
filename: str | bytes = ""
|
||||
open_fp = False
|
||||
if is_path(fp):
|
||||
filename = os.path.realpath(os.fspath(fp))
|
||||
filename = os.fspath(fp)
|
||||
open_fp = True
|
||||
elif fp == sys.stdout:
|
||||
try:
|
||||
|
@ -2559,7 +2559,7 @@ class Image:
|
|||
pass
|
||||
if not filename and hasattr(fp, "name") and is_path(fp.name):
|
||||
# only set the name for metadata purposes
|
||||
filename = os.path.realpath(os.fspath(fp.name))
|
||||
filename = os.fspath(fp.name)
|
||||
|
||||
# may mutate self!
|
||||
self._ensure_mutable()
|
||||
|
@ -3463,7 +3463,7 @@ def open(
|
|||
exclusive_fp = False
|
||||
filename: str | bytes = ""
|
||||
if is_path(fp):
|
||||
filename = os.path.realpath(os.fspath(fp))
|
||||
filename = os.fspath(fp)
|
||||
|
||||
if filename:
|
||||
fp = builtins.open(filename, "rb")
|
||||
|
|
|
@ -130,7 +130,7 @@ class ImageFile(Image.Image):
|
|||
if is_path(fp):
|
||||
# filename
|
||||
self.fp = open(fp, "rb")
|
||||
self.filename = os.path.realpath(os.fspath(fp))
|
||||
self.filename = os.fspath(fp)
|
||||
self._exclusive_fp = True
|
||||
else:
|
||||
# stream
|
||||
|
|
|
@ -270,7 +270,7 @@ class FreeTypeFont:
|
|||
)
|
||||
|
||||
if is_path(font):
|
||||
font = os.path.realpath(os.fspath(font))
|
||||
font = os.fspath(font)
|
||||
if sys.platform == "win32":
|
||||
font_bytes_path = font if isinstance(font, bytes) else font.encode()
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user