Repository navigation
Commit 165b152
Clearing an Unpickler memo left its sequential index and sparse entries intact, so reusing the unpickler for an independent record could raise UnpicklingError or retrieve an object from a previous record. Replace the memo and reset all of its state before releasing the old entries. Backport to 3.15; manually backport only the counter reset to 3.14, which has no sparse memo.
(cherry picked from commit cc36604)
Co-authored-by: Jelle Zijlstra <jelle@openai.com>
1 parent d4d2c53 commit 165b152
3 files changed
Lines changed: 33 additions & 9 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5186 | 5186 | | |
5187 | 5187 | | |
5188 | 5188 | | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
5189 | 5205 | | |
5190 | 5206 | | |
5191 | 5207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1747 | 1747 | | |
1748 | 1748 | | |
1749 | 1749 | | |
1750 | | - | |
| 1750 | + | |
1751 | 1751 | | |
1752 | | - | |
| 1752 | + | |
1753 | 1753 | | |
1754 | 1754 | | |
1755 | 1755 | | |
1756 | 1756 | | |
1757 | | - | |
| 1757 | + | |
| 1758 | + | |
1758 | 1759 | | |
1759 | | - | |
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
| |||
7577 | 7577 | | |
7578 | 7578 | | |
7579 | 7579 | | |
7580 | | - | |
| 7580 | + | |
7581 | 7581 | | |
7582 | 7582 | | |
7583 | 7583 | | |
| |||
7724 | 7724 | | |
7725 | 7725 | | |
7726 | 7726 | | |
7727 | | - | |
7728 | | - | |
7729 | | - | |
| 7727 | + | |
| 7728 | + | |
| 7729 | + | |
7730 | 7730 | | |
| 7731 | + | |
| 7732 | + | |
| 7733 | + | |
| 7734 | + | |
| 7735 | + | |
| 7736 | + | |
7731 | 7737 | | |
7732 | 7738 | | |
7733 | 7739 | | |
| |||
7932 | 7938 | | |
7933 | 7939 | | |
7934 | 7940 | | |
7935 | | - | |
| 7941 | + | |
7936 | 7942 | | |
7937 | 7943 | | |
7938 | 7944 | | |
| |||
0 commit comments