| 82 | if test_fds: |
| 83 | # Gather detailed information about leaked fds. |
| 84 | def get_fds(): |
| 85 | import subprocess |
| 86 | path = 'PyMuPDF-linx-fds' |
| 87 | path_l = 'PyMuPDF-linx-fds-l' |
| 88 | command = f'ls /proc/{os.getpid()}/fd > {path}' |
| 89 | command_l = f'ls -l /proc/{os.getpid()}/fd > {path_l}' |
| 90 | subprocess.run(command, shell=1) |
| 91 | subprocess.run(command_l, shell=1) |
| 92 | with open(path) as f: |
| 93 | ret = f.read() |
| 94 | ret = ret.replace('\n', ' ') |
| 95 | with open(path_l) as f: |
| 96 | ret_l = f.read() |
| 97 | return ret, ret_l |
| 98 | open_fds_before, open_fds_before_l = get_fds() |
| 99 | |
| 100 | pymupdf._log_items_clear() |