Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0231fae

Browse filesBrowse files
authored
Merge pull request #11307 from Nodd/path.py
Avoid recursion for subclasses of str that are also "PathLike" in to_filehandle()
2 parents b5b9a63 + f6a9f98 commit 0231fae
Copy full SHA for 0231fae

File tree

Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed

‎lib/matplotlib/cbook/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook/__init__.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,7 @@ def to_filehandle(fname, flag='rU', return_opened=False, encoding=None):
452452
read/write flag for :func:`file`
453453
"""
454454
if isinstance(fname, getattr(os, "PathLike", ())):
455-
return to_filehandle(
456-
os.fspath(fname),
457-
flag=flag, return_opened=return_opened, encoding=encoding)
455+
fname = os.fspath(fname)
458456
if isinstance(fname, str):
459457
if fname.endswith('.gz'):
460458
# get rid of 'U' in flag for gzipped files.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.