Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc35b812

Browse files
authored
gh-142836: Avoid /proc fd pipes on Solaris (#142853)
1 parent89729f2 commitc35b812

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

‎Lib/test/test_pdb.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3563,10 +3563,22 @@ def _assert_find_function(self, file_content, func_name, expected):
35633563

35643564
def_fd_dir_for_pipe_targets(self):
35653565
"""Return a directory exposing live file descriptors, if any."""
3566+
returnself._proc_fd_dir()orself._dev_fd_dir()
3567+
3568+
def_proc_fd_dir(self):
3569+
"""Return /proc-backed fd dir when it can be used for pipes."""
3570+
# GH-142836: Opening /proc/self/fd entries for pipes raises EACCES on
3571+
# Solaris, so prefer other mechanisms there.
3572+
ifsys.platform.startswith("sunos"):
3573+
returnNone
3574+
35663575
proc_fd="/proc/self/fd"
35673576
ifos.path.isdir(proc_fd)andos.path.exists(os.path.join(proc_fd,'0')):
35683577
returnproc_fd
3578+
returnNone
35693579

3580+
def_dev_fd_dir(self):
3581+
"""Return /dev-backed fd dir when usable."""
35703582
dev_fd="/dev/fd"
35713583
ifos.path.isdir(dev_fd)andos.path.exists(os.path.join(dev_fd,'0')):
35723584
ifsys.platform.startswith("freebsd"):
@@ -3576,7 +3588,6 @@ def _fd_dir_for_pipe_targets(self):
35763588
exceptFileNotFoundError:
35773589
returnNone
35783590
returndev_fd
3579-
35803591
returnNone
35813592

35823593
deftest_find_function_empty_file(self):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Accommodated Solaris in ``test_pdb.test_script_target_anonymous_pipe``.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp