Commit fae8f4a
If history-length is set in .inputrc, and the history file is double the
history size (or more), history_get(N) returns NULL, and python
segfaults. Fix that by checking for NULL return value.
It seems that the root cause is incorrect handling of bigger history in
readline, but Python should not segfault even if readline returns
unexpected value.
This issue affects only GNU readline. When using libedit emulation
system history size option does not work.
1 parent 25a4206 commit fae8f4a
File tree
3 files changed
+48
-7
lines changed- Lib/test
- Misc/NEWS.d/next/Library
- Modules
3 files changed
+48
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
213 | 250 | | |
214 | | - | |
| 251 | + | |
215 | 252 | | |
216 | 253 | | |
217 | 254 | | |
218 | 255 | | |
219 | | - | |
| 256 | + | |
220 | 257 | | |
221 | 258 | | |
222 | 259 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
1350 | | - | |
| 1350 | + | |
| 1351 | + | |
1351 | 1352 | | |
1352 | 1353 | | |
1353 | 1354 | | |
1354 | | - | |
| 1355 | + | |
1355 | 1356 | | |
1356 | 1357 | | |
1357 | | - | |
1358 | | - | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
1359 | 1361 | | |
1360 | 1362 | | |
1361 | 1363 | | |
| |||
0 commit comments