(self)
| 794 | "Requires fdescfs mounted on /dev/fd on FreeBSD") |
| 795 | @unittest.skipIf(sys.platform.startswith("darwin"), "TODO: RUSTPYTHON Problems with Mac os descriptor") |
| 796 | def test_script_as_dev_fd(self): |
| 797 | # GH-87235: On macOS passing a non-trivial script to /dev/fd/N can cause |
| 798 | # problems because all open /dev/fd/N file descriptors share the same |
| 799 | # offset. |
| 800 | script = 'print("12345678912345678912345")' |
| 801 | with os_helper.temp_dir() as work_dir: |
| 802 | script_name = _make_test_script(work_dir, 'script.py', script) |
| 803 | with open(script_name, "r") as fp: |
| 804 | p = spawn_python(f"/dev/fd/{fp.fileno()}", close_fds=True, pass_fds=(0,1,2,fp.fileno())) |
| 805 | out, err = p.communicate() |
| 806 | self.assertEqual(out, b"12345678912345678912345\n") |
| 807 | |
| 808 | |
| 809 |
nothing calls this directly
no test coverage detected