Repository navigation
Commit 3cf0199
committed
gh-151416: Document the __fspath__ reentrancy hazard of the FS path C APIs
PyUnicode_FSConverter(), PyUnicode_FSDecoder(), and PyOS_FSPath() call
an object's __fspath__() method during conversion, so the caller must
protect the input object with a strong reference that this method
cannot release. The docs previously described only the result
reference semantics and gave no hint that passing a reference borrowed
from a mutable container is unsafe.1 parent 8da22af commit 3cf0199
2 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
925 | 925 | | |
926 | 926 | | |
927 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
928 | 935 | | |
929 | 936 | | |
930 | 937 | | |
| |||
952 | 959 | | |
953 | 960 | | |
954 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
955 | 969 | | |
956 | 970 | | |
957 | 971 | | |
| |||
0 commit comments