Commit cfbaecc
committed
Y2K fix affecting asctime(), mktime(), strftime().
2-digit years are now converted using rules that are (according to
Fredrik Lundh) recommended by POSIX or X/Open: 0-68 mean 2000-2068,
69-99 mean 1969-1999.
2-digit years are now only accepted if time.accept2dyear is set to a
nonzero integer; if it is zero or not an integer or absent, only year
values >= 1900 are accepted. Year values 100-1899 and negative year
values are never accepted.
The initial value of time.accept2dyear depends on the environment
variable PYTHONY2K: if PYTHONY2K is set and non-empty,
time.accept2dyear is initialized to 0; if PYTHONY2K is empty or not
set, time.accept2dyear is initialized to 0.1 parent f5a80a4 commit cfbaecc
1 file changed
Lines changed: 37 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
325 | 331 | | |
326 | | - | |
| 332 | + | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
| |||
333 | 339 | | |
334 | 340 | | |
335 | 341 | | |
336 | | - | |
337 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
338 | 362 | | |
339 | 363 | | |
340 | 364 | | |
| |||
347 | 371 | | |
348 | 372 | | |
349 | 373 | | |
| 374 | + | |
350 | 375 | | |
351 | 376 | | |
352 | 377 | | |
353 | 378 | | |
354 | 379 | | |
355 | 380 | | |
356 | 381 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 382 | + | |
368 | 383 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | 384 | | |
375 | 385 | | |
376 | 386 | | |
| |||
414 | 424 | | |
415 | 425 | | |
416 | 426 | | |
| 427 | + | |
417 | 428 | | |
418 | 429 | | |
419 | 430 | | |
| |||
595 | 606 | | |
596 | 607 | | |
597 | 608 | | |
| 609 | + | |
598 | 610 | | |
599 | 611 | | |
600 | 612 | | |
| |||
607 | 619 | | |
608 | 620 | | |
609 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
610 | 628 | | |
611 | 629 | | |
612 | 630 | | |
| |||
0 commit comments