1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
34517
34518
34519
34520
34521
34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
34533
34534
34535
34536
34537
34538
34539
34540
34541
34542
34543
34544
34545
34546
34547
34548
34549
34550
34551
34552
34553
34554
34555
34556
34557
34558
34559
34560
34561
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
34586
34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
34643
34644
34645
34646
34647
34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
34658
34659
34660
34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
34687
34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
34699
34700
34701
34702
34703
34704
34705
34706
34707
34708
34709
34710
34711
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
34725
34726
34727
34728
34729
34730
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
34746
34747
34748
34749
34750
34751
34752
34753
34754
34755
34756
34757
34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
34769
34770
34771
34772
34773
34774
34775
34776
34777
34778
34779
34780
34781
34782
34783
34784
34785
34786
34787
34788
34789
34790
34791
34792
34793
34794
34795
34796
34797
34798
34799
34800
34801
34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
34820
34821
|
Python History
--------------
This file contains the release messages for previous Python releases.
As you read on you go back to the dark ages of Python's history.
======================================================================
What's New in Python 3.4.6?
===========================
Release date: 2017-01-17
There were no changes between 3.4.6rc1 and 3.4.6 final.
What's New in Python 3.4.6rc1?
==============================
Release date: 2017-01-02
Core and Builtins
-----------------
- Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters. Patch by Xiang Zhang.
- Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
build.
Library
-------
- Issue #28563: Fixed possible DoS and arbitrary code execution when handle
plural form selections in the gettext module. The expression parser now
supports exact syntax supported by GNU gettext.
- In the curses module, raise an error if window.getstr() or window.instr() is
passed a negative value.
- Issue #27783: Fix possible usage of uninitialized memory in operator.methodcaller.
- Issue #27774: Fix possible Py_DECREF on unowned object in _sre.
- Issue #27760: Fix possible integer overflow in binascii.b2a_qp.
- Issue #27758: Fix possible integer overflow in the _csv module for large record
lengths.
- Issue #27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the
HTTP_PROXY variable when REQUEST_METHOD environment is set, which indicates
that the script is in CGI mode.
- Issue #27759: Fix selectors incorrectly retain invalid file descriptors.
Patch by Mark Williams.
Build
-----
- Issue #28248: Update Windows build to use OpenSSL 1.0.2j.
Tests
-----
- Issue #27369: In test_pyexpat, avoid testing an error message detail that
changed in Expat 2.2.0.
What's New in Python 3.4.5?
===========================
Release date: 2016-06-26
Tests
-----
- Issue #26867: Ubuntu's openssl OP_NO_SSLv3 is forced on by default; fix test.
What's New in Python 3.4.5rc1?
==============================
Release date: 2016-06-11
Core and Builtins
-----------------
- Issue #26478: Fix semantic bugs when using binary operators with dictionary
views and tuples.
- Issue #26171: Fix possible integer overflow and heap corruption in
zipimporter.get_data().
Library
-------
- Issue #26556: Update expat to 2.1.1, fixes CVE-2015-1283.
- Fix TLS stripping vulnerability in smptlib, CVE-2016-0772. Reported by Team
Oststrom
- Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates.
- Issue #26012: Don't traverse into symlinks for ** pattern in
pathlib.Path.[r]glob().
- Issue #24120: Ignore PermissionError when traversing a tree with
pathlib.Path.[r]glob(). Patch by Ulrich Petri.
- Skip getaddrinfo if host is already resolved.
Patch by A. Jesse Jiryu Davis.
- Add asyncio.timeout() context manager.
- Issue #26050: Add asyncio.StreamReader.readuntil() method.
Patch by Марк Коренберг.
Tests
-----
- Issue #25940: Changed test_ssl to use self-signed.pythontest.net. This
avoids relying on svn.python.org, which recently changed root certificate.
What's New in Python 3.4.4?
===========================
Release date: 2015/12/20
Windows
-------
- Issue #25844: Corrected =/== typo potentially leading to crash in launcher.
What's New in Python 3.4.4rc1?
==============================
Release date: 2015/12/06
Core and Builtins
-----------------
- Issue #25709: Fixed problem with in-place string concatenation and utf-8
cache.
- Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside
__getattr__.
- Issue #24731: Fixed crash on converting objects with special methods
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
- Issue #25388: Fixed tokenizer crash when processing undecodable source code
with a null byte.
- Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
rejects builtin types with not defined __new__.
- Issue #24802: Avoid buffer overreads when int(), float(), compile(), exec()
and eval() are passed bytes-like objects. These objects are not
necessarily terminated by a null byte, but the functions assumed they were.
- Issue #24402: Fix input() to prompt to the redirected stdout when
sys.stdout.fileno() fails.
- Issue #24806: Prevent builtin types that are not allowed to be subclassed from
being subclassed through multiple inheritance.
- Issue #24848: Fixed a number of bugs in UTF-7 decoding of misformed data.
- Issue #25280: Import trace messages emitted in verbose (-v) mode are no
longer formatted twice.
- Issue #25003: os.urandom() doesn't use getentropy() on Solaris because
getentropy() is blocking, whereas os.urandom() should not block. getentropy()
is supported since Solaris 11.3.
- Issue #25182: The stdprinter (used as sys.stderr before the io module is
imported at startup) now uses the backslashreplace error handler.
- Issue #24891: Fix a race condition at Python startup if the file descriptor
of stdin (0), stdout (1) or stderr (2) is closed while Python is creating
sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set
to None if the creation of the object failed, instead of raising an OSError
exception. Initial patch written by Marco Paolini.
- Issue #21167: NAN operations are now handled correctly when python is
compiled with ICC even if -fp-model strict is not specified.
- Issue #4395: Better testing and documentation of binary operators.
Patch by Martin Panter.
- Issue #24467: Fixed possible buffer over-read in bytearray. The bytearray
object now always allocates place for trailing null byte and it's buffer now
is always null-terminated.
- Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
- Issue #24257: Fixed system error in the comparison of faked
types.SimpleNamespace.
- Issue #22939: Fixed integer overflow in iterator object. Patch by
Clement Rouault.
- Issue #23985: Fix a possible buffer overrun when deleting a slice from
the front of a bytearray and then appending some other bytes data.
- Issue #24102: Fixed exception type checking in standard error handlers.
- Issue #23757: PySequence_Tuple() incorrectly called the concrete list API
when the data was a list subclass.
- Issue #24407: Fix crash when dict is mutated while being updated.
- Issue #24096: Make warnings.warn_explicit more robust against mutation of the
warnings.filters list.
- Issue #23996: Avoid a crash when a delegated generator raises an
unnormalized StopIteration exception. Patch by Stefan Behnel.
- Issue #24022: Fix tokenizer crash when processing undecodable source code.
- Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr). A fatal
error is emitted instead.
- Issue #22977: Fixed formatting Windows error messages on Wine.
Patch by Martin Panter.
- Issue #23803: Fixed str.partition() and str.rpartition() when a separator
is wider then partitioned string.
- Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet.
- Issue #23629: Fix the default __sizeof__ implementation for variable-sized
objects.
- Issue #24044: Fix possible null pointer dereference in list.sort in out of
memory conditions.
- Issue #21354: PyCFunction_New function is exposed by python DLL again.
Library
-------
- Issue #24903: Fix regression in number of arguments compileall accepts when
'-d' is specified. The check on the number of arguments has been dropped
completely as it never worked correctly anyway.
- Issue #25764: In the subprocess module, preserve any exception caused by
fork() failure when preexec_fn is used.
- Issue #6478: _strptime's regexp cache now is reset after changing timezone
with time.tzset().
- Issue #25177: Fixed problem with the mean of very small and very large
numbers. As a side effect, statistics.mean and statistics.variance should
be significantly faster.
- Issue #25718: Fixed copying object with state with boolean value is false.
- Issue #10131: Fixed deep copying of minidom documents. Based on patch
by Marian Ganisin.
- Issue #25725: Fixed a reference leak in pickle.loads() when unpickling
invalid data including tuple instructions.
- Issue #25663: In the Readline completer, avoid listing duplicate global
names, and search the global namespace before searching builtins.
- Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error.
- Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.
- Issue #25691: Fixed crash on deleting ElementTree.Element attributes.
- Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
entries. Patch by Dingyuan Wang.
- Issue #25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True)
when the OS gives priority to errors such as EACCES over EEXIST.
- Issue #25593: Change semantics of EventLoop.stop() in asyncio.
- Issue #6973: When we know a subprocess.Popen process has died, do
not allow the send_signal(), terminate(), or kill() methods to do
anything as they could potentially signal a different process.
- Issue #25578: Fix (another) memory leak in SSLSocket.getpeercer().
- Issue #25590: In the Readline completer, only call getattr() once per
attribute.
- Issue #25498: Fix a crash when garbage-collecting ctypes objects created
by wrapping a memoryview. This was a regression made in 3.4.3. Based
on patch by Eryksun.
- Issue #18010: Fix the pydoc web server's module search function to handle
exceptions from importing packages.
- Issue #25510: fileinput.FileInput.readline() now returns b'' instead of ''
at the end if the FileInput was opened with binary mode.
Patch by Ryosuke Ito.
- Issue #25530: Disable the vulnerable SSLv3 protocol by default when creating
ssl.SSLContext.
- Issue #25569: Fix memory leak in SSLSocket.getpeercert().
- Issue #21827: Fixed textwrap.dedent() for the case when largest common
whitespace is a substring of smallest leading whitespace.
Based on patch by Robert Li.
- Issue #25471: Sockets returned from accept() shouldn't appear to be
nonblocking.
- Issue #25441: asyncio: Raise error from drain() when socket is closed.
- Issue #25411: Improved Unicode support in SMTPHandler through better use of
the email package. Thanks to user simon04 for the patch.
- Issue #25380: Fixed protocol for the STACK_GLOBAL opcode in
pickletools.opcodes.
- Issue #23972: Updates asyncio datagram create method allowing reuseport
and reuseaddr socket options to be set prior to binding the socket.
Mirroring the existing asyncio create_server method the reuseaddr option
for datagram sockets defaults to True if the O/S is 'posix' (except if the
platform is Cygwin). Patch by Chris Laws.
- Issue #25304: Add asyncio.run_coroutine_threadsafe(). This lets you
submit a coroutine to a loop from another thread, returning a
concurrent.futures.Future. By Vincent Michel.
- Issue #25319: When threading.Event is reinitialized, the underlying condition
should use a regular lock rather than a recursive lock.
- Issue #25232: Fix CGIRequestHandler to split the query from the URL at the
first question mark (?) rather than the last. Patch from Xiang Zhang.
- Issue #24657: Prevent CGIRequestHandler from collapsing slashes in the
query part of the URL as if it were a path. Patch from Xiang Zhang.
- Issue #22958: Constructor and update method of weakref.WeakValueDictionary
now accept the self and the dict keyword arguments.
- Issue #22609: Constructor of collections.UserDict now accepts the self keyword
argument.
- Issue #25262. Added support for BINBYTES8 opcode in Python implementation of
unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8
opcodes no longer silently ignored on 32-bit platforms in C implementation.
- Issue #25034: Fix string.Formatter problem with auto-numbering and
nested format_specs. Patch by Anthon van der Neut.
- Issue #25233: Rewrite the guts of asyncio.Queue and
asyncio.Semaphore to be more understandable and correct.
- Issue #23600: Default implementation of tzinfo.fromutc() was returning
wrong results in some cases.
- Issue #25203: Failed readline.set_completer_delims() no longer left the
module in inconsistent state.
- Prevent overflow in _Unpickler_Read.
- Issue #25047: The XML encoding declaration written by Element Tree now
respects the letter case given by the user. This restores the ability to
write encoding names in uppercase like "UTF-8", which worked in Python 2.
- Issue #19143: platform module now reads Windows version from kernel32.dll to
avoid compatibility shims.
- Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods
of datetime.datetime: microseconds are now rounded to nearest with ties
going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding
towards zero (ROUND_DOWN). It's important that these methods use the same
rounding mode than datetime.timedelta to keep the property:
(datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t).
It also the rounding mode used by round(float) for example.
- Issue #24684: socket.socket.getaddrinfo() now calls
PyUnicode_AsEncodedString() instead of calling the encode() method of the
host, to handle correctly custom string with an encode() method which doesn't
return a byte string. The encoder of the IDNA codec is now called directly
instead of calling the encode() method of the string.
- Issue #24982: shutil.make_archive() with the "zip" format now adds entries
for directories (including empty directories) in ZIP file.
- Issue #24857: Comparing call_args to a long sequence now correctly returns a
boolean result instead of raising an exception. Patch by A Kaptur.
- Issue #25019: Fixed a crash caused by setting non-string key of expat parser.
Based on patch by John Leitch.
- Issue #24917: time_strftime() buffer over-read.
- Issue #23144: Make sure that HTMLParser.feed() returns all the data, even
when convert_charrefs is True.
- Issue #16180: Exit pdb if file has syntax error, instead of trapping user
in an infinite loop. Patch by Xavier de Gaye.
- Issue #21112: Fix regression in unittest.expectedFailure on subclasses.
Patch from Berker Peksag.
- Issue #24931: Instances of subclasses of namedtuples have their own __dict__
which breaks the inherited __dict__ property and breaks the _asdict() method.
Removed the __dict__ property to prevent the conflict and fixed _asdict().
- Issue #24764: cgi.FieldStorage.read_multi() now ignores the Content-Length
header in part headers. Patch written by Peter Landry and reviewed by Pierre
Quentel.
- Issue #24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
- Issue #21159: Improve message in configparser.InterpolationMissingOptionError.
Patch from Łukasz Langa.
- Issue #23888: Handle fractional time in cookie expiry. Patch by ssh.
- Issue #23004: mock_open() now reads binary data correctly when the type of
read_data is bytes. Initial patch by Aaron Hill.
- Issue #23652: Make it possible to compile the select module against the
libc headers from the Linux Standard Base, which do not include some
EPOLL macros. Patch by Matt Frank.
- Issue #22932: Fix timezones in email.utils.formatdate.
Patch from Dmitry Shachnev.
- Issue #23779: imaplib raises TypeError if authenticator tries to abort.
Patch from Craig Holmquist.
- Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
written by Matthieu Gautier.
- Issue #23254: Document how to close the TCPServer listening socket.
Patch from Martin Panter.
- Issue #19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
- Issue #23441: rcompleter now prints a tab character instead of displaying
possible completions for an empty word. Initial patch by Martin Sekera.
- Issue #24735: Fix invalid memory access in
itertools.combinations_with_replacement().
- Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
- Issue #24683: Fixed crashes in _json functions called with arguments of
inappropriate type.
- Issue #21697: shutil.copytree() now correctly handles symbolic links that
point to directories. Patch by Eduardo Seabra and Thomas Kluyver.
- Issue #24620: Random.setstate() now validates the value of state last element.
- Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
- Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.
- Issue #21750: mock_open.read_data can now be read from each instance, as it
could in Python 3.3.
- Issue #23247: Fix a crash in the StreamWriter.reset() of CJK codecs.
- Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
Patch from Nicola Palumbo and Laurent De Buyst.
- Issue #24608: chunk.Chunk.read() now always returns bytes, not str.
- Issue #18684: Fixed reading out of the buffer in the re module.
- Issue #24259: tarfile now raises a ReadError if an archive is truncated
inside a data segment.
- Issue #24552: Fix use after free in an error case of the _pickle module.
- Issue #24514: tarfile now tolerates number fields consisting of only
whitespace.
- Issue #19176: Fixed doctype() related bugs in C implementation of ElementTree.
A deprecation warning no longer issued by XMLParser subclass with default
doctype() method. Direct call of doctype() now issues a warning. Parser's
doctype() now is not called if target's doctype() is called. Based on patch
by Martin Panter.
- Issue #20387: Restore semantic round-trip correctness in tokenize/untokenize
for tab-indented blocks.
- Issue #24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm()
functions of the audioop module.
- Issue #24336: The contextmanager decorator now works with functions with
keyword arguments called "func" and "self". Patch by Martin Panter.
- Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar().
- Issue #5633: Fixed timeit when the statement is a string and the setup is not.
- Issue #24326: Fixed audioop.ratecv() with non-default weightB argument.
Original patch by David Moore.
- Issue #23840: tokenize.open() now closes the temporary binary file on error
to fix a resource warning.
- Issue #24257: Fixed segmentation fault in sqlite3.Row constructor with faked
cursor type.
- Issue #22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again
when a directory with the chosen name already exists on Windows as well as
on Unix. tempfile.mkstemp() now fails early if parent directory is not
valid (not exists or is a file) on Windows.
- Issue #6598: Increased time precision and random number range in
email.utils.make_msgid() to strengthen the uniqueness of the message ID.
- Issue #24091: Fixed various crashes in corner cases in C implementation of
ElementTree.
- Issue #21931: msilib.FCICreate() now raises TypeError in the case of a bad
argument instead of a ValueError with a bogus FCI error number.
Patch by Jeffrey Armstrong.
- Issue #23796: peek and read1 methods of BufferedReader now raise ValueError
if they called on a closed object. Patch by John Hergenroeder.
- Issue #24521: Fix possible integer overflows in the pickle module.
- Issue #22931: Allow '[' and ']' in cookie values.
- Issue #20274: Remove ignored and erroneous "kwargs" parameters from three
METH_VARARGS methods on _sqlite.Connection.
- Issue #24094: Fix possible crash in json.encode with poorly behaved dict
subclasses.
- Asyncio issue 222 / PR 231 (Victor Stinner) -- fix @coroutine
functions without __name__.
- Issue #9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes.
Patch written by William Orr.
- The keywords attribute of functools.partial is now always a dictionary.
- Issues #24099, #24100, and #24101: Fix free-after-use bug in heapq's siftup
and siftdown functions.
- Backport collections.deque fixes from Python 3.5. Prevents reentrant badness
during deletion by deferring the decref until the container has been restored
to a consistent state.
- Issue #23008: Fixed resolving attributes with boolean value is False in pydoc.
- Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't
increment unfinished tasks (this bug was introduced in 3.4.3 when
JoinableQueue was merged with Queue).
- Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncate them.
- Issue #23728: binascii.crc_hqx() could return an integer outside of the range
0-0xffff for empty data.
- Issue #23811: Add missing newline to the PyCompileError error message.
Patch by Alex Shkop.
- Issue #17898: Fix exception in gettext.py when parsing certain plural forms.
- Issue #22982: Improve BOM handling when seeking to multiple positions of
a writable text file.
- Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If they need to release multiple resources, all are
released even if errors occur.
- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if
the FTP connection failed to fix a ResourceWarning.
- Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not
available. Patch by Davin Potts.
- Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
returns bool. tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool.
- Issue #23338: Fixed formatting ctypes error messages on Cygwin.
Patch by Makoto Kato.
- Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
arbitrary precision integers added in Tcl 8.5.
- Issue #23834: Fix socket.sendto(), use the C Py_ssize_t type to store the
result of sendto() instead of the C int type.
- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
- Issue #23838: linecache now clears the cache and returns an empty result on
MemoryError.
- Issue #18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed
ambigious reverse mappings. Added many new mappings. Import mapping is no
longer applied to modules already mapped with full name mapping.
- Issue #23745: The new email header parser now handles duplicate MIME
parameter names without error, similar to how get_param behaves.
- Issue #23792: Ignore KeyboardInterrupt when the pydoc pager is active.
This mimics the behavior of the standard unix pagers, and prevents
pipepager from shutting down while the pager itself is still running.
- Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.
- Issue #21802: The reader in BufferedRWPair now is closed even when closing
writer failed in BufferedRWPair.close().
- Issue #23671: string.Template now allows to specify the "self" parameter as
keyword argument. string.Formatter now allows to specify the "self" and
the "format_string" parameters as keyword arguments.
- Issue #21560: An attempt to write a data of wrong type no longer cause
GzipFile corruption. Original patch by Wolfgang Maier.
- Issue #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes.
- Issue #23539: If body is None, http.client.HTTPConnection.request now sets
Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from
some web servers.
- Issue #22351: The nntplib.NNTP constructor no longer leaves the connection
and socket open until the garbage collector cleans them up. Patch by
Martin Panter.
- Issue #23136: _strptime now uniformly handles all days in week 0, including
Dec 30 of previous year. Based on patch by Jim Carroll.
- Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to
NamedTemporaryFile instance. Patch by Bohuslav Kabrda.
- Issue #22903: The fake test case created by unittest.loader when it fails
importing a test module is now picklable.
- Issue #23568: Add rdivmod support to MagicMock() objects.
Patch by Håkan Lövdahl.
- Issue #23138: Fixed parsing cookies with absent keys or values in cookiejar.
Patch by Demian Brecht.
- Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now
handle exceptions raised by an iterator. Patch by Alon Diamant and Davin
Potts.
- Issue #22928: Disabled HTTP header injections in http.client.
Original patch by Demian Brecht.
- Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with
imp.reload(). Patch by Thomas Kluyver.
- Issue #23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST
flag on certificate stores when it is available.
- Issue #23576: Avoid stalling in SSL reads when EOF has been reached in the
SSL layer but the underlying connection hasn't been closed.
- Issue #23504: Added an __all__ to the types module.
- Issue #20204: Added the __module__ attribute to _tkinter classes.
- Issue #23521: Corrected pure python implementation of timedelta division.
* Eliminated OverflowError from timedelta * float for some floats;
* Corrected rounding in timedelta true division.
- Issue #21619: Popen objects no longer leave a zombie after exit in the with
statement if the pipe was broken. Patch by Martin Panter.
- Issue #6639: Module-level turtle functions no longer raise TclError after
closing the window.
- Issues #814253, #9179: Warnings now are raised when group references and
conditional group references are used in lookbehind assertions in regular
expressions.
- Issue #23215: Multibyte codecs with custom error handlers that ignores errors
consumed too much memory and raised SystemError or MemoryError.
Original patch by Aleksi Torhamo.
- Issue #5700: io.FileIO() called flush() after closing the file.
flush() was not called in close() if closefd=False.
- Issue #23374: Fixed pydoc failure with non-ASCII files when stdout encoding
differs from file system encoding (e.g. on Mac OS).
- Issue #23481: Remove RC4 from the SSL module's default cipher list.
- Issue #21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty
docstrings.
- Issue #22885: Fixed arbitrary code execution vulnerability in the dbm.dumb
module. Original patch by Claudiu Popa.
- Issue #23146: Fix mishandling of absolute Windows paths with forward
slashes in pathlib.
- Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
- Issue #23367: Fix possible overflows in the unicodedata module.
- Issue #23361: Fix possible overflow in Windows subprocess creation code.
- Issue #23801: Fix issue where cgi.FieldStorage did not always ignore the
entire preamble to a multipart body.
- Issue #23310: Fix MagicMock's initializer to work with __methods__, just
like configure_mock(). Patch by Kasia Jachim.
- asyncio: New event loop APIs: set_task_factory() and get_task_factory().
- asyncio: async() function is deprecated in favour of ensure_future().
- Issue #23898: Fix inspect.classify_class_attrs() to support attributes
with overloaded __eq__ and __bool__. Patch by Mike Bayer.
- Issue #24298: Fix inspect.signature() to correctly unwrap wrappers
around bound methods.
- Issue #23572: Fixed functools.singledispatch on classes with falsy
metaclasses. Patch by Ethan Furman.
IDLE
----
- Issue 15348: Stop the debugger engine (normally in a user process)
before closing the debugger window (running in the IDLE process).
This prevents the RuntimeErrors that were being caught and ignored.
- Issue #24455: Prevent IDLE from hanging when a) closing the shell while the
debugger is active (15347); b) closing the debugger with the [X] button
(15348); and c) activating the debugger when already active (24455).
The patch by Mark Roseman does this by making two changes.
1. Suspend and resume the gui.interaction method with the tcl vwait
mechanism intended for this purpose (instead of root.mainloop & .quit).
2. In gui.run, allow any existing interaction to terminate first.
- Change 'The program' to 'Your program' in an IDLE 'kill program?' message
to make it clearer that the program referred to is the currently running
user program, not IDLE itself.
- Issue #24750: Improve the appearance of the IDLE editor window status bar.
Patch by Mark Roseman.
- Issue #25313: Change the handling of new built-in text color themes to better
address the compatibility problem introduced by the addition of IDLE Dark.
Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
- Issue #24782: Extension configuration is now a tab in the IDLE Preferences
dialog rather than a separate dialog. The former tabs are now a sorted
list. Patch by Mark Roseman.
- Issue #22726: Re-activate the config dialog help button with some content
about the other buttons and the new IDLE Dark theme.
- Issue #24820: IDLE now has an 'IDLE Dark' built-in text color theme.
It is more or less IDLE Classic inverted, with a cobalt blue background.
Strings, comments, keywords, ... are still green, red, orange, ... .
To use it with IDLEs released before November 2015, hit the
'Save as New Custom Theme' button and enter a new name,
such as 'Custom Dark'. The custom theme will work with any IDLE
release, and can be modified.
- Issue #25224: README.txt is now an idlelib index for IDLE developers and
curious users. The previous user content is now in the IDLE doc chapter.
'IDLE' now means 'Integrated Development and Learning Environment'.
- Issue #24820: Users can now set breakpoint colors in
Settings -> Custom Highlighting. Original patch by Mark Roseman.
- Issue #24972: Inactive selection background now matches active selection
background, as configured by users, on all systems. Found items are now
always highlighted on Windows. Initial patch by Mark Roseman.
- Issue #24570: Idle: make calltip and completion boxes appear on Macs
affected by a tk regression. Initial patch by Mark Roseman.
- Issue #24988: Idle ScrolledList context menus (used in debugger)
now work on Mac Aqua. Patch by Mark Roseman.
- Issue #24801: Make right-click for context menu work on Mac Aqua.
Patch by Mark Roseman.
- Issue #25173: Associate tkinter messageboxes with a specific widget.
For Mac OSX, make them a 'sheet'. Patch by Mark Roseman.
- Issue #25198: Enhance the initial html viewer now used for Idle Help.
* Properly indent fixed-pitch text (patch by Mark Roseman).
* Give code snippet a very Sphinx-like light blueish-gray background.
* Re-use initial width and height set by users for shell and editor.
* When the Table of Contents (TOC) menu is used, put the section header
at the top of the screen.
- Issue #25225: Condense and rewrite Idle doc section on text colors.
- Issue #21995: Explain some differences between IDLE and console Python.
- Issue #22820: Explain need for *print* when running file from Idle editor.
- Issue #25224: Doc: augment Idle feature list and no-subprocess section.
- Issue #25219: Update doc for Idle command line options.
Some were missing and notes were not correct.
- Issue #24861: Most of idlelib is private and subject to change.
Use idleib.idle.* to start Idle. See idlelib.__init__.__doc__.
- Issue #25199: Idle: add synchronization comments for future maintainers.
- Issue #16893: Replace help.txt with help.html for Idle doc display.
The new idlelib/help.html is rstripped Doc/build/html/library/idle.html.
It looks better than help.txt and will better document Idle as released.
The tkinter html viewer that works for this file was written by Mark Roseman.
The now unused EditorWindow.HelpDialog class and helt.txt file are deprecated.
- Issue #24199: Deprecate unused idlelib.idlever with possible removal in 3.6.
- Issue #24790: Remove extraneous code (which also create 2 & 3 conflicts).
- Issue #23672: Allow Idle to edit and run files with astral chars in name.
Patch by Mohd Sanad Zaki Rizvi.
- Issue 24745: Idle editor default font. Switch from Courier to
platform-sensitive TkFixedFont. This should not affect current customized
font selections. If there is a problem, edit $HOME/.idlerc/config-main.cfg
and remove 'fontxxx' entries from [Editor Window]. Patch by Mark Roseman.
- Issue #21192: Idle editor. When a file is run, put its name in the restart bar.
Do not print false prompts. Original patch by Adnan Umer.
- Issue #13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy.
- Issue #23184: remove unused names and imports in idlelib.
Initial patch by Al Sweigart.
Tests
-----
- Issue #25616: Tests for OrderedDict are extracted from test_collections
into separate file test_ordered_dict.
- Issue #25099: Make test_compileall not fail when an entry on sys.path cannot
be written to (commonly seen in administrative installs on Windows).
- Issue #24751: When running regrtest with the ``-w`` command line option,
a test run is no longer marked as a failure if all tests succeed when
re-run.
- Issue #21520: test_zipfile no longer fails if the word 'bad' appears
anywhere in the name of the current directory.
- Issue #23799: Added test.support.start_threads() for running and
cleaning up multiple threads.
- Issue #22390: test.regrtest now emits a warning if temporary files or
directories are left after running a test.
- Issue #23583: Added tests for standard IO streams in IDLE.
Build
-----
- Issue #23445: pydebug builds now use "gcc -Og" where possible, to make
the resulting executable faster.
- Issue #24603: Update Windows builds to use OpenSSL1.0.2d
and OS X 10.5 installer to use OpenSSL 1.0.2e.
C API
-----
- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
Documentation
-------------
- Issue #12067: Rewrite Comparisons section in the Expressions chapter of the
language reference. Some of the details of comparing mixed types were
incorrect or ambiguous. NotImplemented is only relevant at a lower level
than the Expressions chapter. Added details of comparing range() objects,
and default behaviour and consistency suggestions for user-defined classes.
Patch from Andy Maier.
- Issue #24952: Clarify the default size argument of stack_size() in
the "threading" and "_thread" modules. Patch from Mattip.
- Issue #24808: Update the types of some PyTypeObject fields. Patch by
Joseph Weston.
- Issue #22812: Fix unittest discovery examples.
Patch from Pam McA'Nulty.
- Issue #24129: Clarify the reference documentation for name resolution.
This includes removing the assumption that readers will be familiar with the
name resolution scheme Python used prior to the introduction of lexical
scoping for function namespaces. Patch by Ivan Levkivskyi.
- Issue #20769: Improve reload() docs. Patch by Dorian Pula.
- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
- Issue #24729: Correct IO tutorial to match implementation regarding
encoding parameter to open function.
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
- Issue #22155: Add File Handlers subsection with createfilehandler to tkinter
doc. Remove obsolete example from FAQ. Patch by Martin Panter.
- Issue #24029: Document the name binding behavior for submodule imports.
- Issue #24077: Fix typo in man page for -I command option: -s, not -S.
Tools/Demos
-----------
- Issue #25440: Fix output of python-config --extension-suffix.
- Issue #23330: h2py now supports arbitrary filenames in #include.
- Issue #24031: make patchcheck now supports git checkouts, too.
Windows
-------
- Issue #24306: Sets component ID for launcher to match 3.5 and later
to avoid downgrading.
- Issue #25022: Removed very outdated PC/example_nt/ directory.
What's New in Python 3.4.3?
===========================
Release date: 2015-02-23
Core and Builtins
-----------------
- Issue #22735: Fix many edge cases (including crashes) involving custom mro()
implementations.
- Issue #22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
and PyObject_AsWriteBuffer().
- Issue #21295: Revert some changes (issue #16795) to AST line numbers and
column offsets that constituted a regression.
- Issue #21408: The default __ne__() now returns NotImplemented if __eq__()
returned NotImplemented. Original patch by Martin Panter.
- Issue #23321: Fixed a crash in str.decode() when error handler returned
replacement string longer than malformed input data.
- Issue #23048: Fix jumping out of an infinite while loop in the pdb.
- Issue #20335: bytes constructor now raises TypeError when encoding or errors
is specified with non-string argument. Based on patch by Renaud Blanch.
- Issue #22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff
bytes on a 32-bit platform.
- Issue #22653: Fix an assertion failure in debug mode when doing a reentrant
dict insertion in debug mode.
- Issue #22643: Fix integer overflow in Unicode case operations (upper, lower,
title, swapcase, casefold).
- Issue #22604: Fix assertion error in debug mode when dividing a complex
number by (nan+0j).
- Issue #22470: Fixed integer overflow issues in "backslashreplace",
"xmlcharrefreplace", and "surrogatepass" error handlers.
- Issue #22520: Fix overflow checking when generating the repr of a unicode
object.
- Issue #22519: Fix overflow checking in PyBytes_Repr.
- Issue #22518: Fix integer overflow issues in latin-1 encoding.
- Issue #23165: Perform overflow checks before allocating memory in the
_Py_char2wchar function.
Library
-------
- Issue #23399: pyvenv creates relative symlinks where possible.
- Issue #23099: Closing io.BytesIO with exported buffer is rejected now to
prevent corrupting exported buffer.
- Issue #23363: Fix possible overflow in itertools.permutations.
- Issue #23364: Fix possible overflow in itertools.product.
- Issue #23366: Fixed possible integer overflow in itertools.combinations.
- Issue #23369: Fixed possible integer overflow in
_json.encode_basestring_ascii.
- Issue #23353: Fix the exception handling of generators in
PyEval_EvalFrameEx(). At entry, save or swap the exception state even if
PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception state
is now always restored or swapped, not only if why is WHY_YIELD or
WHY_RETURN. Patch co-written with Antoine Pitrou.
- Issue #18518: timeit now rejects statements which can't be compiled outside
a function or a loop (e.g. "return" or "break").
- Issue #23094: Fixed readline with frames in Python implementation of pickle.
- Issue #23268: Fixed bugs in the comparison of ipaddress classes.
- Issue #21408: Removed incorrect implementations of __ne__() which didn't
returned NotImplemented if __eq__() returned NotImplemented. The default
__ne__() now works correctly.
- Issue #19996: :class:`email.feedparser.FeedParser` now handles (malformed)
headers with no key rather than assuming the body has started.
- Issue #23248: Update ssl error codes from latest OpenSSL git master.
- Issue #23098: 64-bit dev_t is now supported in the os module.
- Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure"
as they are written in the standard.
- Issue #23063: In the distutils' check command, fix parsing of reST with code or
code-block directives.
- Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal
reference to the selector mapping to break a reference cycle. Initial patch
written by Martin Richard.
- Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The
availability of the function is checked during the compilation. Patch written
by Bernard Spil.
- Issue #20896, #22935: The :func:`ssl.get_server_certificate` function now
uses the :data:`~ssl.PROTOCOL_SSLv23` protocol by default, not
:data:`~ssl.PROTOCOL_SSLv3`, for maximum compatibility and support platforms
where :data:`~ssl.PROTOCOL_SSLv3` support is disabled.
- Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol
version.
- Issue #23132: Mitigate regression in speed and clarity in functools.total_ordering.
- Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
instead of reading /dev/urandom, to get pseudo-random bytes.
- Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and
fragment when it redirects to add a trailing slash.
- Issue #23093: In the io, module allow more operations to work on detached
streams.
- Issue #19104: pprint now produces evaluable output for wrapped strings.
- Issue #23071: Added missing names to codecs.__all__. Patch by Martin Panter.
- Issue #15513: Added a __sizeof__ implementation for pickle classes.
- Issue #19858: pickletools.optimize() now aware of the MEMOIZE opcode, can
produce more compact result and no longer produces invalid output if input
data contains MEMOIZE opcodes together with PUT or BINPUT opcodes.
- Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port
value in the host header was set to "None". Patch by Demian Brecht.
- Issue #23016: A warning no longer produces an AttributeError when the program
is run with pythonw.exe.
- Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception
handler assumed that that OSError objects always have a 'winerror' attribute.
That is not the case, so the exception handler itself raised AttributeError
when run on Linux (and, presumably, any other non-Windows OS).
Patch by Greg Ward.
- Issue #1218234: Fix inspect.getsource() to load updated source of
reloaded module. Initial patch by Berker Peksag.
- Issue #22959: In the constructor of http.client.HTTPSConnection, prefer the
context's check_hostname attribute over the *check_hostname* parameter.
- Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode
will return. This resolves CVE-2013-1753.
- Issue #22966: Fix __pycache__ pyc file name clobber when pyc_compile is
asked to compile a source file containing multiple dots in the source file
name.
- Issue #21971: Update turtledemo doc and add module to the index.
- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.
Original patch by Martin Panter.
- Issue #22960: Add a context argument to xmlrpclib.ServerProxy constructor.
- Issue #22915: SAX parser now supports files opened with file descriptor or
bytes path.
- Issue #22609: Constructors and update methods of mapping classes in the
collections module now accept the self keyword argument.
- Issue #22788: Add *context* parameter to logging.handlers.HTTPHandler.
- Issue #22921: Allow SSLContext to take the *hostname* parameter even if
OpenSSL doesn't support SNI.
- Issue #22894: TestCase.subTest() would cause the test suite to be stopped
when in failfast mode, even in the absence of failures.
- Issue #22638: SSLv3 is now disabled throughout the standard library.
It can still be enabled by instantiating a SSLContext manually.
- Issue #22370: Windows detection in pathlib is now more robust.
- Issue #22841: Reject coroutines in asyncio add_signal_handler().
Patch by Ludovic.Gasc.
- Issue #22849: Fix possible double free in the io.TextIOWrapper constructor.
- Issue #12728: Different Unicode characters having the same uppercase but
different lowercase are now matched in case-insensitive regular expressions.
- Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
platforms.
- Issue #22406: Fixed the uu_codec codec incorrectly ported to 3.x.
Based on patch by Martin Panter.
- Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat.
Based on patch by Aivars Kalvāns.
- Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
- Issue #22417: Verify certificates by default in httplib (PEP 476).
- Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2
and above. Patch by Tim Graham.
- Issue #22366: urllib.request.urlopen will accept a context object
(SSLContext) as an argument which will then used be for HTTPS connection.
Patch by Alex Gaynor.
- Issue #22776: Brought excluded code into the scope of a try block in
SysLogHandler.emit().
- Issue #22665: Add missing get_terminal_size and SameFileError to
shutil.__all__.
- Issue #17381: Fixed handling of case-insensitive ranges in regular
expressions.
- Issue #22410: Module level functions in the re module now cache compiled
locale-dependent regular expressions taking into account the locale.
- Issue #22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.)
now return False when the underlying stat call raises NotADirectoryError.
- Issue #8876: distutils now falls back to copying files when hard linking
doesn't work. This allows use with special filesystems such as VirtualBox
shared folders.
- Issue #18853: Fixed ResourceWarning in shlex.__nain__.
- Issue #9351: Defaults set with set_defaults on an argparse subparser
are no longer ignored when also set on the parent parser.
- Issue #21991: Make email.headerregistry's header 'params' attributes
be read-only (MappingProxyType). Previously the dictionary was modifiable
but a new one was created on each access of the attribute.
- Issue #22641: In asyncio, the default SSL context for client connections
is now created using ssl.create_default_context(), for stronger security.
- Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
- Issue #13096: Fixed segfault in CTypes POINTER handling of large
values.
- Issue #11694: Raise ConversionError in xdrlib as documented. Patch
by Filip Gruszczyński and Claudiu Popa.
- Issue #22462: Fix pyexpat's creation of a dummy frame to make it
appear in exception tracebacks.
- Issue #21173: Fix len() on a WeakKeyDictionary when .clear() was called
with an iterator alive.
- Issue #11866: Eliminated race condition in the computation of names
for new threads.
- Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules
is mutated while iterating. Patch by Olivier Grisel.
- Issue #22219: The zipfile module CLI now adds entries for directories
(including empty directories) in ZIP file.
- Issue #22449: In the ssl.SSLContext.load_default_certs, consult the
environmental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows.
- Issue #20076: Added non derived UTF-8 aliases to locale aliases table.
- Issue #20079: Added locales supported in glibc 2.18 to locale alias table.
- Issue #22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor
os.posix_fallocate() because their prototypes in system headers are wrong.
- Issue #22517: When an io.BufferedRWPair object is deallocated, clear its
weakrefs.
- Issue #22448: Improve canceled timer handles cleanup to prevent
unbound memory usage. Patch by Joshua Moore-Oliva.
- Issue #23009: Make sure selectors.EpollSelector.select() works when no
FD is registered.
IDLE
----
- Issue #20577: Configuration of the max line length for the FormatParagraph
extension has been moved from the General tab of the Idle preferences dialog
to the FormatParagraph tab of the Config Extensions dialog.
Patch by Tal Einat.
- Issue #16893: Update Idle doc chapter to match current Idle and add new
information.
- Issue #3068: Add Idle extension configuration dialog to Options menu.
Changes are written to HOME/.idlerc/config-extensions.cfg.
Original patch by Tal Einat.
- Issue #16233: A module browser (File : Class Browser, Alt+C) requires an
editor window with a filename. When Class Browser is requested otherwise,
from a shell, output window, or 'Untitled' editor, Idle no longer displays
an error box. It now pops up an Open Module box (Alt+M). If a valid name
is entered and a module is opened, a corresponding browser is also opened.
- Issue #4832: Save As to type Python files automatically adds .py to the
name you enter (even if your system does not display it). Some systems
automatically add .txt when type is Text files.
- Issue #21986: Code objects are not normally pickled by the pickle module.
To match this, they are no longer pickled when running under Idle.
- Issue #23180: Rename IDLE "Windows" menu item to "Window".
Patch by Al Sweigart.
Tests
-----
- Issue #23392: Added tests for marshal C API that works with FILE*.
- Issue #18982: Add tests for CLI of the calendar module.
- Issue #19548: Added some additional checks to test_codecs to ensure that
statements in the updated documentation remain accurate. Patch by Martin
Panter.
- Issue #22838: All test_re tests now work with unittest test discovery.
- Issue #22173: Update lib2to3 tests to use unittest test discovery.
- Issue #16000: Convert test_curses to use unittest.
- Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not
present. Patch by Remi Pointel.
- Issue #22770: Prevent some Tk segfaults on OS X when running gui tests.
- Issue #23211: Workaround test_logging failure on some OS X 10.6 systems.
- Issue #23345: Prevent test_ssl failures with large OpenSSL patch level
values (like 0.9.8zc).
- Issue #22289: Prevent test_urllib2net failures due to ftp connection timeout.
Build
-----
- Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure
script.
- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support
SSL 3.
- Issue #16537: Check whether self.extensions is empty in setup.py. Patch by
Jonathan Hosmer.
- Issue #18096: Fix library order returned by python-config.
- Issue #17219: Add library build dir for Python extension cross-builds.
- Issue #17128: Use private version of OpenSSL for 3.4.3 OS X 10.5+ installer.
C API
-----
- Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.
Documentation
-------------
- Issue #19548: Update the codecs module documentation to better cover the
distinction between text encodings and other codecs, together with other
clarifications. Patch by Martin Panter.
- Issue #22914: Update the Python 2/3 porting HOWTO to describe a more automated
approach.
- Issue #21514: The documentation of the json module now refers to new JSON RFC
7159 instead of obsoleted RFC 4627.
Tools/Demos
-----------
- Issue #22314: pydoc now works when the LINES environment variable is set.
Windows
-------
- Issue #17896: The Windows build scripts now expect external library sources
to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``.
- Issue #17717: The Windows build scripts now use a copy of NASM pulled from
svn.python.org to build OpenSSL.
- Issue #22644: The bundled version of OpenSSL has been updated to 1.0.1j.
What's New in Python 3.4.2?
===========================
Release date: 2014-10-06
Library
-------
- Issue #10510: distutils register and upload methods now use HTML standards
compliant CRLF line endings.
- Issue #9850: Fixed macpath.join() for empty first component. Patch by
Oleg Oshmyan.
- Issue #22427: TemporaryDirectory no longer attempts to clean up twice when
used in the with statement in generator.
- Issue #20912: Now directories added to ZIP file have correct Unix and MS-DOS
directory attributes.
- Issue #21866: ZipFile.close() no longer writes ZIP64 central directory
records if allowZip64 is false.
- Issue #22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
module. Removed trailing spaces in debugging output.
- Issue #22423: Unhandled exception in thread no longer causes unhandled
AttributeError when sys.stderr is None.
- Issue #21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects
line buffering, rather than block buffering. Patch by Akira Li.
What's New in Python 3.4.2rc1?
==============================
Release date: 2014-09-22
Core and Builtins
-----------------
- Issue #22258: Fix the internal function set_inheritable() on Illumos.
This platform exposes the function ``ioctl(FIOCLEX)``, but calling it fails
with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable()
now falls back to the slower ``fcntl()`` (``F_GETFD`` and then ``F_SETFD``).
- Issue #21669: With the aid of heuristics in SyntaxError.__init__, the
parser now attempts to generate more meaningful (or at least more search
engine friendly) error messages when "exec" and "print" are used as
statements.
- Issue #21642: In the conditional if-else expression, allow an integer written
with no space between itself and the ``else`` keyword (e.g. ``True if 42else
False``) to be valid syntax.
- Issue #21523: Fix over-pessimistic computation of the stack effect of
some opcodes in the compiler. This also fixes a quadratic compilation
time issue noticeable when compiling code with a large number of "and"
and "or" operators.
Library
-------
- Issue #21091: Fix API bug: email.message.EmailMessage.is_attachment is now
a method. Since EmailMessage is provisional, we can change the API in a
maintenance release, but we use a trick to remain backward compatible with
3.4.0/1.
- Issue #21079: Fix email.message.EmailMessage.is_attachment to return the
correct result when the header has parameters as well as a value.
- Issue #22247: Add NNTPError to nntplib.__all__.
- Issue #4180: The warnings registries are now reset when the filters
are modified.
- Issue #22419: Limit the length of incoming HTTP request in wsgiref server to
65536 bytes and send a 414 error code for higher lengths. Patch contributed
by Devin Cook.
- Lax cookie parsing in http.cookies could be a security issue when combined
with non-standard cookie handling in some web browsers. Reported by
Sergey Bobrov.
- Issue #22384: An exception in Tkinter callback no longer crashes the program
when it is run with pythonw.exe.
- Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
- Issue #21147: sqlite3 now raises an exception if the request contains a null
character instead of truncate it. Based on patch by Victor Stinner.
- Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
empty string or tuple argument.
- Issue #21951: Tkinter now most likely raises MemoryError instead of crash
if the memory allocation fails.
- Issue #22338: Fix a crash in the json module on memory allocation failure.
- Issue #22226: First letter no longer is stripped from the "status" key in
the result of Treeview.heading().
- Issue #19524: Fixed resource leak in the HTTP connection when an invalid
response is received. Patch by Martin Panter.
- Issue #22051: turtledemo no longer reloads examples to re-run them.
Initialization of variables and gui setup should be done in main(),
which is called each time a demo is run, but not on import.
- Issue #21933: Turtledemo users can change the code font size with a menu
selection or control(command) '-' or '+' or control-mousewheel.
Original patch by Lita Cho.
- Issue #21597: The separator between the turtledemo text pane and the drawing
canvas can now be grabbed and dragged with a mouse. The code text pane can
be widened to easily view or copy the full width of the text. The canvas
can be widened on small screens. Original patches by Jan Kanis and Lita Cho.
- Issue #18132: Turtledemo buttons no longer disappear when the window is
shrunk. Original patches by Jan Kanis and Lita Cho.
- Issue #22216: smtplib now resets its state more completely after a quit. The
most obvious consequence of the previous behavior was a STARTTLS failure
during a connect/starttls/quit/connect/starttls sequence.
- Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait()
caused by mutation of the waiters queue without holding the lock. Patch
by Doug Zongker.
- Issue #22182: Use e.args to unpack exceptions correctly in
distutils.file_util.move_file. Patch by Claudiu Popa.
- The webbrowser module now uses subprocess's start_new_session=True rather
than a potentially risky preexec_fn=os.setsid call.
- Issue #22236: Fixed Tkinter images copying operations in NoDefaultRoot mode.
- Issue #22191: Fix warnings.__all__.
- Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
- Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
- Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names.
- Issue #8797: Raise HTTPError on failed Basic Authentication immediately.
Initial patch by Sam Bull.
- Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems()
in the mailbox module.
- Issue #21448: Changed FeedParser feed() to avoid O(N**2) behavior when
parsing long line. Original patch by Raymond Hettinger.
- Issue #22184: The functools LRU Cache decorator factory now gives an earlier
and clearer error message when the user forgets the required parameters.
- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX. Based on patch by Delhallt.
- Issue #21121: Don't force 3rd party C extensions to be built with
-Werror=declaration-after-statement.
- Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in the
__new__() method.
- Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
- Issue #17172: Make turtledemo start as active on OS X even when run with
subprocess. Patch by Lita Cho.
- Issue #21704: Fix build error for _multiprocessing when semaphores
are not available. Patch by Arfrever Frehtes Taifersar Arahesis.
- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
on closed socket. repr(socket.socket) already works fine.
- Issue #16133: The asynchat.async_chat.handle_read() method now ignores
BlockingIOError exceptions.
- Issue #22044: Fixed premature DECREF in call_tzinfo_method.
Patch by Tom Flanagan.
- Issue #19884: readline: Disable the meta modifier key if stdout is not
a terminal to not write the ANSI sequence "\033[1034h" into stdout. This
sequence is used on some terminal (ex: TERM=xterm-256color") to enable
support of 8 bit characters.
- Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
- Issue #21044: tarfile.open() now handles fileobj with an integer 'name'
attribute. Based on patch by Antoine Pietri.
- Issue #21867: Prevent turtle crash due to invalid undo buffer size.
- Issue #19076: Don't pass the redundant 'file' argument to self.error().
- Issue #21942: Fixed source file viewing in pydoc's server mode on Windows.
- Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError
if the number of received bytes is negative.
- Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn't
get a bytes string
- Issue #21707: Add missing kwonlyargcount argument to
ModuleFinder.replace_paths_in_code().
- Issue #20639: calling Path.with_suffix('') allows removing the suffix
again. Patch by July Tikhonov.
- Issue #21714: Disallow the construction of invalid paths using
Path.with_name(). Original patch by Antony Lee.
- Issue #21897: Fix a crash with the f_locals attribute with closure
variables when frame.clear() has been called.
- Issue #21151: Fixed a segfault in the winreg module when ``None`` is passed
as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman.
- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
it ignored I/O errors if at least the first C call read() succeed.
- Issue #21781: ssl.RAND_add() now supports strings longer than 2 GB.
- Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
object is destroyed. The destructor now closes the file if needed. The
close() method can now be called twice: the second call does nothing.
- Issue #21858: Better handling of Python exceptions in the sqlite3 module.
- Issue #21476: Make sure the email.parser.BytesParser TextIOWrapper is
discarded after parsing, so the input file isn't unexpectedly closed.
- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
files closing. Patch by Claudiu Popa.
- Issue #21491: socketserver: Fix a race condition in child processes reaping.
- Issue #21832: Require named tuple inputs to be exact strings.
- Issue #19145: The times argument for itertools.repeat now handles
negative values the same way for keyword arguments as it does for
positional arguments.
- Issue #21812: turtle.shapetransform did not transform the turtle on the
first call. (Issue identified and fixed by Lita Cho.)
- Issue #21635: The difflib SequenceMatcher.get_matching_blocks() method
cache didn't match the actual result. The former was a list of tuples
and the latter was a list of named tuples.
- Issue #21722: The distutils "upload" command now exits with a non-zero
return code when uploading fails. Patch by Martin Dengler.
- Issue #21723: asyncio.Queue: support any type of number (ex: float) for the
maximum size. Patch written by Vajrasky Kok.
- Issue #21326: Add a new is_closed() method to asyncio.BaseEventLoop.
run_forever() and run_until_complete() methods of asyncio.BaseEventLoop now
raise an exception if the event loop was closed.
- Issue #21774: Fixed NameError for an incorrect variable reference in the
XML Minidom code for creating processing instructions.
(Found and fixed by Claudiu Popa.)
- Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths
before checking for a CGI script at that path.
- Issue #21310: Fixed possible resource leak in failed open().
- Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods.
- Issue #11709: Fix the pydoc.help function to not fail when sys.stdin is not a
valid file.
- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods
that use 'self' in the example code is generated correctly.
- Issue #21463: In urllib.request, fix pruning of the FTP cache.
- Issue #21618: The subprocess module could fail to close open fds that were
inherited by the calling process and already higher than POSIX resource
limits would otherwise allow. On systems with a functioning /proc/self/fd
or /dev/fd interface the max is now ignored and all fds are closed.
- Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
- Issue #14315: The zipfile module now ignores extra fields in the central
directory that are too short to be parsed instead of letting a struct.unpack
error bubble up as this "bad data" appears in many real world zip files in
the wild and is ignored by other zip tools.
- Issue #21402: tkinter.ttk now works when default root window is not set.
- Issue #10203: sqlite3.Row now truly supports sequence protocol. In particular
it supports reverse() and negative indices. Original patch by Claudiu Popa.
- Issue #18807: If copying (no symlinks) specified for a venv, then the python
interpreter aliases (python, python3) are now created by copying rather than
symlinking.
- Issue #14710: pkgutil.get_loader() no longer raises an exception when None is
found in sys.modules.
- Issue #14710: pkgutil.find_loader() no longer raises an exception when a
module doesn't exist.
- Issue #21481: Argparse equality and inequality tests now return
NotImplemented when comparing to an unknown type.
- Issue #8743: Fix interoperability between set objects and the
collections.Set() abstract base class.
- Issue #13355: random.triangular() no longer fails with a ZeroDivisionError
when low equals high.
- Issue #21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
- Issue #21801: Validate that __signature__ is None or an instance of Signature.
- Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler
due to possible uninitialized _config_vars.
- Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435. Patch by Zach Byrne.
Extension Modules
-----------------
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
architectures.
Build
-----
- Issue #15661: python.org OS X installers are now distributed as signed
installer packages compatible with the Gatekeeper security feature.
- Issue #21958: Define HAVE_ROUND when building with Visual Studio 2013 and
above. Patch by Zachary Turner.
- Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
now display special message when and only when there are failures.
- Issue #17095: Fix Modules/Setup *shared* support.
- Issue #21811: Anticipated fixes to support OS X versions > 10.9.
- Issue #21166: Prevent possible segfaults and other random failures of
python --generate-posix-vars in pybuilddir.txt build target.
IDLE
----
- Issue #17390: Adjust Editor window title; remove 'Python',
move version to end.
- Issue #14105: Idle debugger breakpoints no longer disappear
when inseting or deleting lines.
- Issue #17172: Turtledemo can now be run from Idle.
Currently, the entry is on the Help menu, but it may move to Run.
Patch by Ramchandra Apt and Lita Cho.
- Issue #21765: Add support for non-ascii identifiers to HyperParser.
- Issue #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav
Heblikar.
- Issue #18592: Add unittest for SearchDialogBase. Patch by Phil Webster.
- Issue #21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar.
- Issue #21686: add unittest for HyperParser. Original patch by Saimadhav
Heblikar.
- Issue #12387: Add missing upper(lower)case versions of default Windows key
bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy.
- Issue #21695: Closing a Find-in-files output window while the search is
still in progress no longer closes Idle.
- Issue #18910: Add unittest for textView. Patch by Phil Webster.
- Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
- Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster.
Tests
-----
- Issue #22166: With the assistance of a new internal _codecs._forget_codec
helping function, test_codecs now clears the encoding caches to avoid the
appearance of a reference leak
- Issue #22236: Tkinter tests now don't reuse default root window. New root
window is created for every test class.
- Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier
de Gaye.
- Issue #22060: test_ctypes has been somewhat cleaned up and simplified; it
now uses unittest test discovery to find its tests.
- Issue #22104: regrtest.py no longer holds a reference to the suite of tests
loaded from test modules that don't define test_main().
- Issue #22002: Added ``load_package_tests`` function to test.support and used
it to implement/augment test discovery in test_asyncio, test_email,
test_importlib, test_json, and test_tools.
- Issue #21976: Fix test_ssl to accept LibreSSL version strings. Thanks
to William Orr.
- Issue #21918: Converted test_tools from a module to a package containing
separate test files for each tested script.
- Issue #20155: Changed HTTP method names in failing tests in test_httpservers
so that packet filtering software (specifically Windows Base Filtering Engine)
does not interfere with the transaction semantics expected by the tests.
- Issue #19493: Refactored the ctypes test package to skip tests explicitly
rather than silently.
- Issue #18492: All resources are now allowed when tests are not run by
regrtest.py.
- Issue #21634: Fix pystone micro-benchmark: use floor division instead of true
division to benchmark integers instead of floating point numbers. Set pystone
version to 1.2. Patch written by Lennart Regebro.
- Issue #21605: Added tests for Tkinter images.
- Issue #21493: Added test for ntpath.expanduser(). Original patch by
Claudiu Popa.
- Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
- Issue #21522: Added Tkinter tests for Listbox.itemconfigure(),
PanedWindow.paneconfigure(), and Menu.entryconfigure().
Documentation
-------------
- Issue #21777: The binary sequence methods on bytes and bytearray are now
documented explicitly, rather than assuming users will be able to derive
the expected behaviour from the behaviour of the corresponding str methods.
Windows
-------
- Issue #21671, #22160, CVE-2014-0224: The bundled version of OpenSSL has been
updated to 1.0.1i.
- Issue #10747: Use versioned labels in the Windows start menu.
Patch by Olive Kilburn.
Tools/Demos
-----------
- Issue #22201: Command-line interface of the zipfile module now correctly
extracts ZIP files with directory entries. Patch by Ryan Wilson.
- Issue #21906: Make Tools/scripts/md5sum.py work in Python 3.
Patch by Zachary Ware.
- Issue #21629: Fix Argument Clinic's "--converters" feature.
What's New in Python 3.4.1?
===========================
Release date: 2014-05-18
Core and Builtins
-----------------
- Issue #21418: Fix a crash in the builtin function super() when called without
argument and without current frame (ex: embedded Python).
- Issue #21425: Fix flushing of standard streams in the interactive
interpreter.
- Issue #21435: In rare cases, when running finalizers on objects in cyclic
trash a bad pointer dereference could occur due to a subtle flaw in
internal iteration logic.
Library
-------
- Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial
shape.
- Issue #20998: Fixed re.fullmatch() of repeated single character pattern
with ignore case. Original patch by Matthew Barnett.
- Issue #21075: fileinput.FileInput now reads bytes from standard stream if
binary mode is specified. Patch by Sam Kimbrel.
- Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a
flush() on the underlying binary stream. Patch by akira.
- Issue #21470: Do a better job seeding the random number generator by
using enough bytes to span the full state space of the Mersenne Twister.
- Issue #21398: Fix an unicode error in the pydoc pager when the documentation
contains characters not encodable to the stdout encoding.
Tests
-----
- Issue #17756: Fix test_code test when run from the installed location.
- Issue #17752: Fix distutils tests when run from the installed location.
IDLE
----
- Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
consolidating and improving human-validated tests of Idle. Change other files
as needed to work with htest. Running the module as __main__ runs all tests.
What's New in Python 3.4.1rc1?
==============================
Release date: 2014-05-05
Core and Builtins
-----------------
- Issue #21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c.
- Issue #21209: Fix sending tuples to custom generator objects with the yield
from syntax.
- Issue #21134: Fix segfault when str is called on an uninitialized
UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object.
- Issue #19537: Fix PyUnicode_DATA() alignment under m68k. Patch by
Andreas Schwab.
- Issue #20929: Add a type cast to avoid shifting a negative number.
- Issue #20731: Properly position in source code files even if they
are opened in text mode. Patch by Serhiy Storchaka.
- Issue #20637: Key-sharing now also works for instance dictionaries of
subclasses. Patch by Peter Ingebretson.
- Issue #12546: Allow ``\x00`` to be used as a fill character when using str, int,
float, and complex __format__ methods.
- Issue #13598: Modify string.Formatter to support auto-numbering of
replacement fields. It now matches the behavior of str.format() in
this regard. Patches by Phil Elson and Ramchandra Apte.
Library
-------
- Issue #21088: Bugfix for curses.window.addch() regression in 3.4.0.
In porting to Argument Clinic, the first two arguments were reversed.
- Issue #21469: Reduced the risk of false positives in robotparser by
checking to make sure that robots.txt has been read or does not exist
prior to returning True in can_fetch().
- Issue #21321: itertools.islice() now releases the reference to the source
iterator when the slice is exhausted. Patch by Anton Afanasyev.
- Issue #9815: assertRaises now tries to clear references to local variables
in the exception's traceback.
- Issue #13204: Calling sys.flags.__new__ would crash the interpreter,
now it raises a TypeError.
- Issue #19385: Make operations on a closed dbm.dumb database always raise the
same exception.
- Issue #21207: Detect when the os.urandom cached fd has been closed or
replaced, and open it anew.
- Issue #21291: subprocess's Popen.wait() is now thread safe so that
multiple threads may be calling wait() or poll() on a Popen instance
at the same time without losing the Popen.returncode value.
- Issue #21127: Path objects can now be instantiated from str subclass
instances (such as ``numpy.str_``).
- Issue #15002: urllib.response object to use _TemporaryFileWrapper (and
_TemporaryFileCloser) facility. Provides a better way to handle file
descriptor close. Patch contributed by Christian Theune.
- Issue #12220: mindom now raises a custom ValueError indicating it doesn't
support spaces in URIs instead of letting a 'split' ValueError bubble up.
- Issue #21239: patch.stopall() didn't work deterministically when the same
name was patched more than once.
- Issue #21222: Passing name keyword argument to mock.create_autospec now
works.
- Issue #21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
- Issue #17498: Some SMTP servers disconnect after certain errors, violating
strict RFC conformance. Instead of losing the error code when we issue the
subsequent RSET, smtplib now returns the error code and defers raising the
SMTPServerDisconnected error until the next command is issued.
- Issue #17826: setting an iterable side_effect on a mock function created by
create_autospec now works. Patch by Kushal Das.
- Issue #7776: Fix ``Host:`` header and reconnection when using
http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
- Issue #20968: unittest.mock.MagicMock now supports division.
Patch by Johannes Baiter.
- Issue #21529 (CVE-2014-4616): Fix arbitrary memory access in
JSONDecoder.raw_decode with a negative second parameter. Bug reported by Guido
Vranken.
- Issue #21169: getpass now handles non-ascii characters that the
input stream encoding cannot encode by re-encoding using the
replace error handler.
- Issue #21171: Fixed undocumented filter API of the rot13 codec.
Patch by Berker Peksag.
- Issue #21172: isinstance check relaxed from dict to collections.Mapping.
- Issue #21155: asyncio.EventLoop.create_unix_server() now raises a ValueError
if path and sock are specified at the same time.
- Issue #21149: Improved thread-safety in logging cleanup during interpreter
shutdown. Thanks to Devin Jeanpierre for the patch.
- Issue #20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a
TypeError if the second argument is not a string or compiled regex.
- Issue #21058: Fix a leak of file descriptor in
:func:`tempfile.NamedTemporaryFile`, close the file descriptor if
:func:`io.open` fails
- Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing.
- Issue #21013: Enhance ssl.create_default_context() when used for server side
sockets to provide better security by default.
- Issue #20633: Replace relative import by absolute import.
- Issue #20980: Stop wrapping exception when using ThreadPool.
- Issue #21082: In os.makedirs, do not set the process-wide umask. Note this
changes behavior of makedirs when exist_ok=True.
- Issue #20990: Fix issues found by pyflakes for multiprocessing.
- Issue #21015: SSL contexts will now automatically select an elliptic
curve for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise
default to "prime256v1".
- Issue #20995: Enhance default ciphers used by the ssl module to enable
better security an prioritize perfect forward secrecy.
- Issue #20884: Don't assume that __file__ is defined on importlib.__init__.
- Issue #21499: Ignore __builtins__ in several test_importlib.test_api tests.
- Issue #20879: Delay the initialization of encoding and decoding tables for
base32, ascii85 and base85 codecs in the base64 module, and delay the
initialization of the unquote_to_bytes() table of the urllib.parse module, to
not waste memory if these modules are not used.
- Issue #19157: Include the broadcast address in the usuable hosts for IPv6
in ipaddress.
- Issue #11599: When an external command (e.g. compiler) fails, distutils now
prints out the whole command line (instead of just the command name) if the
environment variable DISTUTILS_DEBUG is set.
- Issue #4931: distutils should not produce unhelpful "error: None" messages
anymore. distutils.util.grok_environment_error is kept but doc-deprecated.
- Issue #20875: Prevent possible gzip "'read' is not defined" NameError.
Patch by Claudiu Popa.
- Issue #11558: ``email.message.Message.attach`` now returns a more
useful error message if ``attach`` is called on a message for which
``is_multipart`` is False.
- Issue #20283: RE pattern methods now accept the string keyword parameters
as documented. The pattern and source keyword parameters are left as
deprecated aliases.
- Issue #20778: Fix modulefinder to work with bytecode-only modules.
- Issue #20791: copy.copy() now doesn't make a copy when the input is
a bytes object. Initial patch by Peter Otten.
- Issue #19748: On AIX, time.mktime() now raises an OverflowError for year
outsize range [1902; 2037].
- Issue #20816: Fix inspect.getcallargs() to raise correct TypeError for
missing keyword-only arguments. Patch by Jeremiah Lowin.
- Issue #20817: Fix inspect.getcallargs() to fail correctly if more
than 3 arguments are missing. Patch by Jeremiah Lowin.
- Issue #6676: Ensure a meaningful exception is raised when attempting
to parse more than one XML document per pyexpat xmlparser instance.
(Original patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with
suggested wording by David Gutteridge)
- Issue #21117: Fix inspect.signature to better support functools.partial.
Due to the specifics of functools.partial implementation,
positional-or-keyword arguments passed as keyword arguments become
keyword-only.
- Issue #21209: Fix asyncio.tasks.CoroWrapper to workaround a bug
in yield-from implementation in CPythons prior to 3.4.1.
- asyncio: Add gi_{frame,running,code} properties to CoroWrapper
(upstream issue #163).
- Issue #21311: Avoid exception in _osx_support with non-standard compiler
configurations. Patch by John Szakmeister.
- Issue #11571: Ensure that the turtle window becomes the topmost window
when launched on OS X.
Extension Modules
-----------------
- Issue #21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd.
- Issue #21226: Set up modules properly in PyImport_ExecCodeModuleObject
(and friends).
IDLE
----
- Issue #21139: Change default paragraph width to 72, the PEP 8 recommendation.
- Issue #21284: Paragraph reformat test passes after user changes reformat width.
- Issue #17654: Ensure IDLE menus are customized properly on OS X for
non-framework builds and for all variants of Tk.
Build
-----
- The Windows build now includes OpenSSL 1.0.1g
- Issue #21285: Refactor and fix curses configure check to always search
in a ncursesw directory.
- Issue #15234: For BerkeleyDB and Sqlite, only add the found library and
include directories if they aren't already being searched. This avoids
an explicit runtime library dependency.
- Issue #20644: OS X installer build support for documentation build changes
in 3.4.1: assume externally supplied sphinx-build is available in /usr/bin.
C API
-----
- Issue #20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to
match what importlib does; this affects _frozen_importlib as well as any
module loaded using imp.init_frozen().
Documentation
-------------
- Issue #17386: Expanded functionality of the ``Doc/make.bat`` script to make
it much more comparable to ``Doc/Makefile``.
- Issue #21043: Remove the recommendation for specific CA organizations and to
mention the ability to load the OS certificates.
- Issue #20765: Add missing documentation for PurePath.with_name() and
PurePath.with_suffix().
- Issue #19407: New package installation and distribution guides based on
the Python Packaging Authority tools. Existing guides have been retained
as legacy links from the distutils docs, as they still contain some
required reference material for tool developers that isn't recorded
anywhere else.
- Issue #19697: Document cases where __main__.__spec__ is None.
Tests
-----
- Issue #18604: Consolidated checks for GUI availability. All platforms now
at least check whether Tk can be instantiated when the GUI resource is
requested.
- Issue #21275: Fix a socket test on KFreeBSD.
- Issue #21223: Pass test_site/test_startup_imports when some of the extensions
are built as builtins.
- Issue #20635: Added tests for Tk geometry managers.
- Add test case for freeze.
- Issue #20743: Fix a reference leak in test_tcl.
- Issue #21097: Move test_namespace_pkgs into test_importlib.
- Issue #20939: Avoid various network test failures due to new
redirect of http://www.python.org/ to https://www.python.org:
use http://www.example.com instead.
- Issue #20668: asyncio tests no longer rely on tests.txt file.
(Patch by Vajrasky Kok)
- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
copy of libz exists in $HOME/lib or /usr/local/lib.
Tools/Demos
-----------
- Add support for ``yield from`` to 2to3.
- Add support for the PEP 465 matrix multiplication operator to 2to3.
- Issue #16047: Fix module exception list and __file__ handling in freeze.
Patch by Meador Inge.
- Issue #11824: Consider ABI tags in freeze. Patch by Meador Inge.
- Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.
Patch by Arfrever Frehtes Taifersar Arahesis.
What's New in Python 3.4.0?
===========================
Release date: 2014-03-16
Library
-------
- Issue #20939: Fix test_geturl failure in test_urllibnet due to
new redirect of http://www.python.org/ to https://www.python.org.
Documentation
-------------
- Merge in all documentation changes since branching 3.4.0rc1.
What's New in Python 3.4.0 release candidate 3?
===============================================
Release date: 2014-03-09
Core and Builtins
-----------------
- Issue #20786: Fix signatures for dict.__delitem__ and
property.__delete__ builtins.
Library
-------
- Issue #20839: Don't trigger a DeprecationWarning in the still supported
pkgutil.get_loader() API when __loader__ isn't set on a module (nor
when pkgutil.find_loader() is called directly).
Build
-----
- Issue #14512: Launch pydoc -b instead of pydocgui.pyw on Windows.
- Issue #20748: Uninstalling pip does not leave behind the pyc of
the uninstaller anymore.
- Issue #20568: The Windows installer now installs the unversioned ``pip``
command in addition to the versioned ``pip3`` and ``pip3.4`` commands.
- Issue #20757: The ensurepip helper for the Windows uninstaller now skips
uninstalling pip (rather than failing) if the user has updated pip to a
different version from the one bundled with ensurepip.
- Issue #20465: Update OS X and Windows installer builds to use
SQLite 3.8.3.1.
What's New in Python 3.4.0 release candidate 2?
===============================================
Release date: 2014-02-23
Core and Builtins
-----------------
- Issue #20625: Parameter names in __annotations__ were not mangled properly.
Discovered by Jonas Wielicki, patch by Yury Selivanov.
- Issue #20261: In pickle, lookup __getnewargs__ and __getnewargs_ex__ on the
type of the object.
- Issue #20619: Give the AST nodes of keyword-only arguments a column and line
number.
- Issue #20526: Revert changes of issue #19466 which introduces a regression:
don't clear anymore the state of Python threads early during the Python
shutdown.
Library
-------
- Issue #20710: The pydoc summary line no longer displays the "self" parameter
for bound methods.
- Issue #20566: Change asyncio.as_completed() to use a Queue, to
avoid O(N**2) behavior.
- Issue #20704: Implement new debug API in asyncio. Add new methods
BaseEventLoop.set_debug() and BaseEventLoop.get_debug().
Add support for setting 'asyncio.tasks._DEBUG' variable with
'PYTHONASYNCIODEBUG' environment variable.
- asyncio: Refactoring and fixes: BaseEventLoop.sock_connect() raises an
error if the address is not resolved; use __slots__ in Handle and
TimerHandle; as_completed() and wait() raise TypeError if the passed
list of Futures is a single Future; call_soon() and other 'call_*()'
functions raise TypeError if the passed callback is a coroutine
function; _ProactorBasePipeTransport uses _FlowControlMixin;
WriteTransport.set_write_buffer_size() calls _maybe_pause_protocol()
to consider pausing receiving if the watermark limits have changed;
fix _check_resolved_address() for IPv6 address; and other minor
improvements, along with multiple documentation updates.
- Issue #20684: Fix inspect.getfullargspec() to not to follow __wrapped__
chains. Make its behaviour consistent with bound methods first argument.
Patch by Nick Coghlan and Yury Selivanov.
- Issue #20681: Add new error handling API in asyncio. New APIs:
loop.set_exception_handler(), loop.default_exception_handler(), and
loop.call_exception_handler().
- Issue #20673: Implement support for UNIX Domain Sockets in asyncio.
New APIs: loop.create_unix_connection(), loop.create_unix_server(),
streams.open_unix_connection(), and streams.start_unix_server().
- Issue #20616: Add a format() method to tracemalloc.Traceback.
- Issue #19744: the ensurepip installation step now just prints a warning to
stderr rather than failing outright if SSL/TLS is unavailable. This allows
local installation of POSIX builds without SSL/TLS support.
- Issue #20594: Avoid name clash with the libc function posix_close.
Build
-----
- Issue #20641: Run MSI custom actions (pip installation, pyc compilation)
with the NoImpersonate flag, to support elevated execution (UAC).
- Issue #20221: Removed conflicting (or circular) hypot definition when
compiled with VS 2010 or above. Initial patch by Tabrez Mohammed.
- Issue #20609: Restored the ability to build 64-bit Windows binaries on
32-bit Windows, which was broken by the change in issue #19788.
What's New in Python 3.4.0 release candidate 1?
===============================================
Release date: 2014-02-10
Core and Builtins
-----------------
- Issue #19255: The builtins module is restored to initial value before
cleaning other modules. The sys and builtins modules are cleaned last.
- Issue #20588: Make Python-ast.c C89 compliant.
- Issue #20437: Fixed 22 potential bugs when deleting objects references.
- Issue #20500: Displaying an exception at interpreter shutdown no longer
risks triggering an assertion failure in PyObject_Str.
- Issue #20538: UTF-7 incremental decoder produced inconsistent string when
input was truncated in BASE64 section.
- Issue #20404: io.TextIOWrapper (and hence the open() builtin) now uses the
internal codec marking system added for issue #19619 to throw LookupError
for known non-text encodings at stream construction time. The existing
output type checks remain in place to deal with unmarked third party
codecs.
- Issue #17162: Add PyType_GetSlot.
- Issue #20162: Fix an alignment issue in the siphash24() hash function which
caused a crash on PowerPC 64-bit (ppc64).
Library
-------
- Issue #20530: The signatures for slot builtins have been updated
to reflect the fact that they only accept positional-only arguments.
- Issue #20517: Functions in the os module that accept two filenames
now register both filenames in the exception on failure.
- Issue #20563: The ipaddress module API is now considered stable.
- Issue #14983: email.generator now always adds a line end after each MIME
boundary marker, instead of doing so only when there is an epilogue. This
fixes an RFC compliance bug and solves an issue with signed MIME parts.
- Issue #20540: Fix a performance regression (vs. Python 3.2) when layering
a multiprocessing Connection over a TCP socket. For small payloads, Nagle's
algorithm would introduce idle delays before the entire transmission of a
message.
- Issue #16983: the new email header parsing code will now decode encoded words
that are (incorrectly) surrounded by quotes, and register a defect.
- Issue #19772: email.generator no longer mutates the message object when
doing a down-transform from 8bit to 7bit CTEs.
- Issue #20536: the statistics module now correctly handle Decimal instances
with positive exponents
- Issue #18805: the netmask/hostmask parsing in ipaddress now more reliably
filters out illegal values and correctly allows any valid prefix length.
- Issue #20481: For at least Python 3.4, the statistics module will require
that all inputs for a single operation be of a single consistent type, or
else a mixed of ints and a single other consistent type. This avoids
some interoperability issues that arose with the previous approach of
coercing to a suitable common type.
- Issue #20478: the statistics module now treats collections.Counter inputs
like any other iterable.
- Issue #17369: get_filename was raising an exception if the filename
parameter's RFC2231 encoding was broken in certain ways. This was
a regression relative to python2.
- Issue #20013: Some imap servers disconnect if the current mailbox is
deleted, and imaplib did not handle that case gracefully. Now it
handles the 'bye' correctly.
- Issue #20531: Revert 3.4 version of fix for #19063, and apply the 3.3
version. That is, do *not* raise an error if unicode is passed to
email.message.Message.set_payload.
- Issue #20476: If a non-compat32 policy is used with any of the email parsers,
EmailMessage is now used as the factory class. The factory class should
really come from the policy; that will get fixed in 3.5.
- Issue #19920: TarFile.list() no longer fails when outputs a listing
containing non-encodable characters. Based on patch by Vajrasky Kok.
- Issue #20515: Fix NULL pointer dereference introduced by issue #20368.
- Issue #19186: Restore namespacing of expat symbols inside the pyexpat module.
- Issue #20053: ensurepip (and hence venv) are no longer affected by the
settings in the default pip configuration file.
- Issue #20426: When passing the re.DEBUG flag, re.compile() displays the
debug output every time it is called, regardless of the compilation cache.
- Issue #20368: The null character now correctly passed from Tcl to Python.
Improved error handling in variables-related commands.
- Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline
translation settings.
- tracemalloc: Fix slicing traces and fix slicing a traceback.
- Issue #20354: Fix an alignment issue in the tracemalloc module on 64-bit
platforms. Bug seen on 64-bit Linux when using "make profile-opt".
- Issue #17159: inspect.signature now accepts duck types of functions,
which adds support for Cython functions. Initial patch by Stefan Behnel.
- Issue #18801: Fix inspect.classify_class_attrs to correctly classify
object.__new__ and object.__init__.
- Fixed cmath.isinf's name in its argument parsing code.
- Issue #20311, #20452: poll and epoll now round the timeout away from zero,
instead of rounding towards zero, in select and selectors modules:
select.epoll.poll(), selectors.PollSelector.poll() and
selectors.EpollSelector.poll(). For example, a timeout of one microsecond
(1e-6) is now rounded to one millisecondi (1e-3), instead of being rounded to
zero. However, the granularity property and asyncio's resolution feature
were removed again.
- asyncio: Some refactoring; various fixes; add write flow control to
unix pipes; Future.set_exception() instantiates the exception
argument if it is a class; improved proactor pipe transport; support
wait_for(f, None); don't log broken/disconnected pipes; use
ValueError instead of assert for forbidden subprocess_{shell,exec}
arguments; added a convenience API for subprocess management; added
StreamReader.at_eof(); properly handle duplicate coroutines/futures
in gather(), wait(), as_completed(); use a bytearray for buffering
in StreamReader; and more.
- Issue #20288: fix handling of invalid numeric charrefs in HTMLParser.
- Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
- Issue #20308: inspect.signature now works on classes without user-defined
__init__ or __new__ methods.
- Issue #20372: inspect.getfile (and a bunch of other inspect functions that
use it) doesn't crash with unexpected AttributeError on classes defined in C
without __module__.
- Issue #20356: inspect.signature formatting uses '/' to separate
positional-only parameters from others.
- Issue #20223: inspect.signature now supports methods defined with
functools.partialmethods.
- Issue #19456: ntpath.join() now joins relative paths correctly when a drive
is present.
- Issue #19077: tempfile.TemporaryDirectory cleanup no longer fails when
called during shutdown. Emitting resource warning in __del__ no longer fails.
Original patch by Antoine Pitrou.
- Issue #20394: Silence Coverity warning in audioop module.
- Issue #20367: Fix behavior of concurrent.futures.as_completed() for
duplicate arguments. Patch by Glenn Langford.
- Issue #8260: The read(), readline() and readlines() methods of
codecs.StreamReader returned incomplete data when were called after
readline() or read(size). Based on patch by Amaury Forgeot d'Arc.
- Issue #20105: the codec exception chaining now correctly sets the
traceback of the original exception as its __traceback__ attribute.
- Issue #17481: inspect.getfullargspec() now uses inspect.signature() API.
- Issue #15304: concurrent.futures.wait() can block forever even if
Futures have completed. Patch by Glenn Langford.
- Issue #14455: plistlib: fix serializing integers in the range
of an unsigned long long but outside of the range of signed long long for
binary plist files.
IDLE
----
- Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka.
- Update the python.gif icon for the Idle classbrowser and pathbowser
from the old green snake to the new blue and yellow snakes.
- Issue #17721: Remove non-functional configuration dialog help button until we
make it actually gives some help when clicked. Patch by Guilherme Simões.
Tests
-----
- Issue #20532: Tests which use _testcapi now are marked as CPython only.
- Issue #19920: Added tests for TarFile.list(). Based on patch by Vajrasky Kok.
- Issue #19990: Added tests for the imghdr module. Based on patch by
Claudiu Popa.
- Issue #20474: Fix test_socket "unexpected success" failures on OS X 10.7+.
Tools/Demos
-----------
- Issue #20530: Argument Clinic's signature format has been revised again.
The new syntax is highly human readable while still preventing false
positives. The syntax also extends Python syntax to denote "self" and
positional-only parameters, allowing inspect.Signature objects to be
totally accurate for all supported builtins in Python 3.4.
- Issue #20456: Argument Clinic now observes the C preprocessor conditional
compilation statements of the C files it parses. When a Clinic block is
inside a conditional code, it adjusts its output to match, including
automatically generating an empty methoddef macro.
- Issue #20456: Cloned functions in Argument Clinic now use the correct
name, not the name of the function they were cloned from, for text
strings inside generated code.
- Issue #20456: Fixed Argument Clinic's test suite and "--converters" feature.
- Issue #20456: Argument Clinic now allows specifying different names
for a parameter in Python and C, using "as" on the parameter line.
- Issue #20326: Argument Clinic now uses a simple, unique signature to
annotate text signatures in docstrings, resulting in fewer false
positives. "self" parameters are also explicitly marked, allowing
inspect.Signature() to authoritatively detect (and skip) said parameters.
- Issue #20326: Argument Clinic now generates separate checksums for the
input and output sections of the block, allowing external tools to verify
that the input has not changed (and thus the output is not out-of-date).
Build
-----
- Issue #20465: Update SQLite shipped with OS X installer to 3.8.3.
C-API
-----
- Issue #20517: Added new functions allowing OSError exceptions to reference
two filenames instead of one: PyErr_SetFromErrnoWithFilenameObjects() and
PyErr_SetExcFromWindowsErrWithFilenameObjects().
Documentation
-------------
- Issue #20488: Change wording to say importlib is *the* implementation of
import instead of just *an* implementation.
- Issue #6386: Clarify in the tutorial that specifying a symlink to execute
means the directory containing the executed script and not the symlink is
added to sys.path.
What's New in Python 3.4.0 Beta 3?
==================================
Release date: 2014-01-26
Core and Builtins
-----------------
- Issue #20189: Four additional builtin types (PyTypeObject,
PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type)
have been modified to provide introspection information for builtins.
- Issue #17825: Cursor "^" is correctly positioned for SyntaxError and
IndentationError.
- Issue #2382: SyntaxError cursor "^" is now written at correct position in most
cases when multibyte characters are in line (before "^"). This still not
works correctly with wide East Asian characters.
- Issue #18960: The first line of Python script could be executed twice when
the source encoding was specified on the second line. Now the source encoding
declaration on the second line isn't effective if the first line contains
anything except a comment. 'python -x' works now again with files with the
source encoding declarations, and can be used to make Python batch files
on Windows.
Library
-------
- asyncio: Various improvements and small changes not all covered by
issues listed below. E.g. wait_for() now cancels the inner task if
the timeout occcurs; tweaked the set of exported symbols; renamed
Empty/Full to QueueEmpty/QueueFull; "with (yield from lock)" now
uses a separate context manager; readexactly() raises if not enough
data was read; PTY support tweaks.
- Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum
between the resolution of the BaseEventLoop.time() method and the resolution
of the selector. The granuarility is used in the scheduler to round time and
deadline.
- Issue #20311: selectors: Add a resolution attribute to BaseSelector.
- Issue #20189: unittest.mock now no longer assumes that any object for
which it could get an inspect.Signature is a callable written in Python.
Fix courtesy of Michael Foord.
- Issue #20317: ExitStack.__exit__ could create a self-referential loop if an
exception raised by a cleanup operation already had its context set
correctly (for example, by the @contextmanager decorator). The infinite
loop this caused is now avoided by checking if the expected context is
already set before trying to fix it.
- Issue #20374: Fix build with GNU readline >= 6.3.
- Issue #20262: Warnings are raised now when duplicate names are added in the
ZIP file or too long ZIP file comment is truncated.
- Issue #20165: The unittest module no longer considers tests marked with
@expectedFailure successful if they pass.
- Issue #18574: Added missing newline in 100-Continue reply from
http.server.BaseHTTPRequestHandler. Patch by Nikolaus Rath.
- Issue #20270: urllib.urlparse now supports empty ports.
- Issue #20243: TarFile no longer raise ReadError when opened in write mode.
- Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn't
write complete output on close.
- Issue #20245: The open functions in the tarfile module now correctly handle
empty mode.
- Issue #20242: Fixed basicConfig() format strings for the alternative
formatting styles. Thanks to kespindler for the bug report and patch.
- Issue #20246: Fix buffer overflow in socket.recvfrom_into.
- Issues #20206 and #5803: Fix edge case in email.quoprimime.encode where it
truncated lines ending in a character needing encoding but no newline by
using a more efficient algorithm that doesn't have the bug.
- Issue #19082: Working xmlrpc.server and xmlrpc.client examples. Both in
modules and in documentation. Initial patch contributed by Vajrasky Kok.
- Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri()
functions now conform to PEP 3333 when handle non-ASCII URLs.
- Issue #19097: Raise the correct Exception when cgi.FieldStorage is given an
invalid fileobj.
- Issue #20152: Ported Python/import.c over to Argument Clinic.
- Issue #13107: argparse and optparse no longer raises an exception when output
a help on environment with too small COLUMNS. Based on patch by
Elazar Gershuni.
- Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly
asked for.
- Issue #18960: The tokenize module now ignore the source encoding declaration
on the second line if the first line contains anything except a comment.
- Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
consumption.
- Issue #20113: os.readv() and os.writev() now raise an OSError exception on
error instead of returning -1.
- Issue #19719: Make importlib.abc.MetaPathFinder.find_module(),
PathEntryFinder.find_loader(), and Loader.load_module() use PEP 451 APIs to
help with backwards-compatibility.
- Issue #20144: inspect.Signature now supports parsing simple symbolic
constants as parameter default values in __text_signature__.
- Issue #20072: Fixed multiple errors in tkinter with wantobjects is False.
- Issue #20229: Avoid plistlib deprecation warning in platform.mac_ver().
- Issue #14455: Fix some problems with the new binary plist support in plistlib.
IDLE
----
- Issue #17390: Add Python version to Idle editor window title bar.
Original patches by Edmond Burnett and Kent Johnson.
- Issue #18960: IDLE now ignores the source encoding declaration on the second
line if the first line contains anything except a comment.
Tests
-----
- Issue #20358: Tests for curses.window.overlay and curses.window.overwrite
no longer specify min{row,col} > max{row,col}.
- Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
- Issue #19886: Use better estimated memory requirements for bigmem tests.
Tools/Demos
-----------
- Issue #20390: Argument Clinic's "file" output preset now defaults to
"{dirname}/clinic/{basename}.h".
- Issue #20390: Argument Clinic's "class" directive syntax has been extended
with two new required arguments: "typedef" and "type_object".
- Issue #20390: Argument Clinic: If __new__ or __init__ functions didn't use
kwargs (or args), the PyArg_NoKeywords (or PyArg_NoPositional) calls
generated are only run when the type object is an exact match.
- Issue #20390: Argument Clinic now fails if you have required parameters after
optional parameters.
- Issue #20390: Argument Clinic converters now have a new template they can
inject code into: "modifiers". Code put there is run in the parsing
function after argument parsing but before the call to the impl.
- Issue #20376: Argument Clinic now escapes backslashes in docstrings.
- Issue #20381: Argument Clinic now sanity checks the default argument when
c_default is also specified, providing a nice failure message for
disallowed values.
- Issue #20189: Argument Clinic now ensures that parser functions for
__new__ are always of type newfunc, the type of the tp_new slot.
Similarly, parser functions for __init__ are now always of type initproc,
the type of tp_init.
- Issue #20189: Argument Clinic now suppresses the docstring for __new__
and __init__ functions if no docstring is provided in the input.
- Issue #20189: Argument Clinic now suppresses the "self" parameter in the
impl for @staticmethod functions.
- Issue #20294: Argument Clinic now supports argument parsing for __new__ and
__init__ functions.
- Issue #20299: Argument Clinic custom converters may now change the default
value of c_default and py_default with a class member.
- Issue #20287: Argument Clinic's output is now configurable, allowing
delaying its output or even redirecting it to a separate file.
- Issue #20226: Argument Clinic now permits simple expressions
(e.g. "sys.maxsize - 1") as default values for parameters.
- Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them. Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface. Fixed
shebang lines in the unittestgui and checkpip scripts.
- Issue #20268: Argument Clinic now supports cloning the parameters and
return converter of existing functions.
- Issue #20228: Argument Clinic now has special support for class special
methods.
- Issue #20214: Fixed a number of small issues and documentation errors in
Argument Clinic (see issue for details).
- Issue #20196: Fixed a bug where Argument Clinic did not generate correct
parsing code for functions with positional-only parameters where all arguments
are optional.
- Issue #18960: 2to3 and the findnocoding.py script now ignore the source
encoding declaration on the second line if the first line contains anything
except a comment.
- Issue #19723: The marker comments Argument Clinic uses have been changed
to improve readability.
- Issue #20157: When Argument Clinic renames a parameter because its name
collides with a C keyword, it no longer exposes that rename to PyArg_Parse.
- Issue #20141: Improved Argument Clinic's support for the PyArg_Parse "O!"
format unit.
- Issue #20144: Argument Clinic now supports simple symbolic constants
as parameter default values.
- Issue #20143: The line numbers reported in Argument Clinic errors are
now more accurate.
- Issue #20142: Py_buffer variables generated by Argument Clinic are now
initialized with a default value.
Build
-----
- Issue #12837: Silence a tautological comparison warning on OS X under Clang in
socketmodule.c.
What's New in Python 3.4.0 Beta 2?
==================================
Release date: 2014-01-05
Core and Builtins
-----------------
- Issue #17432: Drop UCS2 from names of Unicode functions in python3.def.
- Issue #19526: Exclude all new API from the stable ABI. Exceptions can be
made if a need is demonstrated.
- Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c"
argument is not in range [0; 255].
- Issue #19995: %c, %o, %x, and %X now issue a DeprecationWarning on non-integer
input; reworded docs to clarify that an integer type should define both __int__
and __index__.
- Issue #19787: PyThread_set_key_value() now always set the value. In Python
3.3, the function did nothing if the key already exists (if the current value
is a non-NULL pointer).
- Issue #14432: Remove the thread state field from the frame structure. Fix a
crash when a generator is created in a C thread that is destroyed while the
generator is still used. The issue was that a generator contains a frame, and
the frame kept a reference to the Python state of the destroyed C thread. The
crash occurs when a trace function is setup.
- Issue #19576: PyGILState_Ensure() now initializes threads. At startup, Python
has no concrete GIL. If PyGILState_Ensure() is called from a new thread for
the first time and PyEval_InitThreads() was not called yet, a GIL needs to be
created.
- Issue #17576: Deprecation warning emitted now when __int__() or __index__()
return not int instance.
- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes.
- Issue #19736: Add module-level statvfs constants defined for GNU/glibc
based systems.
- Issue #20097: Fix bad use of "self" in importlib's WindowsRegistryFinder.
- Issue #19729: In str.format(), fix recursive expansion in format spec.
- Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2
billion characters) input strings in _Py_dg_strtod.
Library
-------
- Issue #20154: Deadlock in asyncio.StreamReader.readexactly().
- Issue #16113: Remove sha3 module again.
- Issue #20111: pathlib.Path.with_suffix() now sanity checks the given suffix.
- Fix breakage in TestSuite.countTestCases() introduced by issue #11798.
- Issue #20108: Avoid parameter name clash in inspect.getcallargs().
- Issue #19918: Fix PurePath.relative_to() under Windows.
- Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl
module, rather than silently let them emit clear text data.
- Issue #20046: Locale alias table no longer contains entities which can be
calculated. Generalized support of the euro modifier.
- Issue #20027: Fixed locale aliases for devanagari locales.
- Issue #20067: Tkinter variables now work when wantobjects is false.
- Issue #19020: Tkinter now uses splitlist() instead of split() in configure
methods.
- Issue #19744: ensurepip now provides a better error message when Python is
built without SSL/TLS support (pip currently requires that support to run,
even if only operating with local wheel files)
- Issue #19734: ensurepip now ignores all pip environment variables to avoid
odd behaviour based on user configuration settings
- Fix TypeError on "setup.py upload --show-response".
- Issue #20045: Fix "setup.py register --list-classifiers".
- Issue #18879: When a method is looked up on a temporary file, avoid closing
the file before the method is possibly called.
- Issue #20037: Avoid crashes when opening a text file late at interpreter
shutdown.
- Issue #19967: Thanks to the PEP 442, asyncio.Future now uses a
destructor to log uncaught exceptions, instead of the dedicated
_TracebackLogger class.
- Added a Task.current_task() class method to asyncio.
- Issue #19850: Set SA_RESTART in asyncio when registering a signal
handler to limit EINTR occurrences.
- Implemented write flow control in asyncio for proactor event loop (Windows).
- Change write buffer in asyncio use to avoid O(N**2) behavior. Make
write()/sendto() accept bytearray/memoryview.
- Issue #20034: Updated alias mapping to most recent locale.alias file
from X.org distribution using makelocalealias.py.
- Issue #5815: Fixed support for locales with modifiers. Fixed support for
locale encodings with hyphens.
- Issue #20026: Fix the sqlite module to handle correctly invalid isolation
level (wrong type).
- Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and
quotechar fields. Original patch by Vajrasky Kok.
- Issue #19855: uuid.getnode() on Unix now looks on the PATH for the
executables used to find the mac address, with /sbin and /usr/sbin as
fallbacks.
- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
- Issue #19946: multiprocessing now uses runpy to initialize __main__ in
child processes when necessary, allowing it to correctly handle scripts
without suffixes and submodules that use explicit relative imports or
otherwise rely on parent modules being correctly imported prior to
execution.
- Issue #19921: When Path.mkdir() is called with parents=True, any missing
parent is created with the default permissions, ignoring the mode argument
(mimicking the POSIX "mkdir -p" command).
- Issue #19887: Improve the Path.resolve() algorithm to support certain
symlink chains.
- Issue #19912: Fixed numerous bugs in ntpath.splitunc().
- Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character
(U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE).
- Issue #19532: python -m compileall with no filename/directory arguments now
respects the -f and -q flags instead of ignoring them.
- Issue #19623: Fixed writing to unseekable files in the aifc module.
- Issue #19946: multiprocessing.spawn now raises ImportError when the module to
be used as the main module cannot be imported.
- Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX.
Fixed integer overflow in the eventmask parameter.
- Issue #19063: if a Charset's body_encoding was set to None, the email
package would generate a message claiming the Content-Transfer-Encoding
was 7bit, and produce garbage output for the content. This now works.
A couple of other set_payload mishandlings of non-ASCII are also fixed.
In addition, calling set_payload with a string argument without
specifying a charset now raises an error (this is a new error in 3.4).
- Issue #15475: Add __sizeof__ implementations for itertools objects.
- Issue #19944: Fix importlib.find_spec() so it imports parents as needed
and move the function to importlib.util.
- Issue #19880: Fix a reference leak in unittest.TestCase. Explicitly break
reference cycles between frames and the _Outcome instance.
- Issue #17429: platform.linux_distribution() now decodes files from the UTF-8
encoding with the surrogateescape error handler, instead of decoding from the
locale encoding in strict mode. It fixes the function on Fedora 19 which is
probably the first major distribution release with a non-ASCII name. Patch
written by Toshio Kuratomi.
- Issue #19343: Expose FreeBSD-specific APIs in resource module. Original
patch by Koobs.
- Issue #19929: Call os.read with 32768 within subprocess.Popen.communicate
rather than 4096 for efficiency. A microbenchmark shows Linux and OS X
both using ~50% less cpu time this way.
- Issue #19506: Use a memoryview to avoid a data copy when piping data
to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
- Issue #19876: selectors unregister() no longer raises ValueError or OSError
if the FD is closed (as long as it was registered).
- Issue #19908: pathlib now joins relative Windows paths correctly when a drive
is present. Original patch by Antoine Pitrou.
- Issue #19296: Silence compiler warning in dbm_open
- Issue #6784: Strings from Python 2 can now be unpickled as bytes
objects by setting the encoding argument of Unpickler to be 'bytes'.
Initial patch by Merlijn van Deen.
- Issue #19839: Fix regression in bz2 module's handling of non-bzip2 data at
EOF, and analogous bug in lzma module.
- Issue #19881: Fix pickling bug where cpickle would emit bad pickle data for
large bytes string (i.e., with size greater than 2**32-1).
- Issue #19138: doctest's IGNORE_EXCEPTION_DETAIL now allows a match when
no exception detail exists (no colon following the exception's name, or
a colon does follow but no text follows the colon).
- Issue #19927: Add __eq__ to path-based loaders in importlib.
- Issue #19827: On UNIX, setblocking() and settimeout() methods of
socket.socket can now avoid a second syscall if the ioctl() function can be
used, or if the non-blocking flag of the socket is unchanged.
- Issue #19785: smtplib now supports SSLContext.check_hostname and server name
indication for TLS/SSL connections.
- Issue #19784: poplib now supports SSLContext.check_hostname and server name
indication for TLS/SSL connections.
- Issue #19783: nntplib now supports SSLContext.check_hostname and server name
indication for TLS/SSL connections.
- Issue #19782: imaplib now supports SSLContext.check_hostname and server name
indication for TLS/SSL connections.
- Issue #20123: Fix pydoc.synopsis() for "binary" modules.
- Issue #19834: Support unpickling of exceptions pickled by Python 2.
- Issue #19781: ftplib now supports SSLContext.check_hostname and server name
indication for TLS/SSL connections.
- Issue #19509: Add SSLContext.check_hostname to match the peer's certificate
with server_hostname on handshake.
- Issue #15798: Fixed subprocess.Popen() to no longer fail if file
descriptor 0, 1 or 2 is closed.
- Issue #17897: Optimized unpickle prefetching.
- Issue #3693: Make the error message more helpful when the array.array()
constructor is given a str. Move the array module typecode documentation to
the docstring of the constructor.
- Issue #19088: Fixed incorrect caching of the copyreg module in
object.__reduce__() and object.__reduce_ex__().
- Issue #19698: Removed exec_module() methods from
importlib.machinery.BuiltinImporter and ExtensionFileLoader.
- Issue #18864: Added a setter for ModuleSpec.has_location.
- Fixed _pickle.Unpickler to not fail when loading empty strings as
persistent IDs.
- Issue #11480: Fixed copy.copy to work with classes with custom metaclasses.
Patch by Daniel Urban.
- Issue #6477: Added support for pickling the types of built-in singletons
(i.e., Ellipsis, NotImplemented, None).
- Issue #19713: Add remaining PEP 451-related deprecations and move away
from using find_module/find_loaer/load_module.
- Issue #19708: Update pkgutil to use the new importer APIs.
- Issue #19703: Update pydoc to use the new importer APIs.
- Issue #19851: Fixed a regression in reloading sub-modules.
- ssl.create_default_context() sets OP_NO_COMPRESSION to prevent CRIME.
- Issue #19802: Add socket.SO_PRIORITY.
- Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with
virtual interface. Original patch by Kent Frazier.
- Issue #11489: JSON decoder now accepts lone surrogates.
- Issue #19545: Avoid chained exceptions while passing stray % to
time.strptime(). Initial patch by Claudiu Popa.
IDLE
----
- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
- Issue #19481: print() of string subclass instance in IDLE no longer hangs.
- Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial
shell window is present.
Tests
-----
- Issue #20055: Fix test_shutil under Windows with symlink privileges held.
Patch by Vajrasky Kok.
- Issue #20070: Don't run test_urllib2net when network resources are not
enabled.
- Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been
disabled since 3.0 due to the changes in listcomp handling.
- Issue #19320: test_tcl no longer fails when wantobjects is false.
- Issue #19919: Fix flaky SSL test. connect_ex() sometimes returns
EWOULDBLOCK on Windows or VMs hosted on Windows.
- Issue #19912: Added tests for ntpath.splitunc().
- Issue #19828: Fixed test_site when the whole suite is run with -S.
- Issue #19928: Implemented a test for repr() of cell objects.
- Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, and
test_statistics when python is run with -OO.
- Issue #19926: Removed unneeded test_main from test_abstract_numbers.
Patch by Vajrasky Kok.
- Issue #19572: More skipped tests explicitly marked as skipped.
- Issue #19595, #19987: Re-enabled a long-disabled test in test_winsound.
- Issue #19588: Fixed tests in test_random that were silently skipped most
of the time. Patch by Julian Gindi.
Build
-----
- Issue #19728: Enable pip installation by default on Windows.
- Issue #16136: Remove VMS support
- Issue #18215: Add script Tools/ssl/test_multiple_versions.py to compile and
run Python's unit tests with multiple versions of OpenSSL.
- Issue #19922: define _INCLUDE__STDC_A1_SOURCE in HP-UX to include mbstate_t
for mbrtowc().
- Issue #19788: kill_python(_d).exe is now run as a PreBuildEvent on the
pythoncore sub-project. This should prevent build errors due a previous
build's python(_d).exe still running.
Documentation
-------------
- Issue #20265: Updated some parts of the Using Windows document.
- Issue #20266: Updated some parts of the Windows FAQ.
- Issue #20255: Updated the about and bugs pages.
- Issue #20253: Fixed a typo in the ipaddress docs that advertised an
illegal attribute name. Found by INADA Naoki.
- Issue #18840: Introduce the json module in the tutorial, and de-emphasize
the pickle module.
- Issue #19845: Updated the Compiling Python on Windows section.
- Issue #19795: Improved markup of True/False constants.
Tools/Demos
-----------
- Issue #19659: Added documentation for Argument Clinic.
- Issue #19976: Argument Clinic METH_NOARGS functions now always
take two parameters.
What's New in Python 3.4.0 Beta 1?
==================================
Release date: 2013-11-24
Core and Builtins
-----------------
- Use the repr of a module name in more places in import, especially
exceptions.
- Issue #19619: str.encode, bytes.decode and bytearray.decode now use an
internal API to throw LookupError for known non-text encodings, rather
than attempting the encoding or decoding operation and then throwing a
TypeError for an unexpected output type. (The latter mechanism remains
in place for third party non-text encodings)
- Issue #19183: Implement PEP 456 'secure and interchangeable hash algorithm'.
Python now uses SipHash24 on all major platforms.
- Issue #12892: The utf-16* and utf-32* encoders no longer allow surrogate code
points (U+D800-U+DFFF) to be encoded. The utf-32* decoders no longer decode
byte sequences that correspond to surrogate code points. The surrogatepass
error handler now works with the utf-16* and utf-32* codecs. Based on
patches by Victor Stinner and Kang-Hao (Kenny) Lu.
- Issue #17806: Added keyword-argument support for "tabsize" to
str/bytes.expandtabs().
- Issue #17828: Output type errors in str.encode(), bytes.decode() and
bytearray.decode() now direct users to codecs.encode() or codecs.decode()
as appropriate.
- Issue #17828: The interpreter now attempts to chain errors that occur in
codec processing with a replacement exception of the same type that
includes the codec name in the error message. It ensures it only does this
when the creation of the replacement exception won't lose any information.
- Issue #19466: Clear the frames of daemon threads earlier during the
Python shutdown to call objects destructors. So "unclosed file" resource
warnings are now correctly emitted for daemon threads.
- Issue #19514: Deduplicate some _Py_IDENTIFIER declarations.
Patch by Andrei Dorian Duma.
- Issue #17936: Fix O(n**2) behaviour when adding or removing many subclasses
of a given type.
- Issue #19428: zipimport now handles errors when reading truncated or invalid
ZIP archive.
- Issue #18408: Add a new PyFrame_FastToLocalsWithError() function to handle
exceptions when merging fast locals into f_locals of a frame.
PyEval_GetLocals() now raises an exception and return NULL on failure.
- Issue #19369: Optimized the usage of __length_hint__().
- Issue #18603: Ensure that PyOS_mystricmp and PyOS_mystrnicmp are in the
Python executable and not removed by the linker's optimizer.
- Issue #19306: Add extra hints to the faulthandler module's stack
dumps that these are "upside down".
Library
-------
- Issue #3158: doctest can now find doctests in functions and methods
written in C.
- Issue #13477: Added command line interface to the tarfile module.
Original patch by Berker Peksag.
- Issue #19674: inspect.signature() now produces a correct signature
for some builtins.
- Issue #19722: Added opcode.stack_effect(), which
computes the stack effect of bytecode instructions.
- Issue #19735: Implement private function ssl._create_stdlib_context() to
create SSLContext objects in Python's stdlib module. It provides a single
configuration point and makes use of SSLContext.load_default_certs().
- Issue #16203: Add re.fullmatch() function and regex.fullmatch() method,
which anchor the pattern at both ends of the string to match.
Original patch by Matthew Barnett.
- Issue #13592: Improved the repr for regular expression pattern objects.
Based on patch by Hugo Lopes Tavares.
- Issue #19641: Added the audioop.byteswap() function to convert big-endian
samples to little-endian and vice versa.
- Issue #15204: Deprecated the 'U' mode in file-like objects.
- Issue #17810: Implement PEP 3154, pickle protocol 4.
- Issue #19668: Added support for the cp1125 encoding.
- Issue #19689: Add ssl.create_default_context() factory function. It creates
a new SSLContext object with secure default settings.
- Issue #19727: os.utime(..., None) is now potentially more precise
under Windows.
- Issue #17201: ZIP64 extensions now are enabled by default. Patch by
William Mallard.
- Issue #19292: Add SSLContext.load_default_certs() to load default root CA
certificates from default stores or system stores. By default the method
loads CA certs for authentication of server certs.
- Issue #19673: Add pathlib to the stdlib as a provisional module (PEP 428).
- Issue #16596: pdb in a generator now properly skips over yield and
yield from rather than stepping out of the generator into its
caller. (This is essential for stepping through asyncio coroutines.)
- Issue #17916: Added dis.Bytecode.from_traceback() and
dis.Bytecode.current_offset to easily display "current instruction"
markers in the new disassembly API (Patch by Claudiu Popa).
- Issue #19552: venv now supports bootstrapping pip into virtual environments
- Issue #17134: Finalize interface to Windows' certificate store. Cert and
CRL enumeration are now two functions. enum_certificates() also returns
purpose flags as set of OIDs.
- Issue #19555: Restore sysconfig.get_config_var('SO'), (and the distutils
equivalent) with a DeprecationWarning pointing people at $EXT_SUFFIX.
- Issue #8813: Add SSLContext.verify_flags to change the verification flags
of the context in order to enable certification revocation list (CRL)
checks or strict X509 rules.
- Issue #18294: Fix the zlib module to make it 64-bit safe.
- Issue #19682: Fix compatibility issue with old version of OpenSSL that
was introduced by Issue #18379.
- Issue #14455: plistlib now supports binary plists and has an updated API.
- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on
big-endian platforms.
- Issue #18379: SSLSocket.getpeercert() returns CA issuer AIA fields, OCSP
and CRL distribution points.
- Issue #18138: Implement cadata argument of SSLContext.load_verify_location()
to load CA certificates and CRL from memory. It supports PEM and DER
encoded strings.
- Issue #18775: Add name and block_size attribute to HMAC object. They now
provide the same API elements as non-keyed cryptographic hash functions.
- Issue #17276: MD5 as default digestmod for HMAC is deprecated. The HMAC
module supports digestmod names, e.g. hmac.HMAC('sha1').
- Issue #19449: in csv's writerow, handle non-string keys when generating the
error message that certain keys are not in the 'fieldnames' list.
- Issue #13633: Added a new convert_charrefs keyword arg to HTMLParser that,
when True, automatically converts all character references.
- Issue #2927: Added the unescape() function to the html module.
- Issue #8402: Added the escape() function to the glob module.
- Issue #17618: Add Base85 and Ascii85 encoding/decoding to the base64 module.
- Issue #19634: time.strftime("%y") now raises a ValueError on AIX when given a
year before 1900.
- Fix test.support.bind_port() to not cause an error when Python was compiled
on a system with SO_REUSEPORT defined in the headers but run on a system
with an OS kernel that does not support that reasonably new socket option.
- Fix compilation error under gcc of the ctypes module bundled libffi for arm.
- Issue #19448: Add private API to SSL module to lookup ASN.1 objects by OID,
NID, short name and long name.
- Issue #19282: dbm.open now supports the context management protocol. (Initial
patch by Claudiu Popa)
- Issue #8311: Added support for writing any bytes-like objects in the aifc,
sunau, and wave modules.
- Issue #5202: Added support for unseekable files in the wave module.
- Issue #19544 and Issue #1180: Restore global option to ignore
~/.pydistutils.cfg in Distutils, accidentally removed in backout of
distutils2 changes.
- Issue #19523: Closed FileHandler leak which occurred when delay was set.
- Issue #19544 and Issue #6516: Restore support for --user and --group
parameters to sdist command accidentally rolled back as part of the
distutils2 rollback.
- Issue #13674: Prevented time.strftime from crashing on Windows when given
a year before 1900 and a format of %y.
- Issue #19406: implementation of the ensurepip module (part of PEP 453).
Patch by Donald Stufft and Nick Coghlan.
- Issue #19544 and Issue #6286: Restore use of urllib over http allowing use
of http_proxy for Distutils upload command, a feature accidentally lost
in the rollback of distutils2.
- Issue #19544 and Issue #7457: Restore the read_pkg_file method to
distutils.dist.DistributionMetadata accidentally removed in the undo of
distutils2.
- Issue #16685: Added support for any bytes-like objects in the audioop module.
Removed support for strings.
- Issue #7171: Add Windows implementation of ``inet_ntop`` and ``inet_pton``
to socket module. Patch by Atsuo Ishimoto.
- Issue #19261: Added support for writing 24-bit samples in the sunau module.
- Issue #1097797: Added CP273 encoding, used on IBM mainframes in
Germany and Austria. Mapping provided by Michael Bierenfeld.
- Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms.
- Issue #19378: Fixed a number of cases in the dis module where the new
"file" parameter was not being honoured correctly
- Issue #19378: Removed the "dis.Bytecode.show_info" method
- Issue #19378: Renamed the "dis.Bytecode.display_code" method to
"dis.Bytecode.dis" and converted it to returning a string rather than
printing output.
- Issue #19378: the "line_offset" parameter in the new "dis.get_instructions"
API has been renamed to "first_line" (and the default value and usage
changed accordingly). This should reduce confusion with the more common use
of "offset" in the dis docs to refer to bytecode offsets.
- Issue #18678: Corrected spwd struct member names in spwd module:
sp_nam->sp_namp, and sp_pwd->sp_pwdp. The old names are kept as extra
structseq members, for backward compatibility.
- Issue #6157: Fixed tkinter.Text.debug(). tkinter.Text.bbox() now raises
TypeError instead of TclError on wrong number of arguments. Original patch
by Guilherme Polo.
- Issue #10197: Rework subprocess.get[status]output to use subprocess
functionality and thus to work on Windows. Patch by Nick Coghlan
- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of
integers instead of a string. Based on patch by Guilherme Polo.
- Issue #19403: contextlib.redirect_stdout is now reentrant
- Issue #19286: Directories in ``package_data`` are no longer added to
the filelist, preventing failure outlined in the ticket.
- Issue #19480: HTMLParser now accepts all valid start-tag names as defined
by the HTML5 standard.
- Issue #15114: The html.parser module now raises a DeprecationWarning when the
strict argument of HTMLParser or the HTMLParser.error method are used.
- Issue #19410: Undo the special-casing removal of '' for
importlib.machinery.FileFinder.
- Issue #19424: Fix the warnings module to accept filename containing surrogate
characters.
- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler.
- Issue #19227: Remove pthread_atfork() handler. The handler was added to
solve #18747 but has caused issues.
- Issue #19420: Fix reference leak in module initialization code of
_hashopenssl.c
- Issue #19329: Optimized compiling charsets in regular expressions.
- Issue #19227: Try to fix deadlocks caused by re-seeding then OpenSSL
pseudo-random number generator on fork().
- Issue #16037: HTTPMessage.readheaders() raises an HTTPException when more than
100 headers are read. Adapted from patch by Jyrki Pulliainen.
- Issue #16040: CVE-2013-1752: nntplib: Limit maximum line lengths to 2048 to
prevent readline() calls from consuming too much memory. Patch by Jyrki
Pulliainen.
- Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
prevent readline() calls from consuming too much memory. Patch by Jyrki
Pulliainen.
- Issue #17997: Change behavior of ``ssl.match_hostname()`` to follow RFC 6125,
for security reasons. It now doesn't match multiple wildcards nor wildcards
inside IDN fragments.
- Issue #16039: CVE-2013-1752: Change use of readline in imaplib module to limit
line length. Patch by Emil Lind.
- Issue #19330: the unnecessary wrapper functions have been removed from the
implementations of the new contextlib.redirect_stdout and
contextlib.suppress context managers, which also ensures they provide
reasonable help() output on instances
- Issue #19393: Fix symtable.symtable function to not be confused when there are
functions or classes named "top".
- Issue #18685: Restore re performance to pre-PEP 393 levels.
- Issue #19339: telnetlib module is now using time.monotonic() when available
to compute timeout.
- Issue #19399: fix sporadic test_subprocess failure.
- Issue #13234: Fix os.listdir to work with extended paths on Windows.
Patch by Santoso Wijaya.
- Issue #19375: The site module adding a "site-python" directory to sys.path,
if it exists, is now deprecated.
- Issue #19379: Lazily import linecache in the warnings module, to make
startup with warnings faster until a warning gets printed.
- Issue #19288: Fixed the "in" operator of dbm.gnu databases for string
argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
- Issue #19287: Fixed the "in" operator of dbm.ndbm databases for string
argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
- Issue #19327: Fixed the working of regular expressions with too big charset.
- Issue #17400: New 'is_global' attribute for ipaddress to tell if an address
is allocated by IANA for global or private networks.
- Issue #19350: Increasing the test coverage of macurl2path. Patch by Colin
Williams.
- Issue #19365: Optimized the parsing of long replacement string in re.sub*()
functions.
- Issue #19352: Fix unittest discovery when a module can be reached
through several paths (e.g. under Debian/Ubuntu with virtualenv).
- Issue #15207: Fix mimetypes to read from correct part of Windows registry
Original patch by Dave Chambers
- Issue #16595: Add prlimit() to resource module.
- Issue #19324: Expose Linux-specific constants in resource module.
- Load SSL's error strings in hashlib.
- Issue #18527: Upgrade internal copy of zlib to 1.2.8.
- Issue #19274: Add a filterfunc parameter to PyZipFile.writepy.
- Issue #8964: fix platform._sys_version to handle IronPython 2.6+.
Patch by Martin Matusiak.
- Issue #19413: Restore pre-3.3 reload() semantics of re-finding modules.
- Issue #18958: Improve error message for json.load(s) while passing a string
that starts with a UTF-8 BOM.
- Issue #19307: Improve error message for json.load(s) while passing objects
of the wrong type.
- Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by
limiting the call to readline(). Original patch by Michał
Jastrzębski and Giampaolo Rodola.
- Issue #17087: Improved the repr for regular expression match objects.
Tests
-----
- Issue #19664: test_userdict's repr test no longer depends on the order
of dict elements.
- Issue #19440: Clean up test_capi by removing an unnecessary __future__
import, converting from test_main to unittest.main, and running the
_testcapi module tests as subTests of a unittest TestCase method.
- Issue #19378: the main dis module tests are now run with both stdout
redirection *and* passing an explicit file parameter
- Issue #19378: removed the not-actually-helpful assertInstructionMatches
and assertBytecodeExactlyMatches helpers from bytecode_helper
- Issue #18702: All skipped tests now reported as skipped.
- Issue #19439: interpreter embedding tests are now executed on Windows
(Patch by Zachary Ware)
- Issue #19085: Added basic tests for all tkinter widget options.
- Issue #19384: Fix test_py_compile for root user, patch by Claudiu Popa.
Documentation
-------------
- Issue #18326: Clarify that list.sort's arguments are keyword-only. Also,
attempt to reduce confusion in the glossary by not saying there are
different "types" of arguments and parameters.
Build
-----
- Issue #19358: "make clinic" now runs the Argument Clinic preprocessor
over all CPython source files.
- Update SQLite to 3.8.1, xz to 5.0.5, and Tcl/Tk to 8.6.1 on Windows.
- Issue #16632: Enable DEP and ASLR on Windows.
- Issue #17791: Drop PREFIX and EXEC_PREFIX definitions from PC/pyconfig.h
- Add workaround for VS 2010 nmake clean issue. VS 2010 doesn't set up PATH
for nmake.exe correctly.
- Issue #19550: Implement Windows installer changes of PEP 453 (ensurepip).
- Issue #19520: Fix compiler warning in the _sha3 module on 32bit Windows.
- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
word in some C compilers.
- Issue #15792: Correct build options on Win64. Patch by Jeremy Kloth.
- Issue #19373: Apply upstream change to Tk 8.5.15 fixing OS X 10.9
screen refresh problem for OS X installer build.
- Issue #19649: On OS X, the same set of file names are now installed
in bin directories for all configurations: non-framework vs framework,
and single arch vs universal builds. pythonx.y-32 is now always
installed for 64-bit/32-bit universal builds. The obsolete and
undocumented pythonw* symlinks are no longer installed anywhere.
- Issue #19553: PEP 453 - "make install" and "make altinstall" now install or
upgrade pip by default, using the bundled pip provided by the new ensurepip
module. A new configure option, --with-ensurepip[=upgrade|install|no], is
available to override the default ensurepip "--upgrade" option. The option
can also be set with "make [alt]install ENSUREPIP=[upgrade|install|no]".
- Issue #19551: PEP 453 - the OS X installer now installs pip by default.
- Update third-party libraries for OS X installers: xz 5.0.3 -> 5.0.5,
SQLite 3.7.13 -> 3.8.1
- Issue #15663: Revert OS X installer built-in Tcl/Tk support for 3.4.0b1.
Some third-party projects, such as Matplotlib and PIL/Pillow,
depended on being able to build with Tcl and Tk frameworks in
/Library/Frameworks.
Tools/Demos
-----------
- Issue #19730: Argument Clinic now supports all the existing PyArg
"format units" as legacy converters, as well as two new features:
"self converters" and the "version" directive.
- Issue #19552: pyvenv now bootstraps pip into virtual environments by
default (pass --without-pip to request the old behaviour)
- Issue #19390: Argument Clinic no longer accepts malformed Python
and C ids.
What's New in Python 3.4.0 Alpha 4?
===================================
Release date: 2013-10-20
Core and Builtins
-----------------
- Issue #19301: Give classes and functions that are explicitly marked global a
global qualname.
- Issue #19279: UTF-7 decoder no longer produces illegal strings.
- Issue #16612: Add "Argument Clinic", a compile-time preprocessor for
C files to generate argument parsing code. (See PEP 436.)
- Issue #18810: Shift stat calls in importlib.machinery.FileFinder such that
the code is optimistic that if something exists in a directory named exactly
like the possible package being searched for that it's in actuality a
directory.
- Issue #18416: importlib.machinery.PathFinder now treats '' as the cwd and
importlib.machinery.FileFinder no longer special-cases '' to '.'. This leads
to modules imported from cwd to now possess an absolute file path for
__file__ (this does not affect modules specified by path on the CLI but it
does affect -m/runpy). It also allows FileFinder to be more consistent by not
having an edge case.
- Issue #4555: All exported C symbols are now prefixed with either
"Py" or "_Py".
- Issue #19219: Speed up marshal.loads(), and make pyc files slightly
(5% to 10%) smaller.
- Issue #19221: Upgrade Unicode database to version 6.3.0.
- Issue #16742: The result of the C callback PyOS_ReadlineFunctionPointer must
now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL
if an error occurred), instead of a string allocated by PyMem_Malloc() or
PyMem_Realloc().
- Issue #19199: Remove ``PyThreadState.tick_counter`` field
- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
least one place so as to avoid regressions.
- Issue #19087: Improve bytearray allocation in order to allow cheap popping
of data at the front (slice deletion).
- Issue #19014: memoryview.cast() is now allowed on zero-length views.
- Issue #18690: memoryview is now automatically registered with
collections.abc.Sequence
- Issue #19078: memoryview now correctly supports the reversed builtin
(Patch by Claudiu Popa)
Library
-------
- Issue #17457: unittest test discovery now works with namespace packages.
Patch by Claudiu Popa.
- Issue #18235: Fix the sysconfig variables LDSHARED and BLDSHARED under AIX.
Patch by David Edelsohn.
- Issue #18606: Add the new "statistics" module (PEP 450). Contributed
by Steven D'Aprano.
- Issue #12866: The audioop module now supports 24-bit samples.
- Issue #19254: Provide an optimized Python implementation of pbkdf2_hmac.
- Issues #19201, Issue #19222, Issue #19223: Add "x" mode (exclusive creation)
in opening file to bz2, gzip and lzma modules. Patches by Tim Heaney and
Vajrasky Kok.
- Fix a reference count leak in _sre.
- Issue #19262: Initial check in of the 'asyncio' package (a.k.a. Tulip,
a.k.a. PEP 3156). There are no docs yet, and the PEP is slightly
out of date with the code. This module will have *provisional* status
in Python 3.4.
- Issue #19276: Fixed the wave module on 64-bit big-endian platforms.
- Issue #19266: Rename the new-in-3.4 ``contextlib.ignore`` context manager
to ``contextlib.suppress`` in order to be more consistent with existing
descriptions of that operation elsewhere in the language and standard
library documentation (Patch by Zero Piraeus).
- Issue #18891: Completed the new email package (provisional) API additions
by adding new classes EmailMessage, MIMEPart, and ContentManager.
- Issue #18281: Unused stat constants removed from `tarfile`.
- Issue #18999: Multiprocessing now supports 'contexts' with the same API
as the module, but bound to specified start methods.
- Issue #18468: The re.split, re.findall, and re.sub functions and the group()
and groups() methods of match object now always return a string or a bytes
object.
- Issue #18725: The textwrap module now supports truncating multiline text.
- Issue #18776: atexit callbacks now display their full traceback when they
raise an exception.
- Issue #17827: Add the missing documentation for ``codecs.encode`` and
``codecs.decode``.
- Issue #19218: Rename collections.abc to _collections_abc in order to
speed up interpreter start.
- Issue #18582: Add 'pbkdf2_hmac' to the hashlib module. It implements PKCS#5
password-based key derivation functions with HMAC as pseudorandom function.
- Issue #19131: The aifc module now correctly reads and writes sampwidth of
compressed streams.
- Issue #19209: Remove import of copyreg from the os module to speed up
interpreter startup. stat_result and statvfs_result are now hard-coded to
reside in the os module.
- Issue #19205: Don't import the 're' module in site and sysconfig module to
speed up interpreter start.
- Issue #9548: Add a minimal "_bootlocale" module that is imported by the
_io module instead of the full locale module.
- Issue #18764: Remove the 'print' alias for the PDB 'p' command so that it no
longer shadows the print function.
- Issue #19158: A rare race in BoundedSemaphore could allow .release() too
often.
- Issue #15805: Add contextlib.redirect_stdout().
- Issue #18716: Deprecate the formatter module.
- Issue #10712: 2to3 has a new "asserts" fixer that replaces deprecated names
of unittest methods (e.g. failUnlessEqual -> assertEqual).
- Issue #18037: 2to3 now escapes ``'\u'`` and ``'\U'`` in native strings.
- Issue #17839: base64.decodebytes and base64.encodebytes now accept any
object that exports a 1 dimensional array of bytes (this means the same
is now also true for base64_codec)
- Issue #19132: The pprint module now supports compact mode.
- Issue #19137: The pprint module now correctly formats instances of set and
frozenset subclasses.
- Issue #10042: functools.total_ordering now correctly handles
NotImplemented being returned by the underlying comparison function (Patch
by Katie Miller)
- Issue #19092: contextlib.ExitStack now correctly reraises exceptions
from the __exit__ callbacks of inner context managers (Patch by Hrvoje
Nikšić)
- Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
when necessary. Patch by Oscar Benjamin.
- Issue #5845: In site.py, only load readline history from ~/.python_history
if no history has been read already. This avoids double writes to the
history file at shutdown.
- Properly initialize all fields of a SSL object after allocation.
- Issue #19095: SSLSocket.getpeercert() now raises ValueError when the
SSL handshake hasn't been done.
- Issue #4366: Fix building extensions on all platforms when --enable-shared
is used.
- Issue #19030: Fixed `inspect.getmembers` and `inspect.classify_class_attrs`
to attempt activating descriptors before falling back to a __dict__ search
for faulty descriptors. `inspect.classify_class_attrs` no longer returns
Attributes whose home class is None.
C API
-----
- Issue #1772673: The type of `char*` arguments now changed to `const char*`.
- Issue #16129: Added a `Py_SetStandardStreamEncoding` pre-initialization API
to allow embedding applications like Blender to force a particular
encoding and error handler for the standard IO streams (initial patch by
Bastien Montagne)
Tests
-----
- Issue #19275: Fix test_site on AMD64 Snow Leopard
- Issue #14407: Fix unittest test discovery in test_concurrent_futures.
- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
wave.
- Issue #18714: Added tests for ``pdb.find_function()``.
Documentation
-------------
- Issue #18758: Fixed and improved cross-references.
- Issue #18972: Modernize email examples and use the argparse module in them.
Build
-----
- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
- Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
- Issue #14499: Fix several problems with OS X universal build support:
1. ppc arch detection for extension module builds broke with Xcode 5
2. ppc arch detection in configure did not work on OS X 10.4
3. -sysroot and -arch flags were unnecessarily duplicated
4. there was no obvious way to configure an intel-32 only build.
- Issue #19019: Change the OS X installer build script to use CFLAGS instead
of OPT for special build options. By setting OPT, some compiler-specific
options like -fwrapv were overridden and thus not used, which could result
in broken interpreters when building with clang.
What's New in Python 3.4.0 Alpha 3?
===================================
Release date: 2013-09-29
Core and Builtins
-----------------
- Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional.
- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
absurdly high.
Library
-------
- Issue #18929: `inspect.classify_class_attrs()` now correctly finds class
attributes returned by `dir()` that are located in the metaclass.
- Issue #18950: Fix miscellaneous bugs in the sunau module.
Au_read.readframes() now updates current file position and reads correct
number of frames from multichannel stream. Au_write.writeframesraw() now
correctly updates current file position. Au_read.getnframes() now returns an
integer (as in Python 2). Au_read and Au_write now correctly works with file
object if start file position is not a zero.
- Issue #18594: The fast path for collections.Counter() was never taken
due to an over-restrictive type check.
- Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
bytes until end of data.
- logging: added support for Unix domain sockets to SocketHandler and
DatagramHandler.
- Issue #18996: TestCase.assertEqual() now more cleverly shorten differing
strings in error report.
- Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
- Issue #18978: ``urllib.request.Request`` now allows the method to be
indicated on the class and no longer sets it to None in ``__init__``.
- Issue #18626: the inspect module now offers a basic command line
introspection interface (Initial patch by Claudiu Popa)
- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call
returned empty string.
- Issue #19037: The mailbox module now makes all changes to maildir files
before moving them into place, to avoid race conditions with other programs
that may be accessing the maildir directory.
- Issue #14984: On POSIX systems, when netrc is called without a filename
argument (and therefore is reading the user's $HOME/.netrc file), it now
enforces the same security rules as typical ftp clients: the .netrc file must
be owned by the user that owns the process and must not be readable by any
other user.
- Issue #18873: The tokenize module now detects Python source code encoding
only in comment lines.
- Issue #17764: Enable http.server to bind to a user specified network
interface. Patch contributed by Malte Swart.
- Issue #18937: Add an assertLogs() context manager to unittest.TestCase
to ensure that a block of code emits a message using the logging module.
- Issue #17324: Fix http.server's request handling case on trailing '/'. Patch
contributed by Vajrasky Kok.
- Issue #19018: The heapq.merge() function no longer suppresses IndexError
in the underlying iterables.
- Issue #18784: The uuid module no longer attempts to load libc via ctypes.CDLL
if all the necessary functions have already been found in libuuid. Patch by
Evgeny Sologubov.
- The :envvar:`PYTHONFAULTHANDLER` environment variable now only enables the
faulthandler module if the variable is non-empty. Same behaviour than other
variables like :envvar:`PYTHONDONTWRITEBYTECODE`.
- Issue #1565525: New function ``traceback.clear_frames`` will clear
the local variables of all the stack frames referenced by a traceback
object.
Tests
-----
- Issue #18952: Fix regression in support data downloads introduced when
test.support was converted to a package. Regression noticed by Zachary
Ware.
IDLE
----
- Issue #18873: IDLE now detects Python source code encoding only in comment
lines.
- Issue #18988: The "Tab" key now works when a word is already autocompleted.
Documentation
-------------
- Issue #17003: Unified the size argument names in the io module with common
practice.
Build
-----
- Issue #18596: Support the use of address sanity checking in recent versions
of clang and GCC by appropriately marking known false alarms in the small
object allocator. Patch contributed by Dhiru Kholia.
Tools/Demos
-----------
- Issue #18873: 2to3 and the findnocoding.py script now detect Python source
code encoding only in comment lines.
What's New in Python 3.4.0 Alpha 2?
===================================
Release date: 2013-09-09
Core and Builtins
-----------------
- Issue #18942: sys._debugmallocstats() output was damaged on Windows.
- Issue #18571: Implementation of the PEP 446: file descriptors and file
handles are now created non-inheritable; add functions
os.get/set_inheritable(), os.get/set_handle_inheritable() and
socket.socket.get/set_inheritable().
- Issue #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
- Issue #18808: Non-daemon threads are now automatically joined when
a sub-interpreter is shutdown (it would previously dump a fatal error).
- Remove support for compiling on systems without getcwd().
- Issue #18774: Remove last bits of GNU PTH thread code and thread_pth.h.
- Issue #18771: Add optimization to set object lookups to reduce the cost
of hash collisions. The core idea is to inspect a second key/hash pair
for each cache line retrieved.
- Issue #16105: When a signal handler fails to write to the file descriptor
registered with ``signal.set_wakeup_fd()``, report an exception instead
of ignoring the error.
- Issue #18722: Remove uses of the "register" keyword in C code.
- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
- Issue #16499: Add command line option for isolated mode.
- Issue #15301: Parsing fd, uid, and gid parameters for builtins
in Modules/posixmodule.c is now far more robust.
- Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
fail.
- Issue #17934: Add a clear() method to frame objects, to help clean up
expensive details (local variables) and break reference cycles.
- Issue #18780: %-formatting codes %d, %i, and %u now treat int-subclasses
as int (displays value of int-subclass instead of str(int-subclass) ).
Library
-------
- Issue #18808: Thread.join() now waits for the underlying thread state to
be destroyed before returning. This prevents unpredictable aborts in
Py_EndInterpreter() when some non-daemon threads are still running.
- Issue #18458: Prevent crashes with newer versions of libedit. Its readline
emulation has changed from 0-based indexing to 1-based like gnu readline.
- Issue #18852: Handle case of ``readline.__doc__`` being ``None`` in the new
readline activation code in ``site.py``.
- Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
the _sre module.
- Issue #18830: inspect.getclasstree() no longer produces duplicate entries even
when input list contains duplicates.
- Issue #18878: sunau.open now supports the context management protocol. Based on
patches by Claudiu Popa and R. David Murray.
- Issue #18909: Fix _tkinter.tkapp.interpaddr() on Windows 64-bit, don't cast
64-bit pointer to long (32 bits).
- Issue #18876: The FileIO.mode attribute now better reflects the actual mode
under which the file was opened. Patch by Erik Bray.
- Issue #16853: Add new selectors module.
- Issue #18882: Add threading.main_thread() function.
- Issue #18901: The sunau getparams method now returns a namedtuple rather than
a plain tuple. Patch by Claudiu Popa.
- Issue #17487: The result of the wave getparams method now is pickleable again.
Patch by Claudiu Popa.
- Issue #18756: os.urandom() now uses a lazily-opened persistent file
descriptor, so as to avoid using many file descriptors when run in
parallel from multiple threads.
- Issue #18418: After fork(), reinit all threads states, not only active ones.
Patch by A. Jesse Jiryu Davis.
- Issue #17974: Switch unittest from using getopt to using argparse.
- Issue #11798: TestSuite now drops references to own tests after execution.
- Issue #16611: http.cookie now correctly parses the 'secure' and 'httponly'
cookie flags.
- Issue #11973: Fix a problem in kevent. The flags and fflags fields are now
properly handled as unsigned.
- Issue #18807: ``pyvenv`` now takes a --copies argument allowing copies
instead of symlinks even where symlinks are available and the default.
- Issue #18538: ``python -m dis`` now uses argparse for argument processing.
Patch by Michele Orrù.
- Issue #18394: Close cgi.FieldStorage's optional file.
- Issue #17702: On error, os.environb now suppresses the exception context
when raising a new KeyError with the original key.
- Issue #16809: Fixed some tkinter incompabilities with Tcl/Tk 8.6.
- Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj
argument.
- Issue #18324: set_payload now correctly handles binary input. This also
supersedes the previous fixes for #14360, #1717, and #16564.
- Issue #18794: Add a fileno() method and a closed attribute to select.devpoll
objects.
- Issue #17119: Fixed integer overflows when processing large strings and tuples
in the tkinter module.
- Issue #18747: Re-seed OpenSSL's pseudo-random number generator after fork.
A pthread_atfork() parent handler is used to seed the PRNG with pid, time
and some stack data.
- Issue #8865: Concurrent invocation of select.poll.poll() now raises a
RuntimeError exception. Patch by Christian Schubert.
- Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
OpenSSL 1.0.0+ instead of the deprecated CRYPTO id callback function.
- Issue #18768: Correct doc string of RAND_edg(). Patch by Vajrasky Kok.
- Issue #18178: Fix ctypes on BSD. dlmalloc.c was compiled twice which broke
malloc weak symbols.
- Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes
inside subjectAltName correctly. Formerly the module has used OpenSSL's
GENERAL_NAME_print() function to get the string representation of ASN.1
strings for ``rfc822Name`` (email), ``dNSName`` (DNS) and
``uniformResourceIdentifier`` (URI).
- Issue #18701: Remove support of old CPython versions (<3.0) from C code.
- Issue #18756: Improve error reporting in os.urandom() when the failure
is due to something else than /dev/urandom not existing (for example,
exhausting the file descriptor limit).
- Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel
3.11 or newer. It's only defined on system with 3.11 uapi headers, too.
- Issue #18532: Change the builtin hash algorithms' names to lower case names
as promised by hashlib's documentation.
- Issue #8713: add new spwan and forkserver start methods, and new functions
get_all_start_methods, get_start_method, and set_start_method, to
multiprocessing.
- Issue #18405: Improve the entropy of crypt.mksalt().
- Issue #12015: The tempfile module now uses a suffix of 8 random characters
instead of 6, to reduce the risk of filename collision. The entropy was
reduced when uppercase letters were removed from the charset used to generate
random characters.
- Issue #18585: Add :func:`textwrap.shorten` to collapse and truncate a
piece of text to a given length.
- Issue #18598: Tweak exception message for importlib.import_module() to
include the module name when a key argument is missing.
- Issue #19151: Fix docstring and use of _get_supported_file_loaders() to
reflect 2-tuples.
- Issue #19152: Add ExtensionFileLoader.get_filename().
- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
docstrings and ValueError messages. Patch by Zhongyue Luo
- Fix refcounting issue with extension types in tkinter.
- Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error
if methods have annotations; it now correctly displays the annotations.
- Issue #18600: Added policy argument to email.message.Message.as_string,
and as_bytes and __bytes__ methods to Message.
- Issue #18671: Output more information when logging exceptions occur.
- Issue #18621: Prevent the site module's patched builtins from keeping
too many references alive for too long.
- Issue #4885: Add weakref support to mmap objects. Patch by Valerie Lambert.
- Issue #8860: Fixed rounding in timedelta constructor.
- Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
existing directory caused mkstemp and related APIs to fail instead of
retrying. Report and fix by Vlad Shcherbina.
- Issue #18920: argparse's default destination for the version action (-v,
--version) has also been changed to stdout, to match the Python executable.
Tests
-----
- Issue #18623: Factor out the _SuppressCoreFiles context manager into
test.support. Patch by Valerie Lambert.
- Issue #12037: Fix test_email for desktop Windows.
- Issue #15507: test_subprocess's test_send_signal could fail if the test
runner were run in an environment where the process inherited an ignore
setting for SIGINT. Restore the SIGINT handler to the desired
KeyboardInterrupt raising one during that test.
- Issue #16799: Switched from getopt to argparse style in regrtest's argument
parsing. Added more tests for regrtest's argument parsing.
- Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as
possible, since "localhost" goes through a DNS lookup under recent Windows
versions.
IDLE
----
- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster.
Documentation
-------------
- Issue #18743: Fix references to non-existent "StringIO" module.
- Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
Build
-----
- Issue #1584: Provide configure options to override default search paths for
Tcl and Tk when building _tkinter.
- Issue #15663: Tcl/Tk 8.5.14 is now included with the OS X 10.6+ 64-/32-bit
installer. It is no longer necessary to install a third-party version of
Tcl/Tk 8.5 to work around the problems in the Apple-supplied Tcl/Tk 8.5
shipped in OS X 10.6 and later releases.
Tools/Demos
-----------
- Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write
their version strings to stdout, and not to sderr.
What's New in Python 3.4.0 Alpha 1?
===================================
Release date: 2013-08-03
Core and Builtins
-----------------
- Issue #16741: Fix an error reporting in int().
- Issue #17899: Fix rare file descriptor leak in os.listdir().
- Issue #10241: Clear extension module dict copies at interpreter shutdown.
Patch by Neil Schemenauer, minimally modified.
- Issue #9035: ismount now recognises volumes mounted below a drive root
on Windows. Original patch by Atsuo Ishimoto.
- Issue #18214: Improve finalization of Python modules to avoid setting
their globals to None, in most cases.
- Issue #18112: PEP 442 implementation (safe object finalization).
- Issue #18552: Check return value of PyArena_AddPyObject() in
obj2ast_object().
- Issue #18560: Fix potential NULL pointer dereference in sum().
- Issue #18520: Add a new PyStructSequence_InitType2() function, same than
PyStructSequence_InitType() except that it has a return value (0 on success,
-1 on error).
- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
- Issue #18408: Fix many various bugs in code handling errors, especially
on memory allocation failure (MemoryError).
- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
- Issue #18342: Use the repr of a module name when an import fails when using
``from ... import ...``.
- Issue #17872: Fix a segfault in marshal.load() when input stream returns
more bytes than requested.
- Issue #18338: `python --version` now prints version string to stdout, and
not to stderr. Patch by Berker Peksag and Michael Dickens.
- Issue #18426: Fix NULL pointer dereference in C extension import when
PyModule_GetDef() returns an error.
- Issue #17206: On Windows, increase the stack size from 2 MB to 4.2 MB to fix
a stack overflow in the marshal module (fix a crash in test_marshal).
Patch written by Jeremy Kloth.
- Issue #3329: Implement the PEP 445: Add new APIs to customize Python memory
allocators.
- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
tstate is first removed from TLS and then deallocated.
- Issue #13483: Use VirtualAlloc in obmalloc on Windows.
- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
OverflowError when an argument of %c format is out of range.
- Issue #18111: The min() and max() functions now support a default argument
to be returned instead of raising a ValueError on an empty sequence.
(Contributed by Julian Berman.)
- Issue #18137: Detect integer overflow on precision in float.__format__()
and complex.__format__().
- Issue #18183: Fix various unicode operations on strings with large unicode
codepoints.
- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
- Issue #18038: SyntaxError raised during compilation sources with illegal
encoding now always contains an encoding name.
- Issue #17931: Resolve confusion on Windows between pids and process
handles.
- Tweak the exception message when the magic number or size value in a bytecode
file is truncated.
- Issue #17932: Fix an integer overflow issue on Windows 64-bit in iterators:
change the C type of seqiterobject.it_index from long to Py_ssize_t.
- Issue #18065: Don't set __path__ to the package name for frozen packages.
- Issue #18088: When reloading a module, unconditionally reset all relevant
attributes on the module (e.g. __name__, __loader__, __package__, __file__,
__cached__).
- Issue #17937: Try harder to collect cyclic garbage at shutdown.
- Issue #12370: Prevent class bodies from interfering with the __class__
closure.
- Issue #17644: Fix a crash in str.format when curly braces are used in square
brackets.
- Issue #17237: Fix crash in the ASCII decoder on m68k.
- Issue #17927: Frame objects kept arguments alive if they had been
copied into a cell, even if the cell was cleared.
- Issue #1545463: At shutdown, defer finalization of codec modules so
that stderr remains usable.
- Issue #7330: Implement width and precision (ex: "%5.3s") for the format
string of PyUnicode_FromFormat() function, original patch written by Ysj Ray.
- Issue #1545463: Global variables caught in reference cycles are now
garbage-collected at shutdown.
- Issue #17094: Clear stale thread states after fork(). Note that this
is a potentially disruptive change since it may release some system
resources which would otherwise remain perpetually alive (e.g. database
connections kept in thread-local storage).
- Issue #17408: Avoid using an obsolete instance of the copyreg module when
the interpreter is shutdown and then started again.
- Issue #5845: Enable tab-completion in the interactive interpreter by
default, thanks to a new sys.__interactivehook__.
- Issue #17115,17116: Module initialization now includes setting __package__ and
__loader__ attributes to None.
- Issue #17853: Ensure locals of a class that shadow free variables always win
over the closures.
- Issue #17863: In the interactive console, don't loop forever if the encoding
can't be fetched from stdin.
- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
- Issue #18698: Ensure importlib.reload() returns the module out of sys.modules.
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
such as was shipped with Centos 5 and Mac OS X 10.4.
- Issue #17413: sys.settrace callbacks were being passed a string instead of an
exception instance for the 'value' element of the arg tuple if the exception
originated from C code; now an exception instance is always provided.
- Issue #17782: Fix undefined behaviour on platforms where
``struct timespec``'s "tv_nsec" member is not a C long.
- Issue #17722: When looking up __round__, resolve descriptors.
- Issue #16061: Speed up str.replace() for replacing 1-character strings.
- Issue #17715: Fix segmentation fault from raising an exception in a __trunc__
method.
- Issue #17643: Add __callback__ attribute to weakref.ref.
- Issue #16447: Fixed potential segmentation fault when setting __name__ on a
class.
- Issue #17669: Fix crash involving finalization of generators using yield from.
- Issue #14439: Python now prints the traceback on runpy failure at startup.
- Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks()
when running on valgrind.
- Issue #17619: Make input() check for Ctrl-C correctly on Windows.
- Issue #17357: Add missing verbosity messages for -v/-vv that were lost during
the importlib transition.
- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
- Issue #17323: The "[X refs, Y blocks]" printed by debug builds has been
disabled by default. It can be re-enabled with the `-X showrefcount` option.
- Issue #17328: Fix possible refleak in dict.setdefault.
- Issue #17275: Corrected class name in init error messages of the C version of
BufferedWriter and BufferedRandom.
- Issue #7963: Fixed misleading error message that issued when object is
called without arguments.
- Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob.
- Issue #5308: Raise ValueError when marshalling too large object (a sequence
with size >= 2**31), instead of producing illegal marshal data.
- Issue #12983: Bytes literals with invalid ``\x`` escape now raise a SyntaxError
and a full traceback including line number.
- Issue #16967: In function definition, evaluate positional defaults before
keyword-only defaults.
- Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.)
in the interpreter.
- Issue #17137: When an Unicode string is resized, the internal wide character
string (wstr) format is now cleared.
- Issue #17043: The unicode-internal decoder no longer read past the end of
input buffer.
- Issue #17098: All modules now have __loader__ set even if they pre-exist the
bootstrapping of importlib.
- Issue #16979: Fix error handling bugs in the unicode-escape-decode decoder.
- Issue #16772: The base argument to the int constructor no longer accepts
floats, or other non-integer objects with an __int__ method. Objects
with an __index__ method are now accepted.
- Issue #10156: In the interpreter's initialization phase, unicode globals
are now initialized dynamically as needed.
- Issue #16980: Fix processing of escaped non-ascii bytes in the
unicode-escape-decode decoder.
- Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
- Issue #14850: Now a charmap decoder treats U+FFFE as "undefined mapping"
in any mapping, not only in a string.
- Issue #16613: Add *m* argument to ``collections.Chainmap.new_child`` to
allow the new child map to be specified explicitly.
- Issue #16730: importlib.machinery.FileFinder now no longers raises an
exception when trying to populate its cache and it finds out the directory is
unreadable or has turned into a file. Reported and diagnosed by
David Pritchard.
- Issue #16906: Fix a logic error that prevented most static strings from being
cleared.
- Issue #11461: Fix the incremental UTF-16 decoder. Original patch by
Amaury Forgeot d'Arc.
- Issue #16856: Fix a segmentation fault from calling repr() on a dict with
a key whose repr raise an exception.
- Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
- Issue #16761: Calling int() with base argument only now raises TypeError.
- Issue #16759: Support the full DWORD (unsigned long) range in Reg2Py
when retrieving a REG_DWORD value. This corrects functions like
winreg.QueryValueEx that may have been returning truncated values.
- Issue #14420: Support the full DWORD (unsigned long) range in Py2Reg
when passed a REG_DWORD value. Fixes OverflowError in winreg.SetValueEx.
- Issue #11939: Set the st_dev attribute of stat_result to allow Windows to
take advantage of the os.path.samefile/sameopenfile/samestat implementations
used by other platforms.
- Issue #16772: The int() constructor's second argument (base) no longer
accepts non integer values. Consistent with the behavior in Python 2.
- Issue #14470: Remove w9xpopen support per PEP 11.
- Issue #9856: Replace deprecation warning with raising TypeError
in object.__format__. Patch by Florent Xicluna.
- Issue #16597: In buffered and text IO, call close() on the underlying stream
if invoking flush() fails.
- Issue #16722: In the bytes() constructor, try to call __bytes__ on the
argument before __index__.
- Issue #16421: loading multiple modules from one shared object is now
handled correctly (previously, the first module loaded from that file
was silently returned). Patch by Václav Šmilauer.
- Issue #16602: When a weakref's target was part of a long deallocation
chain, the object could remain reachable through its weakref even though
its refcount had dropped to zero.
- Issue #16495: Remove extraneous NULL encoding check from bytes_decode().
- Issue #16619: Create NameConstant AST class to represent None, True, and False
literals. As a result, these constants are never loaded at runtime from
builtins.
- Issue #16455: On FreeBSD and Solaris, if the locale is C, the
ASCII/surrogateescape codec is now used (instead of the locale encoding) to
decode the command line arguments. This change fixes inconsistencies with
os.fsencode() and os.fsdecode(), because these operating systems announce an
ASCII locale encoding, but actually use the ISO-8859-1 encoding in practice.
- Issue #16562: Optimize dict equality testing. Patch by Serhiy Storchaka.
- Issue #16588: Silence unused-but-set warnings in Python/thread_pthread
- Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation
failure.
- Issue #16546: Fix: ast.YieldFrom argument is now mandatory.
- Issue #16514: Fix regression causing a traceback when sys.path[0] is None
(actually, any non-string or non-bytes type).
- Issue #16306: Fix multiple error messages when unknown command line
parameters where passed to the interpreter. Patch by Hieu Nguyen.
- Issue #16215: Fix potential double memory free in str.replace(). Patch
by Serhiy Storchaka.
- Issue #16290: A float return value from the __complex__ special method is no
longer accepted in the complex() constructor.
- Issue #16416: On Mac OS X, operating system data are now always
encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding
(which may be ASCII if no locale environment variable is set), to avoid
inconsistencies with os.fsencode() and os.fsdecode() functions which are
already using UTF-8/surrogateescape.
- Issue #16453: Fix equality testing of dead weakref objects.
- Issue #9535: Fix pending signals that have been received but not yet
handled by Python to not persist after os.fork() in the child process.
- Issue #14794: Fix slice.indices to return correct results for huge values,
rather than raising OverflowError.
- Issue #15001: fix segfault on "del sys.modules['__main__']". Patch by Victor
Stinner.
- Issue #8271: the utf-8 decoder now outputs the correct number of U+FFFD
characters when used with the 'replace' error handler on invalid utf-8
sequences. Patch by Serhiy Storchaka, tests by Ezio Melotti.
- Issue #5765: Apply a hard recursion limit in the compiler instead of
blowing the stack and segfaulting. Initial patch by Andrea Griffini.
- Issue #16402: When slicing a range, fix shadowing of exceptions from
__index__.
- Issue #16336: fix input checking in the surrogatepass error handler.
Patch by Serhiy Storchaka.
- Issue #8401: assigning an int to a bytearray slice (e.g. b[3:4] = 5) now
raises an error.
- Issue #7317: Display full tracebacks when an error occurs asynchronously.
Patch by Alon Horev with update by Alexey Kachayev.
- Issue #16309: Make PYTHONPATH="" behavior the same as if PYTHONPATH
not set at all.
- Issue #10189: Improve the error reporting of SyntaxErrors related to global
and nonlocal statements.
- Fix segfaults on setting __qualname__ on builtin types and attempting to
delete it on any type.
- Issue #14625: Rewrite the UTF-32 decoder. It is now 3x to 4x faster. Patch
written by Serhiy Storchaka.
- Issue #16345: Fix an infinite loop when ``fromkeys`` on a dict subclass
received a nonempty dict from the constructor.
- Issue #16271: Fix strange bugs that resulted from __qualname__ appearing in a
class's __dict__ and on type.
- Issue #12805: Make bytes.join and bytearray.join faster when the separator
is empty. Patch by Serhiy Storchaka.
- Issue #6074: Ensure cached bytecode files can always be updated by the
user that created them, even when the source file is read-only.
- Issue #15958: bytes.join and bytearray.join now accept arbitrary buffer
objects.
- Issue #14783: Improve int() docstring and switch docstrings for str(),
range(), and slice() to use multi-line signatures.
- Issue #16160: Subclass support now works for types.SimpleNamespace.
- Issue #16148: Implement PEP 424, adding operator.length_hint and
PyObject_LengthHint.
- Upgrade Unicode data (UCD) to version 6.2.
- Issue #15379: Fix passing of non-BMP characters as integers for the charmap
decoder (already working as unicode strings). Patch by Serhiy Storchaka.
- Issue #15144: Fix possible integer overflow when handling pointers as integer
values, by using `Py_uintptr_t` instead of `size_t`. Patch by Serhiy
Storchaka.
- Issue #15965: Explicitly cast `AT_FDCWD` as (int). Required on Solaris 10
(which defines `AT_FDCWD` as ``0xffd19553``), harmless on other platforms.
- Issue #15839: Convert SystemErrors in `super()` to RuntimeErrors.
- Issue #15448: Buffered IO now frees the buffer when closed, instead
of when deallocating.
- Issue #15846: Fix SystemError which happened when using `ast.parse()` in an
exception handler on code with syntax errors.
- Issue #15897: zipimport.c doesn't check return value of fseek().
Patch by Felipe Cruz.
- Issue #15801: Make sure mappings passed to '%' formatting are actually
subscriptable.
- Issue #15111: __import__ should propagate ImportError when raised as a
side-effect of a module triggered from using fromlist.
- Issue #15022: Add pickle and comparison support to types.SimpleNamespace.
Library
-------
- Issue #4331: Added functools.partialmethod (Initial patch by Alon Horev)
- Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit
platforms. Patch by Yogesh Chaudhari.
- Issue #18681: Fix a NameError in importlib.reload() (noticed by Weizhao Li).
- Issue #14323: Expanded the number of digits in the coefficients for the
RGB -- YIQ conversions so that they match the FCC NTSC versions.
- Issue #17998: Fix an internal error in regular expression engine.
- Issue #17557: Fix os.getgroups() to work with the modified behavior of
getgroups(2) on OS X 10.8. Original patch by Mateusz Lenik.
- Issue #18608: Avoid keeping a strong reference to the locale module
inside the _io module.
- Issue #18619: Fix atexit leaking callbacks registered from sub-interpreters,
and make it GC-aware.
- Issue #15699: The readline module now uses PEP 3121-style module
initialization, so as to reclaim allocated resources (Python callbacks)
at shutdown. Original patch by Robin Schreiber.
- Issue #17616: wave.open now supports the context management protocol.
- Issue #18599: Fix name attribute of _sha1.sha1() object. It now returns
'SHA1' instead of 'SHA'.
- Issue #13266: Added inspect.unwrap to easily unravel __wrapped__ chains
(initial patch by Daniel Urban and Aaron Iles)
- Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL.
- Issue #18559: Fix NULL pointer dereference error in _pickle module
- Issue #18556: Check the return type of PyUnicode_AsWideChar() in ctype's
U_set().
- Issue #17818: aifc.getparams now returns a namedtuple.
- Issue #18549: Eliminate dead code in socket_ntohl()
- Issue #18530: Remove additional stat call from posixpath.ismount.
Patch by Alex Gaynor.
- Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
- Issue #9177: Calling read() or write() now raises ValueError, not
AttributeError, on a closed SSL socket. Patch by Senko Rasic.
- Issue #18513: Fix behaviour of cmath.rect w.r.t. signed zeros on OS X 10.8 +
gcc.
- Issue #18479: Changed venv Activate.ps1 to make deactivate a function, and
removed Deactivate.ps1.
- Issue #18480: Add missing call to PyType_Ready to the _elementtree extension.
- Issue #17778: Fix test discovery for test_multiprocessing. (Patch by
Zachary Ware.)
- Issue #18393: The private module _gestalt and private functions
platform._mac_ver_gestalt, platform._mac_ver_lookup and
platform._bcd2str have been removed. This does not affect the public
interface of the platform module.
- Issue #17482: functools.update_wrapper (and functools.wraps) now set the
__wrapped__ attribute correctly even if the underlying function has a
__wrapped__ attribute set.
- Issue #18431: The new email header parser now decodes RFC2047 encoded words
in structured headers.
- Issue #18432: The sched module's queue method was incorrectly returning
an iterator instead of a list.
- Issue #18044: The new email header parser was mis-parsing encoded words where
an encoded character immediately followed the '?' that follows the CTE
character, resulting in a decoding failure. They are now decoded correctly.
- Issue #18101: Tcl.split() now process strings nested in a tuple as it
do with byte strings.
- Issue #18116: getpass was always getting an error when testing /dev/tty,
and thus was always falling back to stdin, and would then raise an exception
if stdin could not be used (such as /dev/null). It also leaked an open file.
All of these issues are now fixed.
- Issue #17198: Fix a NameError in the dbm module. Patch by Valentina
Mukhamedzhanova.
- Issue #18013: Fix cgi.FieldStorage to parse the W3C sample form.
- Issue #18020: improve html.escape speed by an order of magnitude.
Patch by Matt Bryant.
- Issue #18347: ElementTree's html serializer now preserves the case of
closing tags.
- Issue #17261: Ensure multiprocessing's proxies use proper address.
- Issue #18343: faulthandler.register() now keeps the previous signal handler
when the function is called twice, so faulthandler.unregister() restores
correctly the original signal handler.
- Issue #17097: Make multiprocessing ignore EINTR.
- Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a
segfault inside the _pickle C extension.
- Issue #18240: The HMAC module is no longer restricted to bytes and accepts
any bytes-like object, e.g. memoryview. Original patch by Jonas Borgström.
- Issue #18224: Removed pydoc script from created venv, as it causes problems
on Windows and adds no value over and above python -m pydoc ...
- Issue #18155: The csv module now correctly handles csv files that use
a delimter character that has a special meaning in regexes, instead of
throwing an exception.
- Issue #14360: encode_quopri can now be successfully used as an encoder
when constructing a MIMEApplication object.
- Issue #11390: Add -o and -f command line options to the doctest CLI to
specify doctest options (and convert it to using argparse).
- Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the input
string in longer than 2 gigabytes, and ssl.SSLContext.load_cert_chain()
raises a ValueError if the password is longer than 2 gigabytes. The ssl
module does not support partial write.
- Issue #11016: Add C implementation of the stat module as _stat.
- Issue #18248: Fix libffi build on AIX.
- Issue #18259: Declare sethostname in socketmodule.c for AIX
- Issue #18147: Add diagnostic functions to ssl.SSLContext(). get_ca_list()
lists all loaded CA certificates and cert_store_stats() returns amount of
loaded X.509 certs, X.509 CA certs and CRLs.
- Issue #18167: cgi.FieldStorage no longer fails to handle multipart/form-data
when ``\r\n`` appears at end of 65535 bytes without other newlines.
- Issue #18076: Introduce importlib.util.decode_source().
- Issue #18357: add tests for dictview set difference.
Patch by Fraser Tweedale.
- importlib.abc.SourceLoader.get_source() no longer changes SyntaxError or
UnicodeDecodeError into ImportError.
- Issue #18058, 18057: Make the namespace package loader meet the
importlib.abc.InspectLoader ABC, allowing for namespace packages to work with
runpy.
- Issue #17177: The imp module is pending deprecation.
- subprocess: Prevent a possible double close of parent pipe fds when the
subprocess exec runs into an error. Prevent a regular multi-close of the
/dev/null fd when any of stdin, stdout and stderr was set to DEVNULL.
- Issue #18194: Introduce importlib.util.cache_from_source() and
source_from_cache() while documenting the equivalent functions in imp as
deprecated.
- Issue #17907: Document imp.new_module() as deprecated in favour of
types.ModuleType.
- Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document as deprecated
imp.get_magic().
- Issue #18149: Add filecmp.clear_cache() to manually clear the filecmp cache.
Patch by Mark Levitt
- Issue #18193: Add importlib.reload().
- Issue #18157: Stop using imp.load_module() in pydoc.
- Issue #16102: Make uuid._netbios_getnode() work again on Python 3.
- Issue #17134: Add ssl.enum_cert_store() as interface to Windows' cert store.
- Issue #18143: Implement ssl.get_default_verify_paths() in order to debug
the default locations for cafile and capath.
- Issue #17314: Move multiprocessing.forking over to importlib.
- Issue #11959: SMTPServer and SMTPChannel now take an optional map, use of
which avoids affecting global state.
- Issue #18109: os.uname() now decodes fields from the locale encoding, and
socket.gethostname() now decodes the hostname from the locale encoding,
instead of using the UTF-8 encoding in strict mode.
- Issue #18089: Implement importlib.abc.InspectLoader.load_module.
- Issue #18088: Introduce importlib.abc.Loader.init_module_attrs for setting
module attributes. Leads to the pending deprecation of
importlib.util.module_for_loader.
- Issue #17403: urllib.parse.robotparser normalizes the urls before adding to
ruleline. This helps in handling certain types invalid urls in a conservative
manner. Patch contributed by Mher Movsisyan.
- Issue #18070: Have importlib.util.module_for_loader() set attributes
unconditionally in order to properly support reloading.
- Added importlib.util.module_to_load to return a context manager to provide the
proper module object to load.
- Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
stream's read() returns more bytes than requested.
- Issue #18011: As was originally intended, base64.b32decode() now raises a
binascii.Error if there are non-b32-alphabet characters present in the input
string, instead of a TypeError.
- Issue #18072: Implement importlib.abc.InspectLoader.get_code() and
importlib.abc.ExecutionLoader.get_code().
- Issue #8240: Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag on SSL
sockets.
- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X
with port None or "0" and flags AI_NUMERICSERV.
- Issue #16986: ElementTree now correctly works with string input when the
internal XML encoding is not UTF-8 or US-ASCII.
- Issue #17996: socket module now exposes AF_LINK constant on BSD and OSX.
- Issue #17900: Allowed pickling of recursive OrderedDicts. Decreased pickled
size and pickling time.
- Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an
initial patch by Trent Nelson.
- Issue #17812: Fixed quadratic complexity of base64.b32encode().
Optimize base64.b32encode() and base64.b32decode() (speed up to 3x).
- Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of
service using certificates with many wildcards (CVE-2013-2099).
- Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity.
- Issue #14596: The struct.Struct() objects now use a more compact
implementation.
- Issue #17981: logging's SysLogHandler now closes the socket when it catches
socket OSErrors.
- Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function
is long, not int.
- Fix typos in the multiprocessing module.
- Issue #17754: Make ctypes.util.find_library() independent of the locale.
- Issue #17968: Fix memory leak in os.listxattr().
- Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
characters() and ignorableWhitespace() methods. Original patch by Sebastian
Ortiz Vasquez.
- Issue #17732: Ignore distutils.cfg options pertaining to install paths if a
virtual environment is active.
- Issue #17915: Fix interoperability of xml.sax with file objects returned by
codecs.open().
- Issue #16601: Restarting iteration over tarfile really restarts rather
than continuing from where it left off. Patch by Michael Birtwell.
- Issue #17289: The readline module now plays nicer with external modules
or applications changing the rl_completer_word_break_characters global
variable. Initial patch by Bradley Froehle.
- Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit
platforms. Patch by Federico Schwindt.
- Issue #11816: multiple improvements to the dis module: get_instructions
generator, ability to redirect output to a file, Bytecode and Instruction
abstractions. Patch by Nick Coghlan, Ryan Kelly and Thomas Kluyver.
- Issue #13831: Embed stringification of remote traceback in local
traceback raised when pool task raises an exception.
- Issue #15528: Add weakref.finalize to support finalization using
weakref callbacks.
- Issue #14173: Avoid crashing when reading a signal handler during
interpreter shutdown.
- Issue #15902: Fix imp.load_module() accepting None as a file when loading an
extension module.
- Issue #13721: SSLSocket.getpeercert() and SSLSocket.do_handshake() now
raise an OSError with ENOTCONN, instead of an AttributeError, when the
SSLSocket is not connected.
- Issue #14679: add an __all__ (that contains only HTMLParser) to html.parser.
- Issue #17802: Fix an UnboundLocalError in html.parser. Initial tests by
Thomas Barlow.
- Issue #17358: Modules loaded by imp.load_source() and load_compiled() (and by
extension load_module()) now have a better chance of working when reloaded.
- Issue #17804: New function ``struct.iter_unpack`` allows for streaming
struct unpacking.
- Issue #17830: When keyword.py is used to update a keyword file, it now
preserves the line endings of the original file.
- Issue #17272: Making the urllib.request's Request.full_url a descriptor.
Fixes bugs with assignment to full_url. Patch by Demian Brecht.
- Issue #17353: Plistlib emitted empty data tags with deeply nested datastructures
- Issue #11714: Use 'with' statements to assure a Semaphore releases a
condition variable. Original patch by Thomas Rachel.
- Issue #16624: `subprocess.check_output` now accepts an `input` argument,
allowing the subprocess's stdin to be provided as a (byte) string.
Patch by Zack Weinberg.
- Issue #17795: Reverted backwards-incompatible change in SysLogHandler with
Unix domain sockets.
- Issue #16694: Add a pure Python implementation of the operator module.
Patch by Zachary Ware.
- Issue #11182: remove the unused and undocumented pydoc.Scanner class.
Patch by Martin Morrison.
- Issue #17741: Add ElementTree.XMLPullParser, an event-driven parser for
non-blocking applications.
- Issue #17555: Fix ForkAwareThreadLock so that size of after fork
registry does not grow exponentially with generation of process.
- Issue #17707: fix regression in multiprocessing.Queue's get() method where
it did not block for short timeouts.
- Issue #17720: Fix the Python implementation of pickle.Unpickler to correctly
process the APPENDS opcode when it is used on non-list objects.
- Issue #17012: shutil.which() no longer falls back to the PATH environment
variable if an empty path argument is specified. Patch by Serhiy Storchaka.
- Issue #17710: Fix pickle raising a SystemError on bogus input.
- Issue #17341: Include the invalid name in the error messages from re about
invalid group names.
- Issue #17702: os.environ now raises KeyError with the original environment
variable name (str on UNIX), instead of using the encoded name (bytes on
UNIX).
- Issue #16163: Make the importlib based version of pkgutil.iter_importers
work for submodules. Initial patch by Berker Peksag.
- Issue #16804: Fix a bug in the 'site' module that caused running
'python -S -m site' to incorrectly throw an exception.
- Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal.
Initial patch by Daniel Riti.
- Issue #2118: SMTPException is now a subclass of OSError.
- Issue #17016: Get rid of possible pointer wraparounds and integer overflows
in the re module. Patch by Nickolai Zeldovich.
- Issue #16658: add missing return to HTTPConnection.send().
Patch by Jeff Knupp.
- Issue #9556: the logging package now allows specifying a time-of-day for a
TimedRotatingFileHandler to rotate.
- Issue #14971: unittest test discovery no longer gets confused when a function
has a different __name__ than its name in the TestCase class dictionary.
- Issue #17487: The wave getparams method now returns a namedtuple rather than
a plain tuple.
- Issue #17675: socket repr() provides local and remote addresses (if any).
Patch by Giampaolo Rodola'
- Issue #17093: Make the ABCs in importlib.abc provide default values or raise
reasonable exceptions for their methods to make them more amenable to super()
calls.
- Issue #17566: Make importlib.abc.Loader.module_repr() optional instead of an
abstractmethod; now it raises NotImplementedError so as to be ignored by default.
- Issue #17678: Remove the use of deprecated method in http/cookiejar.py by
changing the call to get_origin_req_host() to origin_req_host.
- Issue #17666: Fix reading gzip files with an extra field.
- Issue #16475: Support object instancing, recursion and interned strings
in marshal
- Issue #17502: Process DEFAULT values in mock side_effect that returns iterator.
- Issue #16795: On the ast.arguments object, unify vararg with varargannotation
and kwarg and kwargannotation. Change the column offset of ast.Attribute to be
at the attribute name.
- Issue #17434: Properly raise a SyntaxError when a string occurs between future
imports.
- Issue #17117: Import and @importlib.util.set_loader now set __loader__ when
it has a value of None or the attribute doesn't exist.
- Issue #17032: The "global" in the "NameError: global name 'x' is not defined"
error message has been removed. Patch by Ram Rachum.
- Issue #18080: When building a C extension module on OS X, if the compiler
is overridden with the CC environment variable, use the new compiler as
the default for linking if LDSHARED is not also overridden. This restores
Distutils behavior introduced in 3.2.3 and inadvertently dropped in 3.3.0.
- Issue #18113: Fixed a refcount leak in the curses.panel module's
set_userptr() method. Reported by Atsuo Ishimoto.
- Implement PEP 443 "Single-dispatch generic functions".
- Implement PEP 435 "Adding an Enum type to the Python standard library".
- Issue #15596: Faster pickling of unicode strings.
- Issue #17572: Avoid chained exceptions when passing bad directives to
time.strptime(). Initial patch by Claudiu Popa.
- Issue #17435: threading.Timer's __init__ method no longer uses mutable
default values for the args and kwargs parameters.
- Issue #17526: fix an IndexError raised while passing code without filename to
inspect.findsource(). Initial patch by Tyler Doyle.
- Issue #17540: Added style parameter to logging formatter configuration by dict.
- Issue #16692: The ssl module now supports TLS 1.1 and TLS 1.2. Initial
patch by Michele Orrù.
- Issue #17025: multiprocessing: Reduce Queue and SimpleQueue contention.
- Issue #17536: Add to webbrowser's browser list: www-browser, x-www-browser,
iceweasel, iceape.
- Issue #17150: pprint now uses line continuations to wrap long string
literals.
- Issue #17488: Change the subprocess.Popen bufsize parameter default value
from unbuffered (0) to buffering (-1) to match the behavior existing code
expects and match the behavior of the subprocess module in Python 2 to avoid
introducing hard to track down bugs.
- Issue #17521: Corrected non-enabling of logger following two calls to
fileConfig().
- Issue #17508: Corrected logging MemoryHandler configuration in dictConfig()
where the target handler wasn't configured first.
- Issue #17209: curses.window.get_wch() now correctly handles KeyboardInterrupt
(CTRL+c).
- Issue #5713: smtplib now handles 421 (closing connection) error codes when
sending mail by closing the socket and reporting the 421 error code via the
exception appropriate to the command that received the error response.
- Issue #16997: unittest.TestCase now provides a subTest() context manager
to procedurally generate, in an easy way, small test instances.
- Issue #17485: Also delete the Request Content-Length header if the data
attribute is deleted. (Follow on to issue Issue #16464).
- Issue #15927: CVS now correctly parses escaped newlines and carriage
when parsing with quoting turned off.
- Issue #17467: add readline and readlines support to mock_open in
unittest.mock.
- Issue #13248: removed deprecated and undocumented difflib.isbjunk,
isbpopular.
- Issue #17192: Update the ctypes module's libffi to v3.0.13. This
specifically addresses a stack misalignment issue on x86 and issues on
some more recent platforms.
- Issue #8862: Fixed curses cleanup when getkey is interrupted by a signal.
- Issue #17443: imaplib.IMAP4_stream was using the default unbuffered IO
in subprocess, but the imap code assumes buffered IO. In Python2 this
worked by accident. IMAP4_stream now explicitly uses buffered IO.
- Issue #17476: Fixed regression relative to Python2 in undocumented pydoc
'allmethods'; it was missing unbound methods on the class.
- Issue #17474: Remove the deprecated methods of Request class.
- Issue #16709: unittest discover order is no-longer filesystem specific. Patch
by Jeff Ramnani.
- Use the HTTPS PyPI url for upload, overriding any plain HTTP URL in pypirc.
- Issue #5024: sndhdr.whichhdr now returns the frame count for WAV files
rather than -1.
- Issue #17460: Remove the strict argument of HTTPConnection and removing the
DeprecationWarning being issued from 3.2 onwards.
- Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module.
- Issue #16389: Fixed a performance regression relative to Python 3.1 in the
caching of compiled regular expressions.
- Added missing FeedParser and BytesFeedParser to email.parser.__all__.
- Issue #17431: Fix missing import of BytesFeedParser in email.parser.
- Issue #12921: http.server's send_error takes an explain argument to send more
information in response. Patch contributed by Karl.
- Issue #17414: Add timeit, repeat, and default_timer to timeit.__all__.
- Issue #1285086: Get rid of the refcounting hack and speed up
urllib.parse.unquote() and urllib.parse.unquote_to_bytes().
- Issue #17099: Have importlib.find_loader() raise ValueError when __loader__
is not set, harmonizing with what happens when the attribute is set to None.
- Expose the O_PATH constant in the os module if it is available.
- Issue #17368: Fix an off-by-one error in the Python JSON decoder that caused
a failure while decoding empty object literals when object_pairs_hook was
specified.
- Issue #17385: Fix quadratic behavior in threading.Condition. The FIFO
queue now uses a deque instead of a list.
- Issue #15806: Add contextlib.ignore(). This creates a context manager to
ignore specified exceptions, replacing the "except SomeException: pass" idiom.
- Issue #14645: The email generator classes now produce output using the
specified linesep throughout. Previously if the prolog, epilog, or
body were stored with a different linesep, that linesep was used. This
fix corrects an RFC non-compliance issue with smtplib.send_message.
- Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when
the list is being resized concurrently.
- Issue #16962: Use getdents64 instead of the obsolete getdents syscall
in the subprocess module on Linux.
- Issue #16935: unittest now counts the module as skipped if it raises SkipTest,
instead of counting it as an error. Patch by Zachary Ware.
- Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR.
- Issue #17223: array module: Fix a crasher when converting an array containing
invalid characters (outside range [U+0000; U+10ffff]) to Unicode:
repr(array), str(array) and array.tounicode(). Patch written by Manuel Jacob.
- Issue #17197: profile/cProfile modules refactored so that code of run() and
runctx() utility functions is not duplicated in both modules.
- Issue #14720: sqlite3: Convert datetime microseconds correctly.
Patch by Lowe Thiderman.
- Issue #15132: Allow a list for the defaultTest argument of
unittest.TestProgram. Patch by Jyrki Pulliainen.
- Issue #17225: JSON decoder now counts columns in the first line starting
with 1, as in other lines.
- Issue #6623: Added explicit DeprecationWarning for ftplib.netrc, which has
been deprecated and undocumented for a long time.
- Issue #13700: Fix byte/string handling in imaplib authentication when an
authobject is specified.
- Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.
- Issue #9669: Protect re against infinite loops on zero-width matching in
non-greedy repeat. Patch by Matthew Barnett.
- Issue #13169: The maximal repetition number in a regular expression has been
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
- Issue #17143: Fix a missing import in the trace module. Initial patch by
Berker Peksag.
- Issue #15220: email.feedparser's line splitting algorithm is now simpler and
faster.
- Issue #16743: Fix mmap overflow check on 32 bit Windows.
- Issue #16996: webbrowser module now uses shutil.which() to find a
web-browser on the executable search path.
- Issue #16800: tempfile.gettempdir() no longer left temporary files when
the disk is full. Original patch by Amir Szekely.
- Issue #17192: Import libffi-3.0.12.
- Issue #16564: Fixed regression relative to Python2 in the operation of
email.encoders.encode_7or8bit when used with binary data.
- Issue #17052: unittest discovery should use self.testLoader.
- Issue #4591: Uid and gid values larger than 2**31 are supported now.
- Issue #17141: random.vonmisesvariate() no longer hangs for large kappas.
- Issue #17149: Fix random.vonmisesvariate to always return results in
[0, 2*math.pi].
- Issue #1470548: XMLGenerator now works with binary output streams.
- Issue #6975: os.path.realpath() now correctly resolves multiple nested
symlinks on POSIX platforms.
- Issue #13773: sqlite3.connect() gets a new `uri` parameter to pass the
filename as a URI, allowing to pass custom options.
- Issue #16564: Fixed regression relative to Python2 in the operation of
email.encoders.encode_noop when used with binary data.
- Issue #10355: The mode, name, encoding and newlines properties now work on
SpooledTemporaryFile objects even when they have not yet rolled over.
Obsolete method xreadline (which has never worked in Python 3) has been
removed.
- Issue #16686: Fixed a lot of bugs in audioop module. Fixed crashes in
avgpp(), maxpp() and ratecv(). Fixed an integer overflow in add(), bias(),
and ratecv(). reverse(), lin2lin() and ratecv() no more lose precision for
32-bit samples. max() and rms() no more returns a negative result and
various other functions now work correctly with 32-bit sample -0x80000000.
- Issue #17073: Fix some integer overflows in sqlite3 module.
- Issue #16723: httplib.HTTPResponse no longer marked closed when the connection
is automatically closed.
- Issue #15359: Add CAN_BCM protocol support to the socket module. Patch by
Brian Thorne.
- Issue #16948: Fix quoted printable body encoding for non-latin1 character
sets in the email package.
- Issue #16811: Fix folding of headers with no value in the provisional email
policies.
- Issue #17132: Update symbol for "yield from" grammar changes.
- Issue #17076: Make copying of xattrs more tolerant of missing FS support.
Patch by Thomas Wouters.
- Issue #17089: Expat parser now correctly works with string input when the
internal XML encoding is not UTF-8 or US-ASCII. It also now accepts bytes
and strings larger than 2 GiB.
- Issue #6083: Fix multiple segmentation faults occurred when PyArg_ParseTuple
parses nested mutating sequence.
- Issue #5289: Fix ctypes.util.find_library on Solaris.
- Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
- Issue #17015: When it has a spec, a Mock object now inspects its signature
when matching calls, so that arguments can be matched positionally or
by name.
- Issue #15633: httplib.HTTPResponse is now mark closed when the server
sends less than the advertised Content-Length.
- Issue #12268: The io module file object write methods no longer abort early
when one of its write system calls is interrupted (EINTR).
- Issue #6972: The zipfile module no longer overwrites files outside of
its destination path when extracting malicious zip files.
- Issue #4844: ZipFile now raises BadZipFile when opens a ZIP file with an
incomplete "End of Central Directory" record. Original patch by Guilherme
Polo and Alan McIntyre.
- Issue #17071: Signature.bind() now works when one of the keyword arguments
is named ``self``.
- Issue #12004: Fix an internal error in PyZipFile when writing an invalid
Python file. Patch by Ben Morgan.
- Have py_compile use importlib as much as possible to avoid code duplication.
Code now raises FileExistsError if the file path to be used for the
byte-compiled file is a symlink or non-regular file as a warning that import
will not keep the file path type if it writes to that path.
- Issue #16972: Have site.addpackage() consider already known paths even when
none are explicitly passed in. Bug report and fix by Kirill.
- Issue #1602133: on Mac OS X a shared library build (``--enable-shared``)
now fills the ``os.environ`` variable correctly.
- Issue #15505: `unittest.installHandler` no longer assumes SIGINT handler is
set to a callable object.
- Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
- Issue #12411: Fix to cgi.parse_multipart to correctly use bytes boundaries
and bytes data. Patch by Jonas Wagner.
- Issue #16957: shutil.which() no longer searches a bare file name in the
current directory on Unix and no longer searches a relative file path with
a directory part in PATH directories. Patch by Thomas Kluyver.
- Issue #1159051: GzipFile now raises EOFError when reading a corrupted file
with truncated header or footer.
- Issue #16993: shutil.which() now preserves the case of the path and extension
on Windows.
- Issue #16992: On Windows in signal.set_wakeup_fd, validate the file
descriptor argument.
- Issue #16422: For compatibility with the Python version, the C version of
decimal now uses strings instead of integers for rounding mode constants.
- Issue #15861: tkinter now correctly works with lists and tuples containing
strings with whitespaces, backslashes or unbalanced braces.
- Issue #9720: zipfile now writes correct local headers for files larger than
4 GiB.
- Issue #16955: Fix the poll() method for multiprocessing's socket
connections on Windows.
- SSLContext.load_dh_params() now properly closes the input file.
- Issue #15031: Refactor some .pyc management code to cut down on code
duplication. Thanks to Ronan Lamy for the report and taking an initial stab
at the problem.
- Issue #16398: Optimize deque.rotate() so that it only moves pointers
and doesn't touch the underlying data with increfs and decrefs.
- Issue #16900: Issue a ResourceWarning when an ssl socket is left unclosed.
- Issue #13899: ``\A``, ``\Z``, and ``\B`` now correctly match the A, Z,
and B literals when used inside character classes (e.g. ``'[\A]'``).
Patch by Matthew Barnett.
- Issue #15545: Fix regression in sqlite3's iterdump method where it was
failing if the connection used a row factory (such as sqlite3.Row) that
produced unsortable objects. (Regression was introduced by fix for 9750).
- fcntl: add F_DUPFD_CLOEXEC constant, available on Linux 2.6.24+.
- Issue #15972: Fix error messages when os functions expecting a file name or
file descriptor receive the incorrect type.
- Issue #8109: The ssl module now has support for server-side SNI, thanks
to a :meth:`SSLContext.set_servername_callback` method. Patch by Daniel
Black.
- Issue #16860: In tempfile, use O_CLOEXEC when available to set the
close-on-exec flag atomically.
- Issue #16674: random.getrandbits() is now 20-40% faster for small integers.
- Issue #16009: JSON error messages now provide more information.
- Issue #16828: Fix error incorrectly raised by bz2.compress(b'') and
bz2.BZ2Compressor.compress(b''). Initial patch by Martin Packman.
- Issue #16833: In http.client.HTTPConnection, do not concatenate the request
headers and body when the payload exceeds 16 KB, since it can consume more
memory for no benefit. Patch by Benno Leslie.
- Issue #16541: tk_setPalette() now works with keyword arguments.
- Issue #16820: In configparser, `parser.popitem()` no longer raises ValueError.
This makes `parser.clean()` work correctly.
- Issue #16820: In configparser, ``parser['section'] = {}`` now preserves
section order within the parser. This makes `parser.update()` preserve section
order as well.
- Issue #16820: In configparser, ``parser['DEFAULT'] = {}`` now correctly
clears previous values stored in the default section. Same goes for
``parser.update({'DEFAULT': {}})``.
- Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.
- Issue #16787: Increase asyncore and asynchat default output buffers size, to
decrease CPU usage and increase throughput.
- Issue #10527: make multiprocessing use poll() instead of select() if available.
- Issue #16688: Now regexes contained backreferences correctly work with
non-ASCII strings. Patch by Matthew Barnett.
- Issue #16486: Make aifc files act as context managers.
- Issue #16485: Now file descriptors are closed if file header patching failed
on closing an aifc file.
- Issue #16640: Run less code under a lock in sched module.
- Issue #16165: sched.scheduler.run() no longer blocks a scheduler for other
threads.
- Issue #16641: Default values of sched.scheduler.enter() are no longer
modifiable.
- Issue #16618: Make glob.glob match consistently across strings and bytes
regarding leading dots. Patch by Serhiy Storchaka.
- Issue #16788: Add samestat to Lib/ntpath.py
- Issue #16713: Parsing of 'tel' urls using urlparse separates params from
path.
- Issue #16443: Add docstrings to regular expression match objects.
Patch by Anton Kasyanov.
- Issue #15701: Fix HTTPError info method call to return the headers information.
- Issue #16752: Add a missing import to modulefinder. Patch by Berker Peksag.
- Issue #16646: ftplib.FTP.makeport() might lose socket error details.
(patch by Serhiy Storchaka)
- Issue #16626: Fix infinite recursion in glob.glob() on Windows when the
pattern contains a wildcard in the drive or UNC path. Patch by Serhiy
Storchaka.
- Issue #15783: Except for the number methods, the C version of decimal now
supports all None default values present in decimal.py. These values were
largely undocumented.
- Issue #11175: argparse.FileType now accepts encoding and errors
arguments. Patch by Lucas Maystre.
- Issue #16488: epoll() objects now support the `with` statement. Patch
by Serhiy Storchaka.
- Issue #16298: In HTTPResponse.read(), close the socket when there is no
Content-Length and the incoming stream is finished. Patch by Eran
Rundstein.
- Issue #16049: Add abc.ABC class to enable the use of inheritance to create
ABCs, rather than the more cumbersome metaclass=ABCMeta. Patch by Bruno
Dupuis.
- Expose the TCP_FASTOPEN and MSG_FASTOPEN flags in socket when they're
available.
- Issue #15701: Add a .headers attribute to urllib.error.HTTPError. Patch
contributed by Berker Peksag.
- Issue #15872: Fix 3.3 regression introduced by the new fd-based shutil.rmtree
that caused it to not ignore certain errors when ignore_errors was set.
Patch by Alessandro Moura and Serhiy Storchaka.
- Issue #16248: Disable code execution from the user's home directory by
tkinter when the -E flag is passed to Python. Patch by Zachary Ware.
- Issue #13390: New function :func:`sys.getallocatedblocks()` returns the
number of memory blocks currently allocated.
- Issue #16628: Fix a memory leak in ctypes.resize().
- Issue #13614: Fix setup.py register failure with invalid rst in description.
Patch by Julien Courteau and Pierre Paul Lefebvre.
- Issue #13512: Create ~/.pypirc securely (CVE-2011-4944). Initial patch by
Philip Jenvey, tested by Mageia and Debian.
- Issue #7719: Make distutils ignore ``.nfs*`` files instead of choking later
on. Initial patch by SilentGhost and Jeff Ramnani.
- Issue #13120: Allow to call pdb.set_trace() from thread.
Patch by Ilya Sandler.
- Issue #16585: Make CJK encoders support error handlers that return bytes per
PEP 383.
- Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
Patch by Serhiy Storchaka.
- Issue #16333: use (",", ": ") as default separator in json when indent is
specified, to avoid trailing whitespace. Patch by Serhiy Storchaka.
- Issue #16573: In 2to3, treat enumerate() like a consuming call, so superfluous
list() calls aren't added to filter(), map(), and zip() which are directly
passed enumerate().
- Issue #16464: Reset the Content-Length header when a urllib Request is reused
with new data.
- Issue #12848: The pure Python pickle implementation now treats object
lengths as unsigned 32-bit integers, like the C implementation does.
Patch by Serhiy Storchaka.
- Issue #16423: urllib.request now has support for ``data:`` URLs. Patch by
Mathias Panzenböck.
- Issue #4473: Add a POP3.stls() to switch a clear-text POP3 session into
an encrypted POP3 session, on supported servers. Patch by Lorenzo Catucci.
- Issue #4473: Add a POP3.capa() method to query the capabilities advertised
by the POP3 server. Patch by Lorenzo Catucci.
- Issue #4473: Ensure the socket is shutdown cleanly in POP3.close().
Patch by Lorenzo Catucci.
- Issue #16522: added FAIL_FAST flag to doctest.
- Issue #15627: Add the importlib.abc.InspectLoader.source_to_code() method.
- Issue #16408: Fix file descriptors not being closed in error conditions
in the zipfile module. Patch by Serhiy Storchaka.
- Issue #14631: Add a new :class:`weakref.WeakMethod` to simulate weak
references to bound methods.
- Issue #16469: Fix exceptions from float -> Fraction and Decimal -> Fraction
conversions for special values to be consistent with those for float -> int
and Decimal -> int. Patch by Alexey Kachayev.
- Issue #16481: multiprocessing no longer leaks process handles on Windows.
- Issue #12428: Add a pure Python implementation of functools.partial().
Patch by Brian Thorne.
- Issue #16140: The subprocess module no longer double closes its child
subprocess.PIPE parent file descriptors on child error prior to exec().
- Remove a bare print to stdout from the subprocess module that could have
happened if the child process wrote garbage to its pre-exec error pipe.
- The subprocess module now raises its own SubprocessError instead of a
RuntimeError in various error situations which should not normally happen.
- Issue #16327: The subprocess module no longer leaks file descriptors
used for stdin/stdout/stderr pipes to the child when fork() fails.
- Issue #14396: Handle the odd rare case of waitpid returning 0 when not
expected in subprocess.Popen.wait().
- Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access
previously-freed memory. Patch by Serhiy Storchaka.
- Issue #16357: fix calling accept() on a SSLSocket created through
SSLContext.wrap_socket(). Original patch by Jeff McNeil.
- Issue #16409: The reporthook callback made by the legacy
urllib.request.urlretrieve API now properly supplies a constant non-zero
block_size as it did in Python 3.2 and 2.7. This matches the behavior of
urllib.request.URLopener.retrieve.
- Issue #16431: Use the type information when constructing a Decimal subtype
from a Decimal argument.
- Issue #15641: Clean up deprecated classes from importlib.
Patch by Taras Lyapun.
- Issue #16350: zlib.decompressobj().decompress() now accumulates data from
successive calls after EOF in unused_data, instead of only saving the argument
to the last call. decompressobj().flush() now correctly sets unused_data and
unconsumed_tail. A bug in the handling of MemoryError when setting the
unconsumed_tail attribute has also been fixed. Patch by Serhiy Storchaka.
- Issue #12759: sre_parse now raises a proper error when the name of the group
is missing. Initial patch by Serhiy Storchaka.
- Issue #16152: fix tokenize to ignore whitespace at the end of the code when
no newline is found. Patch by Ned Batchelder.
- Issue #16284: Prevent keeping unnecessary references to worker functions
in concurrent.futures ThreadPoolExecutor.
- Issue #16230: Fix a crash in select.select() when one the lists changes
size while iterated on. Patch by Serhiy Storchaka.
- Issue #16228: Fix a crash in the json module where a list changes size
while it is being encoded. Patch by Serhiy Storchaka.
- Issue #16351: New function gc.get_stats() returns per-generation collection
statistics.
- Issue #14897: Enhance error messages of struct.pack and
struct.pack_into. Patch by Matti Mäki.
- Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions.
Patch by Serhiy Storchaka.
- Issue #12890: cgitb no longer prints spurious <p> tags in text
mode when the logdir option is specified.
- Issue #16307: Fix multiprocessing.Pool.map_async not calling its callbacks.
Patch by Janne Karila.
- Issue #16305: Fix a segmentation fault occurring when interrupting
math.factorial.
- Issue #16116: Fix include and library paths to be correct when building C
extensions in venvs.
- Issue #16245: Fix the value of a few entities in html.entities.html5.
- Issue #16301: Fix the localhost verification in urllib/request.py for file://
urls.
- Issue #16250: Fix the invocations of URLError which had misplaced filename
attribute for exception.
- Issue #10836: Fix exception raised when file not found in urlretrieve
Initial patch by Ezio Melotti.
- Issue #14398: Fix size truncation and overflow bugs in the bz2 module.
- Issue #12692: Fix resource leak in urllib.request when talking to an HTTP
server that does not include a ``Connection: close`` header in its responses.
- Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle.
Patch by Atsuo Ishimoto.
- Improve performance of `lzma.LZMAFile` (see also issue #16034).
- Issue #16220: wsgiref now always calls close() on an iterable response.
Patch by Brent Tubbs.
- Issue #16270: urllib may hang when used for retrieving files via FTP by using
a context manager. Patch by Giampaolo Rodola'.
- Issue #16461: Wave library should be able to deal with 4GB wav files,
and sample rate of 44100 Hz.
- Issue #16176: Properly identify Windows 8 via platform.platform()
- Issue #16088: BaseHTTPRequestHandler's send_error method includes a
Content-Length header in it's response now. Patch by Antoine Pitrou.
- Issue #16114: The subprocess module no longer provides a misleading error
message stating that args[0] did not exist when either the cwd or executable
keyword arguments specified a path that did not exist.
- Issue #16169: Fix ctypes.WinError()'s confusion between errno and winerror.
- Issue #16110: logging.fileConfig now accepts a pre-initialised ConfigParser
instance.
- Issue #1492704: shutil.copyfile() raises a distinct SameFileError now if
source and destination are the same file. Patch by Atsuo Ishimoto.
- Issue #13896: Make shelf instances work with 'with' as context managers.
Original patch by Filip Gruszczyński.
- Issue #15417: Add support for csh and fish in venv activation scripts.
- Issue #14377: ElementTree.write and some of the module-level functions have
a new parameter - *short_empty_elements*. It controls how elements with no
contents are emitted.
- Issue #16089: Allow ElementTree.TreeBuilder to work again with a non-Element
element_factory (fixes a regression in SimpleTAL).
- Issue #9650: List commonly used format codes in time.strftime and
time.strptime docsttings. Original patch by Mike Hoy.
- Issue #15452: logging configuration socket listener now has a verify option
that allows an application to apply a verification function to the
received configuration data before it is acted upon.
- Issue #16034: Fix performance regressions in the new `bz2.BZ2File`
implementation. Initial patch by Serhiy Storchaka.
- `pty.spawn()` now returns the child process status returned by `os.waitpid()`.
- Issue #15756: `subprocess.poll()` now properly handles `errno.ECHILD` to
return a returncode of 0 when the child has already exited or cannot be waited
on.
- Issue #15323: Improve failure message of `Mock.assert_called_once_with()`.
- Issue #16064: ``unittest -m`` claims executable is "python", not "python3".
- Issue #12376: Pass on parameters in `TextTestResult.__init__()` super call.
- Issue #15222: Insert blank line after each message in mbox mailboxes.
- Issue #16013: Fix `csv.Reader` parsing issue with ending quote characters.
Patch by Serhiy Storchaka.
- Issue #15421: Fix an OverflowError in `Calendar.itermonthdates()` after
`datetime.MAXYEAR`. Patch by Cédric Krier.
- Issue #16112: platform.architecture does not correctly escape argument to
/usr/bin/file. Patch by David Benjamin.
- Issue #15970: `xml.etree.ElementTree` now serializes correctly the empty HTML
elements 'meta' and 'param'.
- Issue #15842: The `SocketIO.{readable,writable,seekable}` methods now raise
ValueError when the file-like object is closed. Patch by Alessandro Moura.
- Issue #15876: Fix a refleak in the `curses` module: window.encoding.
- Issue #15881: Fix `atexit` hook in `multiprocessing`. Original patch by Chris
McDonough.
- Issue #15841: The readable(), writable() and seekable() methods of
`io.BytesIO` and `io.StringIO` objects now raise ValueError when the object
has been closed. Patch by Alessandro Moura.
- Issue #15447: Use `subprocess.DEVNULL` in webbrowser, instead of opening
`os.devnull` explicitly and leaving it open.
- Issue #15509: `webbrowser.UnixBrowser` no longer passes empty arguments to
Popen when ``%action`` substitutions produce empty strings.
- Issue #12776, issue #11839: Call `argparse` type function (specified by
add_argument) only once. Before, the type function was called twice in the
case where the default was specified and the argument was given as well. This
was especially problematic for the FileType type, as a default file would
always be opened, even if a file argument was specified on the command line.
- Issue #15906: Fix a regression in argparse caused by the preceding change,
when ``action='append'``, ``type='str'`` and ``default=[]``.
- Issue #16113: Added sha3 module based on the Keccak reference implementation
3.2. The `hashlib` module has four additional hash algorithms: `sha3_224`,
`sha3_256`, `sha3_384` and `sha3_512`. As part of the patch some common
code was moved from _hashopenssl.c to hashlib.h.
- ctypes.call_commethod was removed, since its only usage was in the defunct
samples directory.
- Issue #16692: Added TLSv1.1 and TLSv1.2 support for the ssl modules.
- Issue #16832: add abc.get_cache_token() to expose cache validity checking
support in ABCMeta.
IDLE
----
- Issue #18429: Format / Format Paragraph, now works when comment blocks
are selected. As with text blocks, this works best when the selection
only includes complete lines.
- Issue #18226: Add docstrings and unittests for FormatParagraph.py.
Original patches by Todd Rovito and Phil Webster.
- Issue #18279: Format - Strip trailing whitespace no longer marks a file as
changed when it has not been changed. This fix followed the addition of a
test file originally written by Phil Webster (the issue's main goal).
- Issue #7136: In the Idle File menu, "New Window" is renamed "New File".
Patch by Tal Einat, Roget Serwy, and Todd Rovito.
- Remove dead imports of imp.
- Issue #18196: Avoid displaying spurious SystemExit tracebacks.
- Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
- Issue #17511: Keep IDLE find dialog open after clicking "Find Next".
Original patch by Sarah K.
- Issue #18055: Move IDLE off of imp and on to importlib.
- Issue #15392: Create a unittest framework for IDLE.
Initial patch by Rajagopalasarma Jayakrishnan.
See Lib/idlelib/idle_test/README.txt for how to run Idle tests.
- Issue #14146: Highlight source line while debugging on Windows.
- Issue #17838: Allow sys.stdin to be reassigned.
- Issue #13495: Avoid loading the color delegator twice in IDLE.
- Issue #17798: Allow IDLE to edit new files when specified on command line.
- Issue #14735: Update IDLE docs to omit "Control-z on Windows".
- Issue #17532: Always include Options menu for IDLE on OS X.
Patch by Guilherme Simões.
- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
- Issue #17657: Show full Tk version in IDLE's about dialog.
Patch by Todd Rovito.
- Issue #17613: Prevent traceback when removing syntax colorizer in IDLE.
- Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE.
- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
- Issue #17625: In IDLE, close the replace dialog after it is used.
- Issue #14254: IDLE now handles readline correctly across shell restarts.
- Issue #17614: IDLE no longer raises exception when quickly closing a file.
- Issue #6698: IDLE now opens just an editor window when configured to do so.
- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
raises an exception.
- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
- Issue #17114: IDLE now uses non-strict config parser.
- Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase
interface and support all mandatory methods and properties.
- Issue #5066: Update IDLE docs. Patch by Todd Rovito.
- Issue #16829: IDLE printing no longer fails if there are spaces or other
special characters in the file path.
- Issue #16491: IDLE now prints chained exception tracebacks.
- Issue #16819: IDLE method completion now correctly works for bytes literals.
- Issue #16504: IDLE now catches SyntaxErrors raised by tokenizer. Patch by
Roger Serwy.
- Issue #16511: Use default IDLE width and height if config param is not valid.
Patch Serhiy Storchaka.
- Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu.
Patch by Todd Rovito.
- Issue #16123: IDLE - deprecate running without a subprocess.
Patch by Roger Serwy.
Tests
-----
- Issue #1666318: Add a test that shutil.copytree() retains directory
permissions. Patch by Catherine Devlin.
- Issue #18273: move the tests in Lib/test/json_tests to Lib/test/test_json
and make them discoverable by unittest. Patch by Zachary Ware.
- Fix a fcntl test case on KFreeBSD, Debian #708653 (Petr Salinger).
- Issue #18396: Fix spurious test failure in test_signal on Windows when
faulthandler is enabled (Patch by Jeremy Kloth)
- Issue #17046: Fix broken test_executable_without_cwd in test_subprocess.
- Issue #15415: Add new temp_dir() and change_cwd() context managers to
test.support, and refactor temp_cwd() to use them. Patch by Chris Jerdonek.
- Issue #15494: test.support is now a package rather than a module (Initial
patch by Indra Talip)
- Issue #17944: test_zipfile now discoverable and uses subclassing to
generate tests for different compression types. Fixed a bug with skipping
some tests due to use of exhausted iterators.
- Issue #18266: test_largefile now works with unittest test discovery and
supports running only selected tests. Patch by Zachary Ware.
- Issue #17767: test_locale now works with unittest test discovery.
Original patch by Zachary Ware.
- Issue #18375: Assume --randomize when --randseed is used for running the
testsuite.
- Issue #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé.
- Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds
in ASN1_TIME fields.
- Issue #18094: test_uuid no longer reports skipped tests as passed.
- Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't
accidentally hang.
- Issue #17833: Fix test_gdb failures seen on machines where debug symbols
for glibc are available (seen on PPC64 Linux).
- Issue #7855: Add tests for ctypes/winreg for issues found in IronPython.
Initial patch by Dino Viehland.
- Issue #11078: test___all__ now checks for duplicates in __all__.
Initial patch by R. David Murray.
- Issue #17712: Fix test_gdb failures on Ubuntu 13.04.
- Issue #17835: Fix test_io when the default OS pipe buffer size is larger
than one million bytes.
- Issue #17065: Use process-unique key for winreg tests to avoid failures if
test is run multiple times in parallel (eg: on a buildbot host).
- Issue #12820: add tests for the xml.dom.minicompat module.
Patch by John Chandler and Phil Connell.
- Issue #17691: test_univnewlines now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17790: test_set now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17789: test_random now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17779: test_osx_env now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17766: test_iterlen now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17690: test_time now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17692: test_sqlite now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #11995: test_pydoc doesn't import all sys.path modules anymore.
- Issue #17448: test_sax now skips if there are no xml parsers available
instead of raising an ImportError.
- Issue #11420: make test suite pass with -B/DONTWRITEBYTECODE set.
Initial patch by Thomas Wouters.
- Issue #10652: make tcl/tk tests run after __all__ test, patch by
Zachary Ware.
- Issue #11963: remove human verification from test_parser and test_subprocess.
- Issue #11732: add a new suppress_crash_popup() context manager to test.support
that disables crash popups on Windows and use it in test_faulthandler and
test_capi.
- Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.
- Issue #17283: Share code between `__main__.py` and `regrtest.py` in
`Lib/test`.
- Issue #17249: convert a test in test_capi to use unittest and reap threads.
- Issue #17107: Test client-side SNI support in urllib.request thanks to
the new server-side SNI support in the ssl module. Initial patch by
Daniel Black.
- Issue #17041: Fix testing when Python is configured with the
--without-doc-strings.
- Issue #16923: Fix ResourceWarnings in test_ssl.
- Issue #15539: Added regression tests for Tools/scripts/pindent.py.
- Issue #17479: test_io now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17066: test_robotparser now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17334: test_index now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17333: test_imaplib now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17082: test_dbm* now work with unittest test discovery.
Patch by Zachary Ware.
- Issue #17079: test_ctypes now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17304: test_hash now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #17303: test_future* now work with unittest test discovery.
Patch by Zachary Ware.
- Issue #17163: test_file now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16925: test_configparser now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16918: test_codecs now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16919: test_crypt now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16910: test_bytes, test_unicode, and test_userstring now work with
unittest test discovery. Patch by Zachary Ware.
- Issue #16905: test_warnings now works with unittest test discovery.
Initial patch by Berker Peksag.
- Issue #16898: test_bufio now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16888: test_array now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16896: test_asyncore now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16897: test_bisect now works with unittest test discovery.
Initial patch by Zachary Ware.
- Issue #16852: test_genericpath, test_posixpath, test_ntpath, and test_macpath
now work with unittest test discovery. Patch by Zachary Ware.
- Issue #16748: test_heapq now works with unittest test discovery.
- Issue #10646: Tests rearranged for os.samefile/samestat to check for not
just symlinks but also hard links.
- Issue #15302: Switch regrtest from using getopt to using argparse.
- Issue #15324: Fix regrtest parsing of --fromfile, --match, and --randomize
options.
- Issue #16702: test_urllib2_localnet tests now correctly ignores proxies for
localhost tests.
- Issue #16664: Add regression tests for glob's behaviour concerning entries
starting with a ".". Patch by Sebastian Kreft.
- Issue #13390: The ``-R`` option to regrtest now also checks for memory
allocation leaks, using :func:`sys.getallocatedblocks()`.
- Issue #16559: Add more tests for the json module, including some from the
official test suite at json.org. Patch by Serhiy Storchaka.
- Issue #16661: Fix the `os.getgrouplist()` test by not assuming that it gives
the same output as :command:`id -G`.
- Issue #16115: Add some tests for the executable argument to
subprocess.Popen(). Initial patch by Kushal Das.
- Issue #16126: PyErr_Format format mismatch in _testcapimodule.c.
Patch by Serhiy Storchaka.
- Issue #15304: Fix warning message when `os.chdir()` fails inside
`test.support.temp_cwd()`. Patch by Chris Jerdonek.
- Issue #15802: Fix test logic in `TestMaildir.test_create_tmp()`. Patch by
Serhiy Storchaka.
- Issue #15557: Added a test suite for the webbrowser module, thanks to Anton
Barkovsky.
- Issue #16698: Skip posix test_getgroups when built with OS X
deployment target prior to 10.6.
Build
-----
- Issue #16067: Add description into MSI file to replace installer's
temporary name.
- Issue #18257: Fix readlink usage in python-config. Install the python
version again on Darwin.
- Issue #18481: Add C coverage reporting with gcov and lcov. A new make target
"coverage-report" creates an instrumented Python build, runs unit tests
and creates a HTML. The report can be updated with "make coverage-lcov".
- Issue #17845: Clarified the message printed when some module are not built.
- Issue #18256: Compilation fix for recent AIX releases. Patch by
David Edelsohn.
- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC
4.8.
- Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1
on Windows.
- Issue #17591: Use lowercase filenames when including Windows header files.
Patch by Roumen Petrov.
- Issue #17550: Fix the --enable-profiling configure switch.
- Issue #17425: Build with openssl 1.0.1d on Windows.
- Issue #16754: Fix the incorrect shared library extension on linux. Introduce
two makefile macros SHLIB_SUFFIX and EXT_SUFFIX. SO now has the value of
SHLIB_SUFFIX again (as in 2.x and 3.1). The SO macro is removed in 3.4.
- Issue #5033: Fix building of the sqlite3 extension module when the
SQLite library version has "beta" in it. Patch by Andreas Pelme.
- Issue #17228: Fix building without pymalloc.
- Issue #3718: Use AC_ARG_VAR to set MACHDEP in configure.ac.
- Issue #16235: Implement python-config as a shell script.
- Issue #16769: Remove outdated Visual Studio projects.
- Issue #17031: Fix running regen in cross builds.
- Issue #3754: fix typo in pthread AC_CACHE_VAL.
- Issue #15484: Fix _PYTHON_PROJECT_BASE for srcdir != builddir builds;
use _PYTHON_PROJECT_BASE in distutils/sysconfig.py.
- Drop support for Windows 2000 (changeset e52df05b496a).
- Issue #17029: Let h2py search the multiarch system include directory.
- Issue #16953: Fix socket module compilation on platforms with
HAVE_BROKEN_POLL. Patch by Jeffrey Armstrong.
- Issue #16320: Remove redundant Makefile dependencies for strings and bytes.
- Cross compiling needs host and build settings. configure no longer
creates a broken PYTHON_FOR_BUILD variable when --build is missing.
- Fix cross compiling issue in setup.py, ensure that lib_dirs and inc_dirs are
defined in cross compiling mode, too.
- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
- Issue #16593: Have BSD 'make -s' do the right thing, thanks to Daniel Shahaf
- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
- Issue #15298: ensure _sysconfigdata is generated in build directory, not
source directory.
- Issue #15833: Fix a regression in 3.3 that resulted in exceptions being
raised if importlib failed to write byte-compiled files. This affected
attempts to build Python out-of-tree from a read-only source directory.
- Issue #15923: Fix a mistake in ``asdl_c.py`` that resulted in a TypeError
after 2801bf875a24 (see #15801).
- Issue #16135: Remove OS/2 support.
- Issue #15819: Make sure we can build Python out-of-tree from a read-only
source directory. (Somewhat related to issue #9860.)
- Issue #15587: Enable Tk high-resolution text rendering on Macs with
Retina displays. Applies to Tkinter apps, such as IDLE, on OS X
framework builds linked with Cocoa Tk 8.5.
- Issue #17161: make install now also installs a python3 man page.
C-API
-----
- Issue #18351: Fix various issues in a function in importlib provided to help
PyImport_ExecCodeModuleWithPathnames() (and thus by extension
PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx()).
- Issue #9369: The types of `char*` arguments of PyObject_CallFunction() and
PyObject_CallMethod() now changed to `const char*`. Based on patches by
Jörg Müller and Lars Buitinck.
- Issue #17206: Py_CLEAR(), Py_DECREF(), Py_XINCREF() and Py_XDECREF() now
expand their arguments once instead of multiple times. Patch written by Illia
Polosukhin.
- Issue #17522: Add the PyGILState_Check() API.
- Issue #17327: Add PyDict_SetDefault.
- Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
- Issue #16505: Remove unused Py_TPFLAGS_INT_SUBCLASS.
- Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned
(unsigned long and unsigned int) to avoid an undefined behaviour with
Py_TPFLAGS_TYPE_SUBCLASS ((1 << 31). PyType_GetFlags() result type is
now unsigned too (unsigned long, instead of long).
- Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
endianness detection and handling.
Documentation
-------------
- Issue #17701: Improving strftime documentation.
- Issue #18440: Clarify that `hash()` can truncate the value returned from an
object's custom `__hash__()` method.
- Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
- Issue #14097: improve the "introduction" page of the tutorial.
- Issue #17977: The documentation for the cadefault argument's default value
in urllib.request.urlopen() is fixed to match the code.
- Issue #6696: add documentation for the Profile objects, and improve
profile/cProfile docs. Patch by Tom Pinckney.
- Issue #15940: Specify effect of locale on time functions.
- Issue #17538: Document XML vulnerabilties
- Issue #16642: sched.scheduler timefunc initial default is time.monotonic.
Patch by Ramchandra Apte
- Issue #17047: remove doubled words in docs and docstrings
reported by Serhiy Storchaka and Matthew Barnett.
- Issue #15465: Document the versioning macros in the C API docs rather than
the standard library docs. Patch by Kushal Das.
- Issue #16406: Combine the pages for uploading and registering to PyPI.
- Issue #16403: Document how distutils uses the maintainer field in
PKG-INFO. Patch by Jyrki Pulliainen.
- Issue #16695: Document how glob handles filenames starting with a
dot. Initial patch by Jyrki Pulliainen.
- Issue #8890: Stop advertising an insecure practice by replacing uses
of the /tmp directory with better alternatives in the documentation.
Patch by Geoff Wilson.
- Issue #17203: add long option names to unittest discovery docs.
- Issue #13094: add "Why do lambdas defined in a loop with different values
all return the same result?" programming FAQ.
- Issue #14901: Update portions of the Windows FAQ.
Patch by Ashish Nitin Patil.
- Issue #16267: Better document the 3.3+ approach to combining
@abstractmethod with @staticmethod, @classmethod and @property
- Issue #15209: Clarify exception chaining description in exceptions module
documentation
- Issue #15990: Improve argument/parameter documentation.
- Issue #16209: Move the documentation for the str built-in function to a new
str class entry in the "Text Sequence Type" section.
- Issue #13538: Improve str() and object.__str__() documentation.
- Issue #16489: Make it clearer that importlib.find_loader() needs parent
packages to be explicitly imported.
- Issue #16400: Update the description of which versions of a given package
PyPI displays.
- Issue #15677: Document that zlib and gzip accept a compression level of 0 to
mean 'no compression'. Patch by Brian Brazil.
- Issue #16197: Update winreg docstrings and documentation to match code.
Patch by Zachary Ware.
- Issue #8040: added a version switcher to the documentation. Patch by
Yury Selivanov.
- Issue #16241: Document -X faulthandler command line option.
Patch by Marek Šuppa.
- Additional comments and some style changes in the concurrent.futures URL
retrieval example
- Issue #16115: Improve subprocess.Popen() documentation around args, shell,
and executable arguments.
- Issue #13498: Clarify docs of os.makedirs()'s exist_ok argument. Done with
great native-speaker help from R. David Murray.
- Issue #15533: Clarify docs and add tests for `subprocess.Popen()`'s cwd
argument.
- Issue #15979: Improve timeit documentation.
- Issue #16036: Improve documentation of built-in `int()`'s signature and
arguments.
- Issue #15935: Clarification of `argparse` docs, re: add_argument() type and
default arguments. Patch contributed by Chris Jerdonek.
- Issue #11964: Document a change in v3.2 to the behavior of the indent
parameter of json encoding operations.
- Issue #15116: Remove references to appscript as it is no longer being
supported.
Tools/Demos
-----------
- Issue #18817: Fix a resource warning in Lib/aifc.py demo. Patch by
Vajrasky Kok.
- Issue #18439: Make patchcheck work on Windows for ACKS, NEWS.
- Issue #18448: Fix a typo in Tools/demo/eiffel.py.
- Issue #18457: Fixed saving of formulas and complex numbers in
Tools/demo/ss1.py.
- Issue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by
Févry Thibault.
- Issue #12990: The "Python Launcher" on OSX could not launch python scripts
that have paths that include wide characters.
- Issue #15239: Make mkstringprep.py work again on Python 3.
- Issue #17028: Allowed Python arguments to be supplied to the Windows
launcher.
- Issue #17156: pygettext.py now detects the encoding of source files and
correctly writes and escapes non-ascii characters.
- Issue #15539: Fix a number of bugs in Tools/scripts/pindent.py. Now
pindent.py works with a "with" statement. pindent.py no longer produces
improper indentation. pindent.py now works with continued lines broken after
"class" or "def" keywords and with continuations at the start of line.
- Issue #11797: Add a 2to3 fixer that maps reload() to imp.reload().
- Issue #10966: Remove the concept of unexpected skipped tests.
- Issue #9893: Removed the Misc/Vim directory.
- Removed the Misc/TextMate directory.
- Issue #16245: Add the Tools/scripts/parse_html5_entities.py script to parse
the list of HTML5 entities and update the html.entities.html5 dictionary.
- Issue #15378: Fix Tools/unicode/comparecodecs.py. Patch by Serhiy Storchaka.
- Issue #16549: Make json.tool work again on Python 3 and add tests.
Initial patch by Berker Peksag and Serhiy Storchaka.
- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py.
Patch by Serhiy Storchaka.
Windows
-------
- Issue #18569: The installer now adds .py to the PATHEXT variable when extensions
are registered. Patch by Paul Moore.
What's New in Python 3.3.0?
===========================
*Release date: 29-Sep-2012*
Core and Builtins
-----------------
- Issue #16046: Fix loading sourceless legacy .pyo files.
- Issue #16060: Fix refcounting bug when `__trunc__()` returns an object whose
`__int__()` gives a non-integer. Patch by Serhiy Storchaka.
Extension Modules
-----------------
- Issue #16012: Fix a regression in pyexpat. The parser's `UseForeignDTD()`
method doesn't require an argument again.
What's New in Python 3.3.0 Release Candidate 3?
===============================================
*Release date: 23-Sep-2012*
Core and Builtins
-----------------
- Issue #15900: Fix reference leak in `PyUnicode_TranslateCharmap()`.
- Issue #15926: Fix crash after multiple reinitializations of the interpreter.
- Issue #15895: Fix FILE pointer leak in one error branch of
`PyRun_SimpleFileExFlags()` when filename points to a pyc/pyo file, closeit is
false an and set_main_loader() fails.
- Fixes for a few crash and memory leak regressions found by Coverity.
Library
-------
- Issue #15882: Change `_decimal` to accept any coefficient tuple when
constructing infinities. This is done for backwards compatibility with
decimal.py: Infinity coefficients are undefined in _decimal (in accordance
with the specification).
- Issue #15925: Fix a regression in `email.util` where the `parsedate()` and
`parsedate_tz()` functions did not return None anymore when the argument could
not be parsed.
Extension Modules
-----------------
- Issue #15973: Fix a segmentation fault when comparing datetime timezone
objects.
- Issue #15977: Fix memory leak in Modules/_ssl.c when the function
_set_npn_protocols() is called multiple times, thanks to Daniel Sommermann.
- Issue #15969: `faulthandler` module: rename dump_tracebacks_later() to
dump_traceback_later() and cancel_dump_tracebacks_later() to
cancel_dump_traceback_later().
- _decimal module: use only C 89 style comments.
What's New in Python 3.3.0 Release Candidate 2?
===============================================
*Release date: 09-Sep-2012*
Core and Builtins
-----------------
- Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator chains
ran concurrently and involved subclasses of built-in container types.
- Issue #15784: Modify `OSError`.__str__() to better distinguish between errno
error numbers and Windows error numbers.
- Issue #15781: Fix two small race conditions in import's module locking.
Library
-------
- Issue #17158: Add 'symbols' to help() welcome message; clarify
'modules spam' messages.
- Issue #15847: Fix a regression in argparse, which did not accept tuples as
argument lists anymore.
- Issue #15828: Restore support for C extensions in `imp.load_module()`.
- Issue #15340: Fix importing the random module when ``/dev/urandom`` cannot be
opened. This was a regression caused by the hash randomization patch.
- Issue #10650: Deprecate the watchexp parameter of the `Decimal.quantize()`
method.
- Issue #15785: Modify `window.get_wch()` API of the curses module: return a
character for most keys, and an integer for special keys, instead of always
returning an integer. So it is now possible to distinguish special keys like
keypad keys.
- Issue #14223: Fix `window.addch()` of the curses module for special characters
like curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now
calling the C function waddch()/mvwaddch() (as it was done in Python 3.2),
instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still
calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked
to libncursesw.
Build
-----
- Issue #15822: Really ensure 2to3 grammar pickles are properly installed
(replaces fixes for Issue #15645).
Documentation
-------------
- Issue #15814: The memoryview enhancements in 3.3.0 accidentally permitted the
hashing of multi-dimensional memorviews and memoryviews with multi-byte item
formats. The intended restrictions have now been documented - they will be
correctly enforced in 3.3.1.
What's New in Python 3.3.0 Release Candidate 1?
===============================================
*Release date: 25-Aug-2012*
Core and Builtins
-----------------
- Issue #15573: memoryview comparisons are now performed by value with full
support for any valid struct module format definition.
- Issue #15316: When an item in the fromlist for `__import__()` doesn't exist,
don't raise an error, but if an exception is raised as part of an import do
let that propagate.
- Issue #15778: Ensure that ``str(ImportError(msg))`` returns a str even when
msg isn't a str.
- Issue #2051: Source file permission bits are once again correctly copied to
the cached bytecode file. (The migration to importlib reintroduced this
problem because these was no regression test. A test has been added as part of
this patch)
- Issue #15761: Fix crash when ``PYTHONEXECUTABLE`` is set on Mac OS X.
- Issue #15726: Fix incorrect bounds checking in PyState_FindModule. Patch by
Robin Schreiber.
- Issue #15604: Update uses of `PyObject_IsTrue()` to check for and handle
errors correctly. Patch by Serhiy Storchaka.
- Issue #14846: `importlib.FileFinder` now handles the case where the directory
being searched is removed after a previous import attempt.
Library
-------
- Issue #13370: Ensure that ctypes works on Mac OS X when Python is compiled
using the clang compiler.
- Issue #13072: The array module's 'u' format code is now deprecated and will be
removed in Python 4.0.
- Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
- Issue #15776: Allow pyvenv to work in existing directory with --clean.
- Issue #15249: email's BytesGenerator now correctly mangles From lines (when
requested) even if the body contains undecodable bytes.
- Issue #15777: Fix a refleak in _posixsubprocess.
- Issue #665194: Update `email.utils.localtime` to use datetime.astimezone and
correctly handle historic changes in UTC offsets.
- Issue #15199: Fix JavaScript's default MIME type to application/javascript.
Patch by Bohuslav Kabrda.
- Issue #12643: `code.InteractiveConsole` now respects `sys.excepthook` when
displaying exceptions. Patch by Aaron Iles.
- Issue #13579: `string.Formatter` now understands the 'a' conversion specifier.
- Issue #15595: Fix ``subprocess.Popen(universal_newlines=True)`` for certain
locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
- Issue #15477: In cmath and math modules, add workaround for platforms whose
system-supplied log1p function doesn't respect signs of zeros.
- Issue #15715: `importlib.__import__()` will silence an ImportError when the
use of fromlist leads to a failed import.
- Issue #14669: Fix pickling of connections and sockets on Mac OS X by
sending/receiving an acknowledgment after file descriptor transfer.
TestPicklingConnection has been reenabled for Mac OS X.
- Issue #11062: Fix adding a message from file to Babyl mailbox.
- Issue #15646: Prevent equivalent of a fork bomb when using `multiprocessing`
on Windows without the ``if __name__ == '__main__'`` idiom.
IDLE
----
- Issue #15678: Fix IDLE menus when started from OS X command line (3.3.0b2
regression).
Documentation
-------------
- Touched up the Python 2 to 3 porting guide.
- Issue #14674: Add a discussion of the `json` module's standard compliance.
Patch by Chris Rebert.
- Create a 'Concurrent Execution' section in the docs, and split up the
'Optional Operating System Services' section to use a more user-centric
classification scheme (splitting them across the new CE section, IPC and text
processing). Operating system limitations can be reflected with the Sphinx
``:platform:`` tag, it doesn't make sense as part of the Table of Contents.
- Issue #4966: Bring the sequence docs up to date for the Py3k transition and
the many language enhancements since they were original written.
- The "path importer" misnomer has been replaced with Eric Snow's
more-awkward-but-at-least-not-wrong suggestion of "path based finder" in the
import system reference docs.
- Issue #15640: Document `importlib.abc.Finder` as deprecated.
- Issue #15630: Add an example for "continue" stmt in the tutorial. Patch by
Daniel Ellis.
Tests
-----
- Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the
UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected tests in
test_posix.py to account for this.
- Issue #15285: Refactor the approach for testing connect timeouts using two
external hosts that have been configured specifically for this type of test.
- Issue #15743: Remove the deprecated method usage in `urllib` tests. Patch by
Jeff Knupp.
- Issue #15615: Add some tests for the `json` module's handling of invalid input
data. Patch by Kushal Das.
Build
-----
- Output lib files for PGO build into PGO directory.
- Pick up 32-bit launcher from PGO directory on 64-bit PGO build.
- Drop ``PC\python_nt.h`` as it's not used. Add input dependency on custom
build step.
- Issue #15511: Drop explicit dependency on pythonxy.lib from _decimal amd64
configuration.
- Add missing PGI/PGO configurations for pywlauncher.
- Issue #15645: Ensure 2to3 grammar pickles are properly installed.
What's New in Python 3.3.0 Beta 2?
==================================
*Release date: 12-Aug-2012*
Core and Builtins
-----------------
- Issue #15568: Fix the return value of ``yield from`` when StopIteration is
raised by a custom iterator.
- Issue #13119: `sys.stdout` and `sys.stderr` are now using "\r\n" newline on
Windows, as Python 2.
- Issue #15534: Fix the fast-search function for non-ASCII Unicode strings.
- Issue #15508: Fix the docstring for `__import__()` to have the proper default
value of 0 for 'level' and to not mention negative levels since they are not
supported.
- Issue #15425: Eliminated traceback noise from more situations involving
importlib.
- Issue #14578: Support modules registered in the Windows registry again.
- Issue #15466: Stop using TYPE_INT64 in marshal, to make importlib.h (and other
byte code files) equal between 32-bit and 64-bit systems.
- Issue #1692335: Move initial exception args assignment to
`BaseException.__new__()` to help pickling of naive subclasses.
- Issue #12834: Fix `PyBuffer_ToContiguous()` for non-contiguous arrays.
- Issue #15456: Fix code `__sizeof__()` after #12399 change. Patch by Serhiy
Storchaka.
- Issue #15404: Refleak in PyMethodObject repr.
- Issue #15394: An issue in `PyModule_Create()` that caused references to be
leaked on some error paths has been fixed. Patch by Julia Lawall.
- Issue #15368: An issue that caused bytecode generation to be non-deterministic
has been fixed.
- Issue #15202: Consistently use the name "follow_symlinks" for new parameters
in os and shutil functions.
- Issue #15314: ``__main__.__loader__`` is now set correctly during interpreter
startup.
- Issue #15111: When a module imported using 'from import' has an ImportError
inside itself, don't mask that fact behind a generic ImportError for the
module itself.
- Issue #15293: Add GC support to the AST base node type.
- Issue #15291: Fix a memory leak where AST nodes where not properly
deallocated.
- Issue #15110: Fix the tracebacks generated by "import xxx" to not show the
importlib stack frames.
- Issue #16369: Global PyTypeObjects not initialized with PyType_Ready(...).
- Issue #15020: The program name used to search for Python's path is now
"python3" under Unix, not "python".
- Issue #15897: zipimport.c doesn't check return value of fseek().
Patch by Felipe Cruz.
- Issue #15033: Fix the exit status bug when modules invoked using -m switch,
return the proper failure return value (1). Patch contributed by Jeff Knupp.
- Issue #15229: An `OSError` subclass whose __init__ doesn't call back
OSError.__init__ could produce incomplete instances, leading to crashes when
calling str() on them.
- Issue #15307: Virtual environments now use symlinks with framework builds on
Mac OS X, like other POSIX builds.
Library
-------
- Issue #14590: configparser now correctly strips inline comments when delimiter
occurs earlier without preceding space.
- Issue #15424: Add a `__sizeof__()` implementation for array objects. Patch by
Ludwig Hähne.
- Issue #15576: Allow extension modules to act as a package's __init__ module.
- Issue #15502: Have `importlib.invalidate_caches()` work on `sys.meta_path`
instead of `sys.path_importer_cache`.
- Issue #15163: Pydoc shouldn't list __loader__ as module data.
- Issue #15471: Do not use mutable objects as defaults for
`importlib.__import__()`.
- Issue #15559: To avoid a problematic failure mode when passed to the bytes
constructor, objects in the ipaddress module no longer implement `__index__()`
(they still implement `__int__()` as appropriate).
- Issue #15546: Fix handling of pathological input data in the peek() and
read1() methods of the BZ2File, GzipFile and LZMAFile classes.
- Issue #12655: Instead of requiring a custom type, `os.sched_getaffinity()` and
`os.sched_setaffinity()` now use regular sets of integers to represent the
CPUs a process is restricted to.
- Issue #15538: Fix compilation of the `socket.getnameinfo()` /
`socket.getaddrinfo()` emulation code. Patch by Philipp Hagemeister.
- Issue #15519: Properly expose WindowsRegistryFinder in importlib (and use the
correct term for it). Original patch by Eric Snow.
- Issue #15502: Bring the importlib ABCs into line with the current state of the
import protocols given PEP 420. Original patch by Eric Snow.
- Issue #15499: Launching a webbrowser in Unix used to sleep for a few seconds.
Original patch by Anton Barkovsky.
- Issue #15463: The faulthandler module truncates strings to 500 characters,
instead of 100, to be able to display long file paths.
- Issue #6056: Make `multiprocessing` use setblocking(True) on the sockets it
uses. Original patch by J Derek Wilson.
- Issue #15364: Fix sysconfig.get_config_var('srcdir') to be an absolute path.
- Issue #15413: `os.times()` had disappeared under Windows.
- Issue #15402: An issue in the struct module that caused `sys.getsizeof()` to
return incorrect results for struct.Struct instances has been fixed. Initial
patch by Serhiy Storchaka.
- Issue #15232: When mangle_from is True, `email.Generator` now correctly
mangles lines that start with 'From ' that occur in a MIME preamble or
epilogue.
- Issue #15094: Incorrectly placed #endif in _tkinter.c. Patch by Serhiy
Storchaka.
- Issue #13922: `argparse` no longer incorrectly strips '--'s that appear after
the first one.
- Issue #12353: `argparse` now correctly handles null argument values.
- Issue #10017, issue #14998: Fix TypeError using pprint on dictionaries with
user-defined types as keys or other unorderable keys.
- Issue #15397: `inspect.getmodulename()` is now based directly on importlib via
a new `importlib.machinery.all_suffixes()` API.
- Issue #14635: `telnetlib` will use poll() rather than select() when possible to
avoid failing due to the select() file descriptor limit.
- Issue #15180: Clarify posixpath.join() error message when mixing str & bytes.
- Issue #15343: pkgutil now includes an iter_importer_modules implementation for
importlib.machinery.FileFinder (similar to the way it already handled
zipimport.zipimporter).
- Issue #15314: runpy now sets __main__.__loader__ correctly.
- Issue #15357: The import emulation in pkgutil is now deprecated. pkgutil uses
importlib internally rather than the emulation.
- Issue #15233: Python now guarantees that callables registered with the atexit
module will be called in a deterministic order.
- Issue #15238: `shutil.copystat()` now copies Linux "extended attributes".
- Issue #15230: runpy.run_path now correctly sets __package__ as described in
the documentation.
- Issue #15315: Support VS 2010 in distutils cygwincompiler.
- Issue #15294: Fix a regression in pkgutil.extend_path()'s handling of nested
namespace packages.
- Issue #15056: `imp.cache_from_source()` and `imp.source_from_cache()` raise
NotImplementedError when `sys.implementation.cache_tag` is set to None.
- Issue #15256: Grammatical mistake in exception raised by `imp.find_module()`.
- Issue #5931: `wsgiref` environ variable SERVER_SOFTWARE will specify an
implementation specific term like CPython, Jython instead of generic "Python".
- Issue #13248: Remove obsolete argument "max_buffer_size" of BufferedWriter and
BufferedRWPair, from the io module.
- Issue #13248: Remove obsolete argument "version" of `argparse.ArgumentParser`.
- Issue #14814: Implement more consistent ordering and sorting behaviour for
ipaddress objects.
- Issue #14814: `ipaddress` network objects correctly return NotImplemented when
compared to arbitrary objects instead of raising TypeError.
- Issue #14990: Correctly fail with SyntaxError on invalid encoding declaration.
- Issue #14814: `ipaddress` now provides more informative error messages when
constructing instances directly (changes permitted during beta due to
provisional API status).
- Issue #15247: `io.FileIO` now raises an error when given a file descriptor
pointing to a directory.
- Issue #15261: Stop os.stat(fd) crashing on Windows when fd not open.
- Issue #15166: Implement `imp.get_tag()` using `sys.implementation.cache_tag`.
- Issue #15210: Catch KeyError when `importlib.__init__()` can't find
_frozen_importlib in sys.modules, not ImportError.
- Issue #15030: `importlib.abc.PyPycLoader` now supports the new source size
header field in .pyc files.
- Issue #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on
flush().
- Issue #10571: Fix the "--sign" option of distutils' upload command. Patch by
Jakub Wilk.
- Issue #9559: If messages were only added, a new file is no longer created and
renamed over the old file when flush() is called on an mbox, MMDF or Babyl
mailbox.
- Issue #10924: Fixed `crypt.mksalt()` to use a RNG that is suitable for
cryptographic purpose.
- Issue #15184: Ensure consistent results of OS X configuration tailoring for
universal builds by factoring out common OS X-specific customizations from
sysconfig, distutils.sysconfig, distutils.util, and distutils.unixccompiler
into a new module _osx_support.
C API
-----
- Issue #15610: `PyImport_ImportModuleEx()` now uses a 'level' of 0 instead of -1.
- Issue #15169, issue #14599: Strip out the C implementation of
`imp.source_from_cache()` used by PyImport_ExecCodeModuleWithPathnames() and
used the Python code instead. Leads to PyImport_ExecCodeModuleObject() to not
try to infer the source path from the bytecode path as
PyImport_ExecCodeModuleWithPathnames() does.
Extension Modules
-----------------
- Issue #6493: An issue in ctypes on Windows that caused structure bitfields of
type `ctypes.c_uint32` and width 32 to incorrectly be set has been fixed.
- Issue #15194: Update libffi to the 3.0.11 release.
IDLE
----
- Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog
ended with ``\``. Patch by Roger Serwy.
Tools/Demos
-----------
- Issue #15458: python-config gets a new option --configdir to print the $LIBPL
value.
- Move importlib.test.benchmark to Tools/importbench.
- Issue #12605: The gdb hooks for debugging CPython (within Tools/gdb) have been
enhanced to show information on more C frames relevant to CPython within the
"py-bt" and "py-bt-full" commands:
* C frames that are waiting on the GIL
* C frames that are garbage-collecting
* C frames that are due to the invocation of a PyCFunction
Documentation
-------------
- Issue #15041: Update "see also" list in tkinter documentation.
- Issue #15444: Use proper spelling for non-ASCII contributor names. Patch by
Serhiy Storchaka.
- Issue #15295: Reorganize and rewrite the documentation on the import system.
- Issue #15230: Clearly document some of the limitations of the runpy module and
nudge readers towards importlib when appropriate.
- Issue #15053: Copy Python 3.3 import lock change notice to all relevant
functions in imp instead of just at the top of the relevant section.
- Issue #15288: Link to the term "loader" in notes in pkgutil about how things
won't work as expected in Python 3.3 and mark the requisite functions as
"changed" since they will no longer work with modules directly imported by
import itself.
- Issue #13557: Clarify effect of giving two different namespaces to `exec()` or
`execfile()`.
- Issue #15250: Document that `filecmp.dircmp()` compares files shallowly. Patch
contributed by Chris Jerdonek.
- Issue #15442: Expose the default list of directories ignored by
`filecmp.dircmp()` as a module attribute, and expand the list to more modern
values.
Tests
-----
- Issue #15467: Move helpers for `__sizeof__()` tests into test_support. Patch
by Serhiy Storchaka.
- Issue #15320: Make iterating the list of tests thread-safe when running tests
in multiprocess mode. Patch by Chris Jerdonek.
- Issue #15168: Move `importlib.test` to `test.test_importlib`.
- Issue #15091: Reactivate a test on UNIX which was failing thanks to a
forgotten `importlib.invalidate_caches()` call.
- Issue #15230: Adopted a more systematic approach in the runpy tests.
- Issue #15300: Ensure the temporary test working directories are in the same
parent folder when running tests in multiprocess mode from a Python build.
Patch by Chris Jerdonek.
- Issue #15284: Skip {send,recv}msg tests in test_socket when IPv6 is not
enabled. Patch by Brian Brazil.
- Issue #15277: Fix a resource leak in support.py when IPv6 is disabled. Patch
by Brian Brazil.
Build
-----
- Issue #11715: Fix multiarch detection without having Debian development tools
(dpkg-dev) installed.
- Issue #15037: Build OS X installers with local copy of ncurses 5.9 libraries
to avoid curses.unget_wch bug present in older versions of ncurses such as
those shipped with OS X.
- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK. Also, for
OS X installers, ensure consistent sqlite3 behavior and feature availability
by building a local copy of libsqlite3 rather than depending on the wide range
of versions supplied with various OS X releases.
- Issue #8847: Disable COMDAT folding in Windows PGO builds.
- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
- Issue #16256: OS X installer now sets correct permissions for doc directory.
- Issue #15431: Add _freeze_importlib project to regenerate importlib.h on
Windows. Patch by Kristján Valur Jónsson.
- Issue #14197: For OS X framework builds, ensure links to the shared library
are created with the proper ABI suffix.
- Issue #14330: For cross builds, don't use host python, use host search paths
for host compiler.
- Issue #15235: Allow Berkley DB versions up to 5.3 to build the dbm module.
- Issue #15268: Search curses.h in /usr/include/ncursesw.
What's New in Python 3.3.0 Beta 1?
==================================
*Release date: 27-Jun-2012*
Core and Builtins
-----------------
- Fix a (most likely) very rare memory leak when calling main() and not being
able to decode a command-line argument.
- Issue #14815: Use Py_ssize_t instead of long for the object hash, to
preserve all 64 bits of hash on Win64.
- Issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
- Issue #11626: Add _SizeT functions to stable ABI.
- Issue #15142: Fix reference leak when deallocating instances of types
created using PyType_FromSpec().
- Issue #10053: Don't close FDs when FileIO.__init__ fails. Loosely based on
the work by Hirokazu Yamamoto.
- Issue #15096: Removed support for ur'' as the raw notation isn't
compatible with Python 2.x's raw unicode strings.
- Issue #13783: Generator objects now use the identifier APIs internally
- Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.
Patch by Serhiy Storchaka.
- Issue #15026: utf-16 encoding is now significantly faster (up to 10x).
Patch by Serhiy Storchaka.
- Issue #11022: open() and io.TextIOWrapper are now calling
locale.getpreferredencoding(False) instead of locale.getpreferredencoding()
in text mode if the encoding is not specified. Don't change temporary the
locale encoding using locale.setlocale(), use the current locale encoding
instead of the user preferred encoding.
- Issue #14673: Add Eric Snow's sys.implementation implementation.
- Issue #15038: Optimize python Locks on Windows.
Library
-------
- Issue #12288: Consider '0' and '0.0' as valid initialvalue
for tkinter SimpleDialog.
- Issue #15512: Add a __sizeof__ implementation for parser.
Patch by Serhiy Storchaka.
- Issue #15469: Add a __sizeof__ implementation for deque objects.
Patch by Serhiy Storchaka.
- Issue #15489: Add a __sizeof__ implementation for BytesIO objects.
Patch by Serhiy Storchaka.
- Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
Patch by Serhiy Storchaka.
- Issue #15514: Correct __sizeof__ support for cpu_set.
Patch by Serhiy Storchaka.
- Issue #15177: Added dir_fd parameter to os.fwalk().
- Issue #15061: Re-implemented hmac.compare_digest() in C to prevent further
timing analysis and to support all buffer protocol aware objects as well as
ASCII only str instances safely.
- Issue #15164: Change return value of platform.uname() from a
plain tuple to a collections.namedtuple.
- Support Mageia Linux in the platform module.
- Issue #11678: Support Arch linux in the platform module.
- Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes
(structseq objects).
- Speed up _decimal by another 10-15% by caching the thread local context
that was last accessed. In the pi benchmark (64-bit platform, prec=9),
_decimal is now only 1.5x slower than float.
- Remove the packaging module, which is not ready for prime time.
- Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
parameter from os.remove / os.unlink.
- Issue #4489: Add a shutil.rmtree that isn't susceptible to symlink attacks.
It is used automatically on platforms supporting the necessary os.openat()
and os.unlinkat() functions. Main code by Martin von Löwis.
- Issue #15156: HTMLParser now uses the new "html.entities.html5" dictionary.
- Issue #11113: add a new "html5" dictionary containing the named character
references defined by the HTML5 standard and the equivalent Unicode
character(s) to the html.entities module.
- Issue #15114: the strict mode of HTMLParser and the HTMLParseError exception
are deprecated now that the parser is able to parse invalid markup.
- Issue #3665: \u and \U escapes are now supported in unicode regular
expressions. Patch by Serhiy Storchaka.
- Issue #15153: Added inspect.getgeneratorlocals to simplify white box
testing of generator state updates
- Issue #13062: Added inspect.getclosurevars to simplify testing stateful
closures
- Issue #11024: Fixes and additional tests for Time2Internaldate.
- Issue #14626: Large refactoring of functions / parameters in the os module.
Many functions now support "dir_fd" and "follow_symlinks" parameters;
some also support accepting an open file descriptor in place of a path
string. Added os.support_* collections as LBYL helpers. Removed many
functions only previously seen in 3.3 alpha releases (often starting with
"f" or "l", or ending with "at"). Originally suggested by Serhiy Storchaka;
implemented by Larry Hastings.
- Issue #15008: Implement PEP 362 "Signature Objects".
Patch by Yury Selivanov.
- Issue #15138: base64.urlsafe_{en,de}code() are now 3-4x faster.
- Issue #444582: Add shutil.which, for finding programs on the system path.
Original patch by Erik Demaine, with later iterations by Jan Killian
and Brian Curtin.
- Issue #14837: SSL errors now have ``library`` and ``reason`` attributes
describing precisely what happened and in which OpenSSL submodule. The
str() of a SSLError is also enhanced accordingly.
- Issue #9527: datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
- Issue #14653: email.utils.mktime_tz() no longer relies on system
mktime() when timezone offest is supplied.
- Issue #14684: zlib.compressobj() and zlib.decompressobj() now support the use
of predefined compression dictionaries. Original patch by Sam Rushing.
- Fix GzipFile's handling of filenames given as bytes objects.
- Issue #14772: Return destination values from some shutil functions.
- Issue #15064: Implement context management protocol for multiprocessing types
- Issue #15101: Make pool finalizer avoid joining current thread.
- Issue #14657: The frozen instance of importlib used for bootstrap is now
also the module imported as importlib._bootstrap.
- Issue #14055: Add __sizeof__ support to _elementtree.
- Issue #15054: A bug in tokenize.tokenize that caused string literals
with 'b' prefixes to be incorrectly tokenized has been fixed.
Patch by Serhiy Storchaka.
- Issue #15006: Allow equality comparison between naive and aware
time or datetime objects.
- Issue #15036: Mailbox no longer throws an error if a flush is done
between operations when removing or changing multiple items in mbox,
MMDF, or Babyl mailboxes.
- Issue #14059: Implement multiprocessing.Barrier.
- Issue #15061: The inappropriately named hmac.secure_compare has been
renamed to hmac.compare_digest, restricted to operating on bytes inputs
only and had its documentation updated to more accurately reflect both its
intent and its limitations
- Issue #13841: Make child processes exit using sys.exit() on Windows.
- Issue #14936: curses_panel was converted to PEP 3121 and PEP 384 API.
Patch by Robin Schreiber.
- Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
in struct tm, time.struct_time objects returned by time.gmtime(),
time.localtime() and time.strptime() functions now have tm_zone and
tm_gmtoff attributes. Original patch by Paul Boddie.
- Rename adjusted attribute to adjustable in time.get_clock_info() result.
- Issue #3518: Remove references to non-existent BaseManager.from_address()
method.
- Issue #13857: Added textwrap.indent() function (initial patch by Ezra
Berch)
- Issue #2736: Added datetime.timestamp() method.
- Issue #13854: Make multiprocessing properly handle non-integer
non-string argument to SystemExit.
- Issue #12157: Make pool.map() empty iterables correctly. Initial
patch by mouad.
- Issue #11823: disassembly now shows argument counts on calls with keyword args.
- Issue #14711: os.stat_float_times() has been deprecated.
- LZMAFile now accepts the modes "rb"/"wb"/"ab" as synonyms of "r"/"w"/"a".
- The bz2 and lzma modules now each contain an open() function, allowing
compressed files to readily be opened in text mode as well as binary mode.
- BZ2File.__init__() and LZMAFile.__init__() now accept a file object as their
first argument, rather than requiring a separate "fileobj" argument.
- gzip.open() now accepts file objects as well as filenames.
- Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was
not explicitly asked for. This is no longer an exception as mkdir
cannot control if the OS sets that bit for it or not.
- Issue #14989: Make the CGI enable option to http.server available via command
line.
- Issue #14987: Add a missing import statement to inspect.
- Issue #1079: email.header.decode_header now correctly parses all the examples
in RFC2047. There is a necessary visible behavior change: the leading and/or
trailing whitespace on ASCII parts is now preserved.
- Issue #14969: Better handling of exception chaining in contextlib.ExitStack
- Issue #14963: Convert contextlib.ExitStack.__exit__ to use an iterative
algorithm (Patch by Alon Horev)
- Issue #14785: Add sys._debugmallocstats() to help debug low-level memory
allocation issues
- Issue #14443: Ensure that .py files are byte-compiled with the correct Python
executable within bdist_rpm even on older versions of RPM
C-API
-----
- Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
- Issue #15042: Add PyState_AddModule and PyState_RemoveModule. Add version
guard for Py_LIMITED_API additions. Patch by Robin Schreiber.
- Issue #13783: Inadvertent additions to the public C API in the PEP 380
implementation have either been removed or marked as private interfaces.
Extension Modules
-----------------
- Issue #15000: Support the "unique" x32 architecture in _posixsubprocess.c.
IDLE
----
- Issue #9803: Don't close IDLE on saving if breakpoint is open.
Patch by Roger Serwy.
- Issue #14962: Update text coloring in IDLE shell window after changing
options. Patch by Roger Serwy.
Documentation
-------------
- Issue #15176: Clarified behavior, documentation, and implementation
of os.listdir().
- Issue #14982: Document that pkgutil's iteration functions require the
non-standard iter_modules() method to be defined by an importer (something
the importlib importers do not define).
- Issue #15081: Document PyState_FindModule.
Patch by Robin Schreiber.
- Issue #14814: Added first draft of ipaddress module API reference
Tests
-----
- Issue #15187: Bugfix: remove temporary directories test_shutil was leaving
behind.
- Issue #14769: test_capi now has SkipitemTest, which cleverly checks
for "parity" between PyArg_ParseTuple() and the Python/getargs.c static
function skipitem() for all possible "format units".
- test_nntplib now tolerates being run from behind NNTP gateways that add
"X-Antivirus" headers to articles
- Issue #15043: test_gdb is now skipped entirely if gdb security settings
block loading of the gdb hooks
- Issue #14963: Add test cases for exception handling behaviour
in contextlib.ExitStack (Initial patch by Alon Horev)
Build
-----
- Issue #13590: Improve support for OS X Xcode 4:
* Try to avoid building Python or extension modules with problematic
llvm-gcc compiler.
* Since Xcode 4 removes ppc support, extension module builds now
check for ppc compiler support and automatically remove ppc and
ppc64 archs when not available.
* Since Xcode 4 no longer install SDKs in default locations,
extension module builds now revert to using installed headers
and libs if the SDK used to build the interpreter is not
available.
* Update ./configure to use better defaults for universal builds;
in particular, --enable-universalsdk=yes uses the Xcode default
SDK and --with-universal-archs now defaults to "intel" if ppc
not available.
- Issue #14225: Fix Unicode support for curses (#12567) on OS X
- Issue #14928: Fix importlib bootstrap issues by using a custom executable
(Modules/_freeze_importlib) to build Python/importlib.h.
What's New in Python 3.3.0 Alpha 4?
===================================
*Release date: 31-May-2012*
Core and Builtins
-----------------
- Issue #14835: Make plistlib output empty arrays & dicts like OS X.
Patch by Sidney San Martín.
- Issue #14744: Use the new _PyUnicodeWriter internal API to speed up
str%args and str.format(args).
- Issue #14930: Make memoryview objects weakrefable.
- Issue #14775: Fix a potential quadratic dict build-up due to the garbage
collector repeatedly trying to untrack dicts.
- Issue #14857: fix regression in references to PEP 3135 implicit __class__
closure variable (Reopens issue #12370)
- Issue #14712 (PEP 405): Virtual environments. Implemented by Vinay Sajip.
- Issue #14660 (PEP 420): Namespace packages. Implemented by Eric Smith.
- Issue #14494: Fix __future__.py and its documentation to note that
absolute imports are the default behavior in 3.0 instead of 2.7.
Patch by Sven Marnach.
- Issue #9260: A finer-grained import lock. Most of the import sequence
now uses per-module locks rather than the global import lock, eliminating
well-known issues with threads and imports.
- Issue #14624: UTF-16 decoding is now 3x to 4x faster on various inputs.
Patch by Serhiy Storchaka.
- asdl_seq and asdl_int_seq are now Py_ssize_t sized.
- Issue #14133 (PEP 415): Implement suppression of __context__ display with an
attribute on BaseException. This replaces the original mechanism of PEP 409.
- Issue #14417: Mutating a dict during lookup now restarts the lookup instead
of raising a RuntimeError (undoes issue #14205).
- Issue #14738: Speed-up UTF-8 decoding on non-ASCII data. Patch by Serhiy
Storchaka.
- Issue #14700: Fix two broken and undefined-behaviour-inducing overflow checks
in old-style string formatting.
Library
-------
- Issue #14690: Use monotonic clock instead of system clock in the sched,
subprocess and trace modules.
- Issue #14443: Tell rpmbuild to use the correct version of Python in
bdist_rpm. Initial patch by Ross Lagerwall.
- Issue #12515: email now registers a defect if it gets to EOF while parsing
a MIME part without seeing the closing MIME boundary.
- Issue #1672568: email now always decodes base64 payloads, adding padding and
ignoring non-base64-alphabet characters if needed, and registering defects
for any such problems.
- Issue #14925: email now registers a defect when the parser decides that there
is a missing header/body separator line. MalformedHeaderDefect, which the
existing code would never actually generate, is deprecated.
- Issue #10365: File open dialog now works instead of crashing even when
the parent window is closed before the dialog. Patch by Roger Serwy.
- Issue #8739: Updated smtpd to support RFC 5321, and added support for the
RFC 1870 SIZE extension.
- Issue #665194: Added a localtime function to email.utils to provide an
aware local datetime for use in setting Date headers.
- Issue #12586: Added new provisional policies that implement convenient
unicode support for email headers. See What's New for details.
- Issue #14731: Refactored email Policy framework to support full backward
compatibility with Python 3.2 by default yet allow for the introduction of
new features through new policies. Note that Policy.must_be_7bit is renamed
to cte_type.
- Issue #14876: Use user-selected font for highlight configuration.
- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals.
Have ascii characters in help.
- Issue #14548: Make multiprocessing finalizers check pid before
running to cope with possibility of gc running just after fork.
- Issue #14036: Add an additional check to validate that port in urlparse does
not go in illegal range and returns None.
- Issue #14862: Add missing names to os.__all__
- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
- Issue #13585: Added contextlib.ExitStack
- PEP 3144, Issue #14814: Added the ipaddress module
- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
Header in Cookie.py.
- Issue #14588: The types module now provide new_class() and prepare_class()
functions to support PEP 3115 compliant dynamic class creation. Patch by
Daniel Urban and Nick Coghlan.
- Issue #13152: Allow specifying a custom tabsize for expanding tabs in
textwrap. Patch by John Feuerstein.
- Issue #14721: Send the correct 'Content-length: 0' header when the body is an
empty string ''. Initial Patch contributed by Arve Knudsen.
- Issue #14072: Fix parsing of 'tel' URIs in urlparse by making the check for
ports stricter.
- Issue #9374: Generic parsing of query and fragment portions of url for any
scheme. Supported both by RFC3986 and RFC2396.
- Issue #14798: Fix the functions in pyclbr to raise an ImportError
when the first part of a dotted name is not a package. Patch by
Xavier de Gaye.
- Issue #12098: multiprocessing on Windows now starts child processes
using the same sys.flags as the current process. Initial patch by
Sergey Mezentsev.
- Issue #13031: Small speed-up for tarfile when unzipping tarfiles.
Patch by Justin Peel.
- Issue #14780: urllib.request.urlopen() now has a ``cadefault`` argument
to use the default certificate store. Initial patch by James Oakley.
- Issue #14829: Fix bisect and range() indexing with large indices
(>= 2 ** 32) under 64-bit Windows.
- Issue #14732: The _csv module now uses PEP 3121 module initialization.
Patch by Robin Schreiber.
- Issue #14809: Add HTTP status codes introduced by RFC 6585 to http.server
and http.client. Patch by EungJun Yi.
- Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when
accessing the Tk clipboard. Modify clipboard_get() to first request type
UTF8_STRING when no specific type is requested in an X11 windowing
environment, falling back to the current default type STRING if that fails.
Original patch by Thomas Kluyver.
- Issue #14773: Fix os.fwalk() failing on dangling symlinks.
- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
Authentation in urllib2.
- Issue #14807: move undocumented tarfile.filemode() to stat.filemode() and add
doc entry. Add tarfile.filemode alias with deprecation warning.
- Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
- Issue #14532: Add a secure_compare() helper to the hmac module, to mitigate
timing attacks. Patch by Jon Oberheide.
- Add importlib.util.resolve_name().
- Issue #14366: Support lzma compression in zip files.
Patch by Serhiy Storchaka.
- Issue #13959: Introduce importlib.find_loader() and document
imp.find_module/load_module as deprecated.
- Issue #14082: shutil.copy2() now copies extended attributes, if possible.
Patch by Hynek Schlawack.
- Issue #13959: Make importlib.abc.FileLoader.load_module()/get_filename() and
importlib.machinery.ExtensionFileLoader.load_module() have their single
argument be optional. Allows for the replacement (and thus deprecation) of
imp.load_source()/load_package()/load_compiled().
- Issue #13959: imp.get_suffixes() has been deprecated in favour of the new
attributes on importlib.machinery: SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES, and EXTENSION_SUFFIXES. This
led to an indirect deprecation of inspect.getmoduleinfo().
- Issue #14662: Prevent shutil failures on OS X when destination does not
support chflag operations. Patch by Hynek Schlawack.
- Issue #14157: Fix time.strptime failing without a year on February 29th.
Patch by Hynek Schlawack.
- Issue #14753: Make multiprocessing's handling of negative timeouts
the same as it was in Python 3.2.
- Issue #14583: Fix importlib bug when a package's __init__.py would first
import one of its modules then raise an error.
- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
- Issue #14697: Fix missing support for set displays and set comprehensions in
parser module.
- Issue #14701: Fix missing support for 'raise ... from' in parser module.
- Add support for timeouts to the acquire() methods of
multiprocessing's lock/semaphore/condition proxies.
- Issue #13989: Add support for text mode to gzip.open().
- Issue #14127: The os.stat() result object now provides three additional
fields: st_ctime_ns, st_mtime_ns, and st_atime_ns, providing those times as an
integer with nanosecond resolution. The functions os.utime(), os.lutimes(),
and os.futimes() now accept a new parameter, ns, which accepts mtime and atime
as integers with nanosecond resolution.
- Issue #14127 and #10148: shutil.copystat now preserves exact mtime and atime
on filesystems providing nanosecond resolution.
IDLE
----
- Issue #14958: Change IDLE systax highlighting to recognize all string and
byte literals supported in Python 3.3.
- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
- Issue #14929: Stop IDLE 3.x from closing on Unicode decode errors when
grepping. Patch by Roger Serwy.
- Issue #12510: Attempting to get invalid tooltip no longer closes IDLE.
Other tooltipss have been corrected or improved and the number of tests
has been tripled. Original patch by Roger Serwy.
Tools/Demos
-----------
- Issue #14695: Bring Tools/parser/unparse.py support up to date with
the Python 3.3 Grammar.
Build
-----
- Issue #14472: Update .gitignore. Patch by Matej Cepl.
- Upgrade Windows library versions: bzip 1.0.6, OpenSSL 1.0.1c.
- Issue #14693: Under non-Windows platforms, hashlib's fallback modules are
always compiled, even if OpenSSL is present at build time.
- Issue #13210: Windows build now uses VS2010, ported from VS2008.
C-API
-----
- Issue #14705: The PyArg_Parse() family of functions now support the 'p' format
unit, which accepts a "boolean predicate" argument. It converts any Python
value into an integer--0 if it is "false", and 1 otherwise.
Documentation
-------------
- Issue #14863: Update the documentation of os.fdopen() to reflect the
fact that it's only a thin wrapper around open() anymore.
- Issue #14588: The language reference now accurately documents the Python 3
class definition process. Patch by Nick Coghlan.
- Issue #14943: Correct a default argument value for winreg.OpenKey
and correctly list the argument names in the function's explanation.
What's New in Python 3.3.0 Alpha 3?
===================================
*Release date: 01-May-2012*
Core and Builtins
-----------------
- Issue #14699: Fix calling the classmethod descriptor directly.
- Issue #14433: Prevent msvcrt crash in interactive prompt when stdin is closed.
- Issue #14521: Make result of float('nan') and float('-nan') more consistent
across platforms.
- Issue #14646: __import__() sets __loader__ if the loader did not.
- Issue #14605: No longer have implicit entries in sys.meta_path. If
sys.meta_path is found to be empty, raise ImportWarning.
- Issue #14605: No longer have implicit entries in sys.path_hooks. If
sys.path_hooks is found to be empty, a warning will be raised. None is now
inserted into sys.path_importer_cache if no finder was discovered. This also
means imp.NullImporter is no longer implicitly used.
- Issue #13903: Implement PEP 412. Individual dictionary instances can now share
their keys with other dictionaries. Classes take advantage of this to share
their instance dictionary keys for improved memory and performance.
- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
when repr() or str() is called on such an object.
- Issue #14658: Fix binding a special method to a builtin implementation of a
special method with a different name.
- Issue #14630: Fix a memory access bug for instances of a subclass of int
with value 0.
- Issue #14339: Speed improvements to bin, oct and hex functions. Patch by
Serhiy Storchaka.
- Issue #14385: It is now possible to use a custom type for the __builtins__
namespace, instead of a dict. It can be used for sandboxing for example.
Raise also a NameError instead of ImportError if __build_class__ name if not
found in __builtins__.
- Issue #12599: Be more strict in accepting None compared to a false-like
object for importlib.util.module_for_loader and
importlib.machinery.PathFinder.
- Issue #14612: Fix jumping around with blocks by setting f_lineno.
- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
globals raises a KeyError.
- Issue #14607: Fix keyword-only arguments which started with ``__``.
- Issue #10854: The ImportError raised when an extension module on Windows
fails to import now uses the new path and name attributes from
Issue #1559549.
- Issue #13889: Check and (if necessary) set FPU control word before calling
any of the dtoa.c string <-> float conversion functions, on MSVC builds of
Python. This fixes issues when embedding Python in a Delphi app.
- __import__() now matches PEP 328 and documentation by defaulting 'index' to 0
instead of -1 and removing support for negative values.
- Issue #2377: Make importlib the implementation of __import__().
- Issue #1559549: ImportError now has 'name' and 'path' attributes that are set
using keyword arguments to its constructor. They are currently not set by
import as they are meant for use by importlib.
- Issue #14474: Save and restore exception state in thread.start_new_thread()
while writing error message if the thread leaves an unhandled exception.
- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
by Suman Saha.
Library
-------
- Issue #14768: os.path.expanduser('~/a') doesn't work correctly when HOME is '/'.
- Issue #14371: Support bzip2 in zipfile module. Patch by Serhiy Storchaka.
- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running
step. Patch by Xavier de Gaye.
- Issue #14696: Fix parser module to understand 'nonlocal' declarations.
- Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
the DST transition. Patch by Joe Peterson.
- Issue #9154: Fix parser module to understand function annotations.
- Issue #6085: In http.server.py SimpleHTTPServer.address_string returns the
client ip address instead client hostname. Patch by Charles-François Natali.
- Issue #14309: Deprecate time.clock(), use time.perf_counter() or
time.process_time() instead.
- Issue #14428: Implement the PEP 418. Add time.get_clock_info(),
time.perf_counter() and time.process_time() functions, and rename
time.steady() to time.monotonic().
- Issue #14646: importlib.util.module_for_loader() now sets __loader__ and
__package__ (when possible).
- Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a
test class that doesn't inherit from TestCase (i.e. a mixin).
- Issue #4892: multiprocessing Connections can now be transferred over
multiprocessing Connections. Patch by Richard Oudkerk (sbt).
- Issue #14160: TarFile.extractfile() failed to resolve symbolic links when
the links were not located in an archive subdirectory.
- Issue #14638: pydoc now treats non-string __name__ values as if they
were missing, instead of raising an error.
- Issue #13684: Fix httplib tunnel issue of infinite loops for certain sites
which send EOF without trailing \r\n.
- Issue #14605: Add importlib.abc.FileLoader, importlib.machinery.(FileFinder,
SourceFileLoader, SourcelessFileLoader, ExtensionFileLoader).
- Issue #13959: imp.cache_from_source()/source_from_cache() now follow
os.path.join()/split() semantics for path manipulation instead of its prior,
custom semantics of caring the right-most path separator forward in path
joining.
- Issue #2193: Allow ":" character in Cookie NAME values.
- Issue #14629: tokenizer.detect_encoding will specify the filename in the
SyntaxError exception if found at readline.__self__.name.
- Issue #14629: Raise SyntaxError in tokenizer.detect_encoding if the
first two lines have non-UTF-8 characters without an encoding declaration.
- Issue #14308: Fix an exception when a "dummy" thread is in the threading
module's active list after a fork().
- Issue #11750: The Windows API functions scattered in the _subprocess and
_multiprocessing.win32 modules now live in a single module "_winapi".
Patch by sbt.
- Issue #14087: multiprocessing: add Condition.wait_for(). Patch by sbt.
- Issue #14538: HTMLParser can now parse correctly start tags that contain
a bare '/'.
- Issue #14452: SysLogHandler no longer inserts a UTF-8 BOM into the message.
- Issue #14386: Expose the dict_proxy internal type as types.MappingProxyType.
- Issue #13959: Make imp.reload() always use a module's __loader__ to perform
the reload.
- Issue #13959: Add imp.py and rename the built-in module to _imp, allowing for
re-implementing parts of the module in pure Python.
- Issue #13496: Fix potential overflow in bisect.bisect algorithm when applied
to a collection of size > sys.maxsize / 2.
- Have importlib take advantage of ImportError's new 'name' and 'path'
attributes.
- Issue #14399: zipfile now recognizes that the archive has been modified even
if only the comment is changed. In addition, the TypeError that results from
trying to set a non-binary value as a comment is now raised at the time
the comment is set rather than at the time the zipfile is written.
- trace.CoverageResults.is_ignored_filename() now ignores any name that starts
with "<" and ends with ">" instead of special-casing "<string>" and
"<doctest ".
- Issue #12537: The mailbox module no longer depends on knowledge of internal
implementation details of the email package Message object.
- Issue #7978: socketserver now restarts the select() call when EINTR is
returned. This avoids crashing the server loop when a signal is received.
Patch by Jerzy Kozera.
- Issue #14522: Avoid duplicating socket handles in multiprocessing.connection.
Patch by sbt.
- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
- Issue #3033: Add displayof parameter to tkinter font. Patch by Guilherme Polo.
- Issue #14482: Raise a ValueError, not a NameError, when trying to create
a multiprocessing Client or Listener with an AF_UNIX type address under
Windows. Patch by Popa Claudiu.
- Issue #802310: Generate always unique tkinter font names if not directly passed.
- Issue #14151: Raise a ValueError, not a NameError, when trying to create
a multiprocessing Client or Listener with an AF_PIPE type address under
non-Windows platforms. Patch by Popa Claudiu.
- Issue #14493: Use gvfs-open or xdg-open in webbrowser.
Build
-----
- "make touch" will now touch generated files that are checked into Mercurial,
after a "hg update" which failed to bring the timestamps into the right order.
Tests
-----
- Issue #14026: In test_cmd_line_script, check that sys.argv is populated
correctly for the various invocation approaches (Patch by Jason Yeo)
- Issue #14032: Fix incorrect variable name in test_cmd_line_script debugging
message (Patch by Jason Yeo)
- Issue #14589: Update certificate chain for sha256.tbs-internet.com, fixing
a test failure in test_ssl.
- Issue #14355: Regrtest now supports the standard unittest test loading, and
will use it if a test file contains no `test_main` method.
IDLE
----
- Issue #8515: Set __file__ when run file in IDLE.
Initial patch by Bruce Frederiksen.
- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
Patch by Popa Claudiu.
Tools / Demos
-------------
- Issue #3561: The Windows installer now has an option, off by default, for
placing the Python installation into the system "Path" environment variable.
- Issue #13165: stringbench is now available in the Tools/stringbench folder.
It used to live in its own SVN project.
C-API
-----
- Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.
Patch by Stefan Behnel.
What's New in Python 3.3.0 Alpha 2?
===================================
*Release date: 01-Apr-2012*
Core and Builtins
-----------------
- Issue #1683368: object.__new__ and object.__init__ raise a TypeError if they
are passed arguments and their complementary method is not overridden.
- Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
the module name that was not interned.
- Issue #14331: Use significantly less stack space when importing modules by
allocating path buffers on the heap instead of the stack.
- Issue #14334: Prevent in a segfault in type.__getattribute__ when it was not
passed strings.
- Issue #1469629: Allow cycles through an object's __dict__ slot to be
collected. (For example if ``x.__dict__ is x``).
- Issue #14205: dict lookup raises a RuntimeError if the dict is modified
during a lookup.
- Issue #14220: When a generator is delegating to another iterator with the
yield from syntax, it needs to have its ``gi_running`` flag set to True.
- Issue #14435: Remove dedicated block allocator from floatobject.c and rely
on the PyObject_Malloc() api like all other objects.
- Issue #14471: Fix a possible buffer overrun in the winreg module.
- Issue #14288: Allow the serialization of builtin iterators
Library
-------
- Issue #14300: Under Windows, sockets created using socket.dup() now allow
overlapped I/O. Patch by sbt.
- Issue #13872: socket.detach() now marks the socket closed (as mirrored
in the socket repr()). Patch by Matt Joiner.
- Issue #14406: Fix a race condition when using ``concurrent.futures.wait(
return_when=ALL_COMPLETED)``. Patch by Matt Joiner.
- Issue #5136: deprecate old, unused functions from tkinter.
- Issue #14416: syslog now defines the LOG_ODELAY and LOG_AUTHPRIV constants
if they are defined in <syslog.h>.
- Issue #14295: Add unittest.mock
- Issue #7652: Add --with-system-libmpdec option to configure for linking
the _decimal module against an installed libmpdec.
- Issue #14380: MIMEText now defaults to utf-8 when passed non-ASCII unicode
with no charset specified.
- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on
OSX; avoid to call handle_connect in case of a disconnected socket which
was not meant to connect.
- Issue #14204: The ssl module now has support for the Next Protocol
Negotiation extension, if available in the underlying OpenSSL library.
Patch by Colin Marc.
- Issue #3035: Unused functions from tkinter are marked as pending deprecated.
- Issue #12757: Fix the skipping of doctests when python is run with -OO so
that it works in unittest's verbose mode as well as non-verbose mode.
- Issue #7652: Integrate the decimal floating point libmpdec library to speed
up the decimal module. Performance gains of the new C implementation are
between 10x and 100x, depending on the application.
- Issue #14269: SMTPD now conforms to the RFC and requires a HELO command
before MAIL, RCPT, or DATA.
- Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
attribute.
- Issue #14344: fixed the repr of email.policy objects.
- Issue #11686: Added missing entries to email package __all__ lists
(mostly the new Bytes classes).
- Issue #14335: multiprocessing's custom Pickler subclass now inherits from
the C-accelerated implementation. Patch by sbt.
- Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem.
- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
- Improve the memory utilization and speed of functools.lru_cache.
- Issue #14222: Use the new time.steady() function instead of time.time() for
timeout in queue and threading modules to not be affected of system time
update.
- Issue #13248: Remove lib2to3.pytree.Base.get_prefix/set_prefix.
- Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash
table internal to the pyexpat module's copy of the expat library to avoid a
denial of service due to hash collisions. Patch by David Malcolm with some
modifications by the expat project.
- Issue #12818: format address no longer needlessly \ escapes ()s in names when
the name ends up being quoted.
- Issue #14062: BytesGenerator now correctly folds Header objects,
including using linesep when folding.
- Issue #13839: When invoked on the command-line, the pstats module now
accepts several filenames of profile stat files and merges them all.
Patch by Matt Joiner.
- Issue #14291: Email now defaults to utf-8 for non-ASCII unicode headers
instead of raising an error. This fixes a regression relative to 2.7.
- Issue #989712: Support using Tk without a mainloop.
- Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
- Issue #2843: Add new Tk API to Tkinter.
- Issue #14184: Increase the default stack size for secondary threads on
Mac OS X to avoid interpreter crashes when using threads on 10.7.
- Issue #14180: datetime.date.fromtimestamp(),
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp()
now raise an OSError instead of ValueError if localtime() or gmtime() failed.
- Issue #14180: time.ctime(), gmtime(), time.localtime(),
datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and
datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of
a ValueError, if the timestamp does not fit in time_t.
- Issue #14180: datetime.datetime.fromtimestamp() and
datetime.datetime.utcfromtimestamp() now round microseconds towards zero
instead of rounding to nearest with ties going away from zero.
- Issue #10543: Fix unittest test discovery with Jython bytecode files.
- Issue #1178863: Separate initialisation from setting when initializing
Tkinter.Variables; harmonize exceptions to ValueError; only delete variables
that have not been deleted; assert that variable names are strings.
- Issue #14104: Implement time.monotonic() on Mac OS X, patch written by
Nicholas Riley.
- Issue #13394: the aifc module now uses warnings.warn() to signal warnings.
- Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
Windows when the child process has already exited.
- Issue #14223: curses.addch() is no more limited to the range 0-255 when the
Python curses is not linked to libncursesw. It was a regression introduced
in Python 3.3a1.
- Issue #14168: Check for presence of Element._attrs in minidom before
accessing it.
- Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows.
Also, add a multiprocessing.connection.wait(rlist, timeout=None) function
for polling multiple objects at once. Patch by sbt.
- Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
data or close method) for the Python implementation as well.
Drop the no-op TreeBuilder().xml() method from the C implementation.
- Issue #14210: pdb now has tab-completion not only for command names, but
also for their arguments, wherever possible.
- Issue #14310: Sockets can now be with other processes on Windows using
the api socket.socket.share() and socket.fromshare().
- Issue #10576: The gc module now has a 'callbacks' member that will get
called when garbage collection takes place.
Build
-----
- Issue #14557: Fix extensions build on HP-UX. Patch by Adi Roiban.
- Issue #14387: Do not include accu.h from Python.h.
- Issue #14359: Only use O_CLOEXEC in _posixmodule.c if it is defined.
Based on patch from Hervé Coatanhay.
- Issue #14321: Do not run pgen during the build if files are up to date.
Documentation
-------------
- Issue #14034: added the argparse tutorial.
- Issue #14324: Fix configure tests for cross builds.
- Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in
config.{guess,sub}. Don't use uname calls for cross builds.
Extension Modules
-----------------
- Issue #9041: An issue in ctypes.c_longdouble, ctypes.c_double, and
ctypes.c_float that caused an incorrect exception to be returned in the
case of overflow has been fixed.
- Issue #14212: The re module didn't retain a reference to buffers it was
scanning, resulting in segfaults.
- Issue #14259: The finditer() method of re objects did not take any
keyword arguments, contrary to the documentation.
- Issue #10142: Support for SEEK_HOLE/SEEK_DATA (for example, under ZFS).
Tests
-----
- Issue #14442: Add missing errno import in test_smtplib.
- Issue #8315: (partial fix) python -m unittest test.test_email now works.
What's New in Python 3.3.0 Alpha 1?
===================================
*Release date: 05-Mar-2012*
Core and Builtins
-----------------
- Issue #14172: Fix reference leak when marshalling a buffer-like object
(other than a bytes object).
- Issue #13521: dict.setdefault() now does only one lookup for the given key,
making it "atomic" for many purposes. Patch by Filip Gruszczyński.
- PEP 409, Issue #6210: "raise X from None" is now supported as a means of
suppressing the display of the chained exception context. The chained
context still remains available as the __context__ attribute.
- Issue #10181: New memoryview implementation fixes multiple ownership
and lifetime issues of dynamically allocated Py_buffer members (#9990)
as well as crashes (#8305, #7433). Many new features have been added
(See whatsnew/3.3), and the documentation has been updated extensively.
The ndarray test object from _testbuffer.c implements all aspects of
PEP-3118, so further development towards the complete implementation
of the PEP can proceed in a test-driven manner.
Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review
and many ideas.
- Issue #12834: Fix incorrect results of memoryview.tobytes() for
non-contiguous arrays.
- Issue #5231: Introduce memoryview.cast() method that allows changing
format and shape without making a copy of the underlying memory.
- Issue #14084: Fix a file descriptor leak when importing a module with a
bad encoding.
- Upgrade Unicode data to Unicode 6.1.
- Issue #14040: Remove rarely used file name suffixes for C extensions
(under POSIX mainly).
- Issue #14051: Allow arbitrary attributes to be set of classmethod and
staticmethod.
- Issue #13703: oCERT-2011-003: Randomize hashes of str and bytes to protect
against denial of service attacks due to hash collisions within the dict and
set types. Patch by David Malcolm, based on work by Victor Stinner.
- Issue #13020: Fix a reference leak when allocating a structsequence object
fails. Patch by Suman Saha.
- Issue #13908: Ready types returned from PyType_FromSpec.
- Issue #11235: Fix OverflowError when trying to import a source file whose
modification time doesn't fit in a 32-bit timestamp.
- Issue #12705: A SyntaxError exception is now raised when attempting to
compile multiple statements as a single interactive statement.
- Fix the builtin module initialization code to store the init function for
future reinitialization.
- Issue #8052: The posix subprocess module would take a long time closing
all possible file descriptors in the child process rather than just open
file descriptors. It now closes only the open fds if possible for the
default close_fds=True behavior.
- Issue #13629: Renumber the tokens in token.h so that they match the indexes
into _PyParser_TokenNames.
- Issue #13752: Add a casefold() method to str.
- Issue #13761: Add a "flush" keyword argument to the print() function,
used to ensure flushing the output stream.
- Issue #13645: pyc files now contain the size of the corresponding source
code, to avoid timestamp collisions (especially on filesystems with a low
timestamp resolution) when checking for freshness of the bytecode.
- PEP 380, Issue #11682: Add "yield from <x>" to support easy delegation to
subgenerators (initial patch by Greg Ewing, integration into 3.3 by
Renaud Blanch, Ryan Kelly, Zbigniew Jędrzejewski-Szmek and Nick Coghlan)
- Issue #13748: Raw bytes literals can now be written with the ``rb`` prefix
as well as ``br``.
- Issue #12736: Use full unicode case mappings for upper, lower, and title case.
- Issue #12760: Add a create mode to open(). Patch by David Townshend.
- Issue #13738: Simplify implementation of bytes.lower() and bytes.upper().
- Issue #13577: Built-in methods and functions now have a __qualname__.
Patch by sbt.
- Issue #6695: Full garbage collection runs now clear the freelist of set
objects. Initial patch by Matthias Troffaes.
- Fix OSError.__init__ and OSError.__new__ so that each of them can be
overridden and take additional arguments (followup to issue #12555).
- Fix the fix for issue #12149: it was incorrect, although it had the side
effect of appearing to resolve the issue. Thanks to Mark Shannon for
noticing.
- Issue #13505: Pickle bytes objects in a way that is compatible with
Python 2 when using protocols <= 2.
- Issue #11147: Fix an unused argument in _Py_ANNOTATE_MEMORY_ORDER. (Fix
given by Campbell Barton).
- Issue #13503: Use a more efficient reduction format for bytearrays with
pickle protocol >= 3. The old reduction format is kept with older protocols
in order to allow unpickling under Python 2. Patch by Irmen de Jong.
- Issue #7111: Python can now be run without a stdin, stdout or stderr
stream. It was already the case with Python 2. However, the corresponding
sys module entries are now set to None (instead of an unusable file object).
- Issue #11849: Ensure that free()d memory arenas are really released
on POSIX systems supporting anonymous memory mappings. Patch by
Charles-François Natali.
- PEP 3155 / issue #13448: Qualified name for classes and functions.
- Issue #13436: Fix a bogus error message when an AST object was passed
an invalid integer value.
- Issue #13411: memoryview objects are now hashable when the underlying
object is hashable.
- Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
to allow compiling extension modules with -Wswitch-enum on gcc.
Initial patch by Floris Bruynooghe.
- Issue #10227: Add an allocation cache for a single slice object. Patch by
Stefan Behnel.
- Issue #13393: BufferedReader.read1() now asks the full requested size to
the raw stream instead of limiting itself to the buffer size.
- Issue #13392: Writing a pyc file should now be atomic under Windows as well.
- Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder
already accepts them).
- Issue #13389: Full garbage collection passes now clear the freelists for
list and dict objects. They already cleared other freelists in the
interpreter.
- Issue #13327: Remove the need for an explicit None as the second argument
to os.utime, os.lutimes, os.futimes, os.futimens, os.futimesat, in
order to update to the current time. Also added keyword argument
handling to os.utimensat in order to remove the need for explicit None.
- Issue #13350: Simplify some C code by replacing most usages of
PyUnicode_Format by PyUnicode_FromFormat.
- Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
error handler in interactive mode (when calling into PyOS_Readline()).
- Issue #9896: Add start, stop, and step attributes to range objects.
- Issue #13343: Fix a SystemError when a lambda expression uses a global
variable in the default value of a keyword-only argument: ``lambda *,
arg=GLOBAL_NAME: None``
- Issue #12797: Added custom opener parameter to builtin open() and
FileIO.open().
- Issue #10519: Avoid unnecessary recursive function calls in
setobject.c.
- Issue #10363: Deallocate global locks in Py_Finalize().
- Issue #13018: Fix reference leaks in error paths in dictobject.c.
Patch by Suman Saha.
- Issue #13201: Define '==' and '!=' to compare range objects based on
the sequence of values they define (instead of comparing based on
object identity).
- Issue #1294232: In a few cases involving metaclass inheritance, the
interpreter would sometimes invoke the wrong metaclass when building a new
class object. These cases now behave correctly. Patch by Daniel Urban.
- Issue #12753: Add support for Unicode name aliases and named sequences.
Both ``unicodedata.lookup()`` and '\N{...}' now resolve aliases,
and ``unicodedata.lookup()`` resolves named sequences too.
- Issue #12170: The count(), find(), rfind(), index() and rindex() methods
of bytes and bytearray objects now accept an integer between 0 and 255
as their first argument. Patch by Petri Lehtinen.
- Issue #12604: VTRACE macro expanded to no-op in _sre.c to avoid compiler
warnings. Patch by Josh Triplett and Petri Lehtinen.
- Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
error handlers on all Windows versions. The MBCS codec is now supporting all
error handlers, instead of only replace to encode and ignore to decode.
- Issue #13188: When called without an explicit traceback argument,
generator.throw() now gets the traceback from the passed exception's
``__traceback__`` attribute. Patch by Petri Lehtinen.
- Issue #13146: Writing a pyc file is now atomic under POSIX.
- Issue #7833: Extension modules built using distutils on Windows will no
longer include a "manifest" to prevent them failing at import time in some
embedded situations.
- PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
- Add internal API for static strings (_Py_identifier et al.).
- Issue #13063: the Windows error ERROR_NO_DATA (numbered 232 and described
as "The pipe is being closed") is now mapped to POSIX errno EPIPE
(previously EINVAL).
- Issue #12911: Fix memory consumption when calculating the repr() of huge
tuples or lists.
- PEP 393: flexible string representation. Thanks to Torsten Becker for the
initial implementation, and Victor Stinner for various bug fixes.
- Issue #14081: The 'sep' and 'maxsplit' parameter to str.split, bytes.split,
and bytearray.split may now be passed as keyword arguments.
- Issue #13012: The 'keepends' parameter to str.splitlines may now be passed
as a keyword argument: "my_string.splitlines(keepends=True)". The same
change also applies to bytes.splitlines and bytearray.splitlines.
- Issue #7732: Don't open a directory as a file anymore while importing a
module. Ignore the directory if its name matches the module name (e.g.
"__init__.py") and raise an ImportError instead.
- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for
finding the bug and providing a patch.
- Issue #12973: Fix overflow checks that relied on undefined behaviour in
list_repeat (listobject.c) and islice_next (itertoolsmodule.c). These bugs
caused test failures with recent versions of Clang.
- Issue #12904: os.utime, os.futimes, os.lutimes, and os.futimesat now write
atime and mtime with nanosecond precision on modern POSIX platforms.
- Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
mapped to POSIX errno ENOTDIR (previously EINVAL).
- Issue #9200: The str.is* methods now work with strings that contain non-BMP
characters even in narrow Unicode builds.
- Issue #12791: Break reference cycles early when a generator exits with
an exception.
- Issue #12773: Make __doc__ mutable on user-defined classes.
- Issue #12766: Raise a ValueError when creating a class with a class variable
that conflicts with a name in __slots__.
- Issue #12266: Fix str.capitalize() to correctly uppercase/lowercase
titlecased and cased non-letter characters.
- Issue #12732: In narrow unicode builds, allow Unicode identifiers which fall
outside the BMP.
- Issue #12575: Validate user-generated AST before it is compiled.
- Make type(None), type(Ellipsis), and type(NotImplemented) callable. They
return the respective singleton instances.
- Forbid summing bytes with sum().
- Verify the types of AST strings and identifiers provided by the user before
compiling them.
- Issue #12647: The None object now has a __bool__() method that returns False.
Formerly, bool(None) returned False only because of special case logic
in PyObject_IsTrue().
- Issue #12579: str.format_map() now raises a ValueError if used on a
format string that contains positional fields. Initial patch by
Julian Berman.
- Issue #10271: Allow warnings.showwarning() be any callable.
- Issue #11627: Fix segfault when __new__ on an exception returns a
non-exception class.
- Issue #12149: Update the method cache after a type's dictionary gets
cleared by the garbage collector. This fixes a segfault when an instance
and its type get caught in a reference cycle, and the instance's
deallocator calls one of the methods on the type (e.g. when subclassing
IOBase). Diagnosis and patch by Davide Rizzo.
- Issue #9611, Issue #9015: FileIO.read() clamps the length to INT_MAX on Windows.
- Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
a new HAVE_MBCS define.
- Issue #9642: Fix filesystem encoding initialization: use the ANSI code page
on Windows if the mbcs codec is not available, and fail with a fatal error if
we cannot get the locale encoding (if nl_langinfo(CODESET) is not available)
instead of using UTF-8.
- When a generator yields, do not retain the caller's exception state on the
generator.
- Issue #12475: Prevent generators from leaking their exception state into the
caller's frame as they return for the last time.
- Issue #12291: You can now load multiple marshalled objects from a stream,
with other data interleaved between marshalled objects.
- Issue #12356: When required positional or keyword-only arguments are not
given, produce an informative error message which includes the name(s) of the
missing arguments.
- Issue #12370: Fix super with no arguments when __class__ is overridden in the
class body.
- Issue #12084: os.stat on Windows now works properly with relative symbolic
links when called from any directory.
- Loosen type restrictions on the __dir__ method. __dir__ can now return any
sequence, which will be converted to a list and sorted by dir().
- Issue #12265: Make error messages produced by passing an invalid set of
arguments to a function more informative.
- Issue #12225: Still allow Python to build if Python is not in its hg repo or
mercurial is not installed.
- Issue #1195: my_fgets() now always clears errors before calling fgets(). Fix
the following case: sys.stdin.read() stopped with CTRL+d (end of file),
raw_input() interrupted by CTRL+c.
- Issue #12216: Allow unexpected EOF errors to happen on any line of the file.
- Issue #12199: The TryExcept and TryFinally and AST nodes have been unified
into a Try node.
- Issue #9670: Increase the default stack size for secondary threads on
Mac OS X and FreeBSD to reduce the chances of a crash instead of a
"maximum recursion depth" RuntimeError exception.
(patch by Ronald Oussoren)
- Issue #12106: The use of the multiple-with shorthand syntax is now reflected
in the AST.
- Issue #12190: Try to use the same filename object when compiling unmarshalling
a code objects in the same file.
- Issue #12166: Move implementations of dir() specialized for various types into
the __dir__() methods of those types.
- Issue #5715: In socketserver, close the server socket in the child process.
- Correct lookup of __dir__ on objects. Among other things, this causes errors
besides AttributeError found on lookup to be propagated.
- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal
module. Patch written by Charles-François Natali.
- Issue #1746656: Added the if_nameindex, if_indextoname, if_nametoindex
methods to the socket module.
- Issue #12044: Fixed subprocess.Popen when used as a context manager to
wait for the process to end when exiting the context to avoid unintentionally
leaving zombie processes around.
- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
clear the end-of-file indicator after CTRL+d.
- Issue #1856: Avoid crashes and lockups when daemon threads run while the
interpreter is shutting down; instead, these threads are now killed when
they try to take the GIL.
- Issue #9756: When calling a method descriptor or a slot wrapper descriptor,
the check of the object type doesn't read the __class__ attribute anymore.
Fix a crash if a class override its __class__ attribute (e.g. a proxy of the
str type). Patch written by Andreas Stührk.
- Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*
APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch
by Charles-François Natali.
- Issue #10914: Initialize correctly the filesystem codec when creating a new
subinterpreter to fix a bootstrap issue with codecs implemented in Python, as
the ISO-8859-15 codec.
- Issue #11918: OS/2 and VMS are no more supported because of the lack of
maintainer.
- Issue #6780: fix starts/endswith error message to mention that tuples are
accepted too.
- Issue #5057: fix a bug in the peepholer that led to non-portable pyc files
between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP
chars (e.g. "\U00012345"[0]).
- Issue #11845: Fix typo in rangeobject.c that caused a crash in
compute_slice_indices. Patch by Daniel Urban.
- Issue #5673: Added a `timeout` keyword argument to subprocess.Popen.wait,
subprocess.Popen.communicated, subprocess.call, subprocess.check_call, and
subprocess.check_output. If the blocking operation takes more than `timeout`
seconds, the `subprocess.TimeoutExpired` exception is raised.
- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
(EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
written by Charles-Francois Natali.
- Issue #9319: Include the filename in "Non-UTF8 code ..." syntax error.
- Issue #10785: Store the filename as Unicode in the Python parser.
- Issue #11619: _PyImport_LoadDynamicModule() doesn't encode the path to bytes
on Windows.
- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and
Py_DivisionWarningFlag left over from Python 2.
- Issue #11244: Remove an unnecessary peepholer check that was preventing
negative zeros from being constant-folded properly.
- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on
Windows if the file is a TTY to workaround a Windows bug. The Windows console
returns an error (12: not enough space error) on writing into stdout if
stdout mode is binary and the length is greater than 66,000 bytes (or less,
depending on heap usage).
- Issue #11320: fix bogus memory management in Modules/getpath.c, leading to
a possible crash when calling Py_SetPath().
- Issue #11432: A bug was introduced in subprocess.Popen on posix systems with
3.2.0 where the stdout or stderr file descriptor being the same as the stdin
file descriptor would raise an exception. webbrowser.open would fail. fixed.
- Issue #9856: Change object.__format__ with a non-empty format string
to be a DeprecationWarning. In 3.2 it was a PendingDeprecationWarning.
In 3.4 it will be a TypeError.
- Issue #11244: The peephole optimizer is now able to constant-fold
arbitrarily complex expressions. This also fixes a 3.2 regression where
operations involving negative numbers were not constant-folded.
- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
there are many tags (e.g. when using mq). Patch by Nadeem Vawda.
- Issue #11335: Fixed a memory leak in list.sort when the key function
throws an exception.
- Issue #8923: When a string is encoded to UTF-8 in strict mode, the result is
cached into the object. Examples: str.encode(), str.encode('utf-8'),
PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, "utf-8",
NULL).
- Issue #10829: Refactor PyUnicode_FromFormat(), use the same function to parse
the format string in the 3 steps, fix crashes on invalid format strings.
- Issue #13007: whichdb should recognize gdbm 1.9 magic numbers.
- Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with
a buffer struct having a NULL data pointer.
- Issue #11272: On Windows, input() strips '\r' (and not only '\n'), and
sys.stdin uses universal newline (replace '\r\n' by '\n').
- Issue #11828: startswith and endswith now accept None as slice index.
Patch by Torsten Becker.
- Issue #11168: Remove filename debug variable from PyEval_EvalFrameEx().
It encoded the Unicode filename to UTF-8, but the encoding fails on
undecodable filename (on surrogate characters) which raises an unexpected
UnicodeEncodeError on recursion limit.
- Issue #11187: Remove bootstrap code (use ASCII) of
PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the
locale encoding) in PyUnicode_EncodeFSDefault().
- Check for NULL result in PyType_FromSpec.
- Issue #10516: New copy() and clear() methods for lists and bytearrays.
- Issue #11386: bytearray.pop() now throws IndexError when the bytearray is
empty, instead of OverflowError.
- Issue #12380: The rjust, ljust and center methods of bytes and bytearray
now accept a bytearray argument.
Library
-------
- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly
return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been
fixed.
- Issue #14166: Pickler objects now have an optional ``dispatch_table``
attribute which allows setting custom per-pickler reduction functions.
Patch by sbt.
- Issue #14177: marshal.loads() now raises TypeError when given a unicode
string. Patch by Guilherme Gonçalves.
- Issue #13550: Remove the debug machinery from the threading module: remove
verbose arguments from all threading classes and functions.
- Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary,
WeakValueDictionary) to return a better approximation when some objects
are dead or dying. Moreover, the implementation is now O(1) rather than
O(n).
- Issue #11841: Fix comparison bug with 'rc' versions in packaging.version.
Patch by Filip Gruszczyński.
- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils
on Windows. Also fixed in packaging.
- Issue #8033: sqlite3: Fix 64-bit integer handling in user functions
on 32-bit architectures. Initial patch by Philippe Devalkeneer.
- HTMLParser is now able to handle slashes in the start tag.
- Issue #13641: Decoding functions in the base64 module now accept ASCII-only
unicode strings. Patch by Catalin Iacob.
- Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a
new importlib.invalidate_caches() function.
- Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in
SimpleXMLRPCServer upon malformed POST request.
- Issue #13961: Move importlib over to using os.replace() for atomic renaming.
- Do away with ambiguous level values (as suggested by PEP 328) in
importlib.__import__() by raising ValueError when level < 0.
- Issue #2489: pty.spawn could consume 100% cpu when it encountered an EOF.
- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
- Issue #13777: Add PF_SYSTEM sockets on OS X.
Patch by Michael Goderbauer.
- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
Patch by Suman Saha.
- Issue #1326113: distutils' and packaging's build_ext commands option now
correctly parses multiple values (separated by whitespace or commas) given
to their --libraries option.
- Issue #10287: nntplib now queries the server's CAPABILITIES first before
sending MODE READER, and only sends it if not already in READER mode.
Patch by Hynek Schlawack.
- Issue #13993: HTMLParser is now able to handle broken end tags when
strict=False.
- Issue #13930: lib2to3 now supports writing converted output files to another
directory tree as well as copying unchanged files and altering the file
suffix.
- Issue #9750: Fix sqlite3.Connection.iterdump on tables and fields
with a name that is a keyword or contains quotes. Patch by Marko
Kohtala.
- Issue #10287: nntplib now queries the server's CAPABILITIES again after
authenticating (since the result may change, according to RFC 4643).
Patch by Hynek Schlawack.
- Issue #13590: On OS X 10.7 and 10.6 with Xcode 4.2, building
Distutils-based packages with C extension modules may fail because
Apple has removed gcc-4.2, the version used to build python.org
64-bit/32-bit Pythons. If the user does not explicitly override
the default C compiler by setting the CC environment variable,
Distutils will now attempt to compile extension modules with clang
if gcc-4.2 is required but not found. Also as a convenience, if
the user does explicitly set CC, substitute its value as the default
compiler in the Distutils LDSHARED configuration variable for OS X.
(Note, the python.org 32-bit-only Pythons use gcc-4.0 and the 10.4u
SDK, neither of which are available in Xcode 4. This change does not
attempt to override settings to support their use with Xcode 4.)
- Issue #13960: HTMLParser is now able to handle broken comments when
strict=False.
- When '' is a path (e.g. in sys.path), make sure __file__ uses the current
working directory instead of '' in importlib.
- Issue #13609: Add two functions to query the terminal size:
os.get_terminal_size (low level) and shutil.get_terminal_size (high level).
Patch by Zbigniew Jędrzejewski-Szmek.
- Issue #13845: On Windows, time.time() now uses GetSystemTimeAsFileTime()
instead of ftime() to have a resolution of 100 ns instead of 1 ms (the clock
accuracy is between 0.5 ms and 15 ms).
- Issue #13846: Add time.monotonic(), monotonic clock.
- Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on
Connection sockets, and set FILE_FLAG_FIRST_PIPE_INSTANCE on named pipes, to
make sure two listeners can't bind to the same socket/pipe (or any existing
socket/pipe).
- Issue #10811: Fix recursive usage of cursors. Instead of crashing,
raise a ProgrammingError now.
- Issue #13734: Add os.fwalk(), a directory walking function yielding file
descriptors.
- Issue #2945: Make the distutils upload command aware of bdist_rpm products.
- Issue #13712: pysetup create should not convert package_data to extra_files.
- Issue #11805: package_data in setup.cfg should allow more than one value.
- Issue #13676: Handle strings with embedded zeros correctly in sqlite3.
- Issue #8828: Add new function os.replace(), for cross-platform renaming
with overwriting.
- Issue #13848: open() and the FileIO constructor now check for NUL
characters in the file name. Patch by Hynek Schlawack.
- Issue #13806: The size check in audioop decompression functions was too
strict and could reject valid compressed data. Patch by Oleg Plakhotnyuk.
- Issue #13812: When a multiprocessing Process child raises an exception,
flush stderr after printing the exception traceback.
- Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC
IV attack countermeasure.
- Issue #13847: time.localtime() and time.gmtime() now raise an OSError instead
of ValueError on failure. time.ctime() and time.asctime() now raises an
OSError if localtime() failed. time.clock() now raises a RuntimeError if the
processor time used is not available or its value cannot be represented
- Issue #13772: In os.symlink() under Windows, do not try to guess the link
target's type (file or directory). The detection was buggy and made the
call non-atomic (therefore prone to race conditions).
- Issue #6631: Disallow relative file paths in urllib urlopen methods.
- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
registry.
- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
opening for writing using a fileobj returned by os.fdopen().
- Issue #13803: Under Solaris, distutils doesn't include bitness
in the directory name.
- Issue #10278: Add time.wallclock() function, monotonic clock.
- Issue #13809: Fix regression where bz2 module wouldn't work when threads are
disabled. Original patch by Amaury Forgeot d'Arc.
- Issue #13589: Fix some serialization primitives in the aifc module.
Patch by Oleg Plakhotnyuk.
- Issue #13642: Unquote before b64encoding user:password during Basic
Authentication. Patch contributed by Joonas Kuorilehto.
- Issue #12364: Fix a hang in concurrent.futures.ProcessPoolExecutor.
The hang would occur when retrieving the result of a scheduled future after
the executor had been shut down.
- Issue #13502: threading: Fix a race condition in Event.wait() that made it
return False when the event was set and cleared right after.
- Issue #9993: When the source and destination are on different filesystems,
and the source is a symlink, shutil.move() now recreates a symlink on the
destination instead of copying the file contents. Patch by Jonathan Niehof
and Hynek Schlawack.
- Issue #12926: Fix a bug in tarfile's link extraction.
- Issue #13696: Fix the 302 Relative URL Redirection problem.
- Issue #13636: Weak ciphers are now disabled by default in the ssl module
(except when SSLv2 is explicitly asked for).
- Issue #12715: Add an optional symlinks argument to shutil functions
(copyfile, copymode, copystat, copy, copy2). When that parameter is
true, symlinks aren't dereferenced and the operation instead acts on the
symlink itself (or creates one, if relevant). Patch by Hynek Schlawack.
- Add a flags parameter to select.epoll.
- Issue #13626: Add support for SSL Diffie-Hellman key exchange, through the
SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
- Issue #11006: Don't issue low level warning in subprocess when pipe2() fails.
- Issue #13620: Support for Chrome browser in webbrowser. Patch contributed
by Arnaud Calmettes.
- Issue #11829: Fix code execution holes in inspect.getattr_static for
metaclasses with metaclasses. Patch by Andreas Stührk.
- Issue #12708: Add starmap() and starmap_async() methods (similar to
itertools.starmap()) to multiprocessing.Pool. Patch by Hynek Schlawack.
- Issue #1785: Fix inspect and pydoc with misbehaving descriptors.
- Issue #13637: "a2b" functions in the binascii module now accept ASCII-only
unicode strings.
- Issue #13634: Add support for querying and disabling SSL compression.
- Issue #13627: Add support for SSL Elliptic Curve-based Diffie-Hellman
key exchange, through the SSLContext.set_ecdh_curve() method and the
ssl.OP_SINGLE_ECDH_USE option.
- Issue #13635: Add ssl.OP_CIPHER_SERVER_PREFERENCE, so that SSL servers
choose the cipher based on their own preferences, rather than on the
client's.
- Issue #11813: Fix inspect.getattr_static for modules. Patch by Andreas
Stührk.
- Issue #7502: Fix equality comparison for DocTestCase instances. Patch by
Cédric Krier.
- Issue #11870: threading: Properly reinitialize threads internal locks and
condition variables to avoid deadlocks in child processes.
- Issue #8035: urllib: Fix a bug where the client could remain stuck after a
redirection or an error.
- Issue #13560: os.strerror() now uses the current locale encoding instead of
UTF-8.
- Issue #8373: The filesystem path of AF_UNIX sockets now uses the filesystem
encoding and the surrogateescape error handler, rather than UTF-8. Patch
by David Watson.
- Issue #10350: Read and save errno before calling a function which might
overwrite it. Original patch by Hallvard B Furuseth.
- Issue #11610: Introduce a more general way to declare abstract properties.
- Issue #13591: A bug in importlib has been fixed that caused import_module
to load a module twice.
- Issue #13449: sched.scheduler.run() method has a new "blocking" parameter which
when set to False makes run() execute the scheduled events due to expire
soonest (if any) and then return. Patch by Giampaolo Rodolà.
- Issue #8684: sched.scheduler class can be safely used in multi-threaded
environments. Patch by Josiah Carlson and Giampaolo Rodolà.
- Alias resource.error to OSError ala PEP 3151.
- Issue #5689: Add support for lzma compression to the tarfile module.
- Issue #13248: Turn 3.2's PendingDeprecationWarning into 3.3's
DeprecationWarning. It covers 'cgi.escape', 'importlib.abc.PyLoader',
'importlib.abc.PyPycLoader', 'nntplib.NNTP.xgtitle', 'nntplib.NNTP.xpath',
and private attributes of 'smtpd.SMTPChannel'.
- Issue #5905, Issue #13560: time.strftime() is now using the current locale
encoding, instead of UTF-8, if the wcsftime() function is not available.
- Issue #13464: Add a readinto() method to http.client.HTTPResponse. Patch
by Jon Kuhn.
- tarfile.py: Correctly detect bzip2 compressed streams with blocksizes
other than 900k.
- Issue #13439: Fix many errors in turtle docstrings.
- Issue #6715: Add a module 'lzma' for compression using the LZMA algorithm.
Thanks to Per Øyvind Karlsen for the initial implementation.
- Issue #13487: Make inspect.getmodule robust against changes done to
sys.modules while it is iterating over it.
- Issue #12618: Fix a bug that prevented py_compile from creating byte
compiled files in the current directory. Initial patch by Sjoerd de Vries.
- Issue #13444: When stdout has been closed explicitly, we should not attempt
to flush it at shutdown and print an error.
- Issue #12567: The curses module uses Unicode functions for Unicode arguments
when it is linked to the ncurses library. It encodes also Unicode strings to
the locale encoding instead of UTF-8.
- Issue #12856: Ensure child processes do not inherit the parent's random
seed for filename generation in the tempfile module. Patch by Brian
Harring.
- Issue #9957: SpooledTemporaryFile.truncate() now accepts an optional size
parameter, as other file-like objects. Patch by Ryan Kelly.
- Issue #13458: Fix a memory leak in the ssl module when decoding a
certificate with a subjectAltName. Patch by Robert Xiao.
- Issue #13415: os.unsetenv() doesn't ignore errors anymore.
- Issue #13245: sched.scheduler class constructor's timefunc and
delayfunct parameters are now optional.
scheduler.enter and scheduler.enterabs methods gained a new kwargs parameter.
Patch contributed by Chris Clark.
- Issue #12328: Under Windows, refactor handling of Ctrl-C events and
make _multiprocessing.win32.WaitForMultipleObjects interruptible when
the wait_flag parameter is false. Patch by sbt.
- Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError is
raised when the wrapped raw file is non-blocking and the write would block.
Previous code assumed that the raw write() would raise BlockingIOError, but
RawIOBase.write() is defined to returned None when the call would block.
Patch by sbt.
- Issue #13358: HTMLParser now calls handle_data only once for each CDATA.
- Issue #4147: minidom's toprettyxml no longer adds whitespace around a text
node when it is the only child of an element. Initial patch by Dan
Kenigsberg.
- Issue #13374: The Windows bytes API has been deprecated in the os module. Use
Unicode filenames instead of bytes filenames to not depend on the ANSI code
page anymore and to support any filename.
- Issue #13297: Use bytes type to send and receive binary data through XMLRPC.
- Issue #6397: Support "/dev/poll" polling objects in select module,
under Solaris & derivatives.
- Issues #1745761, #755670, #13357, #12629, #1200313: HTMLParser now correctly
handles non-valid attributes, including adjacent and unquoted attributes.
- Issue #13193: Fix distutils.filelist.FileList and packaging.manifest.Manifest
under Windows.
- Issue #13384: Remove unnecessary __future__ import in Lib/random.py
- Issue #13149: Speed up append-only StringIO objects.
- Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
when called with a timeout. Patch by Arnaud Ysmal.
- Issue #13254: Fix Maildir initialization so that maildir contents
are read correctly.
- Issue #3067: locale.setlocale() now raises TypeError if the second
argument is an invalid iterable. Its documentation and docstring
were also updated. Initial patch by Jyrki Pulliainen.
- Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.
- Issue #13339: Fix compile error in posixmodule.c due to missing semicolon.
Thanks to Robert Xiao.
- Byte compilation in packaging is now isolated from the calling Python -B or
-O options, instead of being disallowed under -B or buggy under -O.
- Issue #10570: curses.putp() and curses.tparm() are now expecting a byte
string, instead of a Unicode string.
- Issue #13295: http.server now produces valid HTML 4.01 strict.
- Issue #2892: preserve iterparse events in case of SyntaxError.
- Issue #13287: urllib.request and urllib.error now contains an __all__
attribute to expose only relevant classes and functions. Patch by Florent
Xicluna.
- Issue #670664: Fix HTMLParser to correctly handle the content of
``<script>...</script>`` and ``<style>...</style>``.
- Issue #10817: Fix urlretrieve function to raise ContentTooShortError even
when reporthook is None. Patch by Jyrki Pulliainen.
- Fix the xmlrpc.client user agent to return something similar to
urllib.request user agent: "Python-xmlrpc/3.3".
- Issue #13293: Better error message when trying to marshal bytes using
xmlrpc.client.
- Issue #13291: NameError in xmlrpc package.
- Issue #13258: Use callable() built-in in the standard library.
- Issue #13273: fix a bug that prevented HTMLParser to properly detect some
tags when strict=False.
- Issue #11183: Add finer-grained exceptions to the ssl module, so that
you don't have to inspect the exception's attributes in the common case.
- Issue #13216: Add cp65001 codec, the Windows UTF-8 (CP_UTF8).
- Issue #13226: Add RTLD_xxx constants to the os module. These constants can be
used with sys.setdlopenflags().
- Issue #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants to
the time module. time.clock_gettime(time.CLOCK_MONOTONIC) provides a
monotonic clock
- Issue #10332: multiprocessing: fix a race condition when a Pool is closed
before all tasks have completed.
- Issue #13255: wrong docstrings in array module.
- Issue #8540: Remove deprecated Context._clamp attribute in Decimal module.
- Issue #13235: Added DeprecationWarning to logging.warn() method and function.
- Issue #9168: now smtpd is able to bind privileged port.
- Issue #12529: fix cgi.parse_header issue on strings with double-quotes and
semicolons together. Patch by Ben Darnell and Petri Lehtinen.
- Issue #13227: functools.lru_cache() now has an option to distinguish
calls with different argument types.
- Issue #6090: zipfile raises a ValueError when a document with a timestamp
earlier than 1980 is provided. Patch contributed by Petri Lehtinen.
- Issue #13150: sysconfig no longer parses the Makefile and config.h files
when imported, instead doing it at build time. This makes importing
sysconfig faster and reduces Python startup time by 20%.
- Issue #12448: smtplib now flushes stdout while running ``python -m smtplib``
in order to display the prompt correctly.
- Issue #12454: The mailbox module is now using ASCII, instead of the locale
encoding, to read and write .mh_sequences files.
- Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
now available on Windows.
- Issue #1673007: urllib.request now supports HEAD request via new method argument.
Patch contributions by David Stanek, Patrick Westerhoff and Ezio Melotti.
- Issue #12386: packaging does not fail anymore when writing the RESOURCES
file.
- Issue #13158: Fix decoding and encoding of GNU tar specific base-256 number
fields in tarfile.
- Issue #13025: mimetypes is now reading MIME types using the UTF-8 encoding,
instead of the locale encoding.
- Issue #10653: On Windows, use strftime() instead of wcsftime() because
wcsftime() doesn't format time zone correctly.
- Issue #13150: The tokenize module doesn't compile large regular expressions
at startup anymore.
- Issue #11171: Fix distutils.sysconfig.get_makefile_filename when Python was
configured with different prefix and exec-prefix.
- Issue #11254: Teach distutils and packaging to compile .pyc and .pyo files in
PEP 3147-compliant __pycache__ directories.
- Issue #7367: Fix pkgutil.walk_paths to skip directories whose
contents cannot be read.
- Issue #3163: The struct module gets new format characters 'n' and 'N'
supporting C integer types ``ssize_t`` and ``size_t``, respectively.
- Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
Reported and diagnosed by Thomas Kluyver.
- Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer. Patch by John O'Connor.
- Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg. Patch by Nicolas M. Thiéry and Craig
Citro.
- Issue #13034: When decoding some SSL certificates, the subjectAltName
extension could be unreported.
- Issue #12306: Expose the runtime version of the zlib C library as a constant,
ZLIB_RUNTIME_VERSION, in the zlib module. Patch by Torsten Landschoff.
- Issue #12959: Add collections.ChainMap to collections.__all__.
- Issue #8933: distutils' PKG-INFO files and packaging's METADATA files will
now correctly report Metadata-Version: 1.1 instead of 1.0 if a Classifier or
Download-URL field is present.
- Issue #12567: Add curses.unget_wch() function. Push a character so the next
get_wch() will return it.
- Issue #9561: distutils and packaging now writes egg-info files using UTF-8,
instead of the locale encoding.
- Issue #8286: The distutils command sdist will print a warning message instead
of crashing when an invalid path is given in the manifest template.
- Issue #12841: tarfile unnecessarily checked the existence of numerical user
and group ids on extraction. If one of them did not exist the respective id
of the current user (i.e. root) was used for the file and ownership
information was lost.
- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
more than 128 entities. Patch by Peter Otten.
- Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses.
- Issue #12494: On error, call(), check_call(), check_output() and
getstatusoutput() functions of the subprocess module now kill the process,
read its status (to avoid zombis) and close pipes.
- Issue #12720: Expose low-level Linux extended file attribute functions in os.
- Issue #10946: The distutils commands bdist_dumb, bdist_wininst and bdist_msi
now respect a --skip-build option given to bdist. The packaging commands
were fixed too.
- Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
- Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items). Instead, in most cases, an OverflowError is raised.
- Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
- Issue #12839: Fix crash in zlib module due to version mismatch.
Fix by Richard M. Tew.
- Issue #9923: The mailcap module now correctly uses the platform path
separator for the MAILCAP environment variable on non-POSIX platforms.
- Issue #12835: Follow up to #6560 that unconditionally prevents use of the
unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets. Patch by David
Watson.
- Issue #12803: SSLContext.load_cert_chain() now accepts a password argument
to be used if the private key is encrypted. Patch by Adam Simpkins.
- Issue #11657: Fix sending file descriptors over 255 over a multiprocessing
Pipe.
- Issue #12811: tabnanny.check() now promptly closes checked files. Patch by
Anthony Briggs.
- Issue #6560: The sendmsg/recvmsg API is now exposed by the socket module
when provided by the underlying platform, supporting processing of
ancillary data in pure Python code. Patch by David Watson and Heiko Wundram.
- Issue #12326: On Linux, sys.platform doesn't contain the major version
anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending
on the Linux version used to build Python.
- Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
- Issue #12778: Reduce memory consumption when JSON-encoding a large
container of many small objects.
- Issue #12650: Fix a race condition where a subprocess.Popen could leak
resources (FD/zombie) when killed at the wrong time.
- Issue #12744: Fix inefficient representation of integers between 2**31 and
2**63 on systems with a 64-bit C "long".
- Issue #12646: Add an 'eof' attribute to zlib.Decompress, to make it easier to
detect truncated input streams.
- Issue #11513: Fix exception handling ``tarfile.TarFile.gzopen()`` when
the file cannot be opened.
- Issue #12687: Fix a possible buffering bug when unpickling text mode
(protocol 0, mostly) pickles.
- Issue #10087: Fix the html output format of the calendar module.
- Issue #13121: add support for inplace math operators to collections.Counter.
- Add support for unary plus and unary minus to collections.Counter.
- Issue #12683: urlparse updated to include svn as schemes that uses relative
paths. (svn from 1.5 onwards support relative path).
- Issue #12655: Expose functions from sched.h in the os module: sched_yield(),
sched_setscheduler(), sched_getscheduler(), sched_setparam(),
sched_get_min_priority(), sched_get_max_priority(), sched_rr_get_interval(),
sched_getaffinity(), sched_setaffinity().
- Add ThreadError to threading.__all__.
- Issues #11104, #8688: Fix the behavior of distutils' sdist command with
manually-maintained MANIFEST files.
- Issue #11281: smtplib.STMP gets source_address parameter, which adds the
ability to bind to specific source address on a machine with multiple
interfaces. Patch by Paulo Scardine.
- Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow
symlinks: fix it. Patch by Petri Lehtinen.
- Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod')
in Python code) now finds the doc of the method.
- Issue #10968: Remove indirection in threading. The public names (Event,
Condition, etc.) used to be factory functions returning instances of hidden
classes (_Event, _Condition, etc.), because (if Guido recalls correctly) this
code pre-dates the ability to subclass extension types. It is now possible
to inherit from these classes, without having to import the private
underscored names like multiprocessing did.
- Issue #9723: Add shlex.quote functions, to escape filenames and command
lines.
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
- Issue #12514: Use try/finally to assure the timeit module restores garbage
collections when it is done.
- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.
- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates)
``Connection: close`` header.
- Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
- Issue #1813: Fix codec lookup under Turkish locales.
- Issue #12591: Improve support of "universal newlines" in the subprocess
module: the piped streams can now be properly read from or written to.
- Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add a *write_through* parameter to mandate
unbuffered writes.
- Issue #10883: Fix socket leaks in urllib.request when using FTP.
- Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
- Issue #12372: POSIX semaphores are broken on AIX: don't use them.
- Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
to get channel binding data for the current SSL session (only the
"tls-unique" channel binding is implemented). This allows the implementation
of certain authentication mechanisms such as SCRAM-SHA-1-PLUS. Patch by
Jacek Konieczny.
- Issue #665194: email.utils now has format_datetime and parsedate_to_datetime
functions, allowing for round tripping of RFC2822 format dates.
- Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2
directory, so that "import DLFCN" and other similar imports work on
Linux 3.0.
- Issue #7484: smtplib no longer puts <> around addresses in VRFY and EXPN
commands; they aren't required and in fact postfix doesn't support that form.
- Issue #12273: Remove ast.__version__. AST changes can be accounted for by
checking sys.version_info or sys._mercurial.
- Silence spurious "broken pipe" tracebacks when shutting down a
ProcessPoolExecutor.
- Fix potential resource leaks in concurrent.futures.ProcessPoolExecutor
by joining all queues and processes when shutdown() is called.
- Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by
Andreas Stührk.
- Issue #11321: Fix a crash with multiple imports of the _pickle module when
embedding Python. Patch by Andreas Stührk.
- Issue #6755: Add get_wch() method to curses.window class. Patch by Iñigo
Serna.
- Add cgi.closelog() function to close the log file.
- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
- Issue #4376: ctypes now supports nested structures in an endian different than
the parent structure. Patch by Vlad Riscutia.
- Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a
TextIOWrapper to a huge value, not TypeError.
- Issue #12504: Close file handles in a timely manner in packaging.database.
This fixes a bug with the remove (uninstall) feature on Windows.
- Issues #12169 and #10510: Factor out code used by various packaging commands
to make HTTP POST requests, and make sure it uses CRLF.
- Issue #12016: Multibyte CJK decoders now resynchronize faster. They only
ignore the first byte of an invalid byte sequence. For example,
b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of '\ufffd'.
- Issue #12459: time.sleep() now raises a ValueError if the sleep length is
negative, instead of an infinite sleep on Windows or raising an IOError on
Linux for example, to have the same behaviour on all platforms.
- Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support
Python scripts using an encoding different than UTF-8 (read the coding cookie
of the script).
- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
if the process has only one pipe.
- Issue #12467: warnings: fix a race condition if a warning is emitted at
shutdown, if globals()['__file__'] is None.
- Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
instead of text mode using the locale encoding, to avoid encoding issues.
- Issue #12451: runpy: run_path() now opens the Python script in binary mode,
instead of text mode using the locale encoding, to support other encodings
than UTF-8 (scripts using the coding cookie).
- Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead
of the text mode (using the locale encoding) to avoid encoding issues.
- Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better
conformance to the RFCs: correctly handle Sender and Resent- headers.
- Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
the garbage collector while the Heap lock is held.
- Issue #12462: time.sleep() now immediately calls the (Python) signal handler
if it is interrupted by a signal, instead of having to wait until the next
instruction.
- Issue #12442: new shutil.disk_usage function, providing total, used and free
disk space statistics.
- Issue #12451: The XInclude default loader of xml.etree now decodes files from
UTF-8 instead of the locale encoding if the encoding is not specified. It now
also opens XML files for the parser in binary mode instead of the text mode
to avoid encoding issues.
- Issue #12451: doctest.debug_script() doesn't create a temporary file
anymore to avoid encoding issues.
- Issue #12451: pydoc.synopsis() now reads the encoding cookie if available,
to read the Python script from the right encoding.
- Issue #12451: distutils now opens the setup script in binary mode to read the
encoding cookie, instead of opening it in UTF-8.
- Issue #9516: On Mac OS X, change Distutils to no longer globally attempt to
check or set the MACOSX_DEPLOYMENT_TARGET environment variable for the
interpreter process. This could cause failures in non-Distutils subprocesses
and was unreliable since tests or user programs could modify the interpreter
environment after Distutils set it. Instead, have Distutils set the
deployment target only in the environment of each build subprocess. It is
still possible to globally override the default by setting
MACOSX_DEPLOYMENT_TARGET before launching the interpreter; its value must be
greater or equal to the default value, the value with which the interpreter
was built. Also, implement the same handling in packaging.
- Issue #12422: In the copy module, don't store objects that are their own copy
in the memo dict.
- Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module.
- Issue #12404: Remove C89 incompatible code from mmap module. Patch by Akira
Kitada.
- Issue #1874: email now detects and reports as a defect the presence of
any CTE other than 7bit, 8bit, or binary on a multipart.
- Issue #12383: Fix subprocess module with env={}: don't copy the environment
variables, start with an empty environment.
- Issue #11637: Fix support for importing packaging setup hooks from the
project directory.
- Issue #6771: Moved the curses.wrapper function from the single-function
wrapper module into __init__, eliminating the module. Since __init__ was
already importing the function to curses.wrapper, there is no API change.
- Issue #11584: email.header.decode_header no longer fails if the header
passed to it is a Header object, and Header/make_header no longer fail
if given binary unknown-8bit input.
- Issue #11700: mailbox proxy object close methods can now be called multiple
times without error.
- Issue #11767: Correct file descriptor leak in mailbox's __getitem__ method.
- Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the HTTP
connection if its getresponse() method fails with a socket error. Patch
written by Ezio Melotti.
- Issue #12240: Allow multiple setup hooks in packaging's setup.cfg files.
Original patch by Erik Bray.
- Issue #9284: Allow inspect.findsource() to find the source of doctest
functions.
- Issue #11595: Fix assorted bugs in packaging.util.cfg_to_args, a
compatibility helper for the distutils-packaging transition. Original patch
by Erik Bray.
- Issue #12287: In ossaudiodev, check that the device isn't closed in several
methods.
- Issue #12009: Fixed regression in netrc file comment handling.
- Issue #12246: Warn and fail when trying to install a third-party project from
an uninstalled Python (built in a source checkout). Original patch by
Tshepang Lekhonkhobe.
- Issue #10694: zipfile now ignores garbage at the end of a zipfile.
- Issue #12283: Fixed regression in smtplib quoting of leading dots in DATA.
- Issue #10424: Argparse now includes the names of the missing required
arguments in the missing arguments error message.
- Issue #12168: SysLogHandler now allows NUL termination to be controlled using
a new 'append_nul' attribute on the handler.
- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
instead of os.stat.
- Issue #12021: Make mmap's read() method argument optional. Patch by Petri
Lehtinen.
- Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed
children and raises BrokenProcessPool in such a situation. Previously it
would reliably freeze/deadlock.
- Issue #12040: Expose a new attribute ``sentinel`` on instances of
``multiprocessing.Process``. Also, fix Process.join() to not use polling
anymore, when given a timeout.
- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the
smtplib module. Patch by Catalin Iacob.
- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
to compute.
- Issue #12221: Remove __version__ attributes from pyexpat, pickle, tarfile,
pydoc, tkinter, and xml.parsers.expat. This were useless version constants
left over from the Mercurial transition
- Named tuples now work correctly with vars().
- Issue #12085: Fix an attribute error in subprocess.Popen destructor if the
constructor has failed, e.g. because of an undeclared keyword argument. Patch
written by Oleg Oshmyan.
- Issue #12028: Make threading._get_ident() public, rename it to
threading.get_ident() and document it. This function was already used using
_thread.get_ident().
- Issue #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls
encreset() instead of decreset().
- Issue #12218: Removed wsgiref.egg-info.
- Issue #12196: Add pipe2() to the os module.
- Issue #985064: Make plistlib more resilient to faulty input plists.
Patch by Mher Movsisyan.
- Issue #1625: BZ2File and bz2.decompress() now support multi-stream files.
Initial patch by Nir Aides.
- Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available.
- Issue #12175: FileIO.readall() now only reads the file position and size
once.
- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
if the file is closed.
- Issue #11109: New service_action method for BaseServer, used by ForkingMixin
class for cleanup. Initial Patch by Justin Warkentin.
- Issue #12045: Avoid duplicate execution of command in
ctypes.util._get_soname(). Patch by Sijin Joseph.
- Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
server.
- Issue #1441530: In imaplib, read the data in one chunk to speed up large
reads and simplify code.
- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
- Issue #12100: Don't reset incremental encoders of CJK codecs at each call to
their encode() method anymore, but continue to call the reset() method if the
final argument is True.
- Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
module.
- Issue #6501: os.device_encoding() returns None on Windows if the application
has no console.
- Issue #12105: Add O_CLOEXEC to the os module.
- Issue #12079: Decimal('Infinity').fma(Decimal('0'), (3.91224318126786e+19+0j))
now raises TypeError (reflecting the invalid type of the 3rd argument) rather
than Decimal.InvalidOperation.
- Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
to be able to unload the module.
- Add the packaging module, an improved fork of distutils (also known as
distutils2).
- Issue #12065: connect_ex() on an SSL socket now returns the original errno
when the socket's timeout expires (it used to return None).
- Issue #8809: The SMTP_SSL constructor and SMTP.starttls() now support
passing a ``context`` argument pointing to an ssl.SSLContext instance.
Patch by Kasun Herath.
- Issue #9516: Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET
is set in shell.
- Issue #8650: Make zlib module 64-bit clean. compress(), decompress() and
their incremental counterparts now raise OverflowError if given an input
larger than 4GB, instead of silently truncating the input and returning
an incorrect result.
- Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
attribute when called without a max_length argument.
- Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
on a file opened in read+write mode (namely: reading, seeking a bit forward,
writing, then seeking before the previous write but still within buffered
data, and writing again).
- Issue #9971: Write an optimized implementation of BufferedReader.readinto().
Patch by John O'Connor.
- Issue #11799: urllib.request Authentication Handlers will raise a ValueError
when presented with an unsupported Authentication Scheme. Patch contributed
by Yuval Greenfield.
- Issue #10419, #6011: build_scripts command of distutils handles correctly
non-ASCII path (path to the Python executable). Open and write the script in
binary mode, but ensure that the shebang is decodable from UTF-8 and from the
encoding of the script.
- Issue #8498: In socket.accept(), allow specifying 0 as a backlog value in
order to accept exactly one connection. Patch by Daniel Evers.
- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
instead of a RuntimeError: OSError has an errno attribute.
- Issue #3709: add a flush_headers method to BaseHTTPRequestHandler, which
manages the sending of headers to output stream and flushing the internal
headers buffer. Patch contribution by Andrew Schaaf
- Issue #11743: Rewrite multiprocessing connection classes in pure Python.
- Issue #11164: Stop trying to use _xmlplus in the xml module.
- Issue #11888: Add log2 function to math module. Patch written by Mark
Dickinson.
- Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional.
- Issue #8407: The signal handler writes the signal number as a single byte
instead of a nul byte into the wakeup file descriptor. So it is possible to
wait more than one signal and know which signals were raised.
- Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the
signal module.
- Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch
by Kasun Herath.
- Issue #12002: ftplib's abort() method raises TypeError.
- Issue #11916: Add a number of MacOSX specific definitions to the errno module.
Patch by Pierre Carrier.
- Issue #11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
detect mtime changes by comparing to the system clock instead of to the
previous value of the mtime.
- Issue #11072: added MLSD command (RFC-3659) support to ftplib.
- Issue #8808: The IMAP4_SSL constructor now allows passing an SSLContext
parameter to control parameters of the secure channel. Patch by Sijin
Joseph.
- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
file on Windows XP. As noticed in issue #10684.
- Issue #12000: When a SSL certificate has a subjectAltName without any
dNSName entry, ssl.match_hostname() should use the subject's commonName.
Patch by Nicolas Bareil.
- Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and
assertWarnsRegex now accept a keyword argument 'msg' when used as context
managers. Initial patch by Winston Ewert.
- Issue #10684: shutil.move used to delete a folder on case insensitive
filesystems when the source and destination name where the same except
for the case.
- Issue #11647: objects created using contextlib.contextmanager now support
more than one call to the function when used as a decorator. Initial patch
by Ysj Ray.
- Issue #11930: Removed deprecated time.accept2dyear variable.
Removed year >= 1000 restriction from datetime.strftime.
- logging: don't define QueueListener if Python has no thread support.
- functools.cmp_to_key() now works with collections.Hashable().
- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
- Issue #8407: Add signal.pthread_sigmask() function to fetch and/or change the
signal mask of the calling thread.
- Issue #11858: configparser.ExtendedInterpolation expected lower-case section
names.
- Issue #11324: ConfigParser(interpolation=None) now works correctly.
- Issue #11811: ssl.get_server_certificate() is now IPv6-compatible. Patch
by Charles-François Natali.
- Issue #11763: don't use difflib in TestCase.assertMultiLineEqual if the
strings are too long.
- Issue #11236: getpass.getpass responds to ctrl-c or ctrl-z on terminal.
- Issue #11856: Speed up parsing of JSON numbers.
- Issue #11005: threading.RLock()._release_save() raises a RuntimeError if the
lock was not acquired.
- Issue #11258: Speed up ctypes.util.find_library() under Linux by a factor
of 5 to 10. Initial patch by Jonas H.
- Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
release the GIL. Patch by Charles-François Natali.
- Issue #11223: Add threading._info() function providing information about
the thread implementation.
- Issue #11731: simplify/enhance email parser/generator API by introducing
policy objects.
- Issue #11768: The signal handler of the signal module only calls
Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or
parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
- Issue #11492: fix several issues with header folding in the email package.
- Issue #11852: Add missing imports and update tests.
- Issue #11875: collections.OrderedDict's __reduce__ was temporarily
mutating the object instead of just working on a copy.
- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
specific part only digits. Patch by Santoso Wijaya.
- collections.Counter().copy() now works correctly for subclasses.
- Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows.
Patch by Santoso Wijaya.
- Issue #11684: complete email.parser bytes API by adding BytesHeaderParser.
- The bz2 module now handles 4GiB+ input buffers correctly.
- Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when
_json is not available.
- Issue #11830: Remove unnecessary introspection code in the decimal module.
- Issue #11703: urllib2.geturl() does not return correct url when the original
url contains #fragment.
- Issue #10019: Fixed regression in json module where an indent of 0 stopped
adding newlines and acted instead like 'None'.
- Issue #11186: pydoc ignores a module if its name contains a surrogate
character in the index of modules.
- Issue #11815: Use a light-weight SimpleQueue for the result queue in
concurrent.futures.ProcessPoolExecutor.
- Issue #5162: Treat services like frozen executables to allow child spawning
from multiprocessing.forking on Windows.
- logging.basicConfig now supports an optional 'handlers' argument taking an
iterable of handlers to be added to the root logger. Additional parameter
checks were also added to basicConfig.
- Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
- Issue #11747: Fix range formatting in difflib.context_diff() and
difflib.unified_diff().
- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
worker processes: new processes would be spawned while the pool is being
shut down. Patch by Charles-François Natali.
- Issue #2650: re.escape() no longer escapes the '_'.
- Issue #11757: select.select() now raises ValueError when a negative timeout
is passed (previously, a select.error with EINVAL would be raised). Patch
by Charles-François Natali.
- Issue #7311: fix html.parser to accept non-ASCII attribute values.
- Issue #11605: email.parser.BytesFeedParser was incorrectly converting
multipart subparts with an 8-bit CTE into unicode instead of preserving the
bytes.
- Issue #1690608: email.util.formataddr is now RFC 2047 aware: it now has a
charset parameter that defaults to utf-8 and is used as the charset for RFC
2047 encoding when the realname contains non-ASCII characters.
- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
- Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFile
to be wrapped in a TextIOWrapper. Patch by Nadeem Vawda.
- Issue #11707: Added a fast C version of functools.cmp_to_key().
Patch by Filip Gruszczyński.
- Issue #11688: Add sqlite3.Connection.set_trace_callback(). Patch by
Torsten Landschoff.
- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
private keys.
- Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept
file-like objects using a new ``fileobj`` constructor argument. Patch by
Nadeem Vawda.
- unittest.TestCase.assertSameElements has been removed.
- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
called yet: detect bootstrap (startup) issues earlier.
- Issue #11393: Add the new faulthandler module.
- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
- Removed the 'strict' argument to email.parser.Parser, which has been
deprecated since Python 2.4.
- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
arguments.
- Issue #11696: Fix ID generation in msilib.
- itertools.accumulate now supports an optional *func* argument for
a user-supplied binary function.
- Issue #11692: Remove unnecessary demo functions in subprocess module.
- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
trying to pack a negative (in-range) integer.
- Issue #11675: multiprocessing.[Raw]Array objects created from an integer size
are now zeroed on creation. This matches the behaviour specified by the
documentation.
- Issue #7639: Fix short file name generation in bdist_msi
- Issue #11635: Don't use polling in worker threads and processes launched by
concurrent.futures.
- Issue #5845: Automatically read readline configuration to enable completion
in interactive mode.
- Issue #6811: Allow importlib to change a code object's co_filename attribute
to match the path to where the source code currently is, not where the code
object originally came from.
- Issue #8754: Have importlib use the repr of a module name in error messages.
- Issue #11591: Prevent "import site" from modifying sys.path when python
was started with -S.
- collections.namedtuple() now adds a _source attribute to the generated
class. This make the source more accessible than the outdated
"verbose" option which prints to stdout but doesn't make the source
string available.
- Issue #11371: Mark getopt error messages as localizable. Patch by Filip
Gruszczyński.
- Issue #11333: Add __slots__ to collections ABCs.
- Issue #11628: cmp_to_key generated class should use __slots__.
- Issue #11666: let help() display named tuple attributes and methods
that start with a leading underscore.
- Issue #11662: Make urllib and urllib2 ignore redirections if the
scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
- Issue #5537: Fix time2isoz() and time2netscape() functions of
httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
- Issue #4391: Use proper gettext plural forms in optparse.
- Issue #11127: Raise a TypeError when trying to pickle a socket object.
- Issue #11563: ``Connection: close`` header is sent by requests using URLOpener
class which helps in closing of sockets after connection is over. Patch
contributions by Jeff McNeil and Nadeem Vawda.
- Issue #11459: A ``bufsize`` value of 0 in subprocess.Popen() really creates
unbuffered pipes, such that select() works properly on them.
- Issue #5421: Fix misleading error message when one of socket.sendto()'s
arguments has the wrong type. Patch by Nikita Vetoshkin.
- Issue #10812: Add some extra posix functions to the os module.
- Issue #10979: unittest stdout buffering now works with class and module
setup and teardown.
- Issue #11243: fix the parameter querying methods of Message to work if
the headers contain un-encoded non-ASCII data.
- Issue #11401: fix handling of headers with no value; this fixes a regression
relative to Python2 and the result is now the same as it was in Python2.
- Issue #9298: base64 bodies weren't being folded to line lengths less than 78,
which was a regression relative to Python2. Unlike Python2, the last line
of the folded body now ends with a carriage return.
- Issue #11560: shutil.unpack_archive now correctly handles the format
parameter. Patch by Evan Dandrea.
- Issue #5870: Add `subprocess.DEVNULL` constant.
- Issue #11133: fix two cases where inspect.getattr_static can trigger code
execution. Patch by Andreas Stührk.
- Issue #11569: use absolute path to the sysctl command in multiprocessing to
ensure that it will be found regardless of the shell PATH. This ensures
that multiprocessing.cpu_count works on default installs of MacOSX.
- Issue #11501: distutils.archive_utils.make_zipfile no longer fails if zlib is
not installed. Instead, the zipfile.ZIP_STORED compression is used to create
the ZipFile. Patch by Natalia B. Bidart.
- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
in a `with` statement. Contributed by Giampaolo Rodola.
- Issue #11554: Fixed support for Japanese codecs; previously the body output
encoding was not done if euc-jp or shift-jis was specified as the charset.
- Issue #11407: `TestCase.run` returns the result object used or created.
Contributed by Janathan Hartley.
- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
IP addresses in the proxy exception list.
- Issue #11491: dbm.error is no longer raised when dbm.open is called with
the "n" as the flag argument and the file exists. The behavior matches
the documentation and general logic.
- Issue #1162477: Postel Principle adjustment to email date parsing: handle the
fact that some non-compliant MUAs use '.' instead of ':' in time specs.
- Issue #11131: Fix sign of zero in decimal.Decimal plus and minus
operations when the rounding mode is ROUND_FLOOR.
- Issue #9935: Speed up pickling of instances of user-defined classes.
- Issue #5622: Fix curses.wrapper to raise correct exception if curses
initialization fails.
- Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when
really necessary. Patch by Charles-François Natali.
- Issue #11391: Writing to a mmap object created with
``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
TypeError. Patch by Charles-François Natali.
- Issue #9795: add context management protocol support for nntplib.NNTP class.
- Issue #11306: mailbox in certain cases adapts to an inability to open
certain files in read-write mode. Previously it detected this by
checking for EACCES, now it also checks for EROFS.
- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
on accept(), send() and recv().
- Issue #11377: Deprecate platform.popen() and reimplement it with os.popen().
- Issue #8513: On UNIX, subprocess supports bytes command string.
- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall.
- Issue #11140: Lock.release() now raises a RuntimeError when attempting
to release an unacquired lock, as claimed in the threading documentation.
The _thread.error exception is now an alias of RuntimeError. Patch by
Filip Gruszczyński. Patch for _dummy_thread by Aymeric Augustin.
- Issue #8594: ftplib now provides a source_address parameter to specify which
(address, port) to bind to before connecting.
- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
and make it work for non-blocking connects.
- Issue #11297: Add collections.ChainMap().
- Issue #10755: Add the posix.flistdir() function. Patch by Ross Lagerwall.
- Issue #4761: Add the ``*at()`` family of functions (openat(), etc.) to the
posix module. Patch by Ross Lagerwall.
- Issue #7322: Trying to read from a socket's file-like object after a timeout
occurred now raises an error instead of silently losing data.
- Issue #11291: poplib.POP no longer suppresses errors on quit().
- Issue #11177: asyncore's create_socket() arguments can now be omitted.
- Issue #6064: Add a ``daemon`` keyword argument to the threading.Thread
and multiprocessing.Process constructors in order to override the
default behaviour of inheriting the daemonic property from the current
thread/process.
- Issue #10956: Buffered I/O classes retry reading or writing after a signal
has arrived and the handler returned successfully.
- Issue #10784: New os.getpriority() and os.setpriority() functions.
- Issue #11114: Fix catastrophic performance of tell() on text files (up
to 1000x faster in some cases). It is still one to two order of magnitudes
slower than binary tell().
- Issue #10882: Add os.sendfile function.
- Issue #10868: Allow usage of the register method of an ABC as a class
decorator.
- Issue #11224: Fixed a regression in tarfile that affected the file-like
objects returned by TarFile.extractfile() regarding performance, memory
consumption and failures with the stream interface.
- Issue #10924: Adding salt and Modular Crypt Format to crypt library.
Moved old C wrapper to _crypt, and added a Python wrapper with
enhanced salt generation and simpler API for password generation.
- Issue #11074: Make 'tokenize' so it can be reloaded.
- Issue #11085: Moved collections abstract base classes into a separate
module called collections.abc, following the pattern used by importlib.abc.
For backwards compatibility, the names are imported into the collections
module.
- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for
32-bit Windows.
- Issue #11169: compileall module uses repr() to format filenames and paths to
escape surrogate characters and show spaces.
- Issue #11089: Fix performance issue limiting the use of ConfigParser()
with large config files.
- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
larger than 4GB. Patch by Nadeem Vawda.
- Issue #11388: Added a clear() method to MutableSequence
- Issue #11174: Add argparse.MetavarTypeHelpFormatter, which uses type names
for the names of optional and positional arguments in help messages.
- Issue #9348: Raise an early error if argparse nargs and metavar don't match.
- Issue #9026: Fix order of argparse sub-commands in help messages.
- Issue #9347: Fix formatting for tuples in argparse type= error messages.
- Issue #12191: Added shutil.chown() to change user and/or group owner of a
given path also specifying their names.
- Issue #13988: The _elementtree accelerator is used whenever available.
Now xml.etree.cElementTree becomes a deprecated alias to ElementTree.
Build
-----
- Issue #6807: Run msisupport.mak earlier.
- Issue #10580: Minor grammar change in Windows installer.
- Issue #13326: Clean __pycache__ directories correctly on OpenBSD.
- PEP 393: the configure option --with-wide-unicode is removed.
- Issue #12852: Set _XOPEN_SOURCE to 700, instead of 600, to get POSIX 2008
functions on OpenBSD (e.g. fdopendir).
- Issue #11863: Remove support for legacy systems deprecated in Python 3.2
(following PEP 11). These systems are systems using Mach C Threads,
SunOS lightweight processes, GNU pth threads and IRIX threads.
- Issue #8746: Correct faulty configure checks so that os.chflags() and
os.lchflags() are once again built on systems that support these
functions (BSD and OS X). Also add new stat file flags for OS X
(UF_HIDDEN and UF_COMPRESSED).
- Issue #10645: Installing Python no longer creates a
Python-X.Y.Z-pyX.Y.egg-info file in the lib-dynload directory.
- Do not accidentally include the directory containing sqlite.h twice when
building sqlite3.
- Issue #11217: For 64-bit/32-bit Mac OS X universal framework builds,
ensure "make install" creates symlinks in --prefix bin for the "-32"
files in the framework bin directory like the installer does.
- Issue #11347: Use --no-as-needed when linking libpython3.so.
- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
- Issue #11268: Prevent Mac OS X Installer failure if Documentation
package had previously been installed.
- Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2.
IDLE
----
- Issue #14409: IDLE now properly executes commands in the Shell window
when it cannot read the normal config files on startup and
has to use the built-in default key bindings.
There was previously a bug in one of the defaults.
- IDLE can be launched as python -m idlelib
- Issue #3573: IDLE hangs when passing invalid command line args
(directory(ies) instead of file(s)) (Patch by Guilherme Polo)
- Issue #14200: IDLE shell crash on printing non-BMP unicode character.
- Issue #5219: Prevent event handler cascade in IDLE.
- Issue #964437: Make IDLE help window non-modal.
Patch by Guilherme Polo and Roger Serwy.
- Issue #13933: IDLE auto-complete did not work with some imported
module, like hashlib. (Patch by Roger Serwy)
- Issue #13506: Add '' to path for IDLE Shell when started and restarted with Restart Shell.
Original patches by Marco Scataglini and Roger Serwy.
- Issue #4625: If IDLE cannot write to its recent file or breakpoint files,
display a message popup and continue rather than crash. Original patch by
Roger Serwy.
- Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..".
Patch by Tal Einat.
- Issue #13296: Fix IDLE to clear compile __future__ flags on shell restart.
(Patch by Roger Serwy)
- Issue #9871: Prevent IDLE 3 crash when given byte stings
with invalid hex escape sequences, like b'\x0'.
(Original patch by Claudiu Popa.)
- Issue #12636: IDLE reads the coding cookie when executing a Python script.
- Issue #12540: Prevent zombie IDLE processes on Windows due to changes
in os.kill().
- Issue #12590: IDLE editor window now always displays the first line
when opening a long file. With Tk 8.5, the first line was hidden.
- Issue #11088: don't crash when using F5 to run a script in IDLE on MacOSX
with Tk 8.5.
- Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused
IDLE to exit. Converted to valid Unicode null in PythonCmd().
- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
file in a package.
Tools/Demos
-----------
- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches.
Patch by Francisco Martín Brugué.
- Issue #13930: 2to3 is now able to write its converted output files to another
directory tree as well as copying unchanged files and altering the file
suffix. See its new -o, -W and --add-suffix options. This makes it more
useful in many automated code translation workflows.
- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
traceback if Python is optimized.
- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and
add a smarter "py-bt" command printing a classic Python traceback.
- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
- Issue #10639: reindent.py no longer converts newlines and will raise
an error if attempting to convert a file with mixed newlines.
"--newline" option added to specify new line character.
Extension Modules
-----------------
- Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
non-pydebug builds. Several extension modules now compile cleanly when
assert()s are enabled in standard builds (-DDEBUG flag).
- Issue #13840: The error message produced by ctypes.create_string_buffer
when given a Unicode string has been fixed.
- Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
Vilmos Nebehaj.
- Issue #7777: socket: Add Reliable Datagram Sockets (PF_RDS) support.
- Issue #13159: FileIO and BZ2Compressor/BZ2Decompressor now use a linear-time
buffer growth strategy instead of a quadratic-time one.
- Issue #10141: socket: Add SocketCAN (PF_CAN) support. Initial patch by
Matthias Fuchs, updated by Tiago Gonçalves.
- Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
- Issue #12881: ctypes: Fix segfault with large structure field names.
- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
Thomas Jarosch.
- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
Thanks to Suman Saha for finding the bug and providing a patch.
- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
file descriptor was actually received.
- Issue #1172711: Add 'long long' support to the array module.
Initial patch by Oren Tirosh and Hirokazu Yamamoto.
- Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
- Issue #12950: Fix passing file descriptors in multiprocessing, under
OpenIndiana/Illumos.
- Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
a string.
- Issue #11241: subclasses of ctypes.Array can now be subclassed.
- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
signature. Without this, architectures where sizeof void* != sizeof int are
broken. Patch given by Hallvard B Furuseth.
- Issue #12051: Fix segfault in json.dumps() while encoding highly-nested
objects using the C accelerations.
- Issue #12017: Fix segfault in json.loads() while decoding highly-nested
objects using the C accelerations.
- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
to an instance of the class.
Tests
-----
- Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode.
Patch by Mikhail Novikov.
- Issue #13447: Add a test file to host regression tests for bugs in the
scripts found in the Tools directory.
- Issue #10881: Fix test_site failure with OS X framework builds.
- Issue #13901: Prevent test_distutils failures on OS X with --enable-shared.
- Issue #13862: Fix spurious failure in test_zlib due to runtime/compile time
minor versions not matching.
- Issue #12804: Fix test_socket and test_urllib2net failures when running tests
on a system without internet access.
- Issue #13726: Fix the ambiguous -S flag in regrtest. It is -o/--slow for slow
tests.
- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
Patch by Ben Hayden.
- Issue #11577: fix ResourceWarning triggered by improved binhex test coverage
- Issue #11509: Significantly increase test coverage of fileinput.
Patch by Denver Coneybeare at PyCon 2011 Sprints.
- Issue #11689: Fix a variable scoping error in an sqlite3 test
- Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
- Issue #13725: Fix regrtest to recognize the documented -d flag.
Patch by Erno Tukia.
- Issue #13304: Skip test case if user site-packages disabled (-s or
PYTHONNOUSERSITE). (Patch by Carl Meyer)
- Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. Patch
by Xavier de Gaye.
- Issue #13218: Fix test_ssl failures on Debian/Ubuntu.
- Re-enable lib2to3's test_parser.py tests, though with an expected failure
(see issue 13125).
- Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.
- Issue #6484: Add unit tests for mailcap module (patch by Gregory Nofi)
- Issue #11651: Improve the Makefile test targets to run more of the test suite
more quickly. The --multiprocess option is now enabled by default, reducing
the amount of time needed to run the tests. "make test" and "make quicktest"
now include some resource-intensive tests, but no longer run the test suite
twice to check for bugs in .pyc generation. Tools/scripts/run_test.py provides
an easy platform-independent way to run test suite with sensible defaults.
- Issue #12331: The test suite for the packaging module can now run from an
installed Python.
- Issue #12331: The test suite for lib2to3 can now run from an installed
Python.
- Issue #12626: In regrtest, allow filtering tests using a glob filter
with the ``-m`` (or ``--match``) option. This works with all test cases
using the unittest module. This is useful with long test suites
such as test_io or test_subprocess.
- Issue #12624: It is now possible to fail after the first failure when
running in verbose mode (``-v`` or ``-W``), by using the ``--failfast``
(or ``-G``) option to regrtest. This is useful with long test suites
such as test_io or test_subprocess.
- Issue #12587: Correct faulty test file and reference in test_tokenize.
(Patch by Robert Xiao)
- Issue #12573: Add resource checks for dangling Thread and Process objects.
- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
as the processor type on some Mac systems.
- Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
failure in name resolution.
- Issue #11812: Solve transient socket failure to connect to 'localhost'
in test_telnetlib.py.
- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812.
- Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
web site.
- Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test
is now skipped instead.
- Issue #12440: When testing whether some bits in SSLContext.options can be
reset, check the version of the OpenSSL headers Python was compiled against,
rather than the runtime version of the OpenSSL library.
- Issue #11512: Add a test suite for the cgitb module. Patch by Robbie Clemons.
- Issue #12497: Install test/data to prevent failures of the various codecmaps
tests.
- Issue #12496: Install test/capath directory to prevent test_connect_capath
testcase failure in test_ssl.
- Issue #12469: Run wakeup and pending signal tests in a subprocess to run the
test in a fresh process with only one thread and to not change signal
handling of the parent process.
- Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
test_tk or test_ttk_guionly under a username that is not currently logged
in to the console windowserver (as may be the case under buildbot or ssh).
- Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows.
- Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
the output and displays it on failure instead. regrtest -v doesn't print the
error twice anymore if there is only one error.
- Issue #12141: Install copies of template C module file so that
test_build_ext of test_distutils and test_command_build_ext of
test_packaging are no longer silently skipped when
run outside of a build directory.
- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
Patch by Garrett Cooper.
- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
2.8 + on Mac OS X. (Patch by Ronald Oussoren)
- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
iso2022_kr).
- Issue #12096: Fix a race condition in test_threading.test_waitfor(). Patch
written by Charles-François Natali.
- Issue #11614: import __hello__ prints "Hello World!". Patch written by
Andreas Stührk.
- Issue #5723: Improve json tests to be executed with and without accelerations.
- Issue #12041: Make test_wait3 more robust.
- Issue #11873: Change regex in test_compileall to fix occasional failures when
the randomly generated temporary path happened to match the regex.
- Issue #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
Patch written by Charles-Francois Natali.
- Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use
pthread_sigmask() to ensure that the SIGALRM signal is received by the main
thread.
- Issue #11811: Factor out detection of IPv6 support on the current host
and make it available as ``test.support.IPV6_ENABLED``. Patch by
Charles-François Natali.
- Issue #10914: Add a minimal embedding test to test_capi.
- Issue #11223: Skip test_lock_acquire_interruption() and
test_rlock_acquire_interruption() of test_threadsignals if a thread lock is
implemented using a POSIX mutex and a POSIX condition variable. A POSIX
condition variable cannot be interrupted by a signal (e.g. on Linux, the
futex system call is restarted).
- Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition.
- Fix possible "file already exists" error when running the tests in parallel.
- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
platforms. Patch by Nadeem Vawda.
- Issue #11727: Add a --timeout option to regrtest: if a test takes more than
TIMEOUT seconds, dumps the traceback of all threads and exits.
- Issue #11653: fix -W with -j in regrtest.
- The email test suite now lives in the Lib/test/test_email package. The test
harness code has also been modernized to allow use of new unittest features.
- regrtest now discovers test packages as well as test modules.
- Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov.
- New test_crashers added to exercise the scripts in the Lib/test/crashers
directory and confirm they fail as expected
- Issue #11578: added test for the timeit module. Patch by Michael Henry.
- Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea.
- Issue #11505: improves test coverage of string.py, increases granularity of
string.Formatter tests. Initial patch by Alicia Arlen.
- Issue #11548: Improve test coverage of the shutil module. Patch by
Evan Dandrea.
- Issue #11554: Reactivated test_email_codecs.
- Issue #11505: improves test coverage of string.py. Patch by Alicia
Arlen
- Issue #11490: test_subprocess.test_leaking_fds_on_error no longer gives a
false positive if the last directory in the path is inaccessible.
- Issue #11223: Fix test_threadsignals to fail, not hang, when the
non-semaphore implementation of locks is used under POSIX.
- Issue #10911: Add tests on CGI with non-ASCII characters. Patch written by
Pierre Quentel.
- Issue #9931: Fix hangs in GUI tests under Windows in certain conditions.
Patch by Hirokazu Yamamoto.
- Issue #10512: Properly close sockets under test.test_cgi.
- Issue #10992: Make tests pass under coverage.
- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
to open door files.
- Issue #10990: Prevent tests from clobbering a set trace function.
C-API
-----
- Issue #13452: PyUnicode_EncodeDecimal() doesn't support error handlers
different than "strict" anymore. The caller was unable to compute the
size of the output buffer: it depends on the error handler.
- Issue #13560: Add PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
and PyUnicode_EncodeLocale() functions to the C API to decode/encode from/to
the current locale encoding.
- Issue #10831: PyUnicode_FromFormat() supports %li, %lli and %zi formats.
- Issue #11246: Fix PyUnicode_FromFormat("%V") to decode the byte string from
UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode).
Patch written by Ray Allen.
- Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
narrow build.
- Add PyObject_GenericGetDict and PyObject_GeneriSetDict. They are generic
implementations for the getter and setter of a ``__dict__`` descriptor of C
types.
- Issue #13727: Add 3 macros to access PyDateTime_Delta members:
PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS,
PyDateTime_DELTA_GET_MICROSECONDS.
- Issue #10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE,
Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE,
Py_UNICODE_JOIN_SURROGATES.
- Issue #12724: Add Py_RETURN_NOTIMPLEMENTED macro for returning NotImplemented.
- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with
Mercurial.
- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const
char *` instead of `char *`.
- Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
Documentation
-------------
- Issue #13989: Document that GzipFile does not support text mode, and give a
more helpful error message when opened with an invalid mode string.
- Issue #13921: Undocument and clean up sqlite3.OptimizedUnicode,
which is obsolete in Python 3.x. It's now aliased to str for
backwards compatibility.
- Issue #12102: Document that buffered files must be flushed before being used
with mmap. Patch by Steffen Daode Nurpmeso.
- Issue #8982: Improve the documentation for the argparse Namespace object.
- Issue #9343: Document that argparse parent parsers must be configured before
their children.
- Issue #13498: Clarify docs of os.makedirs()'s exist_ok argument. Done with
great native-speaker help from R. David Murray.
- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
Initial patch for #13491 by Johannes Vogel.
- Issue #13402: Document absoluteness of sys.executable.
- Issue #13883: PYTHONCASEOK also works on OS X.
- Issue #9021: Add an introduction to the copy module documentation.
- Issue #6005: Examples in the socket library documentation use sendall, where
relevant, instead send method.
- Issue #12798: Updated the mimetypes documentation.
- Issue #12949: Document the kwonlyargcount argument for the PyCode_New
C API function.
- Issue #13513: Fix io.IOBase documentation to correctly link to the
io.IOBase.readline method instead of the readline module.
- Issue #13237: Reorganise subprocess documentation to emphasise convenience
functions and the most commonly needed arguments to Popen.
- Issue #13141: Demonstrate recommended style for socketserver examples.
- Issue #11818: Fix tempfile examples for Python 3.
What's New in Python 3.2?
=========================
*Release date: 20-Feb-2011*
Core and Builtins
-----------------
- Issue #11249: Fix potential crashes when using the limited API.
Build
-----
- Issue #11222: Fix non-framework shared library build on Mac OS X.
- Issue #11184: Fix large-file support on AIX.
- Issue #941346: Fix broken shared library build on AIX.
Documentation
-------------
- Issue #10709: Add updated AIX notes in Misc/README.AIX.
What's New in Python 3.2 Release Candidate 3?
=============================================
*Release date: 13-Feb-2011*
Core and Builtins
-----------------
- Issue #11134: Add missing fields to typeslots.h.
- Issue #11135: Remove redundant doc field from PyType_Spec.
- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
ABI.
- Issue #11118: Fix bogus export of None in python3.dll.
Library
-------
- Issue #11116: any error during addition of a message to a mailbox now causes a
rollback, instead of leaving the mailbox partially modified.
- Issue #11132: Fix passing of "optimize" parameter when recursing in
compileall.compile_dir().
- Issue #11110: Fix a potential decref of a NULL in sqlite3.
- Issue #8275: Fix passing of callback arguments with ctypes under Win64. Patch
by Stan Mihai.
Build
-----
- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
installers now includes a link to the installed documentation and no longer
includes an Extras directory. The Tools directory is now installed in the
framework under share/doc.
- Issue #11121: Fix building with --enable-shared.
Tests
-----
- Issue #10971: test_zipimport_support is once again compatible with the refleak
hunter feature of test.regrtest.
What's New in Python 3.2 Release Candidate 2?
=============================================
*Release date: 30-Jan-2011*
Core and Builtins
-----------------
- Issue #10451: memoryview objects could allow mutating a readable buffer.
Initial patch by Ross Lagerwall.
Library
-------
- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
files in binary mode, using the email package's binary support to parse
arbitrary email messages. StringIO and text file input is deprecated,
and string input fails early if non-ASCII characters are used, where
previously it would fail when the email was processed in a later step.
- Issue #10845: Mitigate the incompatibility between the multiprocessing
module on Windows and the use of package, zipfile or directory execution
by special casing main modules that actually *are* called __main__.py.
- Issue #11045: Protect logging call against None argument.
- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
commands.
- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
preventing a confusing hung appearance on OS X with the windows
obscured.
- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
menu accelerators for Open Module, Go to Line, and New Indent Width.
The accelerators still work but no longer appear in the menu items.
- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
conversion.
- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
with a None body.
- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
keyword-only argument. The preceding positional argument was deprecated,
so it made no sense to add filter as a positional argument.
- Issue #11004: Repaired edge case in deque.count().
- Issue #10974: IDLE no longer crashes if its recent files list includes files
with non-ASCII characters in their path names.
- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
return sets instead of one returning a tuple and the other a frozenset.
- Issue #10987: Fix the recursion limit handling in the _pickle module.
- Issue #10983: Fix several bugs making tunnel requests in http.client.
- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
filenames, at bootstrap, if the codec registry is not ready yet. It is still
possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
for all file entries in the ZIP file.
- Issue #10949: Improved robustness of rotating file handlers.
- Issue #10955: Fix a potential crash when trying to mmap() a file past its
length. Initial patch by Ross Lagerwall.
- Issue #10898: Allow compiling the posix module when the C library defines
a symbol named FSTAT.
- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
encoding. This is the preferred encoding of PEP 3333 and the base encoding
of HTTP 1.1.
- To match the behaviour of HTTP server, the HTTP client library now also
encodes headers with iso-8859-1 (latin1) encoding. It was already doing
that for incoming headers which makes this behaviour now consistent in
both incoming and outgoing direction.
- Issue #9509: argparse now properly handles IOErrors raised by
argparse.FileType.
- Issue #10961: The new pydoc server now better handles exceptions raised
during request handling.
- Issue #10680: Fix mutually exclusive arguments for argument groups in
argparse.
Build
-----
- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
the system-provided Python.
What's New in Python 3.2 Release Candidate 1
============================================
*Release date: 16-Jan-2011*
Core and Builtins
-----------------
- Issue #10889: range indexing and slicing now works correctly on ranges with
a length that exceeds sys.maxsize.
- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
class.
- Issue #8020: Avoid a crash where the small objects allocator would read
non-Python managed memory while it is being modified by another thread. Patch
by Matt Bandy.
- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
translates newlines (\r\n => \n).
- Remove buffer API from stable ABI for now, see #10181.
- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
(length bigger than 2^31-1 bytes).
- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
stdprinter.write() clamp the length to INT_MAX on Windows.
- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
can now handle dates after 2038.
- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
filesystem encoding instead of UTF-8.
- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
encoding instead of UTF-8.
- Add sys.flags attribute for the new -q command-line option.
- Issue #11506: Trying to assign to a bytes literal should result in a
SyntaxError.
Library
-------
- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
and a non-zero offset, and an attempt to read past the end of file is made
(IndexError is raised instead). Patch by Ross Lagerwall.
- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
than the currently problematic Apple-supplied one, when running with the
64-/32-bit installer variant.
- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
as unicode, and accept binary files. Add encoding and errors attributes to
cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
Linderman).
- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
- Issue #10899: No function type annotations in the standard library. Removed
function type annotations from _pyio.py.
- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
if available.
- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
twice.
- Issue #5871: email.header.Header.encode now raises an error if any
continuation line in the formatted value has no leading white space and looks
like a header. Since Generator uses Header to format all headers, this check
is made for all headers in any serialized message at serialization time. This
provides protection against header injection attacks.
- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
private by renaming it to ``_GeneratorContextManager``.
- Issue #10042: Fixed the total_ordering decorator to handle cross-type
comparisons that could lead to infinite recursion.
- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
presentation, instead of replacing them with ?s.
- email.header.Header was incorrectly encoding folding whitespace when
rfc2047-encoding header values with embedded newlines, leaving them without
folding whitespace. It now uses the continuation_ws, as it does for
continuation lines that it creates itself.
- Issue #1777412, #10827: Changed the rules for 2-digit years. The
time.asctime(), time.ctime() and time.strftime() functions will now format
any year when ``time.accept2dyear`` is False and will accept years >= 1000
otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
supported by the OS. With Visual Studio or on Solaris, the year is limited to
the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
- Issue #7858: Raise an error properly when os.utime() fails under Windows
on an existing file.
- Issue #3839: wsgiref should not override a Content-Length header set by
the application. Initial patch by Clovis Fabricio.
- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
compilation (if the input is a string).
- Issue #7995: When calling accept() on a socket with a timeout, the returned
socket is now always blocking, regardless of the operating system.
- Issue #10756: atexit normalizes the exception before displaying it. Patch by
Andreas Stührk.
- Issue #10790: email.header.Header.append's charset logic now works correctly
for charsets whose output codec is different from its input codec.
- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
raising a ValueError, to fix repr().
- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
the input buffer length doesn't fit into an unsigned int (length bigger than
2^32-1 bytes).
- Issue #6643: Reinitialize locks held within the threading module after fork to
avoid a potential rare deadlock or crash on some platforms.
- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross
Lagerwall.
- `unittest.TestCase` can be instantiated without a method name; for simpler
exploration from the interactive interpreter.
- Issue #10798: Reject supporting concurrent.futures if the system has too
few POSIX semaphores.
- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
the codec aliases. They are still accessible via codecs.lookup().
- Issue #10801: In zipfile, support different encodings for the header and the
filenames.
- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
David Daniels.
- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
define __missing__().
- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
time. `sys.stderr` now looked up at instantiation time. Fix contributed by
Mark Roddy.
- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
won't be quoted when the URI is constructed by the wsgiref.util's request_uri
method. According to RFC 3986, these characters can be a part of params in
PATH component of URI and need not be quoted.
- Issue #10738: Fix webbrowser.Opera.raise_opts.
- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
browsers actually parse cookies.
- Issue #9333: os.symlink now available regardless of user privileges. The
function now raises OSError on Windows >=6.0 when the user is unable to create
symbolic links. XP and 2003 still raise NotImplementedError.
- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
- Issue #10730: Add SVG mime types to mimetypes module.
- Issue #10768: Make the Tkinter ScrolledText widget work again.
- Issue #10777: Fix "dictionary changed size during iteration" bug in
ElementTree register_namespace().
- Issue #10626: test_logging now preserves logger disabled states.
- Issue #10774: test_logging now removes temp files created during tests.
- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
it now prints the filename, line number, and traceback to stderr and skips
the rest of that individual file, instead of stopping processing entirely.
- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
pipes (bug specific to Windows).
- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
compliance (no "s around encoded values).
- Improved the diff message in the unittest module's assertCountEqual().
- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
the '-' of a timezone field as well as before a '+'.
- Issue #4871: The zipfile module now gives a more useful error message if
an attempt is made to use a string to specify the archive password.
- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
- Deprecated assertDictContainsSubset() in the unittest module.
C-API
-----
- PyObject_CallMethod now passes along any underlying AttributeError from
PyObject_GetAttr, instead of replacing it with something less informative
- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
- Issue #10333: Remove ancient GC API, which has been deprecated since Python
2.2.
Build
-----
- Issue #10843: Update third-party library versions used in OS X 32-bit
installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
- Issue #10820: Fix OS X framework installs to support version-specific
scripts (#10679).
- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
the configure script but use $GREP instead. Patch by Fabian Groffen.
- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
and DragonFly BSD. Patch by Nicolas Joly.
- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
a version-specific suffix on "make altinstall".
- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
only be present on OS X; the former is the correct one for Linux with GCC.
- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
using GCC 4.0.
Tools/Demos
-----------
- Issue #10843: Install the Tools directory on OS X in the applications Extras
(/Applications/Python 3.n/Extras/) where the Demo directory had previous been
installed.
- Issue #7962: The Demo directory is gone. Most of the old and unmaintained
demos have been removed, others integrated in documentation or a new
Tools/demo subdirectory.
- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
Curtin.
Tests
-----
- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
- Fix test_startfile to wait for child process to terminate before finishing.
- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
by Ross Lagerwall.
- Make the --coverage flag work for test.regrtest.
- Issue #1677694: Refactor and improve test_timeout. Original patch by
Björn Lindqvist.
- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
Patch by Jean-Paul Calderone and Sandro Tosi.
- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default in
whole runs and enabled selectively using ``--header`` when running an explicit
list of tests. Original patch by Collin Winter.
What's New in Python 3.2 Beta 2?
================================
*Release date: 19-Dec-2010*
Core and Builtins
-----------------
- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
by signals on platforms using pthreads. Patch by Reid Kleckner.
- Issue #4236: PyModule_Create2 now checks the import machinery directly
rather than the Py_IsInitialized flag, avoiding a Fatal Python
error in certain circumstances when an import is done in __del__.
- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
Daniel Urban.
Library
-------
- Issue #3243: Support iterable bodies in httplib. Patch Contributions by
Xuanji Li and Chris AtLee.
- Issue #10611: SystemExit exception will no longer kill a unittest run.
- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
up function.
- Issue #10573: use actual/expected consistently in unittest methods.
The order of the args of assertCountEqual is also changed.
- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
words in the local part of email addresses, thereby preserving the input.
- Issue #6791: Limit header line length (to 65535 bytes) in http.client
and http.server, to avoid denial of services from the other party.
- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
- Issue #9907: Fix tab handling on OSX when using editline by calling
rl_initialize first, then setting our custom defaults, then reading .editrc.
- Issue #4188: Avoid creating dummy thread objects when logging operations
from the threading module (with the internal verbose flag activated).
- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
parameter to HTTPConnection and friends is deprecated.
- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
';' character. Patch by Wes Chow.
- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
for security reasons. Initial patch by Ross Lagerwall.
- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
- Issue #10667: Fast path for collections.Counter().
- Issue #10695: passing the port as a string value to telnetlib no longer
causes debug mode to fail.
- Issue #1078919: add_header now automatically RFC2231 encodes parameters
that contain non-ascii values.
- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
a warning on sys.stderr rather than throwing a misleading exception
if cleanup fails due to nulling out of modules during shutdown.
Also avoids an AttributeError when mkdtemp call fails and issues
a ResourceWarning on implicit cleanup via __del__.
- Issue #10107: Warn about unsaved files in IDLE on OSX.
- Issue #7213: subprocess.Popen's default for close_fds has been changed.
It is now True in most cases other than on Windows when input, output or
error handles are provided.
- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
added in 3.2beta1) to allow specifying a specific list of file descriptors
to keep open in the child process.
- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
OSError exception when The OS had been told to ignore SIGCLD in our process
or otherwise not wait for exiting child processes.
Tests
-----
- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
encountering them.
Tools/Demos
-----------
- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
Cocoa AquaTk.
- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
- Issue #10706: Remove outdated script runtests.sh. Either ``make test``
or ``python -m test`` should be used instead.
Build
-----
- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
- Issue #9234: argparse supports alias names for subparsers.
What's New in Python 3.2 Beta 1?
================================
*Release date: 05-Dec-2010*
Core and Builtins
-----------------
- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
methods.
- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
with respect to signed zeros. -4.0 % 4.0 should be 0.0, not -0.0.
- Issue #1772833: Add the -q command-line option to suppress copyright and
version output in interactive mode.
- Provide an *optimize* parameter in the built-in compile() function.
- Fixed several corner case issues on Windows in os.stat/os.lstat related to
reparse points.
- PEP 384 (Defining a Stable ABI) is implemented.
- Issue #2690: Range objects support negative indices and slicing.
- Issue #9915: Speed up sorting with a key.
- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
larger than operand ``b``. Patch by Andrew Bennetts.
- Issue #10518: Bring back the callable() builtin.
- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
method of float, complex, and Decimal. This allows more precise control over
when decimal points are displayed.
- Issue #10474: range.count() should return integers.
- Issue #1574217: isinstance now catches only AttributeError, rather than
masking all errors.
Library
-------
- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
- test.support: Added TestHandler and Matcher classes for better support of
assertions about logging.
- Issue #4391: Use proper plural forms in argparse.
- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
UnicodeEncodeError.
- Add the "display" and "undisplay" pdb commands.
- Issue #7245: Add a SIGINT handler in pdb that allows breaking a program again
after a "continue" command.
- Add the "interact" pdb command.
- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
- Issue #1569291: Speed up array.repeat().
- Provide an interface to set the optimization level of compilation in
py_compile, compileall and zipfile.PyZipFile.
- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
RFC3986. Anything before :// is considered a scheme and is followed by an
authority (or netloc) and by '/' led path, which is optional.
- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
- Issue #10620: `python -m unittest` can accept file paths instead of module
names for running specific tests.
- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
`assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
and replace them with the correct methods in the Python test suite.
- Issue #10272: The ssl module now raises socket.timeout instead of a generic
SSLError on socket timeouts.
- Issue #10528: Allow translators to reorder placeholders in localizable
messages from argparse.
- Issue #10497: Fix incorrect use of gettext in argparse.
- Issue #10478: Reentrant calls inside buffered IO objects (for example by
way of a signal handler) now raise a RuntimeError instead of freezing the
current process.
- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
- Issue #2001: New HTML server with enhanced web page features. Patch by Ron
Adam.
- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
of non-weakrefable objects.
- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
DoS attacks. Patch by Savio Sena.
- Issue #4925: Add filename to error message when executable can't be found in
subprocess.
- Issue #10391: Don't dereference invalid memory in error messages in the ast
module.
- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
os.lstat. Patch by Hirokazu Yamamoto.
- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
held by the user's account, i.e., when the function can actually be used.
- Issue #8879: Add os.link support for Windows.
- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
failure messages by default. Patch by Mark Roddy.
- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
guess at the correct parsing of invalid html.
- Issue #10554: Add context management protocol support to subprocess.Popen objects.
- Issue #8989: email.utils.make_msgid now has a domain parameter that can
override the domain name used in the generated msgid.
- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
exists' exception when a target directory already exists with the specified
mode. Patch by Ray Allen.
- Issue #9573: os.fork() now works correctly when triggered as a side effect of
a module import.
- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
- Added itertools.accumulate().
- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
Original patch by Daniel Urban.
- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
`assertRegex` and `assertRaisesRegex`.
- Issue #10535: Enable silenced warnings in unittest by default.
- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
sequences as input in addition to character strings.
- Issue #10586: The statistics API for the new functools.lru_cache has been
changed to a single cache_info() method returning a named tuple.
- Issue #10323: itertools.islice() now consumes the minimum number of inputs
before stopping. Formerly, the final state of the underlying iterator was
undefined.
- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
__next__.
- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
more informative name, unittest.CountEqual.
- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
be set to False to turn off the previously undocumented 'popularity'
heuristic. Patch by Terry Reedy and Eli Bendersky.
- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
undocumented and now redundant isbjunk and isbpopular methods.
- Issue #9846: zipfile is now correctly closing underlying file objects.
- Issue #10459: Update CJK character names to Unicode 6.0.
- Issue #4493: urllib.request adds '/' in front of path components which does not
start with '/. Common behavior exhibited by browsers and other clients.
- Issue #6378: idle.bat now runs with the appropriate Python version rather than
the system default. Patch by Sridhar Ratnakumar.
- Issue #10470: 'python -m unittest' will now run test discovery by default,
when no extra arguments have been provided.
- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
output stream only when end_headers is invoked. This is a speedup and an
internal optimization. Patch by Andrew Shaaf.
- Issue #10220: Added inspect.getgeneratorstate. Initial patch by Rodolpho
Eckhardt.
- Issue #10453: compileall now uses argparse instead of getopt, and thus
provides clean output when called with '-h'.
- Issue #8078: Add constants for higher baud rates in the termios module. Patch
by Rodolpho Eckhardt.
- Issue #10407: Fix two NameErrors in distutils.
- Issue #10371: Deprecated undocumented functions in the trace module.
- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
end of the file.
- configparser: 100% test coverage.
- Issue #10499: configparser supports pluggable interpolation handlers. The
default classic interpolation handler is called BasicInterpolation. Another
interpolation handler added (ExtendedInterpolation) which supports the syntax
used by zc.buildout (e.g. interpolation between sections).
- configparser: the SafeConfigParser class has been renamed to ConfigParser.
The legacy ConfigParser class has been removed but its interpolation mechanism
is still available as LegacyInterpolation.
- configparser: Usage of RawConfigParser is now discouraged for new projects
in favor of ConfigParser(interpolation=None).
- Issue #1682942: configparser supports alternative option/value delimiters.
- Issue #5412: configparser supports mapping protocol access.
- Issue #9411: configparser supports specifying encoding for read operations.
- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
accept vars and default arguments just like get() does.
- Issue #9452: configparser supports reading from strings and dictionaries
(thanks to the mapping protocol API, the latter can be used to copy data
between parsers).
- configparser: accepted INI file structure is now customizable, including
comment prefixes, name of the DEFAULT section, empty lines in multiline
values, and indentation.
- Issue #10326: unittest.TestCase instances can be pickled.
- Issue #9926: Wrapped TestSuite subclass does not get __call__ executed.
- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to complex
zeros on systems where the log1p function fails to respect the sign of zero.
This fixes a test failure on AIX.
- Issue #9732: Addition of getattr_static to the inspect module.
- Issue #10446: Module documentation generated by pydoc now links to a
version-specific online reference manual.
- Make the 'No module named' exception message from importlib consistent.
- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
Patch by Robert Collins.
- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
than strings.
C-API
-----
- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
which transforms non-ASCII decimal digits in a Unicode string to their ASCII
equivalents.
- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
zero-initialize all fields, fixing compiler warnings seen when building
extension modules with gcc with "-Wmissing-field-initializers" (implied by
"-W").
- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
Schemenauer.
- structseq.h is now included in Python.h.
- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
Tests
-----
- regrtest.py once again ensures the test directory is removed from sys.path
when it is invoked directly as the __main__ module.
- `python -m test` can be used to run the test suite as well as `python -m
test.regrtest`.
- Do not fail test_socket when the IP address of the local hostname cannot be
looked up.
- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
Carstensen.
Build
-----
- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
Documentation
-------------
- Issue #10299: List the built-in functions in a table in functions.rst.
What's New in Python 3.2 Alpha 4?
=================================
*Release date: 13-Nov-2010*
Core and Builtins
-----------------
- Issue #10372: Import the warnings module only after the IO library is
initialized, so as to avoid bootstrap issues with the '-W' option.
- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
undocumented value PyBUF_SHADOW, and strangely-looking code in
PyMemoryView_GetContiguous.
- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
- If FileIO.__init__ fails, close the file descriptor.
- Issue #10221: dict.pop(k) now has a key error message that includes the
missing key (same message d[k] returns for missing keys).
- Issue #5437: A preallocated MemoryError instance should not keep traceback
data (including local variables caught in the stack trace) alive infinitely.
- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
of the offending line.
- Issue #10089: Add support for arbitrary -X options on the command line. They
can be retrieved through a new attribute ``sys._xoptions``.
- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment
variable is not set, the locale encoding is ISO-8859-1, whereas most programs
(including Python) expect UTF-8. Python already uses UTF-8 for the filesystem
encoding and to encode command line arguments on this OS.
- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
filenames encoded to the filesystem encoding with the surrogateescape error
handler (to support undecodable bytes), instead of UTF-8 in strict mode.
- Issue #9997: Don't let the name "top" have special significance in scope
resolution.
- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
the default 512 when compiling on AIX.
- Use locale encoding instead of UTF-8 to encode and decode filenames if
Py_FileSystemDefaultEncoding is not set.
- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
descriptor.
- Issue #9418: Moved private string methods ``_formatter_parser`` and
``_formatter_field_name_split`` into a new ``_string`` module.
- Issue #9992: Remove PYTHONFSENCODING environment variable.
Library
-------
- Issue #12943: python -m tokenize support has been added to tokenize.
- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
- Issue #10356: Decimal.__hash__(-1) should return -2.
- Issue #1553375: logging: Added stack_info kwarg to display stack information.
- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2. (See also issue
#10356.)
- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
IMAP4 connections. Original patch by Lorenzo M. Catucci.
- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
there are non-base64 alphabet characters in the input.
- Issue #10386: Add __all__ to token module; this simplifies importing in
tokenize module and prevents leaking of private names through ``import *``.
- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by Lorenzo
M. Catucci.
- Fix IMAP.login() to work properly.
- Issue #9244: multiprocessing pool worker processes could terminate
unexpectedly if the return value of a task could not be pickled. Only the
``repr`` of such errors are now sent back, wrapped in an
``MaybeEncodingError`` exception.
- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
``multiprocessing.Pool`` now accepts an ``error_callback`` argument. This can
be a callback with the signature ``callback(exc)``, which will be called if
the target raises an exception.
- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
sockets now has additional items such as ``issuer`` and ``notBefore``.
- ``usenetrc`` is now false by default for NNTP objects.
- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
Patch by Andrew Vant.
- Issue #10335: Add tokenize.open(), detect the file encoding using
tokenize.detect_encoding() and open it in read only mode.
- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
method send_message to send an email.message.Message object.
- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
code directory name contains a non-ASCII character and the locale encoding is
ASCII.
- Issue #10329: The trace module writes reports using the input Python script
encoding, instead of the locale encoding. Patch written by Alexander
Belopolsky.
- Issue #10126: Fix distutils' test_build when Python was built with
--enable-shared.
- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
Arfrever.
- Issue #10229: Fix caching error in gettext.
- Issue #10252: Close file objects in a timely manner in distutils code and
tests. Patch by Brian Brazil, completed by Éric Araujo.
- Issue #10180: Pickling file objects is now explicitly forbidden, since
unpickling them produced nonsensical results.
- Issue #10311: The signal module now restores errno before returning from its
low-level signal handler. Patch by Hallvard B Furuseth.
- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
environment better, and to correct unicode environment values for WSGI 1.0.1.
- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
response, instead of raising an exception.
- wsgiref now implements and validates PEP 3333, rather than an experimental
extension of PEP 333. (Note: earlier versions of Python 3.x may have
incorrectly validated some non-compliant applications as WSGI compliant; if
your app validates with Python <3.2b1+, but not on this version, it is likely
the case that your app was not compliant.)
- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
by the server.
- Issue #10184: Touch directories only once when extracting a tarfile.
- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
that were formerly found under Demo/turtle.
- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
filename. Patch by Brian Brazil.
- Issue #10110: Queue objects didn't recognize full queues when the maxsize
parameter had been reduced.
- Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
- Issue #5729: json.dumps() now supports using a string such as '\t' for
pretty-printing multilevel objects.
- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
append that isn't seekable. Patch by Brian Brazil.
- Support context management protocol for file-like objects returned by mailbox
``get_file()`` methods.
- Issue #10246: uu.encode didn't close file objects explicitly when filenames
were given to it. Patch by Brian Brazil.
- Issue #10198: fix duplicate header written to wave files when writeframes() is
called without data.
- Close file objects in modulefinder in a timely manner.
- Close an io.TextIOWrapper object in email.parser in a timely manner.
- Close a file object in distutils.sysconfig in a timely manner.
- Close a file object in pkgutil in a timely manner.
- Issue #10233: Close file objects in a timely manner in the tarfile module and
its test suite.
- Issue #10093: ResourceWarnings are now issued when files and sockets are
deallocated without explicit closing. These warnings are silenced by default,
except in pydebug mode.
- tarfile.py: Add support for all missing variants of the GNU sparse extensions
and create files with holes when extracting sparse members.
- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
deprecate the old name ``zipfile.BadZipfile``.
- Issue #5027: The standard ``xml`` namespace is now understood by
xml.sax.saxutils.XMLGenerator as being bound to
http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
- Issue #5975: Add csv.unix_dialect class.
- Issue #7761: telnetlib.interact failures on Windows fixed.
- logging: Added style option to Formatter to allow %, {} or $-formatting.
- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
context manager.
- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
encode method now support a 'linesep' argument.
- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
order to support the TLS SNI extension. ``HTTPSConnection`` and ``urlopen()``
also use this argument, so that HTTPS virtual hosts are now supported.
- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
- logging: Made StreamHandler terminator configurable.
- logging: Allowed filters to be just callables.
- logging: Added tests for _logRecordClass changes.
- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
increase flexibility of LogRecord creation.
- Issue #5117: Case normalization was needed on ntpath.relpath(). Also fixed
root directory issue on posixpath.relpath(). (Ported working fixes from
ntpath.)
- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
short_empty_elements to direct it to use self-closing tags when appropriate.
- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags. Add --abiflags
switch to python-config for command line access.
- Issue #6098: Don't claim DOM level 3 conformance in minidom.
- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
XML namespace attribute is encountered.
- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
characters by default. Deprecate ``cgi.escape()``.
- Issue #9409: Fix the regex to match all kind of filenames, for interactive
debugging in doctests.
- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
same instance as ``datetime.timezone.utc``.
- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
supported by the system. Patch by Nikita Vetoshkin.
- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
protocol. file:// urls had fallback to access remote hosts via ftp. This was
not correct, change is made to raise a URLError when a remote host is tried to
access via file:// scheme.
- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
created in modes 'a' or 'w' and then closed without adding any files. Raise
BadZipfile (rather than IOError) when opening small non-ZIP files.
- Issue #10041: The signature of optional arguments in socket.makefile() didn't
match that of io.open(), and they also didn't get forwarded properly to
TextIOWrapper in text mode. Patch by Kai Zhu.
- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
urllib.request.urlopen now take optional arguments to allow for server
certificate checking, as recommended in public uses of HTTPS.
- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
current directory was deleted. Patch written by W. Trevor King.
- Issue #3873: Speed up unpickling from file objects that have a peek() method.
- Issue #10075: Add a session_stats() method to SSLContext objects.
- Issue #9948: Fixed problem of losing filename case information.
Extension Modules
-----------------
- Issue #5109: array.array constructor will now use fast code when
initial data is provided in an array object with correct type.
- Issue #6317: Now winsound.PlaySound only accepts unicode.
- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
- Issue #9377: Use Unicode API for gethostname on Windows.
- Issue #10143: Update "os.pathconf" values.
- Issue #6518: Support context management protocol for ossaudiodev types.
- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
version 2.0.1.
- Issue #5355: Provide mappings from Expat error numbers to string descriptions
and backwards, in order to actually make it possible to analyze error codes
provided by ExpatError.
- The Unicode database was updated to 6.0.0.
C-API
-----
- Issue #10288: The deprecated family of "char"-handling macros
(ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
type has been introduced.
Tools/Demos
-----------
- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
encoding other than ASCII or UTF-8. Source encoding is preserved when
reindented code is written to a file.
- Issue #7287: Demo/imputil/knee.py was removed.
Tests
-----
- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
as unicode strings. Initial patch by Sandro Tosi.
- Issue #10294: Remove dead code form test_unicode_file.
- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
test specific to unicode (non-ascii name and filename).
Build
-----
- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
- Issue #8852: Allow the socket module to build on OpenSolaris.
- Drop -OPT:Olimit compiler option.
- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
- Issue #7473: avoid link errors when building a framework with a different set
of architectures than the one that is currently installed.
What's New in Python 3.2 Alpha 3?
=================================
*Release date: 09-Oct-2010*
Core and Builtins
-----------------
- Issue #10068: Global objects which have reference cycles with their module's
dict are now cleared again. This causes issue #7140 to appear again.
- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
encodings.
- ast.literal_eval() can now handle negative numbers. It is also a little more
liberal in what it accepts without compromising the safety of the evaluation.
For example, 3j+4 and 3+4+5 are both accepted.
- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
result metaclasses can now be ABCs (see #9533).
- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
32 bits wchar_t (eg. Linux in narrow build).
- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
introduced by issue #9324.
- Issue #9979: Create function PyUnicode_AsWideCharString().
- Issue #7397: Mention that importlib.import_module() is probably what someone
really wants to be using in __import__'s docstring.
- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
to use named arguments.
- Issue #9930: Remove bogus subtype check that was causing (e.g.)
float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
threads are still running. Instead, reinitialize the GIL on a second call to
Py_Initialize().
- All SyntaxErrors now have a column offset and therefore a caret when the error
is printed.
- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
module that was imported, but instead gets the module from sys.modules.
- Issue #9213: The range type_items now provides index() and count() methods, to
conform to the Sequence ABC. Patch by Daniel Urban and Daniel Stutzbach.
- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
with a non-empty format string. This is an effort to future-proof user
code. If a derived class does not currently implement __format__ but later
adds its own __format__, it would most likely break user code that had
supplied a format string. This will be changed to a DeprecationWaring in
Python 3.3 and it will be an error in Python 3.4.
- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
re-created on a subsequent call to Py_Initialize(). The problem (a crash)
wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
- Issue #9210: Configure option --with-wctype-functions was removed. Using the
functions from the libc caused the methods .upper() and lower() to become
locale aware and created subtly wrong results.
- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
non-ASCII byte in the format string.
- Issue #4617: Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block. This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
``\UXXXXXXXX``, regardless of whether the character is printable or not.
Also, the "backslashreplace" error handler now joins surrogate pairs into a
single character on UCS-2 builds.
- Issue #9757: memoryview objects get a release() method to release the
underlying buffer (previously this was only done when deallocating the
memoryview), and gain support for the context management protocol.
- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
thread-local storage key.
Library
-------
- Issue #2236: distutils' mkpath ignored the mode parameter.
- Fix typo in one sdist option (medata-check).
- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
- Issue #1718574: Fix options that were supposed to accept arguments but did
not in build_clib.
- Issue #9437: Fix building C extensions with non-default LDFLAGS.
- Issue #4661: email can now parse bytes input and generate either converted
7bit output or bytes output. Email version bumped to 5.1.0.
- Issue #1589: Add ssl.match_hostname(), to help implement server identity
verification for higher-level protocols.
- Issue #9759: GzipFile now raises ValueError when an operation is attempted
after the file is closed. Patch by Jeffrey Finkelstein.
- Issue #9042: Fix interaction of custom translation classes and caching in
gettext.
- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
returning a (sock, addr) pair which is called when a connection has been
established with a new remote endpoint. This is supposed to be used as a
replacement for old handle_accept() and avoids the user to call accept()
directly.
- Issue #9065: tarfile no longer uses "root" as the default for the uname and
gname field.
- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
an environment that does not have docutils. Patch by Arfrever.
- Issue #1050268: parseaddr now correctly quotes double quote and backslash
characters that appear inside quoted strings in email addresses.
- Issue #10004: quoprimime no longer generates a traceback when confronted with
invalid characters after '=' in a Q-encoded word.
- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
sending a 200 OK for the Expect: 100-continue request header.
- Issue #9360: Cleanup and improvements to the nntplib module. The API now
conforms to the philosophy of bytes and unicode separation in Python 3. A
test suite has also been added.
- Issue #9962: GzipFile now has the peek() method.
- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
retry the select() loop instead of bailing out. This is because select() can
incorrectly report a socket as ready for reading (for example, if it received
some data with an invalid checksum).
- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
received. Now sendall() properly calls signal handlers if necessary, and
retries sending if these returned successfully, including on sockets with a
timeout.
- Issue #9947: logging: Fixed locking bug in stopListening.
- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
- Issue #9936: Fixed executable lines' search in the trace module.
- Issue #9790: Rework imports necessary for samefile and sameopenfile
in ntpath.
- Issue #9928: Properly initialize the types exported by the bz2 module.
- Issue #1675951: Allow GzipFile to work with unseekable file objects. Patch by
Florian Festi.
- Logging: Added QueueListener class to facilitate logging usage for
performance-critical threads.
- Issue #9916: Add some missing errno symbols.
- Issue #9877: Expose sysconfig.get_makefile_filename()
- logging: Added hasHandlers() method to Logger and LoggerAdapter.
- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
- Issue #2643: msync() is not called anymore when deallocating an open mmap
object, only munmap().
- logging: Changed LoggerAdapter implementation internally, to make it easier to
subclass in a useful way.
- logging: hasHandlers method was added to Logger, and isEnabledFor,
getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
LoggerAdapter was introduced into the unit tests for logging.
- Issue #1686: Fix string.Template when overriding the pattern attribute.
- Issue #9854: SocketIO objects now observe the RawIOBase interface in
non-blocking mode: they return None when an operation would block (instead of
raising an exception).
- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
another kind.
- Issue #9441: logging has better coverage for rotating file handlers.
- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
- Issue #9854: The default read() implementation in io.RawIOBase now handles
non-blocking readinto() returning None correctly.
- Issue #1552: socket.socketpair() now returns regular socket.socket objects
supporting the whole socket API (rather than the "raw" _socket.socket
objects).
- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
to match the corresponding socket methods.
- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
them handle recursive calls within the same thread.
- logging: Enhanced HTTPHandler with secure and credentials initializers.
- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
- Issue #9837: The read() method of ZipExtFile objects (as returned by
ZipFile.open()) could return more bytes than requested.
- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
d['x'] = d.
- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
it possible for the user to create self-referencing ordered dictionaries which
become permanently uncollectable GC garbage. Reinstated the Python 3.1
approach of using weakref proxies so that reference cycles never get created
in the first place.
- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
encode the value with filesystem encoding and surrogateescape (instead of
utf-8 in strict mode) . Patch written by David Watson.
- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
- Issue #9410: Various optimizations to the pickle module, leading to speedups
up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow;
initial patch by Alexandre Vassalotti.
- The pprint module now supports printing OrderedDicts in their given order
(formerly, it would sort the keys).
- Logging: Added QueueHandler class to facilitate logging usage with
multiprocessing.
- Issue #9707: Rewritten reference implementation of threading.local which is
friendlier towards reference cycles. This change is not normally visible
since an optimized C implementation (_thread._local) is used instead.
- Issue #6394: os.getppid() is now supported on Windows. Note that it will
still return the id of the parent process after it has exited. This process
id may even have been reused by another unrelated process.
- Issue #9792: In case of connection failure, socket.create_connection() would
swallow the exception and raise a new one, making it impossible to fetch the
original errno, or to filter timeout errors. Now the original error is
re-raised.
- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
back after the system call. Original patch by Brian Brazil.
- Updates to the random module:
* Document which parts of the module are guaranteed to stay the same across
versions and which parts are subject to change.
* Update the seed() method to use all of the bits in a string instead of just
the hash value. This makes better use of the seed value and assures the
seeding is platform independent. Issue #7889.
* Improved the random()-->integer algorithm used in choice(), shuffle(),
sample(), randrange(), and randint(). Formerly, it used int(n*random())
which has a slight bias whenever n is not a power of two. Issue #9025.
* Improved documentation of arguments to randrange(). Issue #9379.
- collections.OrderedDict now supports a new method for repositioning keys to
either end.
- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
cases now also have assertWarns and assertWarnsRegexp methods to check that a
given warning type was triggered by the code under test.
- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
their contents without duplicating them. The view is both readable and
writable.
- Issue #7566: Implement os.path.sameopenfile for Windows.
- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
unsupported operation is attempted (for example, writing to a file open only
for reading).
- hashlib has two new constant attributes: algorithms_guaranteed and
algorithms_available that respectively list the names of hash algorithms
guaranteed to exist in all Python implementations and the names of hash
algorithms available in the current process.
- A new package ``concurrent.futures`` as defined by PEP 3148.
C-API
-----
- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
PySequence_DelSlice when the object doesn't have any mapping operations
defined.
Tools/Demos
-----------
- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
and the interpreter under test.
Tests
-----
- Issue #9308: Added tests for importing encoded modules that do not
depend on specific stdlib modules being encoded in a certain way.
- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
certificate and private key files used by SSL-related certs.
- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
in test_os)
- Issue #7110: regrtest now sends test failure reports and single-failure
tracebacks to stderr rather than stdout.
- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
- Issue #9899: Fix test_tkinter.test_font on various platforms. Patch by Ned
Deily.
- Issue #9894: Do not hardcode ENOENT in test_subprocess.
- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
case when running profile or trace, for example.
- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
Build
-----
- Issue #10062: Allow building on platforms which do not have sem_timedwait.
- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by Akira
Kitada.
- Issue #10055: Make json C89-compliant in UCS4 mode.
- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
- Issue #1633863: Don't ignore $CC under AIX.
- Issue #9810: Compile bzip2 source files in Python's project file directly. It
used to be built with bzip2's makefile.
- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
module.
- Issue #9806: python-config now has an ``--extension-suffix`` option that
outputs the suffix for dynamic libraries including the ABI version name
defined by PEP 3149.
- Issue #941346: Improve the build process under AIX and allow Python to be
built as a shared library. Patch by Sébastien Sablé.
- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
Sablé.
- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
the "bin" directory inside the framework is on the shell's search path. This
feature now also supports the ZSH shell.
What's New in Python 3.2 Alpha 2?
=================================
*Release date: 05-Sep-2010*
Core and Builtins
-----------------
- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but our
bytecode is a bit simplified. Patch by Demur Rumed.
- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
confusion with the proper variables names from 'warnings' itself.
- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
conform to the Set ABC. Patch by Daniel Urban.
- Issue #9737: Fix a crash when trying to delete a slice or an item from a
memoryview object.
- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
now removed, since their effect was inexistent in 3.x (the default encoding is
hardcoded to utf-8 and cannot be changed).
- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
properly. Patch by Stefan Behnel.
- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
platforms. Previously, it inlined only when using Microsoft Visual C.
- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
the pyconfig.h generated by configure on other systems.
- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
occur during attribute lookup are now propagated to the caller.
- Issue #8622: Add PYTHONFSENCODING environment variable to override the
filesystem encoding.
- Issue #5127: The C functions that access the Unicode Database now accept and
return characters from the full Unicode range, even on narrow unicode builds
(Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
in Python is that unicodedata.numeric() now returns the correct value for
large code points, and repr() may consider more characters as printable.
- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
as a unicode object, instead of a byte string. Function needed to support
unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
function.
- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
- Issue #9612: The set object is now 64-bit clean under Windows.
- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
the module file to be executed with the -m command line option.
- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
sys.stderr.
- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
objects are output as-is.
- Issue #9203: Computed gotos are now enabled by default on supported compilers
(which are detected by the configure script). They can still be disable
selectively by specifying --without-computed-gotos.
- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
use PyUnicode_FromFormatV() to format the warning message.
- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
array.
- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
- Issue #9337: The str() of a float or complex number is now identical to its
repr().
- Issue #9416: Fix some issues with complex formatting where the output with no
type specifier failed to match the str output:
- format(complex(-0.0, 2.0), '-') omitted the real part from the output,
- format(complex(0.0, 2.0), '-') included a sign and parentheses.
Extension Modules
-----------------
- Issue #8013: time.asctime and time.ctime no longer call system
asctime and ctime functions. The year range for time.asctime is now
1900 through maxint. The range for time.ctime is the same as for
time.localtime. The string produced by these functions is longer
than 24 characters when year is greater than 9999.
- Issue #6608: time.asctime is now checking struct tm fields its input
before passing it to the system asctime. Patch by MunSic Jeong.
- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
descriptor is provided. Patch by Pascal Chambon.
- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
posix module. Patch by Marcin Bachry.
- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
socket module, and fix the width of socket descriptors to be correctly
detected under 64-bit Windows.
- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
and gethostbyaddr. getnameinfo is now restricted to numeric addresses as
input.
- Issue #9214: Set operations on a KeysView or ItemsView in collections now
correctly return a set. Patch by Eli Bendersky.
- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
Matthew Ahrens.
- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
the surrogate error handler.
- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
than ``TypeError`` raised by the iterator argument.
- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
Lock around all system calls. Original patch by Ryan Kelly.
- Issue #8524: Add a detach() method to socket objects, so as to put the socket
into the closed state without closing the underlying file descriptor.
- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
- Issue #6869: Fix a refcount problem in the _ctypes extension.
- Issue #5504: ctypes should now work with systems where mmap can't be
PROT_WRITE and PROT_EXEC.
- Issue #9507: Named tuple repr will now automatically display the right name in
a tuple subclass.
- Issue #9324: Add parameter validation to signal.signal on Windows in order to
prevent crashes.
- Issue #9526: Remove some outdated (int) casts that were preventing the array
module from working correctly with arrays of more than 2**31 elements.
- Fix memory leak in ssl._ssl._test_decode_cert.
- Issue #8065: Fix memory leak in readline module (from failure to free the
result of history_get_history_state()).
- Issue #9450: Fix memory leak in readline.replace_history_item and
readline.remove_history_item for readline version >= 5.0.
- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
- Issue #8046: Add context management protocol support and .closed property to mmap
objects.
Library
-------
- Issue #7451: Improve decoding performance of JSON objects, and reduce the
memory consumption of said decoded objects when they use the same strings as
keys.
- Issue #1100562: Fix deep-copying of objects derived from the list and dict
types. Patch by Michele Orrù and Björn Lindqvist.
- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
- Issue #9421: Made the get<type> methods consistently accept the vars and
default arguments on all parser classes.
- Issue #7005: Fixed output of None values for RawConfigParser.write and
ConfigParser.write.
- Issue #8990: array.fromstring() and array.tostring() get renamed to
frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
array.frombytes(), array.extend() as well as the array.array() constructor now
accept bytearray objects. Patch by Thomas Jollans.
- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
issues when socket.close is called from a __del__ method.
- Issue #9706: ssl module provides a better error handling in various
circumstances.
- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
rid of the cached copy of thread-local attribute dictionary.
- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
are rounded to the nearest integer.
- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
falling into recursion.
- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
character years even if the message contains RFC822 two character years.
- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
operations on its self, namely x -= x and x ^= x.
- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
handling when accepting a new connection.
- Issue #9601: ftplib now provides a workaround for non-compliant
implementations such as IIS shipped with Windows server 2003 returning invalid
response codes for MKD and PWD commands.
- Issue #658749: asyncore's connect() method now correctly interprets winsock
errors.
- Issue #9501: Fixed logging regressions in cleanup code.
- Fix functools.total_ordering() to skip methods inherited from object.
- Issue #9572: Importlib should not raise an exception if a directory it thought
it needed to create was done concurrently by another process.
- Issue #9617: Signals received during a low-level write operation aren't
ignored by the buffered IO layer anymore.
- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
error handler, or strict error handler on Windows.
- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
``gzip.decompress``. Original patch by Anand B. Pillai.
- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
ssl.SSLContext object allowing bundling SSL configuration options,
certificates and private keys into a single (potentially long-lived)
structure.
- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
single keyword arguments.
- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
compiler flag values over defining its own.
- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
formatted code information in a string rather than displaying on screen.
- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
pointing to the original callable.
- Issue #3445: functools.update_wrapper now tolerates missing attributes on
wrapped callables.
- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
- Issue #9605: posix.getlogin() decodes the username with file filesystem
encoding and surrogateescape error handler. Patch written by David Watson.
- Issue #9604: posix.initgroups() encodes the username using the fileystem
encoding and surrogateescape error handler. Patch written by David Watson.
- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
using the filesystem encoding and surrogateescape error handler. Patch written
by David Watson.
- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
for use with the statvfs() function. Patch by Adam Jackson.
- Issue #8688: MANIFEST files created by distutils now include a magic comment
indicating they are generated. Manually maintained MANIFESTs without this
marker will not be overwritten or removed.
- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
BadZipfile error is raised if it doesn't match (as used to be the case in
Python 2.5 and earlier).
- Issue #9550: a BufferedReader could issue an additional read when the original
read request had been satisfied, which could block indefinitely when the
underlying raw IO channel was e.g. a socket. Report and original patch by
Jason V. Miller.
- Issue #3757: thread-local objects now support cyclic garbage collection.
Thread-local objects involved in reference cycles will be deallocated timely
by the cyclic GC, even if the underlying thread is still running.
- Issue #9452: Add read_file, read_string, and read_dict to the configparser
API; new source attribute to exceptions.
- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
node.
- Issue #8047: Fix the xml.etree serializer to return bytes by default. Use
``encoding="unicode"`` to generate a Unicode string.
- Issue #8280: urllib2's Request method will remove fragments in the url. This
is how it is supposed to work, wget and curl do the same. Previous behavior
was wrong.
- Issue #6683: For SMTP logins we now try all authentication methods advertised
by the server. Many servers are buggy and advertise authentication methods
they do not support in reality.
- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
included in the set of attributes copied by default by functools.wraps and
functools.update_wrapper. Patch by Terrence Cole.
- Issue #2944: asyncore doesn't handle connection refused correctly.
- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
the private attributes. Add tests for smtpd module.
- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
encoded in base64 is lacking padding.
- Issue #9444: Argparse now uses the first element of prefix_chars as the option
character for the added 'h/help' option if prefix_chars does not contain a
'-', instead of raising an error.
- Issue #7372: Fix pstats regression when stripping paths from profile data
generated with the profile module.
- Issue #9428: Fix running scripts with the profile/cProfile modules from the
command line.
- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
browser.
- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
expressions.
- Update collections.OrderedDict to match the implementation in Py2.7 (based on
lists instead of weakly referenced Link objects).
- Issue #8397: Raise an error when attempting to mix iteration and regular reads
on a BZ2File object, rather than returning incorrect results.
- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
re-initializing a buffered IO object by calling its ``__init__`` method.
- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
across devices.
- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
- Issue #1690103: Fix initial namespace for code run with trace.main().
- Issue #7395: Fix tracebacks in pstats interactive browser.
- Issue #8230: Fix Lib/test/sortperf.py.
- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
newline, it no longer truncates the last character of the last command line.
- Issue #5146: Handle UID THREAD command correctly in imaplib.
- Issue #5147: Fix the header generated for cookie files written by
http.cookiejar.MozillaCookieJar.
- Issue #8198: In pydoc, output all help text to the correct stream when
sys.stdout is reassigned.
- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
in ntpath.normpath().
- Issue #1286: Allow using fileinput.FileInput as a context manager.
- Add lru_cache() decorator to the functools module.
Tools/Demos
-----------
- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
non-ASCII content.
Tests
-----
- Issue #9601: Provide a test case for ftplib.parse257.
- Issue #8857: Provide a test case for socket.getaddrinfo.
- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
- Issue #8433: Fix test_curses failure with newer versions of ncurses.
- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
Michele Orrù.
- Issue #8687: provide a test suite for sched.py module.
Build
-----
- Issue #1303434: Generate ZIP file containing all PDBs.
- Issue #9193: PEP 3149 is accepted.
- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
Sébastien Sablé.
- Don't run pgen twice when using make -j.
What's New in Python 3.2 Alpha 1?
=================================
*Release date: 01-Aug-2010*
Core and Builtins
-----------------
- Issue #8991: convertbuffer() rejects discontigious buffers.
- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
compiler.
- Issue #8413: structsequence now subclasses tuple.
- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
start byte and the continuation byte(s) are now considered invalid, instead of
the number of bytes specified by the start byte. E.g.:
'\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
even if '\xf1' is the start byte of a 4-bytes sequence. Previous versions
returned a single u'\ufffd'.
- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
rather than 0.0. So "-7j" is now exactly equivalent to "-(7j)".
- Be more specific in error messages about positional arguments.
- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
objects, as described in the documentation.
- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
Fix the encoding of the modules filename. Patch written by Amaury Forgeot
d'Arc.
- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
dealing with unary minus applied to a constant. The removed code was mutating
the ST, causing a second compilation to fail.
- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
mode raises unicode errors. The encoder only supports "strict" and "replace"
error handlers, the decoder only supports "strict" and "ignore" error
handlers. Patch written by Mark Hammond.
- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
"w*" format instead. Add tests for "w*" format.
- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
formats if the string contains a null byte/character. Write unit tests for
string formats.
- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
location of the raised exception.
- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
filenames and enable os.fsencode().
- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
interpreter with characters outside the Basic Multilingual Plane (higher than
0x10000).
- Issue #8950: (See also issue #5080). Py_ArgParse*() functions now raise
TypeError instead of giving a DeprecationWarning when a float is parsed using
the 'L' code (for long long). (All other integer codes already raise
TypeError in this case.)
- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
enable shortcuts for upper case encoding name. Add also a shortcut for
"iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
- Issue #8838: Remove codecs.charbuffer_encode() function. The buffer protocol
doesn't support "char buffer" anymore in Python 3.
- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
instead. codecs.charbuffer_encode() now accepts modifiable buffer objects
like bytearray.
- Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is no
used anymore and it was never documented.
- In str.format(), raise a ValueError when indexes to arguments are too large.
- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
integers n (including n = -909).
- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
equal value.
- Issue #8748: Fix two issues with comparisons between complex and integer
objects. (1) The comparison could incorrectly return True in some cases
(2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
(2) The comparison raised an OverflowError for large integers, leading to
unpredictable exceptions when combining integers and complex objects in sets
or dicts.
- Issue #8766: Initialize _warnings module before importing the first module.
Fix a crash if an empty directory called "encodings" exists in sys.path.
- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
encoding and surrogateescape error handler instead of the locale encoding to
be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
of strict) error handler to escape surrogates.
- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall
back to UTF-8.
- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
error handler, not only the default error handler (strict).
- Issue #8610: Load file system codec at startup, and display a fatal error on
failure. Set the file system encoding to utf-8 (instead of None) if getting
the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
PyUnicode_FromString() to support surrogates in the filename and use the right
encoding.
- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
- Issue #8419: Prevent the dict constructor from accepting non-string keyword
arguments.
- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
indirectly Python signal handlers anymore because mywrite() ignores exceptions
(KeyboardInterrupt).
- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
unicode string (eg. backslashreplace).
- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
anymore, you have to convert your bytearray filenames to bytes.
- Issue #7332: Remove the 16KB stack-based buffer in
PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
compared to the dynamic memory allocation fallback. Patch by Charles-François
Natali.
- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
passed to bytes or bytearray.
- Issue #7301: Add environment variable $PYTHONWARNINGS.
- Issue #8329: Don't return the same lists from select.select when no fds are
changed.
- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
64-bit machines. The shift count for either left or right shift is permitted
to be up to sys.maxsize.
- Ensure that tokenization of identifiers is not affected by locale.
- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
is set.
- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
is unknown.
- Issue #1583863: A str subclass can now override the __str__ method.
- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
PyMemberDefs could produce an internal error; raise TypeError instead.
- Issue #7845: Rich comparison methods on the complex type now return
NotImplemented rather than raising a TypeError when comparing with an
incompatible type; this allows user-defined classes to implement their own
comparisons with complex.
- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
(SIGINT). If an error occurs while importing the site module, the error is
printed and Python exits. Initialize the GIL before importing the site module.
- Issue #7173: Generator finalization could invalidate sys.exc_info().
- Issue #7544: Preallocate thread memory before creating the thread to avoid a
fatal error in low memory condition.
- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
check fails.
- Handle errors from looking up __prepare__ correctly.
- Issue #5939: Add additional runtime checking to ensure a valid capsule in
Modules/_ctypes/callproc.c.
- Issue #7309: Fix unchecked attribute access when converting
UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
- Issue #6902: Fix problem with built-in types format incorrectly with 0
padding.
- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
Now it matches other numeric types.
- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
PyOS_ascii_strtod, and PyOS_ascii_atof. Use PyOS_double_to_string and
PyOS_string_to_double instead. See issue #5835 for the original deprecations.
- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
fails. Patch by Florent Xicluna.
- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
very large step value.
- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
add the additional members returned in an OSVERSIONINFOEX structure. The new
members are service_pack_major, service_pack_minor, suite_mask, and
product_type.
- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
crash in many places because of the PyByteArray_AS_STRING() macro returning
NULL. The macro now returns a statically allocated empty string instead.
- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
where the right hand operand is a set of constants, by turning the set into a
frozenset and pre-building it as a constant. The comparison operation is made
against the constant instead of building a new set each time it is executed (a
similar optimization already existed which turned a list of constants into a
pre-built tuple). Patch and additional tests by Dave Malcolm.
- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
of bytes, bytearray and unicode objects by using a common implementation based
on stringlib's fast search. Patch by Florent Xicluna.
- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
including: (1) a serious 'wrong output' bug that could occur for long (> 40
digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
parsing certain long numeric strings corresponding to subnormal values, (3) a
memory leak for some values large enough to cause overflow, and (4) a number
of flaws that could lead to incorrectly rounded results.
- The __complex__ method is now looked up on the class of instances to make it
consistent with other special methods.
- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
`rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
- Issue #7604: Deleting an unset slotted attribute did not raise an
AttributeError.
- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
in ** operator. The behaviour now conforms to that described in C99 Annex F.
- Issue #1811: improve accuracy and cross-platform consistency for true division
of integers: the result of a/b is now correctly rounded for ints a and b (at
least on IEEE 754 platforms), and in particular does not depend on the
internal representation of an int.
- Issue #6834: replace the implementation for the 'python' and 'pythonw'
executables on OSX.
These executables now work properly with the arch(1) command: ``arch -ppc
python`` will start a universal binary version of python in PPC mode (unlike
previous releases).
- Issue #7466: Segmentation fault when the garbage collector is called in the
middle of populating a tuple. Patch by Florent Xicluna.
- Issue #7419: setlocale() could crash the interpreter on Windows when called
with invalid values.
- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
10.6.
- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
- Issue #6970: Remove redundant calls when comparing objects that don't
implement the relevant rich comparison methods.
- Issue #7298: Fixes for range and reversed(range(...)). Iteration over
range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
long but the length of the range did not. Also fix several cases where
reversed(range(a, b, c)) gave wrong results, and fix a refleak for
reversed(range(a, b, c)) with large arguments.
- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
during the formation of an output tuple.
- Issue #3297: On wide unicode builds, do not split unicode characters into
surrogates.
- Remove length limitation when constructing a complex number from a string.
- Issue #1087418: Boost performance of bitwise operations for longs.
- Support for AtheOS has been completely removed from the code base. It was
disabled since Python 3.0.
- Support for several legacy threading libraries has been disabled. These
libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
will be entirely removed in 3.3.
- Support for OSF* has been disabled. If nobody stands up, support will be
removed in 3.3. See <http://bugs.python.org/issue8606>.
- Peephole constant folding had missed UNARY_POSITIVE.
- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
fixes the problem of some exceptions being thrown at shutdown when the
interpreter is killed. Patch by Adam Olsen.
- Issue #7147: Remove support for compiling Python without complex number
support.
- Issue #7120: logging: Removed import of multiprocessing which is causing crash
in GAE.
- Issue #1754094: Improve the stack depth calculation in the compiler. There
should be no other effect than a small decrease in memory use. Patch by
Christopher Tur Lesniewski-Laas.
- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
byte values greater than 127. Patch by Derk Drukker.
- Issue #1571184: The Unicode database contains properties for more characters.
The tables for code points representing numeric values, white spaces or line
breaks are now generated from the official Unicode Character Database files,
and include information from the Unihan.txt file.
- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
producing internally inconsistent Python longs.
- Issue #6990: Fix threading.local subclasses leaving old state around after a
reference cycle GC which could be recycled by new locals.
- Issue #5460: Fix an ambiguity in the grammar.
- Issue #1766304: Improve performance of membership tests on range objects.
- Issue #6713: Improve performance of integer -> string conversions.
- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
- Issue #6750: A text file opened with io.open() could duplicate its output when
writing from multiple threads at the same time.
- Issue #6707: dir() on an uninitialized module caused a crash.
- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
- Issue #6573: set.union() stopped processing inputs if an instance of self
occurred in the argument chain.
- Issue #6070: On posix platforms import no longer copies the execute bit from
the .py file to the .pyc file if it is set.
- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
and not an int. Fix the corresponding error message, and the documentation.
- The deprecated PyCObject has been removed.
- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a
build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
of stdint.h on that platform.
- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
'surrogateescape' error handler, a string which contains unpaired surrogates.
- Issue #4856: Remove checks for win NT.
- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
to construct a null-initialized bytes object.
- Issue #1023290: Add from_bytes() and to_bytes() methods to integers. These
methods allow the conversion of integers to bytes, and vice-versa.
- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
from being copied with copy.copy(), and bytes subclasses from being pickled
properly.
- Code objects now support weak references.
- Issue #7072: isspace(0xa0) is true on Mac OS X.
- Issue #8084: PEP 370 now conforms to system conventions for framework builds
on MacOS X. That is, "python setup.py install --user" will install into
"~/Library/Python/2.7" instead of "~/.local".
C-API
-----
- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
variable argument list. `Py_VA_COPY` is equivalent to C99
`va_copy`, but available on all python platforms.
- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX]. This makes it safe to do
"step = -step" when reversing a slice.
- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
interpreter to set sys.argv without also modifying sys.path. This helps fix
`CVE-2008-5983
<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
strings in an efficient manner.
- Issue #8276: PyEval_CallObject() is now only available in macro form. The
function declaration, which was kept for backwards compatibility reasons, is
now removed (the macro was introduced in 1997!).
- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
PyLong_AsLongAndOverflow.
- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
has '\0' at the end.
- Issue #5080: The argument parsing functions PyArg_ParseTuple,
PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
'L' format code. This will become a TypeError in a future version of Python,
to match the behaviour of the other integer format codes.
- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
PyArg_ParseTupleAndKeywords.
- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
PyErr_Format, on machines with HAVE_LONG_LONG defined.
- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be used for
accessing the d_type and d_name members of structures using PyDescr_COMMON.
- Issue #6405: Remove duplicate type declarations in descrobject.h.
- The code flags for old __future__ features are now available again.
- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
PyCode_Addr2Line().
- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
object at a specified file, function, and line number.
- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
``const char *`` as the string is stored beyond the call.
- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
allocator will be automatically disabled when running under Valgrind. This
gives improved memory leak detection when running under Valgrind, while taking
advantage of pymalloc at other times.
Library
-------
- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
old commands are restored.
- For traceback debugging, the pdb listing now also shows the locations where
the exception was originally (re)raised, if it differs from the last line
executed (e.g. in case of finally clauses).
- The pdb command "source" has been added. It displays the source code for a
given object, if possible.
- The pdb command "longlist" has been added. It displays the whole source code
for the current function.
- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
output into methods.
- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
emit a message when a breakpoint is enabled or disabled.
- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
top-level debugged frame.
- Issue #5727: Restore the ability to use readline when calling into pdb in
doctests.
- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
source file to be debugged is in a non-builtin encoding.
- Issue #8048: Prevent doctests from failing when sys.displayhook has been
reassigned.
- Issue #8015: In pdb, do not crash when an empty line is entered as a
breakpoint command.
- In pdb, allow giving a line number to the "until" command.
- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
files. Also, add a command-line option "-c" that runs a command as if given
in .pdbrc.
- Issue #4179: In pdb, allow "list ." as a command to return to the currently
debugged line.
- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
entries, consider the first one.
- Issue #6630: Allow customizing regex flags when subclassing the
string.Template class.
- Issue #9411: Allow specifying an encoding for config files in the configparser
module.
- Issue #1682942: Improvements to configparser: support alternate delimiters,
alternate comment prefixes and empty lines in values.
- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
- Issue #9378: python -m pickle <pickle file> will now load and display the
first object in the pickle file.
- Issue #4770: Restrict binascii module to accept only bytes (as specified).
And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
before ASCII-to-binary decoding.
- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
- The default size of the re module's compiled regular expression cache has been
increased from 100 to 500 and the cache replacement policy has changed from
simply clearing the entire cache on overflow to forgetting the least recently
used cached compiled regular expressions. This is a performance win for
applications that use a lot of regular expressions and limits the impact of
the performance hit anytime the cache is exceeded.
- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
error occurs when the server closes the socket and the client sends a big
XML-RPC request.
- Issue #4629: getopt raises an error if an argument ends with "=", whereas
getopt doesn't accept a value (eg. --help= is rejected if getopt uses
['help='] long options).
- Issue #7989: Added pure python implementation of the `datetime` module. The C
module is renamed to `_datetime` and if available, overrides all classes
defined in datetime with fast C impementation. Python implementation is based
on the original python prototype for the datetime module by Tim Peters with
minor modifications by the PyPy project. The test suite now tests `datetime`
module with and without `_datetime` acceleration using the same test cases.
- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
- Issue #9323: Fixed a bug in trace.py that resulted in losing the name of the
script being traced. Patch by Eli Bendersky.
- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for
the patch.
- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
parameters.
- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
which controls printing of opcode descriptions in ``dis()`` output.
- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
crosses an 8192 byte boundary.
- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
- ``ast.literal_eval()`` now allows byte literals.
- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
keyword arguments called 'self' or 'other' specially.
- ``ast.literal_eval()`` now allows set literals.
- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
- Issue #7646: The fnmatch pattern cache no longer grows without bound.
- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
produced when profiling the decimal module. This was due to a dangerous
iteration over 'locals()' in Context.__init__.
- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
and the exponent is tiny (for example, ``Decimal(10) **
Decimal('1e-999999999')``).
- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
- Issue #9130: Fix validation of relative imports in parser module.
- Issue #9128: Fix validation of class decorators in parser module.
- Issue #9094: python -m pickletools will now disassemble pickle files listed in
the command line arguments. See output of python -m pickletools -h for more
details.
- Issue #5468: urlencode to handle bytes type and other encodings in its query
parameter. Patch by Dan Mahn.
- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
ensure that the input string length is a multiple of the frame size.
- Issue #6507: Accept source strings in dis.dis(). Original patch by Daniel
Urban.
- Issue #7829: Clearly document that the dis module is exposing an
implementation detail that is not stable between Python VMs or releases.
- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
raises an exception.
- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
that act as both context managers and decorators. contextmanager changes to
use ContextDecorator.
- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
for removal in Python 3.4.
- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
giving the number of frames to go.
- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
``str`` or ``bytes``.
- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
OpenSSL structure.
- Issue #8682: The ssl module now temporary increments the reference count of a
socket object got through ``PyWeakref_GetObject``, so as to avoid possible
deallocation while the object is still being used.
- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
password instead of presenting an interactive prompt. Older behavior can be
obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
smart enough to find source files in the linecache.
- Issue #5610: feedparser no longer eats extra characters at the end of a body
part if the body part ends with a ``\r\n``.
- Issue #8986: math.erfc was incorrectly raising OverflowError for values
between -27.3 and -30.0 on some platforms.
- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
- Issue #8966: If a ctypes structure field is an array of c_char, convert its
value to bytes instead of str (as done for c_char and c_char_p).
- Issue #8188: Comparisons between Decimal and Fraction objects are now
permitted, returning a result based on the exact numerical values of the
operands. This builds on issue #2531, which allowed Decimal-to-float
comparisons; all comparisons involving numeric types (bool, int, float,
complex, Decimal, Fraction) should now act as expected.
- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
Thomas Jollans.
- Issue #8899: time.struct_time now has class and attribute docstrings.
- Issue #6470: Drop UNC prefix in FixTk.
- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
strings. They are now correctly converted to strings.
- Issue #8833: tarfile created hard link entries with a size field != 0 by
mistake.
- Charset.body_encode now correctly handles base64 encoding by encoding with the
output_charset before calling base64mime.encode. Passes the tests from 2.x
issue #1368247.
- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
attribute that is True iff there are uncommitted changes.
- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
divided by float and int objects. Results are rounded to the nearest multiple
of timedelta.resolution with ties resolved using round-half-to-even method.
- Issue #7150: Raise OverflowError if the result of adding or subtracting
timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
- Issue #8806: add SSL contexts support to ftplib.
- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
API.
- Issue #8770: Now sysconfig displays information when it's called as a script.
Initial idea by Sridhar Ratnakumar.
- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
Fredrik Håård.
- Issue #8540: Decimal module: rename the Context._clamp attribute to
Context.clamp and make it public. This is useful in creating contexts that
correspond to the decimal interchange formats specified in IEEE 754.
- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
StreamWriter classes.
- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
of the C file stderr, to use stderr encoding and error handler.
- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
of files without one.
- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
comparing to a non-mapping.
- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
correct encoding.
- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
``OP_*`` constants to the `ssl` module. This allows selectively disabling
protocol versions, when used in combination with `PROTOCOL_SSLv23`.
- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
stdout is not a TTY).
- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
subprocess.Popen() and os._execvpe() support bytes program name. Add
os.supports_bytes_environ flag: True if the native OS type of the environment
is bytes (eg. False on Windows).
- Issue #8633: tarfile is now able to read and write archives with "raw" binary
pax headers as described in POSIX.1-2008.
- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
unquote, unquote_to_bytes.
- Issue #8688: Distutils now recalculates MANIFEST every time.
- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
surrogates and bytes for the filename.
- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
- Issue #8681: Make the zlib module's error messages more informative when the
zlib itself doesn't give any detailed explanation.
- The audioop module now supports sound fragments of length greater than 2**31
bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
- Issue #4972: Add support for the context management protocol to the ftplib.FTP
class.
- Issue #8664: In py_compile, create __pycache__ when the compiled path is
given.
- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
for use in the file system, environment variables or the command line.
- Issue #8571: Fix an internal error when compressing or decompressing a chunk
larger than 1GB with the zlib module's compressor and decompressor objects.
- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
file system encoding with the surrogateescape error handler (instead of
utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
- Issue #8573: asyncore _strerror() function might throw ValueError.
- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
messages when accessing undefined class attributes because of the cheap
inheritance with the underlying socket object. The cheap inheritance has been
deprecated.
- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
Patch by Tres Seaver.
- Issue #8390: tarfile uses surrogateescape as the default error handler
(instead of replace in read mode or strict in write mode).
- Issue #7755: Use an unencumbered audio file for tests.
- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
and any children created using ``os.fork`` on MacOS X 10.6.
- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
operation raises multiple signals and more than one of those signals is
trapped, the specification determines the order in which the signals should be
handled. In many cases this order wasn't being followed, leading to the wrong
Python exception being raised.
- Issue #7865: The close() method of ``io`` objects should not swallow
exceptions raised by the implicit flush(). Also qensure that calling close()
several times is supported. Patch by Pascal Chambon.
- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
gc.DEBUG_STATS.
- Issue #8354: The siginterrupt setting is now preserved for all signals, not
just SIGCHLD.
- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
webbrowser.get("safari").
- Issue #8464: tarfile no longer creates files with execute permissions set when
mode="w|" is used.
- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
the Linux kernel. Patch by Yaniv Aknin.
- Issue #8295: Added shutil.unpack_archive.
- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
It should correctly return an empty response now.
- Issue #8546: Reject None given as the buffering argument to _pyio.open.
- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
Sridhar Ratnakumar.
- Issue #6656: fix locale.format_string to handle escaped percents
and mappings.
- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
the method could block indefinitely if called just before the event loop
started running. This also fixes the occasional freezes witnessed in
test_httpservers.
- Issue #8524: When creating an SSL socket, the timeout value of the original
socket wasn't retained (instead, a socket with a positive timeout would be
turned into a non-blocking SSL socket).
- Issue #5103: SSL handshake would ignore the socket timeout and block
indefinitely if the other end didn't respond.
- The do_handshake() method of SSL objects now adjusts the blocking mode of the
SSL structure if necessary (as other methods already do).
- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
bytes strings for environment keys and values.
- Issue #8467: Pure Python implementation of subprocess encodes the error
message using surrogatepass error handler to support surrogates in the
message.
- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
string "python" as the *ident*. openlog() arguments are all optional and
keywords.
- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
non-infinite timeout. Also make that method friendlier with applications
wanting to continue using the socket in clear-text mode, by disabling
OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
- Issue #8496: make mailcap.lookup() always return a list, rather than an
iterator. Patch by Gregory Nofi.
- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
collation name contains a surrogate character.
- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
extension, such that verification of some SSL certificates doesn't fail
because of an "unknown algorithm".
- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
- Issue #4814: timeout parameter is now applied also for connections resulting
from PORT/EPRT commands.
- Issue #8463: added missing reference to bztar in shutil's documentation.
- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
long as the user didn't specify 'automatic proxy configuration').
- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
as stated in RFC-959 at chapter 5.4.
- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
surrogates.
- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
`threading.Semaphore` objects. Original patch by Torsten Landschoff.
- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
available cipher list. Helps fix test_ssl with OpenSSL 1.0.0.
- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
the current working directory.
- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
using backslashreplace error handler.
- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
Locke and Hans Ulrich Niedermann.
- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
- Issue #7316: The acquire() method of lock objects in the ``threading``
module now takes an optional timeout argument in seconds. Timeout support
relies on the system threading library, so as to avoid a semi-busy wait loop.
- Issue #8383: pickle and pickletools use surrogatepass error handler when
encoding unicode as utf8 to support lone surrogates and stay compatible with
Python 2.x and 3.x.
- Issue #7585: difflib context and unified diffs now place a tab between
filename and date, conforming to the 'standards' they were originally designed
to follow. This improves compatibility with patch tools.
- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
character sets will now consistently use a Content-Transfer-Encoding of 7bit
rather than sometimes being marked as 8bit.
- Issue #8375: test_distutils now checks if the temporary directory are still
present before it cleans them.
- Issue #8374: Update the internal alias table in the ``locale`` module to
cover recent locale changes and additions.
- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
`ssl.OPENSSL_VERSION_NUMBER`.
- Add functools.total_ordering() and functools.cmp_to_key().
- Issue #8257: The Decimal construct now accepts a float instance directly,
converting that float to a Decimal of equal value:
>>> Decimal(1.1)
Decimal('1.100000000000000088817841970012523233890533447265625')
- Issue #8294: The Fraction constructor now accepts Decimal and float instances
directly.
- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
InvalidOperation instead of returning False. (Comparisons involving a quiet
NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
signaling NaNs remain unhashable.
- Issue #2531: Comparison operations between floats and Decimal instances now
return a result based on the numeric values of the operands; previously they
returned an arbitrary result based on the relative ordering of id(float) and
id(Decimal). See also issue #8188, which adds Decimal-to-Fraction
comparisons.
- Added a subtract() method to collections.Counter().
- Issue #8233: When run as a script, py_compile.py optionally takes a single
argument `-` which tells it to read files to compile from stdin. Each line is
read on demand and the named file is compiled immediately. (Original patch by
Piotr Ożarowski).
- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
form feed (0x0C) are now considered linebreaks, as specified in Unicode
Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
- Comparisons using one of <, <=, >, >= between a complex instance and a
Fractions instance now raise TypeError instead of returning True/False. This
makes Fraction <=> complex comparisons consistent with int <=> complex, float
<=> complex, and complex <=> complex comparisons.
- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
methods (such as oss_mixer_device.fileno()) were not available. Initial patch
by Bertrand Janin.
- Issue #8205: Remove the "Modules" directory from sys.path when Python is
running from the build directory (POSIX only).
- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
didn't support chflags() (for example ZFS under FreeBSD). The error is now
silenced.
- Issue #7860: platform.uname now reports the correct 'machine' type when Python
is running in WOW64 mode on 64 bit Windows.
- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
reads and writes are always retried by OpenSSL itself.
- Issue #4282: Fix the main function of the profile module for a non-ASCII
script, open the file in binary mode and not in text mode with the default
(utf8) encoding.
- Issue #8179: Fix macpath.realpath() on a non-existing path.
- Issue #8024: Update the Unicode database to 5.2.
- Issue #8168: py_compile now handles files with utf-8 BOMS.
- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
detected.
- Issue #6716/2: Backslash-replace error output in compilall.
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
with Tcl/Tk-8.5.
- Issue #8140: extend compileall to compile single files. Add -i option.
- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
locale.
- The internals of the subprocess module on POSIX systems have been replaced by
an extension module (_posixsubprocess) so that the fork()+exec() can be done
safely without the possibility of deadlock in multithreaded applications.
- subprocess.Popen now has restore_signals and start_new_session features. The
default of restore_signals=True is a new behavior compared to earlier Python
versions. This means that signals such as SIGPIPE are not ignored by default
in subprocesses launched by Python (Issue #1652).
- Issue #6472: The xml.etree package is updated to ElementTree 1.3. The
cElementTree module is updated too.
- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
a non existent program name and Python is unable to retrieve the real program
name.
- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
replacement were all bytes. Patch by Antoine Pitrou.
- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
bugs and allows loading SQLite extensions from shared libraries.
- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
Review Issue #29 (http://unicode.org/review/pr-29.html).
- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
reset also the pointer to the current pointer context.
- Issue #7232: Add support for the context management protocol to the TarFile
class.
- Issue #7250: Fix info leak of os.environ across multi-run uses of
wsgiref.handlers.CGIHandler.
- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
- Issue #691291: codecs.open() should not convert end of lines on reading and
writing.
- Issue #7869: logging: improved diagnostic for format-time errors.
- Issue #7868: logging: added loggerClass attribute to Manager.
- logging: Implemented PEP 391.
- Issue #1537721: Add a writeheader() method to csv.DictWriter.
- Issue #7959: ctypes callback functions are now registered correctly with the
cycle garbage collector.
- Issue #5801: removed spurious empty lines in wsgiref.
- Issue #6666: fix bug in trace.py that applied the list of directories to be
ignored only to the first file. Noted by Bogdan Opanchuk.
- Issue #7597: curses.use_env() can now be called before initscr(). Noted by
Kan-Ru Chen.
- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
messages parsed by email.Parser.HeaderParser.
- Issue #7361: Importlib was not properly checking the number of bytes in
bytecode file when it was less than 8 bytes.
- Issue #7633: In the decimal module, Context class methods (with the exception
of canonical and is_canonical) now accept instances of int and long wherever a
Decimal instance is accepted, and implicitly convert that argument to Decimal.
Previously only some arguments were converted.
- Issue #7835: shelve should no longer produce mysterious warnings during
interpreter shutdown.
- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
processing instructions and comments. These raw characters are allowed by the
XML specification, and are necessary when outputting e.g. PHP code in a
processing instruction. Patch by Neil Muller.
- Issue #6233: ElementTree failed converting unicode characters to XML entities
when they couldn't be represented in the requested output encoding. Patch by
Jerry Chen.
- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
compression type.
- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
specified, rather than fall through to AF_PACKET (in the `socket` module).
Also, raise ValueError rather than TypeError when an unknown TIPC address type
is specified. Patch by Brian Curtin.
- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
position when calling `truncate()`. It would previously change the file
position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
- Issue #7610: Reworked implementation of the internal
``zipfile.ZipExtFile`` class used to represent files stored inside an
archive. The new implementation is significantly faster and can be wrapped in
an ``io.BufferedReader`` object for more speedups. It also solves an
issue where interleaved calls to `read()` and `readline()` give wrong results.
Patch by Nir Aides.
- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
allowing for a maximum number of tasks within the pool to be completed by the
worker before that worker is terminated, and a new one created to replace it.
- Issue #7792: Registering non-classes to ABCs raised an obscure error.
- Issue #7785: Don't accept bytes in FileIO.write().
- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
the release file is empty.
- Issue #7561: Fix crashes when using bytearray objects with the posix
module.
- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
multipart/signed MIME parts, which fixes one of the sources of invalid
modifications to such parts by Generator.
- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`. Patch
by Florent Xicluna, along with some additional tests.
- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
argument. Patch by Victor Stinner.
- Issue #3299: Fix possible crash in the _sre module when given bad argument
values in debug mode. Patch by Victor Stinner.
- Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch
by Brian Curtin.
- Issue #7681: Use floor division in appropriate places in the wave module.
- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
Extension extra options may change the output without changing the .c
file). Initial patch by Collin Winter.
- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
when it has a fully qualified configuration prefix. Initial patch by Arfrever.
- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
destruction of weakref'ed objects while iterating.
- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
Stinner.
- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
properly handles EINTR within the read, readline, write & flush methods. The
socket.sendall() method now properly handles interrupted system calls.
- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
parameter to allow specifying where your connections come from.
- socket.create_connection now accepts an optional source_address parameter.
- Issue #5511: now zipfile.ZipFile can be used as a context manager. Initial
patch by Brian Curtin.
- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
Manifest file in text mode so string patterns can be used in regular
expressions.
- Issue #7552: Removed line feed in the base64 Authorization header in the
Distutils upload command to avoid an error when PyPI reads it. This occurs on
long passwords. Initial patch by JP St. Pierre.
- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
Tatsuhiro Tsujikawa.
- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
TypeError when given an `str` object (rather than a `bytes`-like object).
Patch by Victor Stinner and Florent Xicluna.
- Issue #7349: Make methods of file objects in the io module accept None as an
argument where file-like objects (ie StringIO and BytesIO) accept them to mean
the same as passing no argument.
- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
- Issue #5949: added check for correct lineends in input from IMAP server in
imaplib.
- Add count() and reverse() methods to collections.deque().
- Fix variations of extending deques: d.extend(d) d.extendleft(d) d+=d
- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
parameter types. Patch by Victor Stinner.
- Issue #7457: added a read_pkg_file method to
distutils.dist.DistributionMetadata.
- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
TLS with authentication credentials.
- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
in Distutils. Patch by Stephen Emslie.
- Issue #4120: Drop reference to CRT from manifest when building extensions with
msvc9compiler.
- Issue #7333: The `posix` module gains an `initgroups()` function providing
access to the initgroups(3) C library call on Unix systems which implement it.
Patch by Jean-Paul Calderone.
- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
ownership when the group is not forced, because the group may be different
from the user's group and inherit from its container when the test is run.
- Issue #4486: When an exception has an explicit cause, do not print its
implicit context too. This affects the `traceback` module as well as built-in
exception printing.
- Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert
Collins.
- Issue #7403: logging: Fixed possible race condition in lock creation.
- Issue #6845: Add restart support for binary upload in ftplib. The
`storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
argument. Patch by Pablo Mouzo.
- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
returning the total number of seconds in the duration. Patch by Brian
Quinlan.
- Issue #7133: SSL objects now support the new buffer API.
- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
- Issue #6123: tarfile now opens empty archives correctly and consistently
raises ReadError on empty files.
- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
of __str__.
- Issue #7341: Close the internal file object in the TarFile constructor in case
of an error.
- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
Windows box. Help provided by David Bolen.
- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
or SSL. Patch by Giampaolo Rodola'.
- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
- Issue #4969: The mimetypes module now reads the MIME database from the
registry under Windows. Patch by Gabriel Genellina.
- Issue #6816: runpy now provides a run_path function that allows Python code to
execute file paths that refer to source or compiled Python files as well as
zipfiles, directories and other valid sys.path entries that contain a
__main__.py file. This allows applications that run other Python scripts to
support the same flexibility as the CPython command line itself.
- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
connection with another process, rather than looping endlessly. The default
timeout is 20 seconds, which should be amply sufficient for local connections.
- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
unpickled. This fixes crashes under Windows when trying to run
test_multiprocessing in verbose mode.
- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
argument added to the TextTestRunner constructor allowing a different result
class to be used without having to subclass.
- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
name in failure reports even if the test has a docstring.
- Issue #3001: Add a C implementation of recursive locks which is used by
default when instantiating a `threading.RLock` object. This makes recursive
locks as fast as regular non-recursive locks (previously, they were slower by
10x to 15x).
- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
those started through `threading.Thread` (for example, using
`_thread.start_new_thread()`).
- Issue #7187: Importlib would not silence the IOError raised when trying to
write new bytecode when it was made read-only.
- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
which are part of a reference cycle.
- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
objects on 64-bit systems. Patch by Michael Broghton.
- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
modification is done through it. This fixes inconsistencies and test failures
on systems with slightly bogus mtime behaviour.
- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
from stdin so that existing input does not confuse it and lead to incorrect
entry or an IOError. It also properly flushes it afterwards to avoid the
terminal echoing the input afterwards on OSes such as Solaris.
- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
they accept an int or long as the second argument. Also fix buggy handling of
large arguments (those with coefficient longer than the current precision) in
shift and rotate.
- Issue #4750: Store the basename of the original filename in the gzip FNAME
header as required by RFC 1952.
- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
Distutils.
- Issue #7218: Fix test_site for win32, the directory comparison was done with
an uppercase.
- Issue #7205: Fix a possible deadlock when using a BZ2File object from
several threads at once.
- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
larger than emax.
- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
platforms, and assorted locale fixes by Derk Drukker.
- Issue #5833: Fix extra space character in readline completion with the GNU
readline library version 6.0.
- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
anachronisms in the code which were a relic of 1.5.2 compatibility.
- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
to look for it is the Content-Type header.
- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
builtin tokenizer.
- Issue #7048: Force Decimal.logb to round its result when that result is too
large to fit in the current precision.
- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
always result in NULL.
- Issue #5042: Structure sub-subclass does now initialize correctly with base
class positional arguments.
- Issue #6882: Import uuid creates zombies processes.
- Issue #6635: Fix profiler printing usage message.
- Issue #6856: Add a filter keyword argument to TarFile.add().
- Issue #6888: pdb's alias command was broken when no arguments were given.
- Issue #6857: Default format() alignment should be '>' for Decimal instances.
- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
NaN or raising InvalidContext. Also, fix infinite recursion in
long(Decimal('nan')).
- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
type specifier.
- Issue #6239: ctypes.c_char_p return value must return bytes.
- Issue #6838: Use a list to accumulate the value instead of repeatedly
concatenating strings in http.client's HTTPResponse._read_chunked providing a
significant speed increase when downloading large files servend with a
Transfer-Encoding of 'chunked'.
- Trying to import a submodule from a module that is not a package, ImportError
should be raised, not AttributeError.
- When the globals past to importlib.__import__() has __package__ set to None,
fall back to computing what __package__ should be instead of giving up.
- Raise a TypeError when the name of a module to be imported for
importlib.__import__ is not a string (was raising an AttributeError before).
- Allow the fromlist passed into importlib.__import__ to be any iterable.
- Have importlib raise ImportError if None is found in sys.modules.
- Issue #6054: Do not normalize stored pathnames in tarfile.
- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
payloads are now ordered by integer value rather than lexicographically.
- Issue #1356969: Add missing info methods in tix.HList.
- Issue #1522587: New constants and methods for the tix.Grid widget.
- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
- Issue #1119673: Do not override tkinter.Text methods when creating a
ScrolledText.
- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
and yview* methods.
- Issue #6629: Fix a data corruption issue in the new I/O library, which could
occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
"wb+" mode) after having buffered a certain amount of data for reading. This
bug was not present in the pure Python implementation.
- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
POP3.apop.
- Issue #2715: Remove remnants of Carbon.File from binhex module.
- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
digits in input, as recommended by the standard. Previously it was restricted
to accepting [0-9].
- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
DO/DONT correctly.
- Issue #1424152: Fix for http.client, urllib.request to support SSL while
working through proxy. Original patch by Christopher Li, changes made by
Senthil Kumaran.
- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
PyPycLoader inherit from this class and provide implementations in relation to
other methods required by the ABCs.
- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
the documentation said it did even though the code in PyLoader relied on the
abstract method required by ResourceLoader.
- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
to handle a comparison without loss of precision. Also add correct handling
of infinities and nans for comparisons with float.
- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
- Issue #6358: The exit status of a command started with os.popen() was reported
differently than it did with python 2.x.
- Issue #6323: The pdb debugger did not exit when running a script with a syntax
error.
- Issue #3392: The subprocess communicate() method no longer fails in select()
when file descriptors are large; communicate() now uses poll() when possible.
- Issue #6369: Fix an RLE decompression bug in the binhex module.
- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
- The deprecated function string.maketrans has been removed.
- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
sys.path.
- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
- The os.get_exec_path() function to return the list of directories that will be
searched for an executable when launching a subprocess was added.
- Issue #7481: When a threading.Thread failed to start it would leave the
instance stuck in initial state and present in threading.enumerate().
- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
and os.read system calls where appropriate.
- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
- Issue #6247: The argparse module has been added to the standard library.
- Issue #8235: _socket: Add the constant ``SO_SETFIB``. SO_SETFIB is a socket
option available on FreeBSD 7.1 and newer.
- Issue #9315: Fix for the trace module to record correct class name
for tracing methods.
Extension Modules
-----------------
- Issue #9959: Tweak formula used for computing math.log of an integer,
making it marginally more accurate for exact powers of 2.
- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
compared to other unix systems. In particular, os.getgroups() does not reflect
any changes made using os.setgroups() but basically always returns the same
information as the id command. os.getgroups() can now return more than 16
groups on MacOSX.
- Issue #6095: Make directory argument to os.listdir optional.
- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
struct.pack('>?')): if conversion to bool raised an exception then that
exception wasn't properly propagated on machines where char is unsigned.
- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
they contain instances of old-style classes.
- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
existing isinf and isnan functions.
- Issue #1578269: Implement os.symlink for Windows 6.0+. Patch by Jason
R. Coombs.
- In struct.pack, correctly propagate exceptions from computing the truth of an
object in the '?' format.
- Issue #9000: datetime.timezone objects now have eval-friendly repr.
- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
special methods.
- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
Prior to this change, timezone adjustment in utctimetuple() could produce
tm_year value of 0 or 10,000. Now an OverflowError is raised in these edge
cases.
- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
directive. When the ``%z`` directive is present in the format string, an
aware ``datetime`` object is returned with ``tzinfo`` bound to a
``datetime.timezone`` instance constructed from the parsed offset. If both
``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
name, but ``%Z`` data without ``%z`` is discarded.
- Issue #5094: The ``datetime`` module now has a simple concrete class
implementing ``datetime.tzinfo`` interface. Instances of the new class,
``datetime.timezone``, return fixed name and UTC offset from their
``tzname(dt)`` and ``utcoffset(dt)`` methods. The ``dst(dt)`` method always
returns ``None``. A class attribute, ``utc`` contains an instance
representing the UTC timezone. Original patch by Rafe Kaplan.
- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
includes documentation for the struct.Struct class.
- Issue #3129: Trailing digits in struct format string are no longer ignored.
For example, "1" or "ilib123" are now invalid formats and cause
``struct.error`` to be raised. Patch by Caleb Deveraux.
- Issue #7384: If the system readline library is linked against ncurses, the
curses module must be linked against ncurses as well. Otherwise it is not safe
to load both the readline and curses modules in an application.
- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
requiring a re-try in order to get the complete result.
- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
with an improved 'binary-split' algorithm that uses fewer multiplications and
allows many of the multiplications to be performed using plain C integer
arithmetic instead of PyLong arithmetic. Also uses a lookup table for small
arguments.
- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
overflow checks in the audioop module.
- Issue #8644: The accuracy of td.total_seconds() has been improved (by
calculating with integer arithmetic instead of float arithmetic internally):
the result is now always correctly rounded, and is equivalent to ``td /
timedelta(seconds=1)``.
- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
timedelta) are all supported.
- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
- Issue #8300: When passing a non-integer argument to struct.pack with any
integer format code, struct.pack first attempts to convert the non-integer
using its __index__ method. If that method is non-existent or raises
TypeError it goes on to try the __int__ method, as described below.
- Issue #8142: Update libffi to the 3.0.9 release.
- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
- Issue #6544: Fix a reference leak in the kqueue implementation's error
handling.
- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
msvcr100.dll is not a platform assembly anymore.
- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
- Issue #7078: Set struct.__doc__ from _struct.__doc__.
- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
- Issue #6877: It is now possible to link the readline extension to the libedit
readline emulation on OSX 10.5 or later.
- Issue #6848: Fix curses module build failure on OS X 10.6.
- Fix a segfault that could be triggered by expat with specially formed input.
- Issue #6561: '\d' in a regex now matches only characters with Unicode category
'Nd' (Number, Decimal Digit). Previously it also matched characters with
category 'No'.
- Issue #4509: Array objects are no longer modified after an operation failing
due to the resize restriction in-place when the object has exported buffers.
- Issue #2389: Array objects are now pickled in a portable manner.
- Expat: Fix DoS via XML document with malformed UTF-8 sequences
(CVE_2009_3560).
- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
could raise an incorrect RuntimeError about not holding the import lock. The
import lock is now reinitialized after fork.
- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
parameter on some platforms such as OS X.
- Build the ossaudio extension on GNU/kFreeBSD.
- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
the return value of QueryReflectionKey.
- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
Build
-----
- Use OpenSSL 1.0.0a on Windows.
- Issue #9280: Make sharedinstall depend on sharedmods.
- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
override the configure and makefile defaults, without deleting options the
user didn't intend to override. Developers should no longer need to specify
OPT or EXTRA_CFLAGS, although those variables are still present for
backward-compatibility.
- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
multiprocessing only.
- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
(Optimization was unintentionally turned on in gcc --with-pydebug builds as a
result of the issue #1628484 fix, combined with autoconf's strange choice of
default CFLAGS produced by AC_PROG_CC for gcc.)
- Issue #3646: It is now easily possible to install a Python framework into your
home directory on MacOSX, see Mac/README for more information.
- Issue #3928: os.mknod() now available in Solaris, also.
- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
give false warnings.
- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
anymore. It also forwards the LDFLAGS settings to the linker when building a
shared library.
- Issue #6716: Quote -x arguments of compileall in MSI installer. Exclude 2to3
tests from compileall.
- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
instead. Also disable caching of powers of 5.
- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
- Issue #6943: Use pkg-config to find the libffi headers when the
--with-system-ffi flag is used.
- Issue #7609: Add a --with-system-expat option that causes the system's expat
library to be used for the pyexpat module instead of the one included with
Python.
- Issue #7589: Only build the nis module when the correct header files are
found.
- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
- Issue #5792: Extend the short float repr support to x86 systems using
icc or suncc.
- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
correctly under gcc on x86-64. This fixes a reported problem with the
--with-tsc build on x86-64.
- Issue #6802: Fix build issues on MacOSX 10.6.
- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
- Issue #4601: 'make install' did not set the appropriate permissions on
directories.
- Issue #5390: Add uninstall icon independent of whether file extensions are
installed.
- Issue #7541: When using ``python-config`` with a framework install the
compiler might use the wrong library.
- python-config now supports multiple options on the same command line.
- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
- Issue #8510: Update to autoconf2.65.
Documentation
-------------
- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
to Doc/license.rst.
- Issue #9524: Document that two CTRL* signals are meant for use only
with os.kill.
- Issue #9255: Document that the 'test' package is meant for internal Python use
only.
- A small WSGI server was added as Tools/scripts/serve.py, and is used to
implement a local documentation server via 'make serve' in the doc directory.
- Updating `Using Python` documentation to include description of CPython's -J
and -X options.
- Document that importing a module that has None in sys.modules triggers an
ImportError.
- Issue #6556: Fixed the Distutils configuration files location explanation for
Windows.
- Update python manual page (options -B, -O0, -s, environment variables
PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
- Issue #8909: Added the size of the bitmap used in the installer created by
distutils' bdist_wininst. Patch by Anatoly Techtonik.
Tests
-----
- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
import lock was disabled.
- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
- Issue #7449: Skip test_socketserver if threading support is disabled.
- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
by a decompressor object without errors (it returns incomplete uncompressed
data).
- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
- Issue #8576: Remove use of find_unused_port() in test_smtplib and
test_multiprocessing. Patch by Paul Moore.
- Issue #7449: Fix many tests to support Python compiled without thread
support. Patches written by Jerry Seutter.
- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
SSL shutdowns.
- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
by Dave Malcolm.
- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
thread was previously started, most likely due to a platform bug.
- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
- Issue #8263: Now regrtest.py will report a failure if it receives a
KeyboardInterrupt (SIGINT).
- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
Unicode normalization cases.
- Issue #7783: test.support.open_urlresource invalidates the outdated files from
the local cache.
- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
effectively raised.
- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
TestCase for some tests: test_genericpath.CommonTest.
- Print platform information when running the whole test suite, or using the
--verbose flag.
- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
filesystem encoding.
- Issue #6292: for the moment at least, the test suite runs cleanly if python is
run with the -OO flag. Tests requiring docstrings are skipped.
- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
also used by regrtest to run all the tests in a temporary directory. The
original CWD is saved in `support.SAVEDCWD`. Thanks to Florent Xicluna who
helped with the patch.
- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
(only seen so far on platforms where the curses module wasn't built), due to
an uncleared exception.
- Issue #7728: test_timeout was changed to use support.bind_port instead of a
hard coded port.
- Issue #7376: Instead of running a self-test (which was failing) when called
with no arguments, doctest.py now gives a usage message.
- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
instead of a hardcoded port number in test_rapid_restart.
- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
in the Lib/test directory, which might be read-only for the user running the
tests.
- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
of an option with no handler.
- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
fails. Can be combined with -j.
- Issue #6551: test_zipimport could import and then destroy some modules of the
encodings package, which would make other tests fail further down the road
because the internally cached encoders and decoders would point to empty
global variables.
- Issue #7295: Do not use a hardcoded file name in test_tarfile.
- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
primitives such as Lock, RLock, Condition, Event and Semaphore.
- Issue #7248 (part 2): Use a unique temporary directory for importlib source
tests instead of tempfile.tempdir. This prevents the tests from sharing state
between concurrent executions on the same system.
- Issue #7248: In importlib.test.source.util a try/finally block did not make
sure that some referenced objects actually were created in the block before
calling methods on the object.
- Issue #7222: Make thread "reaping" more reliable so that reference
leak-chasing test runs give sensible results. The previous method of reaping
threads could return successfully while some Thread objects were still
referenced. This also introduces a new private function:
``_thread._count()``.
- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
runs the risk of causing the worker thread to fail.
- Issue #7055: test___all__ now greedily detects all modules which have an
__all__ attribute, rather than using a hardcoded and incomplete list.
- Issue #7058: Added save/restore for things like sys.argv and cwd to
runtest_inner in regrtest, with warnings if the called test modifies them, and
a new section in the summary report at the end.
- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
- Fixed tests in importlib.test.source.test_abc_loader that were masking the
proper exceptions that should be raised for missing or improper code object
bytecode.
- Removed importlib's custom test discovery code and switched to
unittest.TestLoader.discover().
Tools/Demos
-----------
- Issue #5464, #8974: Implement plural forms in msgfmt.py.
- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
added to the `Tools/` directory. They were previously living in the sandbox.
What's New in Python 3.1?
=========================
*Release date: 27-June-2009*
Core and Builtins
-----------------
- Issue #6334: Fix bug in range length calculation for ranges with
large arguments.
- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
because it wasn't recognized as a sequence).
Library
-------
- Issue #6126: Fixed pdb command-line usage.
- Issue #6314: logging: performs extra checks on the "level" argument.
- Issue #6274: Fixed possible file descriptors leak in subprocess.py
- Accessing io.StringIO.buffer now raises an AttributeError instead of
io.UnsupportedOperation.
- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
(On Unix)
- Issue #1202: zipfile module would cause a struct.error when attempting to
store files with a CRC32 > 2**31-1.
Extension Modules
-----------------
- Issue #5590: Remove unused global variable in pyexpat extension.
What's New in Python 3.1 Release Candidate 2?
=============================================
*Release date: 13-June-2009*
Core and Builtins
-----------------
- Fixed SystemError triggered by "range([], 1, -1)".
- Issue #5924: On Windows, a large PYTHONPATH environment variable
(more than 255 characters) would be completely ignored.
- Issue #4547: When debugging a very large function, it was not always
possible to update the lineno attribute of the current frame.
- Issue #5330: C functions called with keyword arguments were not reported by
the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
Library
-------
- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
expression string pattern was trying to match against a bytes returned by
Popen. Tested under win32 to build the py-postgresql project.
- Issue #6258: Support AMD64 in bdist_msi.
- Issue #6195: fixed doctest to no longer try to read 'source' data from
binary files.
- Issue #5262: Fixed bug in next rollover time computation in
TimedRotatingFileHandler.
- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
errors property. Additionally, the errors and encoding properties of StringIO
are always None now.
- Issue #6137: The pickle module now translates module names when loading
or dumping pickles with a 2.x-compatible protocol, in order to make data
sharing and migration easier. This behaviour can be disabled using the
new `fix_imports` optional argument.
- Removed the ipaddr module.
- Issue #3613: base64.{encode,decode}string are now called
base64.{encode,decode}bytes which reflects what type they accept and return.
The old names are still there as deprecated aliases.
- Issue #5767: Remove sgmlop support from xmlrpc.client.
- Issue #6150: Fix test_unicode on wide-unicode builds.
- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
parameters.
Windows
-------
- Issue #6221: Delete test registry key before running the test.
- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
C-API
-----
- Issue #5735: Python compiled with --with-pydebug should throw an
ImportError when trying to import modules compiled without
--with-pydebug, and vice-versa.
Build
-----
- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
added LIBS to OS X framework builds.
- Issue #5809: Specifying both --enable-framework and --enable-shared is
an error. Configure now explicitly tells you about this.
What's New in Python 3.1 release candidate 1?
=============================================
*Release date: 2009-05-30*
Core and Builtins
-----------------
- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
of the command line.
- Issue #6012: Add cleanup support to O& argument parsing.
- Issue #6089: Fixed str.format with certain invalid field specifiers
that would raise SystemError.
- Issue #5982: staticmethod and classmethod now expose the wrapped
function with __func__.
- Added support for multiple context managers in the same with-statement.
Deprecated contextlib.nested() which is no longer needed.
- Issue #5829: complex("1e500") no longer raises OverflowError. This
makes it consistent with float("1e500") and interpretation of real
and imaginary literals.
- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
- Issue #5994: the marshal module now has docstrings.
- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
(1) inf and nan strings with trailing whitespace were incorrectly
rejected; (2) parsing of strings representing infinities and nans
was locale aware; and (3) the interpretation of fromhex('-nan')
didn't match that of float('-nan').
Library
-------
- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
- Issue #6121: pydoc now ignores leading and trailing spaces in the
argument to the 'help' function.
- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
arguments for strings with a space in them.
- collections.namedtuple() was not working with the following field
names: cls, self, tuple, itemgetter, and property.
- In unittest, using a skipping decorator on a class is now equivalent to
skipping every test on the class. The ClassTestSuite class has been removed.
- Issue #6050: Don't fail extracting a directory from a zipfile if
the directory already exists.
- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
than an int, which makes some operations possible under 64-bit Linux (e.g.
DN_MULTISHOT with F_NOTIFY).
- Issue #5761: Add the name of the underlying file to the repr() of various
IO objects.
- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix
by Musashi Tamura, tests by Marcin Bachry.
- Issue #1983: Fix functions taking or returning a process identifier to use
the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
a process identifier type wider than the standard C integer type.
- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
Patch by Farhan Ahmad, test by Marcin Bachry.
- Issue #2116: Weak references and weak dictionaries now support copy()ing and
deepcopy()ing.
- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
- Issue #5918: Fix a crash in the parser module.
- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
library. This means, for example, that opening a UTF-16 text file in
append mode doesn't add a BOM at the end of the file if the file isn't
empty.
- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix
corrects a pydoc regression.
- Issue #5955: aifc's close method did not close the file it wrapped,
now it does. This also means getfp method now returns the real fp.
Installation
------------
- Issue #6047: fullinstall has been removed because Python 3's executable will
now be known as python3.
- Lib/smtpd.py is no longer installed as a script.
Extension Modules
-----------------
- Issue #3061: Use wcsftime for time.strftime where available.
- Issue #4873: Fix resource leaks in error cases of pwd and grp.
- Issue #6093: Fix off-by-one error in locale.strxfrm.
- The _functools and _locale modules are now built into the libpython shared
library instead of as extension modules.
Build
-----
- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
Clinton Roy.
Tests
-----
- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
tests on darwin even when the OS was installed on a case-sensitive
filesystem. Also fixed tests that should not be run when
sys.dont_write_bytecode is true.
What's New in Python 3.1 beta 1?
================================
*Release date: 2009-05-06*
Core and Builtins
-----------------
- Issue #5914: Add new C API function PyOS_string_to_double, and
deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
- Issue #3382: float.__format__, complex.__format__, and %-formatting
no longer map 'F' to 'f'. Because of issue #5859 (below), this only
affects nan -> NAN and inf -> INF.
- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
in all operations, including splitdrive, split, etc. splitunc() now issues
a PendingDeprecation warning.
- Issue #5920: For float.__format__, change the behavior with the
empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
to be like 'g' but with at least one decimal point and with a
default precision of 12. Previously, the behavior the same but with
a default precision of 6. This more closely matches str(), and
reduces surprises when adding alignment flags to the empty
presentation type. This also affects the new complex.__format__ in
the same way.
- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
- Issue #5890: in subclasses of 'property' the __doc__ attribute was
shadowed by classtype's, even if it was None. property now
inserts the __doc__ into the subclass instance __dict__.
- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
sequences. Patch by Nick Barnes and Victor Stinner.
- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
received a new method, detach(). detach() disconnects the underlying stream
from the buffer or text IO and returns it.
- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
floats with absolute value over 1e50. Also remove length
restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
12.34 no longer raise an exception.
- Issue #1588: Add complex.__format__. For example,
format(complex(1, 2./3), '.5') now produces a sensible result.
- Issue #5864: Fix empty format code formatting for floats so that it
never gives more than the requested number of significant digits.
- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
- Issue #5835: Deprecate PyOS_ascii_formatd.
- Issue #4971: Fix titlecase for characters that are their own
titlecase, but not their own uppercase.
- Issue #5283: Setting __class__ in __del__ caused a segfault.
- Issue #5816: complex(repr(z)) now recovers z exactly, even when
z involves nans, infs or negative zeros.
- Issue #3166: Make int -> float conversions correctly rounded.
- Issue #1869 (and many duplicates): make round(x, n) correctly
rounded for a float x, by using the decimal <-> binary conversions
from Python/dtoa.c. As a consequence, (e.g.) round(x, 2) now
consistently agrees with format(x, '.2f').
- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
some builtin types.
- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
- Issue #5515: str.format() type 'n' combined with commas and leading
zeros no longer gives odd results with ints and floats.
- Implement PEP 378, Format Specifier for Thousands Separator, for
floats.
- The str function switches to exponential notation at
1e11, not 1e12. This avoids printing 13 significant digits in
situations where only 12 of them are correct. Example problem
value: str(1e11 + 0.5). (This minor issue has existed in 2.x for a
long time.)
- Issue #1580: On most platforms, use a 'short' float repr: for a
finite float x, repr(x) now outputs a string based on the shortest
sequence of decimal digits that rounds to x. Previous behaviour was
to output 17 significant digits and then strip trailing zeros.
Another minor difference is that the new repr switches to
exponential notation at 1e16 instead of the previous 1e17; this
avoids misleading output in some cases.
There's a new sys attribute sys.float_repr_style, which takes
the value 'short' to indicate that we're using short float repr,
and 'legacy' if the short float repr isn't available for one
reason or another.
The float repr change involves incorporating David Gay's 'perfect
rounding' code into the Python core (it's in Python/dtoa.c). As a
secondary consequence, all string-to-float and float-to-string
conversions (including all float formatting operations) will be
correctly rounded on these platforms.
See issue #1580 discussions for details of platforms for which
this change does not apply.
- Issue #5759: float() didn't call __float__ on str subclasses.
- The string.maketrans() function is deprecated; there is a new static method
maketrans() on the bytes and bytearray classes. This removes confusion about
the types string.maketrans() is supposed to work with, and mirrors the
methods available on the str class.
- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
its clarity and its speed.
- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
to avoid compiler warnings.
- Issue #3739: The unicode-internal encoder now reports the number of characters
consumed like any other encoder (instead of the number of bytes).
Installation
------------
- Issue #5756: Install idle and pydoc with a 3 suffix.
Library
-------
- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
- Issue #5311: bdist_msi can now build packages that do not depend on a
specific Python version.
- Issue #5150: IDLE's format menu now has an option to strip trailing
whitespace.
- Issue #5940: distutils.command.build_clib.check_library_list was not doing
the right type checkings anymore.
- Issue #4875: On win32, ctypes.util.find_library does no longer
return directories.
- Issue #5142: Add the ability to skip modules while stepping to pdb.
- Issue #1309567: Fix linecache behavior of stripping subdirectories when
looking for files given by a relative filename.
- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
turtle demos in Demo/turtle.
- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
extracting a file to the root directory.
- Issue #5913: os.listdir() should fail for empty path on windows.
- Issue #5084: unpickling now interns the attribute names of pickled objects,
saving memory and avoiding growth in size of subsequent pickles. Proposal
and original patch by Jake McGuire.
- The json module now works exclusively with str and not bytes.
- Issue #3959: The ipaddr module has been added to the standard library.
Contributed by Google.
- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
error when a named pipe is encountered, rather than blocking infinitely.
- Issue #5857: tokenize.tokenize() now returns named tuples.
- Issue #4305: ctypes should now build again on mipsel-linux-gnu
- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
string is already in normalized form, by performing a quick check beforehand.
Original patch by Rauli Ruohonen.
- Issue #5853: calling a function of the mimetypes module from several threads
at once could hit the recursion limit if the mimetypes database hadn't been
initialized before.
- Issue #5854: Updated __all__ to include some missing names and remove some
names which should not be exported.
- Issue #3102: All global symbols that the _ctypes extension defines
are now prefixed with 'Py' or '_ctypes'.
- Issue #5041: ctypes does now allow pickling wide character.
- Issue #5812: For the two-argument form of the Fraction constructor,
Fraction(m, n), m and n are permitted to be arbitrary Rational
instances.
- Issue #5812: Fraction('1e6') is valid: more generally, any string
that's valid for float() is now valid for Fraction(), with the
exception of strings representing NaNs and infinities.
- Issue #5734: BufferedRWPair was poorly tested and had several glaring
bugs. Patch by Brian Quinlan.
- Issue #1161031: fix readwrite select flag handling: POLLPRI now
results in a handle_expt_event call, not handle_read_event, and POLLERR
and POLLNVAL now call handle_close, not handle_expt_event. Also,
dispatcher now has an 'ignore_log_types' attribute for suppressing
log messages, which is set to 'warning' by default.
- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
new arguments introduced in 2.5.
- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
makeunicodedata.py and regenerated the Unicode database (This fixes
u'\u1d79'.lower() == '\x00').
Extension Modules
-----------------
- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
pwd.
- Issue #5463: In struct module, remove deprecated float coercion
for integer type codes: struct.pack('L', 0.3) should now raise
an error. The _PY_STRUCT_FLOAT_COERCE constant has been removed.
The version number has been bumped to 0.3.
- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
using Berkeley DB.
Tests
-----
- Issue #5354: New test support function import_fresh_module() makes
it easy to import both normal and optimised versions of modules.
test_heapq and test_warnings have been adjusted to use it, tests for
other modules with both C and Python implementations in the stdlib
can be adjusted to use it over time.
- Issue #5837: Certain sequences of calls to set() and unset() for
support.EnvironmentVarGuard objects restored the environment variables
incorrectly on __exit__.
C-API
-----
- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
What's New in Python 3.1 alpha 2?
=================================
*Release date: 2009-4-4*
Core and Builtins
-----------------
- Implement PEP 378, Format Specifier for Thousands Separator, for
integers.
- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
- Issue #5499: The 'c' code for argument parsing functions now only accepts a
byte, and the 'C' code only accepts a unicode character.
- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
when hitting the recursion limit under certain circumstances.
- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
- Fix a segfault when running test_exceptions with coverage, caused by
insufficient checks in accessors of Exception.__context__.
- Issue #5604: non-ASCII characters in module name passed to
imp.find_module() were converted to UTF-8 while the path is
converted to the default filesystem encoding, causing nonsense.
- Issue #5126: str.isprintable() returned False for space characters.
- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
the end sys.path, for compatibility with the system install of Python.
- Issue #4688: Add a heuristic so that tuples and dicts containing only
untrackable objects are not tracked by the garbage collector. This can
reduce the size of collections and therefore the garbage collection overhead
on long-running programs, depending on their particular use of datatypes.
- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
improve its performance. Long divisions and remainder operations
are now between 50% and 150% faster.
- Issue #4258: Make it possible to use base 2**30 instead of base
2**15 for the internal representation of integers, for performance
reasons. Base 2**30 is enabled by default on 64-bit machines. Add
--enable-big-digits option to configure, which overrides the
default. Add sys.int_info structseq to provide information about
the internal format.
- Issue #4474: PyUnicode_FromWideChar now converts characters outside
the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
and sizeof(Py_UNICODE) == 2.
- Issue #5237: Allow auto-numbered fields in str.format(). For
example: '{} {}'.format(1, 2) == '1 2'.
- Issue #5392: when a very low recursion limit was set, the interpreter would
abort with a fatal error after the recursion limit was hit twice.
- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
short file names.
Library
-------
- Issue #2625: added missing items() call to the for loop in
mailbox.MH.get_message().
- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
error substitutions from non-strict codec error callbacks in
incrementalencoder and StreamWriter.
- Issue #5656: Fix the coverage reporting when running the test suite with
the -T argument.
- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
- Issue #5624: Fix the _winreg module name still used in several modules.
- Issue #5628: Fix io.TextIOWrapper.read() with an unreadable buffer.
- Issue #5619: Multiprocessing children disobey the debug flag and causes
popups on windows buildbots. Patch applied to work around this issue.
- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
- Issue #5387: Fixed mmap.move crash by integer overflow.
- Issue #5261: Patch multiprocessing's semaphore.c to support context
manager use: "with multiprocessing.Lock()" works now.
- Issue #5236: Change time.strptime() to only take strings. Didn't work with
bytes already but the failure was non-obvious.
- Issue #5177: Multiprocessing's SocketListener class now uses
socket.SO_REUSEADDR on all connections so that the user no longer needs
to wait 120 seconds for the socket to expire.
- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
- Issue #1174606: Calling read() without arguments of an unbounded file
(typically /dev/zero under Unix) could crash the interpreter.
- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
io.BufferedRandom have been deprecated for removal in Python 3.2.
- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
forever on incomplete input. That caused tarfile.open() to hang when used
with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
partial bzip2 compressed data.
- Issue #2110: Add support for thousands separator and 'n' type
specifier to Decimal.__format__
- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
'>' alignment characters.
- The error detection code in FileIO.close() could fail to reflect the `errno`
value, and report it as -1 instead.
- Issue #5016: FileIO.seekable() could return False if the file position
was negative when truncated to a C int. Patch by Victor Stinner.
Extension Modules
-----------------
- Issue #5391: mmap now deals exclusively with bytes.
- Issue #5463: In struct module, remove deprecated overflow wrapping
when packing an integer: struct.pack('=L', -1) now raises
struct.error instead of returning b'\xff\xff\xff\xff'. The
_PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
have been removed from the struct module.
What's New in Python 3.1 alpha 1
================================
*Release date: 2009-03-07*
Core and Builtins
-----------------
- The io module has been reimplemented in C for speed.
- Give dict views an informative __repr__.
- Issue #5247: Improve error message when unknown format codes are
used when using str.format() with str, int, and float arguments.
- Issue #5249: time.strftime returned malformed string when format string
contained non ascii character on windows.
- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
source has already been decoded into str.
- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
rotating the object pointer by 4 bits to the right.
- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
it now forces its argument to double before testing for infinity.
- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
returns a non-number type.
- Issue #5182: Removed memoryview.__str__.
- Issue #1717: Removed builtin cmp() function, dropped tp_compare
slot, the C API functions PyObject_Compare and PyUnicode_Compare and
the type definition cmpfunc. The tp_compare slot has been renamed
to tp_reserved, and is reserved for future usage.
- Issue #1242657: the __len__() and __length_hint__() calls in several tools
were suppressing all exceptions. These include list() and bytearray().
- Issue #4707: round(x, n) now returns an integer if x is an integer.
Previously it returned a float.
- Issue #4753: By enabling a configure option named '--with-computed-gotos'
on compilers that support it (notably: gcc, SunPro, icc), the bytecode
evaluation loop is compiled with a new dispatch mechanism which gives
speedups of up to 20%, depending on the system, on various benchmarks.
- Issue #4874: Most builtin decoders now reject unicode input.
- Issue #4842: Don't allow trailing 'L' when constructing an integer
from a string.
- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
- Issue #4838: When a module is deallocated, free the memory backing the
optional module state data.
- Issue #4910: Rename nb_long slot to nb_reserved, and change its
type to ``(void *)``.
- Issue #4935: The overflow checking code in the expandtabs() method common
to str, bytes and bytearray could be optimized away by the compiler, letting
the interpreter segfault instead of raising an error.
- Issue #3720: Fix a crash when an iterator modifies its class and removes its
__next__ method.
- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
function no longer attempt to call the __long__ slot to convert an object
to an integer. Only the __int__ and __trunc__ slots are examined.
- Issue #4893: Use NT threading on CE.
- Issue #4915: Port sysmodule to Windows CE.
- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
common cases are optimized thanks to a dedicated fast path and a moderate
amount of loop unrolling.
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
collecting the oldest generation) so that allocating lots of objects without
destroying them does not show quadratic performance. Based on a proposal by
Martin von Löwis at
http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
- Issue #4604: Some objects of the I/O library could still be used after
having been closed (for instance, a read() call could return some
previously buffered data). Patch by Dmitry Vasiliev.
- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
flag to work properly. Furthermore, when specifying -u, the text stdout
and stderr streams have line-by-line buffering enabled (the default being
to buffer arbitrary chunks of data).
- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
instead of ints (reducing its size from 4 to 8 times thereby reducing
Python's overall memory).
- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
an existing .py counterpart, override the co_filename attributes of all
code objects if the original filename is obsolete (which can happen if the
file has been renamed, moved, or if it is accessed through different paths).
Patch by Ziga Seilnacht and Jean-Paul Calderone.
- Issue #4580: Fix slicing of memoryviews when the item size is greater than
one byte. Also fixes the meaning of len() so that it returns the number of
items, rather than the size in bytes.
- Issue #4075: Use OutputDebugStringW in Py_FatalError.
- Issue #4747: When the terminal does not use utf-8, executing a script with
non-ascii characters in its name could fail with a "SyntaxError: None" error.
- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
to open file with a bytes filename on Windows.
- Issue #3680: Reference cycles created through a dict, set or deque iterator
did not get collected.
- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
where the tp_hash and tp_dict slots are both NULL.
- Issue #4759: None is now allowed as the first argument of
bytearray.translate(). It was always allowed for bytes.translate().
- Added test case to ensure attempts to read from a file opened for writing
fail.
- Issue #3106: Speedup some comparisons (str/str and int/int).
- Issue #2183: Simplify and optimize bytecode for list, dict and set
comprehensions. Original patch for list comprehensions by Neal Norwitz.
- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
print elapsed times, not only when some objects are uncollectable /
unreachable. Original patch by Neil Schemenauer.
- Issue #3439: Add a bit_length method to int.
- Issue #2173: When getting device encoding, check that return value of
nl_langinfo is not the empty string. This was causing silent build
failures on OS X.
- Issue #4597: Fixed several opcodes that weren't always propagating
exceptions.
- Issue #4589: Fixed exception handling when the __exit__ function of a
context manager returns a value that cannot be converted to a bool.
- Issue #4445: Replace "sizeof(PyBytesObject)" with
"offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
bytes instances. On a typical machine this saves 3 bytes of memory
(on average) per allocation of a bytes instance.
- Issue #4533: File read operation was dreadfully slow due to a slowly
growing read buffer. Fixed by using the same growth rate algorithm as
Python 2.x.
- Issue #4509: Various issues surrounding resize of bytearray objects to
which there are buffer exports (e.g. memoryview instances).
- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
method on file objects with closefd=False. The file descriptor is still
kept open but the file object behaves like a closed file. The ``FileIO``
object also got a new readonly attribute ``closefd``.
- Issue #4569: Interpreter crash when mutating a memoryview with an item size
larger than 1.
- Issue #4748: Lambda generators no longer return a value.
- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
PyUnicode_DecodeUTF8() once, remember the result and output it in a second
step. This avoids problems with counting UTF-8 bytes that ignores the effect
of using the replace error handler in PyUnicode_DecodeUTF8().
Library
-------
- Issue #7071: byte-compilation in Distutils is now done with respect to
sys.dont_write_bytecode.
- Issue #7066: archive_util.make_archive now restores the cwd if an error is
raised. Initial patch by Ezio Melotti.
- Issue #6516: Added owner/group support when creating tar archives in
Distutils.
- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
- Issue #6163: Fixed HP-UX runtime library dir options in
distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
Michael Haubenwallner.
- Issue #6693: New functions in site.py to get user/global site packages paths.
- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
opening an empty or very small file.
- Issue #6545: Removed assert statements in distutils.Extension, so the
behavior is similar when used with -O.
- unittest has been split up into a package. All old names should still work.
- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
uses the same refactored function to get gcc/ld/dllwrap versions numbers.
It's `distutils.util.get_compiler_versions`. Added deprecation warnings
for the obsolete get_versions() functions.
- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
- Issue #6314: logging: Extra checks on the "level" argument in more places.
- Issue #2622: Fixed an ImportError when importing email.message from a
standalone application built with py2exe or py2app.
- Issue #6455: Fixed test_build_ext under win32.
- Issue #6377: Enabled the compiler option, and deprecate its usage as an
attribute.
- Issue #6413: Fixed the log level in distutils.dist for announce.
- Issue #6403: Fixed package path usage in build_ext.
- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
descriptor errors
- Issue #6365: Distutils build_ext inplace mode was copying the compiled
extension in a subdirectory if the extension name had dots.
- Issue #6164: Added an AIX specific linker argument in Distutils
unixcompiler. Original patch by Sridhar Ratnakumar.
- Issue #6286: Now Distutils upload command is based on urllib2 instead of
httplib, allowing the usage of http_proxy.
- Issue #6287: Added the license field in Distutils documentation.
- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
in Makefiles. This prevents compile errors when using syntax like:
`LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
- Issue #6131: test_modulefinder leaked when run after test_distutils.
Patch by Hirokazu Yamamoto.
- Issue #6048: Now Distutils uses the tarfile module in archive_util.
- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
and tests on pywin32 by Tim Golden.
- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
- Issue #6046: Fixed the library extension when distutils build_ext is used
inplace. Initial patch by Roumen Petrov.
- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
subcommand.
- Issue #6022: a test file was created in the current working directory by
test_get_outputs in Distutils.
- Issue #5977: distutils build_ext.get_outputs was not taking into account the
inplace option. Initial patch by kxroberto.
- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
for old-style extensions.
- Issue #5976: Fixed Distutils test_check_environ.
- Issue #5941: Distutils build_clib command was not working anymore because
of an incomplete customization of the archiver command. Added ARFLAGS in the
Makefile besides AR and make Distutils use it. Original patch by David
Cournapeau.
- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
anymore.
- Issue #5810: Fixed Distutils test_build_scripts so it uses
sysconfig.get_config_vars.
- Issue #4951: Fixed failure in test_httpservers.
- Issue #5795: Fixed test_distutils failure on Debian ppc.
- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
a value in SafeConfigParser.
- Issue #5732: added a new command in Distutils: check.
- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
platforms. Initial patch by Paul Moore.
- Issue #5095: Added bdist_msi to the list of bdist supported formats.
Initial fix by Steven Bethard.
- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
Initial fix by Wayne Davison.
- Issue #5694: removed spurious test output in Distutils (test_clean).
- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
- Issue #1665206 (partially): Move imports in cgitb to the top of the module
instead of performing them in functions. Helps prevent import deadlocking in
threads.
- Issue #2522: locale.format now checks its first argument to ensure it has
been passed only one pattern, avoiding mysterious errors where it appeared
that it was failing to do localization.
- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
Brandl.
- Issue #1222: locale.format() bug when the thousands separator is a space
character.
- Issue #5472: Fixed distutils.test_util tear down. Original patch by
Tim Golden.
- collections.deque() objects now have a read-only attribute called maxlen.
- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
it is has been populated and properly configured in order to prevent
window flashing.
- Issue #4792: Prevent a segfault in _tkinter by using the
guaranteed to be safe interp argument given to the PythonCmd in place of
the Tcl interpreter taken from a PythonCmd_ClientData.
- Issue #5193: Guarantee that tkinter.Text.search returns a string.
- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
Original patch by Akira Kitada.
- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
- Issue #5385: Fixed mmap crash after resize failure on windows.
- Issue #5179: Fixed subprocess handle leak on failure on windows.
- PEP 372: Added collections.OrderedDict().
- The _asdict() for method for namedtuples now returns an OrderedDict().
- configparser now defaults to using an ordered dictionary.
- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
import guess_extension`` was used.
- Issue #1733986: Fixed mmap crash in accessing elements of second map object
with same tagname but larger size than first map. (Windows)
- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
overrun.
- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
bdist_rpm command.
- Issue #5378: added --quiet option to Distutils bdist_rpm command.
- Issue #5052: make Distutils compatible with 2.3 again.
- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
in Distutils tests.
- Issue #5287: Add exception handling around findCaller() call to help out
IronPython.
- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
The file was resized to wrong size.
- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
- Issue #2279: distutils.sdist.add_defaults now add files
from the package_data and the data_files metadata.
- Issue #5257: refactored all tests in distutils, so they use
support.TempdirManager, to avoid writing in the tests directory.
- Issue #4524: distutils build_script command failed with --with-suffix=3.
Initial patch by Amaury Forgeot d'Arc.
- Issue #2461: added tests for distutils.util
- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
which inherited from numbers.py which did not have __slots__ defined. The
numbers hierarchy now has its own __slots__ declarations.
- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
encoding.
- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
under NT and OS2. Patch by Philip Jenvey.
- Issue #5128: Make compileall properly inspect bytecode to determine if needs
to be recreated. This avoids a timing hole thanks to the old reliance on the
ctime of the files involved.
- Issue #5122: Synchronize tk load failure check to prevent a potential
deadlock.
- Issue #1818: collections.namedtuple() now supports a keyword argument
'rename' which lets invalid fieldnames be automatically converted to
positional names in the form, _1, _2, ...
- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
public documented method ``ZipImporter.get_filename()``.
- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
the execution of packages by looking for and executing a ``__main__``
submodule when a package name is supplied. Initial patch by Andi
Vajda.
- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
Tkapp_Call when calling from a thread different than the one that created
the Tcl interpreter. Patch by Robert Hancock.
- Issue #4285: Change sys.version_info to be a named tuple. Patch by
Ross Light.
- Issue #1520877: Now distutils.sysconfig reads $AR from the
environment/Makefile. Patch by Douglas Greiman.
- Issue #1276768: The verbose option was not used in the code of
distutils.file_util and distutils.dir_util.
- Issue #5132: Fixed trouble building extensions under Solaris with
--enabled-shared activated. Initial patch by Dave Peterson.
- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
- The shelve module now defaults to pickle protocol 3.
- Fix a bug in the trace module where a bytes object from co_lnotab had its
items being passed through ord().
- Issue #2047: shutil.move() could believe that its destination path was
inside its source path if it began with the same letters (e.g. "src" vs.
"src.new").
- Added the ttk module. See issue #2983: Ttk support for Tkinter.
- Removed isSequenceType(), isMappingType, and isNumberType() from the
operator module; use the abstract base classes instead. Also removed
the repeat() function; use mul() instead.
- Issue #5021: doctest.testfile() did not create __name__ and
collections.namedtuple() relied on __name__ being defined.
- Backport importlib from Python 3.1. Only the import_module() function has
been backported to help facilitate transitions from 2.7 to 3.1.
- Issue #1885: distutils. When running sdist with --formats=tar,gztar
the tar file was overridden by the gztar one.
- Issue #4863: distutils.mwerkscompiler has been removed.
- Added a new itertools functions: combinations_with_replacement()
and compress().
- Issue #5032: added a step argument to itertools.count() and
allowed non-integer arguments.
- Fix and properly document the multiprocessing module's logging
support, expose the internal levels and provide proper usage
examples.
- Issue #1672332: fix unpickling of subnormal floats, which was
producing a ValueError on some platforms.
- Issue #3881: Help Tcl to load even when started through the
unreadable local symlink to "Program Files" on Vista.
- Issue #4710: Extract directories properly in the zipfile module;
allow adding directories to a zipfile.
- Issue #3807: _multiprocessing build fails when configure is passed
--without-threads argument. When this occurs, _multiprocessing will
be disabled, and not compiled.
- Issue #5008: When a file is opened in append mode with the new IO library,
do an explicit seek to the end of file (so that e.g. tell() returns the
file size rather than 0). This is consistent with the behaviour of the
traditional 2.x file object.
- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
parameter was set.
- Issue #4842: Always append a trailing 'L' when pickling longs using
pickle protocol 0. When reading, the 'L' is optional.
- Add the importlib package.
- Issue #4301: Patch the logging module to add processName support, remove
_check_logger_class from multiprocessing.
- Issue #3325: Remove python2.x try: except: imports for old cPickle from
multiprocessing.
- Issue #4959: inspect.formatargspec now works for keyword only arguments
without defaults.
- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
for Unix machines for negative handles and large int handles. Without this check
it is possible to segfault the interpreter.
- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
in sharedctypes.py.
- Issue #1225107: inspect.isclass() returned True for instances with a custom
__getattr__.
- Issue #3826 and #4791: The socket module now closes the underlying socket
appropriately when it is being used via socket.makefile() objects
rather than delaying the close by waiting for garbage collection to do it.
- Issue #1696199: Add collections.Counter() for rapid and convenient
counting.
- Issue #3860: GzipFile and BZ2File now support the context management protocol.
- Issue #4867: Fixed a crash in ctypes when passing a string to a
function without defining argtypes.
- Issue #4272: Add an optional argument to the GzipFile constructor to override
the timestamp in the gzip stream. The default value remains the current time.
The information can be used by e.g. gunzip when decompressing. Patch by
Jacques Frechet.
- Restore Python 2.3 compatibility for decimal.py.
- Issue #3638: Remove functions from _tkinter module level that depend on
TkappObject to work with multiple threads.
- Issue #4718: Adapt the wsgiref package so that it actually works with
Python 3.x, in accordance with the `official amendments of the spec
<http://www.wsgi.org/wsgi/Amendments_1.0>`_.
- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
to the decimal module.
- Fractions.from_float() no longer loses precision for integers too big to
cast as floats.
- Issue #4812: add missing underscore prefix to some internal-use-only
constants in the decimal module. (Dec_0 becomes _Dec_0, etc.)
- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
did unnecessary work in the common case where no key function was specified.
- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
the function is not a generator.
- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
- Issue #4646: distutils was choking on empty options arg in the setup
function. Original patch by Thomas Heller.
- Issue #3767: Convert Tk object to string in tkColorChooser.
- Issue #3248: Allow placing ScrolledText in a PanedWindow.
- Issue #4444: Allow assertRaises() to be used as a context handler, so that
the code under test can be written inline if more practical.
- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
works as expected in the interactive environment.
- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
Gabriel Genellina.
- Issue #4574: reading a UTF16-encoded text file crashes if \r on 64-char
boundary.
- Issue #4223: inspect.getsource() will now correctly display source code
for packages loaded via zipimport (or any other conformant PEP 302
loader). Original patch by Alexander Belopolsky.
- Issue #4201: pdb can now access and display source code loaded via
zipimport (or any other conformant PEP 302 loader). Original patch by
Alexander Belopolsky.
- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
302 conformant loader) will now work correctly in most cases (they
are still subject to the constraints that exist for all code running
from inside a module loaded via a PEP 302 loader and attempting to
perform IO operations based on __file__). Original patch by
Alexander Belopolsky.
- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
allows backporting to maintenance branches. Original patch by
Alexander Belopolsky.
- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
a non-ASCII letter.
- Issue #4616: TarFile.utime(): Restore directory times on Windows.
- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
codec cannot be found. This is for compatibility with the builtin behavior.
- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
give correct results in the case where one argument is a quiet NaN
and the other is a finite number that requires rounding.
- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
libs.
- Added the subprocess.check_call_output() convenience function to get output
from a subprocess on success or raise an exception on error.
- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
support unusual filenames (such as those containing semi-colons) in
Content-Disposition headers.
- Issue #4384: Added logging integration with warnings module using
captureWarnings(). This change includes a NullHandler which does nothing;
it will be of use to library developers who want to avoid the "No handlers
could be found for logger XXX" message which can appear if the library user
doesn't configure logging.
- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
exception.
- Issue #4529: fix the parser module's validation of try-except-finally
statements.
- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
not a malformed option.
- Added the subprocess.check_output() convenience function to get output
from a subprocess on success or raise an exception on error.
- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
the corresponding tests now pass.
- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
it was calling the wrong open() function.
- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
support unusual filenames (such as those containing semi-colons) in
Content-Disposition headers.
- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
- Issue #5104: The socket module now raises OverflowError when 16-bit port and
protocol numbers are supplied outside the allowed 0-65536 range on bind()
and getservbyport().
- Windows locale mapping updated to Vista.
Tools/Demos
-----------
- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
and make it 2.6-compatible.
- Ttk demos added in Demo/tkinter/ttk/
- Issue #4677: add two list comprehension tests to pybench.
Build
-----
- Issue #6094: Build correctly with Subversion 1.7.
- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
linker, rather than always exit successfully. Patch by Floris Bruynooghe.
- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
the order that backends for the dbm extension are checked.
- Link the shared python library with $(MODLIBS).
- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
- Issue #4895: Use _strdup on Windows CE.
- Issue #4472: "configure --enable-shared" now works on OSX
- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
- Issue #4289: Remove Cancel button from AdvancedDlg.
- Issue #1656675: Register a drop handler for .py* files on Windows.
- Issue #4120: Exclude manifest from extension modules in VS2008.
- Issue #4091: Install pythonxy.dll in system32 again.
- Issue #4018: Disable "for me" installations on Vista.
- Issue #3758: Add ``patchcheck`` build target to .PHONY.
- Issue #4204: Fixed module build errors on FreeBSD 4.
C-API
-----
- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
NUL: Bogus TypeError detail string.
- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
for negative arguments. Previously, it raised TypeError.
- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
the GIL is released, or owned by another thread.
- Issue #4122: On Windows, fix a compilation error when using the
Py_UNICODE_ISSPACE macro in an extension module.
Extension Modules
-----------------
- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
supporting objects as input no matter how it was compiled (built in
implementations or external openssl library).
- Issue #4397: Fix occasional test_socket failure on OS X.
- Issue #4279: Fix build of parsermodule under Cygwin.
- Issue #4751: hashlib now releases the GIL when hashing large buffers
(with a hardwired threshold of 2048 bytes), allowing better parallelization
on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
- Issue #4738: Each zlib object now has a separate lock, allowing several streams
to be compressed or decompressed at once on multi-CPU systems. Also, the GIL
is now released when computing the CRC of a large buffer. Patch by ebfe.
- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
OpenBSD.
- Issue #4583: array.array would not always prohibit resizing when a buffer
has been exported, resulting in an interpreter crash when accessing the
buffer.
- Issue #5228: Make functools.partial objects can now be pickled.
Tests
-----
- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
regression tests in parallel, shortening the total runtime.
- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
the same behaviour as test_ttkguionly (and now also test_tk) which is to
skip the tests if DISPLAY is defined but can't be used.
- regrtest no longer treats ImportError as equivalent to SkipTest. Imports
that should cause a test to be skipped are now done using import_module
from test support, which does the conversion.
- Issue #5083: New 'gui' resource for regrtest.
Docs
----
What's New in Python 3.0 final
==============================
*Release date: 03-Dec-2008*
Core and Builtins
-----------------
- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
interpreter to abort ("Fatal Python error: Could not reset the stack!")
instead of throwing a MemoryError.
- Issue #3689: The list reversed iterator now supports __length_hint__
instead of __len__. Behavior now matches other reversed iterators.
- Issue #4367: Python would segfault during compiling when the unicodedata
module couldn't be imported and \N escapes were present.
- Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
Library
-------
- Issue #4387: binascii now refuses to accept str as binary input.
- Issue #4073: Add 2to3 support to build_scripts, refactor that support
in build_py.
- IDLE would print a "Unhandled server exception!" message when internal
debugging is enabled.
- Issue #4455: IDLE failed to display the windows list when two windows have
the same title.
- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
exception.
- Issue #4433: Fixed an access violation when garbage collecting
_ctypes.COMError instances.
- Issue #4429: Fixed UnicodeDecodeError in ctypes.
- Issue #4373: Corrected a potential reference leak in the pickle module and
silenced a false positive ref leak in distutils.tests.test_build_ext.
- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
files.
- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
fail to properly display the error message.
Build
-----
- Issue #4407: Fix source file that caused the compileall step in Windows installer
to fail.
Docs
----
- Issue #4449: Fixed multiprocessing examples
- Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
for keys and values which will be converted to bytes before committal.
What's New in Python 3.0 release candidate 3?
=============================================
*Release date: 20-Nov-2008*
Core and Builtins
-----------------
- Issue #4349: sys.path included a non-existent platform directory because of a
faulty Makefile.
- Issue #3327: Don't overallocate in the modules_by_index list.
- Issue #1721812: Binary set operations and copy() returned the input type
instead of the appropriate base type. This was incorrect because set
subclasses would be created without their __init__() method being called.
The corrected behavior brings sets into line with lists and dicts.
- Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates to
True, even when x doesn't compare equal to itself. This was a regression
from 2.6.
- Issue #3705: Command-line arguments were not correctly decoded when the
terminal does not use UTF8.
Library
-------
- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
the ctypes module is not present.
- FileIO's mode attribute now always includes ``"b"``.
- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String
keys are now written out in UTF-8.
- Issue #4338: Fix distutils upload command.
- Issue #4354: Fix distutils register command.
- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
- Issue #4307: The named tuple that ``inspect.getfullargspec()`` returns now
uses ``kwonlydefaults`` instead of ``kwdefaults``.
- Issue #4298: Fix a segfault when pickle.loads is passed ill-formed input.
- Issue #4283: Fix a left-over "iteritems" call in distutils.
Build
-----
- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
- Issue #4289: Remove Cancel button from AdvancedDlg.
- Issue #1656675: Register a drop handler for .py* files on Windows.
Tools/Demos
-----------
- Demos of the socketserver module now work with Python 3.
What's New in Python 3.0 release candidate 2
============================================
*Release date: 05-Nov-2008*
Core and Builtins
-----------------
- Issue #4211: The __path__ attribute of frozen packages is now a list instead
of a string as required by PEP 302.
- Issue #3727: Fixed poplib.
- Issue #3714: Fixed nntplib by using bytes where appropriate.
- Issue #1210: Fixed imaplib and its documentation.
- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
method on file objects with closefd=False. The file descriptor is still
kept open but the file object behaves like a closed file. The ``FileIO``
object also got a new readonly attribute ``closefd``.
- Issue #3626: On cygwin, starting python with a non-existent script name
would not display anything if the file name is only 1 character long.
- Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
method does not return iterators for the 4th and 5th items.
- Issue #3723: Fixed initialization of subinterpreters.
- Issue #4213: The file system encoding is now normalized by the
codec subsystem, for example UTF-8 is turned into utf-8.
- Issue #4200: Changed the atexit module to store its state in its
PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
- Issue #4237: io.FileIO() was raising invalid warnings caused by
insufficient initialization of PyFileIOObject struct members.
- Issue #4170: Pickling a collections.defaultdict object would crash the
interpreter.
- Issue #4146: Compilation on OpenBSD has been restored.
- Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
- Issues #2384 and #3975: Tracebacks were not correctly printed when the
source file contains a ``coding:`` header: the wrong line was displayed, and
the encoding was not respected.
- Issue #3740: Null-initialize module state.
- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
- Issue #1688: On Windows, the input() prompt was not correctly displayed if it
contains non-ascii characters.
- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
Library
-------
- Issue #3664: The pickle module could segfault if a subclass of Pickler fails
to call the base __init__ method.
- Issue #3725: telnetlib now works completely in bytes.
- Issue #4072: Restore build_py_2to3.
- Issue #4014: Don't claim that Python has an Alpha release status, in addition
to claiming it is Mature.
- Issue #3187: Add sys.setfilesystemencoding.
- Issue #3187: Better support for "undecodable" filenames. Code by Victor
Stinner, with small tweaks by GvR.
- Issue #3965: Allow repeated calls to turtle.Screen, by making it a
true singleton object.
- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
raise a TypeError: "'tuple' object is not callable" instead of the expected
dbm.error.
- Bug #3884: Make the turtle module toplevel again.
- Issue #3547: Fixed ctypes structures bitfields of varying integer
sizes.
Extension Modules
-----------------
- Issue #3659: Subclasses of str didn't work as SQL parameters.
Build
-----
- Issue #4120: Exclude manifest from extension modules in VS2008.
- Issue #4091: Install pythonxy.dll in system32 again.
- Issue #4018: Disable "for me" installations on Vista.
- Issue #4204: Fixed module build errors on FreeBSD 4.
Tools/Demos
-----------
- Issue #3717: Fix Demo/embed/demo.c.
- Issue #4072: Add a distutils demo for build_py_2to3.
What's New in Python 3.0 release candidate 1
============================================
*Release date: 17-Sep-2008*
Core and Builtins
-----------------
- Issue #3827: memoryview lost its size attribute in favor of using len(view).
- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
- Issue #3705: fix crash when given a non-ascii value on the command line for
the "-c" and "-m" parameters. Now the behaviour is as expected under Linux,
although under Windows it fails at a later point.
- Issue #3279: Importing site at interpreter was failing silently because the
site module uses the open builtin which was not initialized at the time.
- Issue #3660: Corrected a reference leak in str.encode() when the encoder
does not return a bytes object.
- Issue #3774: Added a few more checks in PyTokenizer_FindEncoding to handle
error conditions.
- Issue #3594: Fix Parser/tokenizer.c:fp_setreadl() to open the file being
tokenized by either a file path or file pointer for the benefit of
PyTokenizer_FindEncoding().
- Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin. On
these systems, the mbstowcs() function is slightly buggy and must be
replaced with strlen() for the purpose of counting of number of wide
characters needed to represent the multi-byte character string.
- Issue #3697: "Fatal Python error: Cannot recover from stack overflow"
could be easily encountered under Windows in debug mode when exercising
the recursion limit checking code, due to bogus handling of recursion
limit when USE_STACKCHEK was enabled.
- Issue #3639: The _warnings module could segfault the interpreter when
unexpected types were passed in as arguments.
- Issue #3712: The memoryview object had a reference leak and didn't support
cyclic garbage collection.
- Issue #3668: Fix a memory leak with the "s*" argument parser in
PyArg_ParseTuple and friends, which occurred when the argument for "s*"
was correctly parsed but parsing of subsequent arguments failed.
- Issue #3611: An exception __context__ could be cleared in a complex pattern
involving a __del__ method re-raising an exception.
- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
mechanism. In the process, fix a bug where isinstance() and issubclass(),
when given a tuple of classes as second argument, were looking up
__instancecheck__ / __subclasscheck__ on the tuple rather than on each
type object.
- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
- Issue #3651: Fix various memory leaks when using the buffer
interface, or when the "s#" code of PyArg_ParseTuple is given a
bytes object.
- Issue #3657: Fix uninitialized memory read when pickling longs.
Found by valgrind.
- Apply security patches from Apple.
- Fix crashes on memory allocation failure found with failmalloc.
- Fix memory leaks found with valgrind and update suppressions file.
- Fix compiler warnings in opt mode which would lead to invalid memory reads.
- Fix problem using wrong name in decimal module reported by pychecker.
- Issue #3650: Fixed a reference leak in bytes.split('x').
- bytes(o) now tries to use o.__bytes__() before using fallbacks.
- Issue #1204: The configure script now tests for additional libraries
that may be required when linking against readline. This fixes issues
with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
C API
-----
- PyObject_Bytes and PyBytes_FromObject were added.
Library
-------
- Issue #3756: make re.escape() handle bytes as well as str.
- Issue #3800: fix filter() related bug in formatter.py.
- Issue #874900: fix behaviour of threading module after a fork.
- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
- Issue #3776: Deprecate the bsddb package for removal in 3.0.
- Issue #3762: platform.architecture() fails if python is lanched via
its symbolic link.
- Issue #3660: fix a memory leak in the C accelerator of the pickle module.
- Issue #3160: the "bdist_wininst" distutils command didn't work.
- Issue #1658: tkinter changes dict size during iteration in both
tkinter.BaseWidget and tkinter.scrolledtext.ScrolledText.
- The bsddb module (and therefore the dbm.bsd module) has been removed.
It is now maintained outside of the standard library at
http://www.jcea.es/programacion/pybsddb.htm.
- Issue #600362: Relocated parse_qs() and parse_qsl(), from the cgi module
to the urlparse one. Added a DeprecationWarning in the old module, it
will be deprecated in the future.
- Issue #3719: platform.architecture() fails if there are spaces in the
path to the Python binary.
- Issue #3602: As part of the merge of r66135, make the parameters on
warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning.
- The deprecation warnings for the camelCase threading API names were removed.
- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
SEM_VALUE_MAX.
Extension Modules
-----------------
- Issue #3782: os.write() must not accept unicode strings.
- Issue #2975: When compiling several extension modules with Visual Studio 2008
from the same python interpreter, some environment variables would grow
without limit.
- Issue #3643: Added a few more checks to _testcapi to prevent segfaults by
exploitation of poor argument checking.
- bsddb code updated to version 4.7.3pre2. This code is the same than
Python 2.6 one, since the intention is to keep a unified 2.x/3.x codebase.
The Python code is automatically translated using "2to3". Please, do not
update this code in Python 3.0 by hand. Update the 2.6 one and then
do "2to3".
- The _bytesio and _stringio modules are now compiled into the python binary.
- Issue #3492 and #3790: Fixed the zlib module and zipimport module uses of
mutable bytearray objects where they should have been using immutable bytes.
- Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to
return bytes objects instead of bytearray objects.
Tools/Demos
-----------
- Fix Misc/gdbinit so it works.
Build
-----
- Issue #3812: Failed to build python if configure --without-threads.
- Issue #3791: Remove the bsddb module from the Windows installer, and the
core bsddb library from the Windows build files.
What's new in Python 3.0b3?
===========================
*Release date: 20-Aug-2008*
Core and Builtins
-----------------
- Issue #3653: Fix a segfault when sys.excepthook was called with invalid
arguments.
- Issue #2394: implement more of the memoryview API, with the caveat that
only one-dimensional contiguous buffers are supported and exercised right
now. Slicing, slice assignment and comparison (equality and inequality)
have been added. Also, the tolist() method has been implemented, but only
for byte buffers. Finally, the API has been updated to return bytes objects
wherever it used to return bytearrays.
- Issue #3560: clean up the new C PyMemoryView API so that naming is
internally consistent; add macros PyMemoryView_GET_BASE() and
PyMemoryView_GET_BUFFER() to access useful properties of a memory views
without relying on a particular implementation; remove the ill-named
PyMemoryView() function (PyMemoryView_GET_BUFFER() can be used instead).
- ctypes function pointers that are COM methods have a boolean True
value again.
- Issue #1819: function calls with several named parameters are now on
average 35% faster (as measured by pybench).
- The undocumented C APIs PyUnicode_AsString() and
PyUnicode_AsStringAndSize() were made private to the interpreter, in
order to be able to refine their interfaces for Python 3.1.
If you need to access the UTF-8 representation of a Unicode object
as bytes string, please use PyUnicode_AsUTF8String() instead.
- Issue #3460: PyUnicode_Join() implementation is 10% to 80% faster thanks
to Python 3.0's stricter semantics which allow avoiding successive
reallocations of the result string (this also affects str.join()).
Library
-------
- Issue #1276: Added temporary aliases for CJK Mac encodings to resolve
a build problem on MacOS with CJK locales. It adds four temporary
mappings to existing legacy codecs that are virtually compatible
with Mac encodings. They will be replaced by codecs correctly
implemented in 3.1.
- Issue #3614: Corrected a typo in xmlrpc.client, leading to a NameError
"global name 'header' is not defined".
- Issue #2834: update the regular expression library to match the unicode
standards of py3k. In other words, mixing bytes and unicode strings
(be it as pattern, search string or replacement string) raises a TypeError.
Moreover, the re.UNICODE flag is enabled automatically for unicode patterns,
and can be disabled by specifying a new re.ASCII flag; as for bytes
patterns, ASCII matching is the only option and trying to specify re.UNICODE
for such patterns raises a ValueError.
- Issue #3300: make urllib.parse.[un]quote() default to UTF-8.
Code contributed by Matt Giuca. quote() now encodes the input
before quoting, unquote() decodes after unquoting. There are
new arguments to change the encoding and errors settings.
There are also new APIs to skip the encode/decode steps.
[un]quote_plus() are also affected.
- Issue #2235: numbers.Number now blocks inheritance of the default id()
based hash because that hash mechanism is not correct for numeric types.
All concrete numeric types that inherit from Number (rather than just
registering with it) must explicitly provide a hash implementation in
order for their instances to be hashable.
- Issue #2676: in the email package, content-type parsing was hanging on
pathological input because of quadratic or exponential behaviour of a
regular expression.
- Issue #3476: binary buffered reading through the new "io" library is now
thread-safe.
- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
menu entries were not deleted.
- Remove the TarFileCompat class from tarfile.py.
- Issue #2491: os.fdopen is now almost an alias for the built-in open(), and
accepts the same parameters. It just checks that its first argument is an
integer.
- Issue #3394: zipfile.writestr sets external attributes when passed a
file name rather than a ZipInfo instance, so files are extracted with
mode 0600 rather than 000 under Unix.
- Issue #2523: Fix quadratic behaviour when read()ing a binary file without
asking for a specific length.
Extension Modules
-----------------
- Bug #3542: Support Unicode strings in _msi module.
What's new in Python 3.0b2?
===========================
*Release date: 17-Jul-2008*
Core and Builtins
-----------------
- Issue #3008: the float type has a new instance method 'float.hex'
and a new class method 'float.fromhex' to convert floating-point
numbers to and from hexadecimal strings, respectively.
- Issue #3083: Add alternate (#) formatting for bin, oct, hex output
for str.format(). This adds the prefix 0b, 0o, or 0x, respectively.
- Issue #3280: like chr(), the "%c" format now accepts unicode code points
beyond the Basic Multilingual Plane (above 0xffff) on all configurations. On
"narrow Unicode" builds, the result is a string of 2 code units, forming a
UTF-16 surrogate pair.
- Issue #3282: str.isprintable() should return False for undefined
Unicode characters.
- Issue #3236: Return small longs from PyLong_FromString.
- Exception tracebacks now support exception chaining.
Library
-------
- Removed the sunaudio module. Use sunau instead.
- Issue #3554: ctypes.string_at and ctypes.wstring_at did call Python
api functions without holding the GIL, which could lead to a fatal
error when they failed.
- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
- Removed "ast" function aliases from the parser module.
- Issue #3313: Fixed a crash when a failed dlopen() call does not set
a valid dlerror() message.
- Issue #3258: Fixed a crash when a ctypes POINTER type to an
incomplete structure was created.
- Issue #2683: Fix inconsistency in subprocess.Popen.communicate(): the
argument now must be a bytes object in any case.
- Issue #3145: help("modules whatever") failed when trying to load the source
code of every single module of the standard library, including invalid files
used in the test suite.
- The gettext library now consistently uses Unicode strings for message ids
and message strings, and ``ugettext()`` and the like don't exist anymore.
- The traceback module has been expanded to handle chained exceptions.
C API
-----
- Issue #3247: the function Py_FindMethod was removed. Modern types should
use the tp_methods slot instead.
Tools/Demos
-----------
- The Mac/Demos directory has been removed.
- All of the Mac scripts have been removed (including BuildApplet.py).
What's new in Python 3.0b1?
===========================
*Release date: 18-Jun-2008*
Core and Builtins
-----------------
- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
argument being anything other than a dict or None. Also fixed a bug in error
handling when 'message' and 'category' were both set to None, triggering a
bus error.
- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
holds the last (strong) reference to its referent.
- Issue #2630: implement PEP 3138. repr() now returns printable
Unicode characters unescaped, to get an ASCII-only representation
of an object use ascii().
- Issue #1342: On windows, Python could not start when installed in a
directory with non-ascii characters.
- Implement PEP 3121: new module initialization and finalization API.
- Removed the already-defunct ``-t`` option.
- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
unmarshalling many code objects, which happens when importing a
large .pyc file (~1000 functions).
- Issue #2963: fix merging oversight that disabled method cache for
all types.
- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
- Issue #2895: Don't crash when given bytes objects as keyword names.
- Issue #2798: When parsing arguments with PyArg_ParseTuple, the "s"
code now allows any unicode string and returns a utf-8 encoded
buffer, just like the "s#" code already does. The "z" code was
corrected as well.
- Issue #2863: generators now have a ``gen.__name__`` attribute that
equals ``gen.gi_code.co_name``, like ``func.__name___`` that equals
``func.func_code.co_name``. The repr() of a generator now also
contains this name.
- Issue #2831: enumerate() now has a ``start`` argument.
- Issue #2801: fix bug in the float.is_integer method where a
ValueError was sometimes incorrectly raised.
- The ``--with-toolbox-glue`` option (and the associated
pymactoolbox.h) have been removed.
- Issue #2196: hasattr() now lets exceptions which do not inherit
Exception (KeyboardInterrupt, and SystemExit) propagate instead of
ignoring them.
- #3021 Exception reraising semantics have been significantly improved. However,
f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
code anymore.
- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
removed.
Extension Modules
-----------------
- Renamed ``_winreg`` module to ``winreg``.
- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the
platform.
- Support for Windows 9x has been removed from the winsound module.
- Issue #2870: cmathmodule.c compile error.
Library
-------
- The methods ``is_in_tuple()``, ``is_vararg()``, and ``is_keywordarg()`` of
symtable.Symbol have been removed.
- Patch #3133: http.server.CGIHTTPRequestHandler did not work on windows.
- a new ``urllib`` package was created. It consists of code from
``urllib``, ``urllib2``, ``urlparse``, and ``robotparser``. The old
modules have all been removed. The new package has five submodules:
``urllib.parse``, ``urllib.request``, ``urllib.response``,
``urllib.error``, and ``urllib.robotparser``. The
``urllib.request.urlopen()`` function uses the url opener from
``urllib2``. (Note that the unittests have not been renamed for the
beta, but they will be renamed in the future.)
- rfc822 has been removed in favor of the email package.
- mimetools has been removed in favor of the email package.
- Patch #2849: Remove use of rfc822 module from standard library.
- Added C optimized implementation of io.StringIO.
- The ``pickle`` module is now automatically use an optimized C
implementation of Pickler and Unpickler when available. The
``cPickle`` module is no longer needed.
- Removed the ``htmllib`` and ``sgmllib`` modules.
- The deprecated ``SmartCookie`` and ``SimpleCookie`` classes have
been removed from ``http.cookies``.
- The ``commands`` module has been removed. Its getoutput() and
getstatusoutput() functions have been moved to the ``subprocess`` module.
- The ``http`` package was created; it contains the old ``httplib``
as ``http.client``, ``Cookie`` as ``http.cookies``, ``cookielib``
as ``http.cookiejar``, and the content of the three ``HTTPServer``
modules as ``http.server``.
- The ``xmlrpc`` package was created; it contains the old
``xmlrpclib`` module as ``xmlrpc.client`` and the content of
the old ``SimpleXMLRPCServer`` and ``DocXMLRPCServer`` modules
as ``xmlrpc.server``.
- The ``dbm`` package was created, containing the old modules
``anydbm`` and ``whichdb`` in its ``__init__.py``, and having
``dbm.gnu`` (was ``gdbm``), ``dbm.bsd`` (was ``dbhash``),
``dbm.ndbm`` (was ``dbm``) and ``dbm.dumb`` (was ``dumbdbm``)
as submodules.
- The ``repr`` module has been renamed to ``reprlib``.
- The ``statvfs`` module has been removed.
- Issue #1713041: fix pprint's handling of maximum depth.
- Issue #2250: Exceptions raised during evaluation of names in
rlcompleter's ``Completer.complete()`` method are now caught and
ignored.
- Patch #2659: Added ``break_on_hyphens`` option to textwrap's
``TextWrapper`` class.
- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
large to fit in a C long. ldexp(x, n) now returns a zero (with
suitable sign) if n is large and negative; previously, it raised
OverflowError.
- The ``ConfigParser`` module has been renamed to ``configparser``.
- Issue #2865: webbrowser.open() works again in a KDE environment.
- The ``multifile`` module has been removed.
- The ``SocketServer`` module has been renamed to ``socketserver``.
- Fixed the ``__all__`` setting on ``collections`` to include
``UserList`` and ``UserString``.
- The sre module has been removed.
- The Queue module has been renamed to queue.
- The copy_reg module has been renamed to copyreg.
- The mhlib module has been removed.
- The ihooks module has been removed.
- The fpformat module has been removed.
- The dircache module has been removed.
- The Canvas module has been removed.
- The Decimal module gained the magic methods __round__, __ceil__,
__floor__ and __trunc__, to give support for round, math.ceil,
math.floor and math.trunc.
- The user module has been removed.
- The mutex module has been removed.
- The imputil module has been removed.
- os.path.walk has been removed in favor of os.walk.
- pdb gained the "until" command.
- The test.test_support module has been renamed to test.support.
- The threading module API was renamed to be PEP 8 compliant. The
old names are still present, but will be removed in the near future.
Tools/Demos
-----------
- The bgen tool has been removed.
Build
-----
What's New in Python 3.0a5?
===========================
*Release date: 08-May-2008*
Core and Builtins
-----------------
- Fixed misbehaviour of PyLong_FromSsize_t on systems where
sizeof(size_t) > sizeof(long).
- Issue #2221: Corrected a SystemError "error return without exception
set", when the code executed by exec() raises an exception, and
sys.stdout.flush() also raises an error.
- Bug #2565: The repr() of type objects now calls them 'class', not
'type' - whether they are builtin types or not.
- The command line processing was converted to pass Unicode strings
through as unmodified as possible; as a consequence, the C API
related to command line arguments was changed to use wchar_t.
- All backslashes in raw strings are interpreted literally. This
means that '\u' and '\U' escapes are not treated specially.
Extension Modules
-----------------
Library
-------
- ctypes objects now support the PEP3118 buffer interface.
- Issue #2682: ctypes callback functions now longer contain a cyclic
reference to themselves.
- Issue #2058: Remove the buf attribute and add __slots__ to the
TarInfo class in order to reduce tarfile's memory usage.
- Bug #2606: Avoid calling .sort() on a dict_keys object.
- The bundled libffi copy is now in sync with the recently released
libffi3.0.5 version, apart from some small changes to
Modules/_ctypes/libffi/configure.ac.
Build
-----
- Issue #1496032: On alpha, use -mieee when gcc is the compiler.
- "make install" is now an alias for "make altinstall", to prevent
accidentally overwriting a Python 2.x installation. Use "make
fullinstall" to force Python 3.0 to be installed as "python".
- Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when
gcc is used as compiler.
What's New in Python 3.0a4?
===========================
*Release date: 02-Apr-2008*
Core and Builtins
-----------------
- Bug #2301: Don't try decoding the source code into the original
encoding for syntax errors.
Extension Modules
-----------------
- The dl module was removed, use the ctypes module instead.
- Use wchar_t functions in _locale module.
Library
-------
- The class distutils.commands.build_py.build_py_2to3 can be used as a
build_py replacement to automatically run 2to3 on modules that are
going to be installed.
- A new pickle protocol (protocol 3) is added with explicit support
for bytes. This is the default protocol. It intentionally cannot
be unpickled by Python 2.x.
- When a pickle written by Python 2.x contains an (8-bit) str
instance, this is now decoded to a (Unicode) str instance. The
encoding used to do this defaults to ASCII, but can be overridden
via two new keyword arguments to the Unpickler class. Previously
this would create bytes instances, which is usually wrong: str
instances are often used to pickle attribute names etc., and text is
more common than binary data anyway.
- Default to ASCII as the locale.getpreferredencoding, if the POSIX
system doesn't support CODESET and LANG isn't set or doesn't allow
deduction of an encoding.
- Issue #1202: zlib.crc32 and zlib.adler32 now return an unsigned
value.
- Issue #719888: Updated tokenize to use a bytes API. generate_tokens
has been renamed tokenize and now works with bytes rather than
strings. A new detect_encoding function has been added for
determining source file encoding according to PEP-0263. Token
sequences returned by tokenize always start with an ENCODING token
which specifies the encoding used to decode the file. This token is
used to encode the output of untokenize back to bytes.
What's New in Python 3.0a3?
===========================
*Release date: 29-Feb-2008*
Core and Builtins
-----------------
- Issue #2282: io.TextIOWrapper was not overriding seekable() from
io.IOBase.
- Issue #2115: Important speedup in setting __slot__ attributes. Also
prevent a possible crash: an Abstract Base Class would try to access
a slot on a registered virtual subclass.
- Fixed repr() and str() of complex numbers with infinity or nan as
real or imaginary part.
- Clear all free list during a gc.collect() of the highest generation
in order to allow pymalloc to free more arenas. Python may give back
memory to the OS earlier.
- Issue #2045: Fix an infinite recursion triggered when printing a
subclass of collections.defaultdict, if its default_factory is set
to a bound method.
- Fixed a minor memory leak in dictobject.c. The content of the free
list was not freed on interpreter shutdown.
- Limit free list of method and builtin function objects to 256
entries each.
- Patch #1953: Added ``sys._compact_freelists()`` and the C API
functions ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
to compact the internal free lists of pre-allocted ints and floats.
- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
Python expected the return type int but the fork familie returns
pi_t.
- Issue #1678380: Fix a bug that identifies 0j and -0j when they
appear in the same code unit.
- Issue #2025: Added tuple.count() and tuple.index() methods to comply
with the collections.Sequence API.
- Fixed multiple reinitialization of the Python interpreter. The small
int list in longobject.c has caused a seg fault during the third
finalization.
- Issue #1973: bytes.fromhex('') raised SystemError.
- Issue #1771: remove cmp parameter from sorted() and list.sort().
- Issue #1969: split and rsplit in bytearray are inconsistent.
- map() no longer accepts None for the first argument. Use zip()
instead.
- Issue #1769: Now int("- 1") is not allowed any more.
- Object/longobject.c: long(float('nan')) raises an OverflowError
instead of returning 0.
- Issue #1762972: __file__ points to the source file instead of the
pyc/pyo file if the py file exists.
- Issue #1393: object_richcompare() returns NotImplemented instead of
False if the objects aren't equal, to give the other side a chance.
- Issue #1692: Interpreter was not displaying location of SyntaxError.
- Improve some exception messages when Windows fails to load an
extension module. Now we get for example '%1 is not a valid Win32
application' instead of 'error code 193'. Also use Unicode strings
to deal with non-English locales.
- Issue #1587: Added instancemethod wrapper for PyCFunctions. The
Python C API has gained a new type *PyInstanceMethod_Type* and the
functions *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)*
and *PyInstanceMethod_Function(im)*.
- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed
from the gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE
are now enough to print the corresponding list of objects considered
by the garbage collector.
- Issue #1573: Improper use of the keyword-only syntax makes the
parser crash.
- Issue #1564: The set implementation should special-case PyUnicode
instead of PyString.
- Patch #1031213: Decode source line in SyntaxErrors back to its
original source encoding.
- inspect.getsource() includes the decorators again.
- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
mountpoint.
- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when
the first chunk fed to the decoder started with a BOM, but was
longer than 3 bytes.
Extension Modules
-----------------
- Code for itertools ifilter(), imap(), and izip() moved to bultins
and renamed to filter(), map(), and zip(). Also, renamed
izip_longest() to zip_longest() and ifilterfalse() to filterfalse().
- Issue #1762972: Readded the reload() function as imp.reload().
- Bug #2111: mmap segfaults when trying to write a block opened with
PROT_READ.
- Issue #2063: correct order of utime and stime in os.times() result
on Windows.
Library
-------
- Weakref dictionaries now inherit from MutableMapping.
- Created new UserDict class in collections module. This one inherits
from and complies with the MutableMapping ABC. Also, moved
UserString and UserList to the collections module. The
MutableUserString class was removed.
- Removed UserDict.DictMixin. Replaced all its uses with
collections.MutableMapping.
- Issue #1703: getpass() should flush after writing prompt.
- Issue #1585: IDLE uses non-existent xrange() function.
- Issue #1578: Problems in win_getpass.
Build
-----
- Renamed --enable-unicode configure flag to --with-wide-unicode,
since Unicode strings can't be disabled anymore.
C API
-----
- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
Py_TYPE and Py_REFCNT.
- New API PyImport_ImportModuleNoBlock(), works like
PyImport_ImportModule() but won't block on the import lock
(returning an error instead).
What's New in Python 3.0a2?
===========================
*Release date: 07-Dec-2007*
(Note: this list is incomplete.)
Core and Builtins
-----------------
- str8 now has the same construction signature as bytes.
- Comparisons between str and str8 now return False/True for ==/!=.
sqlite3 returns str8 when recreating on object from it's __conform__
value. The struct module returns str8 for all string-related
formats. This was true before this change, but becomes more
apparent thanks to string comparisons always being False.
- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode,
buffer, encoding, newline)`.
- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
- Changed `__file__` and `co_filename` to unicode. The path names are decoded
with `Py_FileSystemDefaultEncoding` and a new API method
`PyUnicode_DecodeFSDefault(char*)` was added.
- io.open() and _fileio.FileIO have grown a new argument closefd. A
false value disables the closing of the file descriptor.
- Added a new option -b to issues warnings (-bb for errors) about
certain operations between bytes/buffer and str like str(b'') and
comparison.
- The standard streams sys.stdin, stdout and stderr may be None
when the C runtime library returns an invalid file descriptor
for the streams (fileno(stdin) < 0). For now this happens only for
Windows GUI apps and scripts started with `pythonw.exe`.
- Added PCbuild9 directory for VS 2008.
- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to
work around a name clash with VS 2008 on Windows.
- Unbound methods are gone for good. ClassObject.method returns an
ordinary function object, instance.method still returns a bound
method object. The API of bound methods is cleaned up, too. The
im_class attribute is removed and im_func + im_self are renamed to
__func__ and __self__. The factory PyMethod_New takes only func and
instance as argument.
- intobject.h is no longer included by Python.h. The remains were
moved to longobject.h. It still exists to define several aliases
from PyInt to PyLong functions.
- Removed sys.maxint, use sys.maxsize instead.
Extension Modules
-----------------
- The `hotshot` profiler has been removed; use `cProfile` instead.
Library
-------
- When loading an external file using testfile(), the passed-in
encoding argument was being ignored if __loader__ is defined and
forcing the source to be UTF-8.
- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have
been removed in favor of the tempfile module.
- Removed the 'new' module.
- Removed all types from the 'types' module that are easily accessible
through builtins.
What's New in Python 3.0a1?
===========================
*Release date: 31-Aug-2007*
Core and Builtins
-----------------
- PEP 3131: Support non-ASCII identifiers.
- PEP 3120: Change default encoding to UTF-8.
- PEP 3123: Use proper C inheritance for PyObject.
- Removed the __oct__ and __hex__ special methods and added a bin()
builtin function.
- PEP 3127: octal literals now start with "0o". Old-style octal
literals are invalid. There are binary literals with a prefix of
"0b". This also affects int(x, 0).
- None, True, False are now keywords.
- PEP 3119: isinstance() and issubclass() can be overridden.
- Remove BaseException.message.
- Remove tuple parameter unpacking (PEP 3113).
- Remove the f_restricted attribute from frames. This naturally leads
to the removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
- PEP 3132 was accepted. That means that you can do ``a, *b =
range(5)`` to assign 0 to a and [1, 2, 3, 4] to b.
- range() now returns an iterator rather than a list. Floats are not
allowed. xrange() is no longer defined.
- Patch #1660500: hide iteration variable in list comps, add set comps
and use common code to handle compilation of iterative expressions.
- By default, != returns the opposite of ==, unless the latter returns
NotImplemented.
- Patch #1680961: sys.exitfunc has been removed and replaced with a
private C-level API.
- PEP 3115: new metaclasses: the metaclass is now specified as a
keyword arg in the class statement, which can now use the full
syntax of a parameter list. Also, the metaclass can implement a
__prepare__ function which will be called to create the dictionary
for the new class namespace.
- The long-deprecated argument "pend" of PyFloat_FromString() has been
removed.
- The dir() function has been extended to call the __dir__() method on
its argument, if it exists. If not, it will work like before. This
allows customizing the output of dir() in the presence of a
__getattr__().
- Removed support for __members__ and __methods__.
- Removed indexing/slicing on BaseException.
- input() became raw_input(): the name input() now implements the
functionality formerly known as raw_input(); the name raw_input() is
no longer defined.
- Classes listed in an 'except' clause must inherit from
BaseException.
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views, which behave
like sets.
- PEP 3105: print is now a function. Also (not in the PEP) the
'softspace' attribute of files is now gone (since print() doesn't
use it). A side effect of this change is that you can get
incomplete output lines in interactive sessions:
>>> print(42, end="")
42>>>
We may be able to fix this after the I/O library rewrite.
- PEP 3102: keyword-only arguments.
- Int/Long unification is complete. The 'long' built-in type and
literals with trailing 'L' or 'l' have been removed. Performance
may be sub-optimal (haven't really benchmarked).
- 'except E, V' must now be spelled as 'except E as V' and deletes V
at the end of the except clause; V must be a simple name.
- Added function annotations per PEP 3107.
- Added nonlocal declaration from PEP 3104:
>>> def f(x):
... def inc():
... nonlocal x
... x += 1
... return x
... return inc
...
>>> inc = f(0)
>>> inc()
1
>>> inc()
2
- Moved intern() to sys.intern().
- exec is now a function.
- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
- Classic classes are a thing of the past. All classes are new style.
- Exceptions *must* derive from BaseException.
- Integer division always returns a float. The -Q option is no more.
All the following are gone:
* PyNumber_Divide and PyNumber_InPlaceDivide
* __div__, __rdiv__, and __idiv__
* nb_divide, nb_inplace_divide
* operator.div, operator.idiv, operator.__div__, operator.__idiv__
(Only __truediv__ and __floordiv__ remain, not sure how to handle
them if we want to re-use __div__ and friends. If we do, it will
make it harder to write code for both 2.x and 3.x.)
- 'as' and 'with' are keywords.
- Absolute import is the default behavior for 'import foo' etc.
- Removed support for syntax: backticks (ie, `x`), <>.
- Removed these Python builtins: apply(), callable(), coerce(),
execfile(), file(), reduce(), reload().
- Removed these Python methods: {}.has_key.
- Removed these opcodes: BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT.
- Remove C API support for restricted execution.
- zip(), map() and filter() now return iterators, behaving like their
itertools counterparts. This also affect map()'s behavior on
sequences of unequal length -- it now stops after the shortest one
is exhausted.
- Additions: set literals, set comprehensions, ellipsis literal.
- Added class decorators per PEP 3129.
Extension Modules
-----------------
- Removed the imageop module. Obsolete long with its unit tests
becoming useless from the removal of rgbimg and imgfile.
- Removed these attributes from the operator module: div, idiv,
__div__, __idiv__, isCallable, sequenceIncludes.
- Removed these attributes from the sys module: exc_clear(), exc_type,
exc_value, exc_traceback.
Library
-------
- Removed the compiler package. Use of the _ast module and (an
eventual) AST -> bytecode mechanism.
- Removed these modules: audiodev, Bastion, bsddb185, exceptions,
linuxaudiodev, md5, MimeWriter, mimify, popen2, rexec, sets, sha,
stringold, strop, sunaudiodev, timing, xmllib.
- Moved the toaiff module to Tools/Demos.
- Removed obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL,
DEVICE, ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile,
IOCTL, jpeg, panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
- Removed obsolete functions: commands.getstatus(), os.popen*().
- Removed functions in the string module that are also string methods;
Remove string.{letters, lowercase, uppercase}.
- Removed support for long obsolete platforms: plat-aix3, plat-irix5.
- Removed xmlrpclib.SlowParser. It was based on xmllib.
- Patch #1680961: atexit has been reimplemented in C.
- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
Build
-----
C API
-----
- Removed these Python slots: __coerce__, __div__, __idiv__, __rdiv__.
- Removed these C APIs: PyNumber_Coerce(), PyNumber_CoerceEx(),
PyMember_Get, PyMember_Set.
- Removed these C slots/fields: nb_divide, nb_inplace_divide.
- Removed these macros: staticforward, statichere, PyArg_GetInt,
PyArg_NoArgs, _PyObject_Del.
- Removed these typedefs: intargfunc, intintargfunc, intobjargproc,
intintobjargproc, getreadbufferproc, getwritebufferproc,
getsegcountproc, getcharbufferproc, memberlist.
Tests
-----
- Removed test.testall as test.regrtest replaces it.
Documentation
-------------
Mac
---
- The cfmfile module was removed.
Platforms
---------
- Support for BeOS and AtheOS was removed (according to PEP 11).
- Support for RiscOS, Irix, Tru64 was removed (allegedly).
Tools/Demos
-----------
What's New in Python 2.5 release candidate 1?
=============================================
*Release date: 17-AUG-2006*
Core and builtins
-----------------
- Unicode objects will no longer raise an exception when being
compared equal or unequal to a string and a UnicodeDecodeError
exception occurs, e.g. as result of a decoding failure.
Instead, the equal (==) and unequal (!=) comparison operators will
now issue a UnicodeWarning and interpret the two objects as
unequal. The UnicodeWarning can be filtered as desired using
the warning framework, e.g. silenced completely, turned into an
exception, logged, etc.
Note that compare operators other than equal and unequal will still
raise UnicodeDecodeError exceptions as they've always done.
- Fix segfault when doing string formatting on subclasses of long.
- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
with new-style classes.
- Fix bug related to __len__ functions returning negative values with
classic classes.
- Patch #1538606, Fix __index__() clipping. There were some problems
discovered with the API and how integers that didn't fit into Py_ssize_t
were handled. This patch attempts to provide enough alternatives
to effectively use __index__.
- Bug #1536021: __hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
- Bug #1536786: buffer comparison could emit a RuntimeWarning.
- Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
- On Windows, the PyErr_Warn function is now exported from
the Python dll again.
- Bug #1191458: tracing over for loops now produces a line event
on each iteration. Fixing this problem required changing the .pyc
magic number. This means that .pyc files generated before 2.5c1
will be regenerated.
- Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
- Fixed a reference-counting problem in property().
Library
-------
- Fix a bug in the ``compiler`` package that caused invalid code to be
generated for generator expressions.
- The distutils version has been changed to 2.5.0. The change to
keep it programmatically in sync with the Python version running
the code (introduced in 2.5b3) has been reverted. It will continue
to be maintained manually as static string literal.
- If the Python part of a ctypes callback function returns None,
and this cannot be converted to the required C type, an exception is
printed with PyErr_WriteUnraisable. Before this change, the C
callback returned arbitrary values to the calling code.
- The __repr__ method of a NULL ctypes.py_object() no longer raises
an exception.
- uuid.UUID now has a bytes_le attribute. This returns the UUID in
little-endian byte order for Windows. In addition, uuid.py gained some
workarounds for clocks with low resolution, to stop the code yielding
duplicate UUIDs.
- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
before raising SystemExit, allowing IDLE to honor quit() and exit().
- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
- Patch #1536071: trace.py should now find the full module name of a
file correctly even on Windows.
- logging's atexit hook now runs even if the rest of the module has
already been cleaned up.
- Bug #1112549, fix DoS attack on cgi.FieldStorage.
- Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
- Fix a bug in the ``compiler`` package that caused invalid code to be
generated for nested functions.
Extension Modules
-----------------
- Patch #1511317: don't crash on invalid hostname (alias) info.
- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
- Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The
'-no-stack-protector' compiler flag for OpenBSD has been removed.
- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
uses the _as_parameter_ attribute when objects are passed to foreign
function calls. The ctypes version number was changed to 1.0.1.
- Bug #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
Tests
-----
- test_socketserver should now work on cygwin and not fail sporadically
on other platforms.
- test_mailbox should now work on cygwin versions 2006-08-10 and later.
- Bug #1535182: really test the xreadlines() method of bz2 objects.
- test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
Documentation
-------------
- Patch #1534922: unittest docs were corrected and enhanced.
Build
-----
- Bug #1535502, build _hashlib on Windows, and use masm assembler
code in OpenSSL.
- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
C API
-----
- New API for Unicode rich comparisons: PyUnicode_RichCompare()
- Bug #1069160. Internal correctness changes were made to
``PyThreadState_SetAsyncExc()``. A test case was added, and
the documentation was changed to state that the return value
is always 1 (normal) or 0 (if the specified thread wasn't found).
What's New in Python 2.5 beta 3?
================================
*Release date: 03-AUG-2006*
Core and builtins
-----------------
- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
returned a long (see PEP 353).
- Bug #1515471: string.replace() accepts character buffers again.
- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
- Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
operations on signed longs that are formally undefined by C.
Unfortunately, at least one compiler now cares about that, so complicated
the code to make that compiler happy again.
- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
- Patch #1232023: Stop including current directory in search
path on Windows.
- Fix some potential crashes found with failmalloc.
- Fix warnings reported by Klocwork's static analysis tool.
- Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines.
- Patch #1521179: Python now accepts the standard options ``--help`` and
``--version`` as well as ``/?`` on Windows.
- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
again. Fixing this problem required changing the .pyc magic number.
This means that .pyc files generated before 2.5b3 will be regenerated.
- Bug #1524317: Compiling Python ``--without-threads`` failed.
The Python core compiles again, and, in a build without threads, the
new ``sys._current_frames()`` returns a dictionary with one entry,
mapping the faux "thread id" 0 to the current frame.
- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
Library
-------
- Fix #1693149. Now you can pass several modules separated by
comma to trace.py in the same --ignore-module option.
- Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
- os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
- Bug #1525866: Don't copy directory stat times in
shutil.copytree on Windows
- Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
- The renaming of the xml package to xmlcore, and the import hackery done
to make it appear at both names, has been removed. Bug #1511497,
#1513611, and probably others.
- Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
- Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. This rarely
matters for well-written tests, but can create baffling symptoms if
side effects from one test to the next affect outcomes. ``DocTestFinder``
has been changed to sort the list of tests it returns.
- The distutils version has been changed to 2.5.0, and is now kept
in sync with sys.version_info[:3].
- Bug #978833: Really close underlying socket in _socketobject.close.
- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
title().
- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
to recursive calls and call it with the failing package name.
- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
- Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
- Patch #1524429: Use repr() instead of backticks in Tkinter again.
- Bug #1520914: Change time.strftime() to accept a zero for any position in its
argument tuple. For arguments where zero is illegal, the value is forced to
the minimum value that is correct. This is to support an undocumented but
common way people used to fill in inconsequential information in the time
tuple pre-2.4.
- Patch #1220874: Update the binhex module for Mach-O.
- The email package has improved RFC 2231 support, specifically for
recognizing the difference between encoded (name*0*=<blah>) and non-encoded
(name*0=<blah>) parameter continuations. This may change the types of
values returned from email.message.Message.get_param() and friends.
Specifically in some cases where non-encoded continuations were used,
get_param() used to return a 3-tuple of (None, None, string) whereas now it
will just return the string (since non-encoded continuations don't have
charset and language parts).
Also, whereas % values were decoded in all parameter continuations, they are
now only decoded in encoded parameter parts.
- Bug #1517990: IDLE keybindings on MacOS X now work correctly
- Bug #1517996: IDLE now longer shows the default Tk menu when a
path browser, class browser or debugger is the frontmost window on MacOS X
- Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type
of an object against these built-in types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
Extension Modules
-----------------
- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
- Patch #1529514: The _ctypes extension is now compiled on more
openbsd target platforms.
- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
a memory leak, affecting pickles and deep copies.
- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
Paul Eggert.
- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
- Patch #1521817: Index range checking on ctypes arrays containing
exactly one element enabled again. This allows iterating over these
arrays, without the need to check the array size before.
- Bug #1521375: When the code in ctypes.util.find_library was
run with root privileges, it could overwrite or delete
/dev/null in certain cases; this is now fixed.
- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
default mode for loading shared libraries in ctypes.
- Because of a misspelled preprocessor symbol, ctypes was always
compiled without thread support; this is now fixed.
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
bluetooth API compared with Linux and FreeBSD.
Tests
-----
- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
how long the test file should take to play. Now accepts taking 2.93 secs
(exact time) +/- 10% instead of the hard-coded 3.1 sec.
- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
run via ``regrtest.py``. Now they do.
Build
-----
- Bug #1439538: Drop usage of test -e in configure as it is not portable.
Mac
---
- PythonLauncher now works correctly when the path to the script contains
characters that are treated specially by the shell (such as quotes).
- Bug #1527397: PythonLauncher now launches scripts with the working directory
set to the directory that contains the script instead of the user home
directory. That latter was an implementation accident and not what users
expect.
What's New in Python 2.5 beta 2?
================================
*Release date: 11-JUL-2006*
Core and builtins
-----------------
- Bug #1441486: The literal representation of -(sys.maxint - 1)
again evaluates to an int object, not a long.
- Bug #1501934: The scope of global variables that are locally assigned
using augmented assignment is now correctly determined.
- Bug #927248: Recursive method-wrapper objects can now safely
be released.
- Bug #1417699: Reject locale-specific decimal point in float()
and atof().
- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
- Bug #1519018: 'as' is now validated properly in import statements.
- On 64 bit systems, int literals that use less than 64 bits are
now ints rather than longs.
- Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
- New function ``sys._current_frames()`` returns a dict mapping thread
id to topmost thread stack frame. This is for expert use, and is
especially useful for debugging application deadlocks. The functionality
was previously available in Fazal Majid's ``threadframe`` extension
module, but it wasn't possible to do this in a wholly threadsafe way from
an extension.
Library
-------
- Bug #1257728: Mention Cygwin in distutils error message about a missing
VS 2003.
- Patch #1519566: Update turtle demo, make begin_fill idempotent.
- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
environment variable to be set in order to the SDK environment
for finding the compiler, include files, etc.
- Bug #1515998: Properly generate logical ids for files in bdist_msi.
- warnings.py now ignores ImportWarning by default
- string.Template() now correctly handles tuple-values. Previously,
multi-value tuples would raise an exception and single-value tuples would
be treated as the value they contain, instead.
- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
even if some data are received.
- Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
- Bug #1514693: Update turtle's heading when switching between
degrees and radians.
- Reimplement turtle.circle using a polyline, to allow correct
filling of arcs.
- Bug #1514703: Only setup canvas window in turtle when the canvas
is created.
- Bug #1513223: .close() of a _socketobj now releases the underlying
socket again, which then gets closed as it becomes unreferenced.
- Bug #1504333: Make sgmllib support angle brackets in quoted
attribute values.
- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
sgmllib ('[' and ']' were not accepted).
- Fix a bug in the turtle module's end_fill function.
- Bug #1510580: The 'warnings' module improperly required that a Warning
category be either a types.ClassType and a subclass of Warning. The proper
check is just that it is a subclass with Warning as the documentation states.
- The compiler module now correctly compiles the new try-except-finally
statement (bug #1509132).
- The wsgiref package is now installed properly on Unix.
- A bug was fixed in logging.config.fileConfig() which caused a crash on
shutdown when fileConfig() was called multiple times.
- The sqlite3 module did cut off data from the SQLite database at the first
null character before sending it to a custom converter. This has been fixed
now.
Extension Modules
-----------------
- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
- Assigning None to pointer type fields in ctypes structures possible
overwrote the wrong fields, this is fixed now.
- Fixed a segfault in _ctypes when ctypes.wintypes were imported
on non-Windows platforms.
- Bug #1518190: The ctypes.c_void_p constructor now accepts any
integer or long, without range checking.
- Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a from_param
method, no longer is it required that the object is a ctypes type.
- The '_ctypes' extension module now works when Python is configured
with the --without-threads option.
- Bug #1513646: os.access on Windows now correctly determines write
access, again.
- Bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt.
- Bug #1296433: parsing XML with a non-default encoding and
a CharacterDataHandler could crash the interpreter in pyexpat.
- Patch #1516912: improve Modules support for OpenVMS.
Build
-----
- Automate Windows build process for the Win64 SSL module.
- 'configure' now detects the zlib library the same way as distutils.
Previously, the slight difference could cause compilation errors of the
'zlib' module on systems with more than one version of zlib.
- The MSI compileall step was fixed to also support a TARGETDIR
with spaces in it.
- Bug #1517388: sqlite3.dll is now installed on Windows independent
of Tcl/Tk.
- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
trying to be installed even though it's empty.
Tests
-----
- Call os.waitpid() at the end of tests that spawn child processes in order
to minimize resources (zombies).
Documentation
-------------
- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
documentation for the warnings module.
- Patch #1509163: MS Toolkit Compiler no longer available.
- Patch #1504046: Add documentation for xml.etree.
What's New in Python 2.5 beta 1?
================================
*Release date: 20-JUN-2006*
Core and builtins
-----------------
- Patch #1507676: Error messages returned by invalid abstract object operations
(such as iterating over an integer) have been improved and now include the
type of the offending object to help with debugging.
- Bug #992017: A classic class that defined a __coerce__() method that returned
its arguments swapped would infinitely recurse and segfault the interpreter.
- Fix the socket tests so they can be run concurrently.
- Removed 5 integers from C frame objects (PyFrameObject).
f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
- Bug #532646: object.__call__() will continue looking for the __call__
attribute on objects until one without one is found. This leads to recursion
when you take a class and set its __call__ attribute to an instance of the
class. Originally fixed for classic classes, but this fix is for new-style.
Removes the infinite_rec_3 crasher.
- The string and unicode methods startswith() and endswith() now accept
a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
- Buffer objects, at the C level, never used the char buffer
implementation even when the char buffer for the wrapped object was
explicitly requested (originally returned the read or write buffer).
Now a TypeError is raised if the char buffer is not present but is
requested.
- Patch #1346214: Statements like "if 0: suite" are now again optimized
away like they were in Python 2.4.
- Builtin exceptions are now full-blown new-style classes instead of
instances pretending to be classes, which speeds up exception handling
by about 80% in comparison to 2.5a2.
- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
Unicode 4.1.
- Patch #921466: sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
of-2 bases. The largest speedup is for inputs with about 1000 decimal
digits. Conversion from non-power-of-2 bases remains quadratic-time in
the number of input digits (it was and remains linear-time for bases
2, 4, 8, 16 and 32).
- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
an integer close to ``sys.maxint``. This was repaired by patch
#1335972, which also gives a nice speedup.
- Patch #1337051: reduced size of frame objects.
- PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
- Patch #876206: function call speedup by retaining allocated frame
objects.
- Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
- Patch #1488312, Fix memory alignment problem on SPARC in unicode
- Bug #1487966: Fix SystemError with conditional expression in assignment
- WindowsError now has two error code attributes: errno, which carries
the error values from errno.h, and winerror, which carries the error
values from winerror.h. Previous versions put the winerror.h values
(from GetLastError()) into the errno attribute.
- Patch #1475845: Raise IndentationError for unexpected indent.
- Patch #1479181: split open() and file() from being aliases for each other.
- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
methods were always silently ignored by dictionaries when comparing keys.
They are now passed through (except when using the C API function
``PyDict_GetItem()``, whose semantics did not change).
- Bug #1456209: In some obscure cases it was possible for a class with a
custom ``__eq__()`` method to confuse dict internals when class instances
were used as a dict's keys and the ``__eq__()`` method mutated the dict.
No, you don't have any code that did this ;-)
Extension Modules
-----------------
- Bug #1295808: expat symbols should be namespaced in pyexpat
- Patch #1462338: Upgrade pyexpat to expat 2.0.0
- Change binascii.hexlify to accept a read-only buffer instead of only a char
buffer and actually follow its documentation.
- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
- Patch #1478788 (modified version): The functional extension module has
been renamed to _functools and a functools Python wrapper module added.
This provides a home for additional function related utilities that are
not specifically about functional programming. See PEP 309.
- Patch #1493701: performance enhancements for struct module.
- Patch #1490224: time.altzone is now set correctly on Cygwin.
- Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
- Patch #1454481: thread stack size is now tunable at runtime for thread
enabled builds on Windows and systems with Posix threads support.
- On Win32, os.listdir now supports arbitrarily-long Unicode path names
(up to the system limit of 32K characters).
- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
As a result, these functions now raise WindowsError instead of OSError.
- ``time.clock()`` on Win64 should use the high-performance Windows
``QueryPerformanceCounter()`` now (as was already the case on 32-bit
Windows platforms).
- Calling Tk_Init twice is refused if the first call failed as that
may deadlock.
- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
accept it without potentially using an uninitialized pointer.
- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
patch numbers 1494885 and 1494902]
- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
[pybsddb project SF patch number 1466734]
- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
parameter is supplied. [SF pybsddb bug #1477863]
- bsddb: the __len__ method of a DB object has been fixed to return correct
results. It could previously incorrectly return 0 in some cases.
Fixes SF bug 1493322 (pybsddb bug 1184012).
- bsddb: the bsddb.dbtables Modify method now raises the proper error and
aborts the db transaction safely when a modifier callback fails.
Fixes SF python patch/bug #1408584.
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
- Patch #1446489: add support for the ZIP64 extensions to zipfile.
- Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm.
Library
-------
- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
functions.
- Patch #812986: Update turtle output even if not tracing.
- Patch #1494750: Destroy master after deleting children in
Tkinter.BaseWidget.
- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
- Patch #763580: Add name and value arguments to Tkinter variable
classes.
- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
- Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
- Patch #1455898: The MBCS codec now supports the incremental mode for
double-byte encodings.
- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
guarantee that adjacent triples in the return list always describe
non-adjacent blocks. Previously, a pair of matching blocks could end
up being described by multiple adjacent triples that formed a partition
of the matching pair.
- Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
- Bug #1366250: minor optparse documentation error.
- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
clarify docs.
- The wsgiref package has been added to the standard library.
- The functions update_wrapper() and wraps() have been added to the functools
module. These make it easier to copy relevant metadata from the original
function when writing wrapper functions.
- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
``doctest.is_private()`` function, both deprecated in 2.4, were removed.
- Patch #1359618: Speed up charmap encoder by using a trie structure
for lookup.
- The functions in the ``pprint`` module now sort dictionaries by key
before computing the display. Before 2.5, ``pprint`` sorted a dictionary
if and only if its display required more than one line, although that
wasn't documented. The new behavior increases predictability; e.g.,
using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
- Patch #1497027: try HTTP digest auth before basic auth in urllib2
(thanks for J. J. Lee).
- Patch #1496206: improve urllib2 handling of passwords with respect to
default HTTP and HTTPS ports.
- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
- Patch #1281707: speed up gzip.readline.
- Patch #1180296: Two new functions were added to the locale module:
format_string() to get the effect of "format % items" but locale-aware,
and currency() to format a monetary number with currency sign.
- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
- Patch #1488881: add support for external file objects in bz2 compressed
tarfiles.
- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
- Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
new flag when ``name`` is already the name of an option flag.
- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
package.
- Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
- Bug #1472827: correctly escape newlines and tabs in attribute values in
the saxutils.XMLGenerator class.
Build
-----
- Bug #1502728: Correctly link against librt library on HP-UX.
- OpenBSD 3.9 is supported now.
- Patch #1492356: Port to Windows CE.
- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
- Patch #1471883: Add --enable-universalsdk.
C API
-----
Tests
-----
Tools
-----
Documentation
-------------
What's New in Python 2.5 alpha 2?
=================================
*Release date: 27-APR-2006*
Core and builtins
-----------------
- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
by converting these apis from macros into exported functions again:
PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
PyRun_String Py_CompileString
- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
- All uses of PyStructSequence_InitType have been changed to initialize
the type objects only once, even if the interpreter is initialized
multiple times.
- Bug #1454485, array.array('u') could crash the interpreter. This was
due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
to unicode when it didn't make sense. 'u#' now requires a unicode string.
- Py_UNICODE is unsigned. It was always documented as unsigned, but
due to a bug had a signed value in previous versions.
- Patch #837242: ``id()`` of any Python object always gives a positive
number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
``PyLong_AsVoidPtr`` have been changed accordingly. Note that it has
never been correct to implement a ``__hash()__`` method that returns the
``id()`` of an object:
def __hash__(self):
return id(self) # WRONG
because a hash result must be a (short) Python int but it was always
possible for ``id()`` to return a Python long. However, because ``id()``
could return negative values before, on a 32-bit box an ``id()`` result
was always usable as a hash value before this patch. That's no longer
necessarily so.
- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
to load extension modules and now provides the dl module. As a result,
sys.setdlopenflags() now works correctly on these systems. (SF patch
#1454844)
- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
involving generators that have paused outside of any ``try`` or ``with``
blocks. (In 2.5a1, a paused generator that was part of a reference
cycle could not be garbage collected, regardless of whether it was
paused in a ``try`` or ``with`` block.)
Extension Modules
-----------------
- Patch #1191065: Fix preprocessor problems on systems where recvfrom
is a macro.
- Bug #1467952: os.listdir() now correctly raises an error if readdir()
fails with an error condition.
- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
- Bug #1117761: bsddb.*open() no longer raises an exception when using
the cachesize parameter.
- Bug #1149413: bsddb.*open() no longer raises an exception when using
a temporary db (file=None) with the 'n' flag to truncate on open.
- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
as older versions cause excessive test failures.
- Patch #1062014: AF_UNIX sockets under Linux have a special
abstract namespace that is now fully supported.
Library
-------
- Bug #1223937: subprocess.CalledProcessError reports the exit status
of the process using the returncode attribute, instead of
abusing errno.
- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
a doctest to be skipped (the code is not run, and the expected output
or exception is ignored).
- Fixed contextlib.nested to cope with exceptions being raised and
caught inside exit handlers.
- Updated optparse module to Optik 1.5.1 (allow numeric constants in
hex, octal, or binary; add ``append_const`` action; keep going if
gettext cannot be imported; added ``OptionParser.destroy()`` method;
added ``epilog`` for better help generation).
- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
called from a thread spawned as a side effect of importing a module.
- The pydoc module now supports documenting packages contained in
.zip or .egg files.
- The pkgutil module now has several new utility functions, such
as ``walk_packages()`` to support working with packages that are either
in the filesystem or zip files.
- The mailbox module can now modify and delete messages from
mailboxes, in addition to simply reading them. Thanks to Gregory
K. Johnson for writing the code, and to the 2005 Google Summer of
Code for funding his work.
- The ``__del__`` method of class ``local`` in module ``_threading_local``
returned before accomplishing any of its intended cleanup.
- Patch #790710: Add breakpoint command lists in pdb.
- Patch #1063914: Add Tkinter.Misc.clipboard_get().
- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
Windows. Bug #1469163.
- The warnings, linecache, inspect, traceback, site, and doctest modules
were updated to work correctly with modules imported from zipfiles or
via other PEP 302 __loader__ objects.
- Patch #1467770: Reduce usage of subprocess._active to processes which
the application hasn't waited on.
- Patch #1462222: Fix Tix.Grid.
- Fix exception when doing glob.glob('anything*/')
- The pstats.Stats class accepts an optional stream keyword argument to
direct output to an alternate file-like object.
Build
-----
- The Makefile now has a reindent target, which runs reindent.py on
the library.
- Patch #1470875: Building Python with MS Free Compiler
- Patch #1161914: Add a python-config script.
- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
--with-cxx-main. Link with C++ compiler only if --with-cxx-main was
specified. (Can be overridden by explicitly setting LINKCC.) Decouple
CXX from --with-cxx-main, see description in README.
- Patch #1429775: Link extension modules with the shared libpython.
- Fixed a libffi build problem on MIPS systems.
- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
and "%zu" for unsigned integers of type ``size_t``.
Tests
-----
- test_contextlib now checks contextlib.nested can cope with exceptions
being raised and caught inside exit handlers.
- test_cmd_line now checks operation of the -m and -c command switches
- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
it separately and by hand. It also wasn't cleaning up its changes to
the current Decimal context.
- regrtest.py now has a -M option to run tests that test the new limits of
containers, on 64-bit architectures. Running these tests is only sensible
on 64-bit machines with more than two gigabytes of memory. The argument
passed is the maximum amount of memory for the tests to use.
Tools
-----
- Added the Python benchmark suite pybench to the Tools/ directory;
contributed by Marc-Andre Lemburg.
Documentation
-------------
- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
- PEP 343: Added Context Types section to the library reference
and attempted to bring other PEP 343 related documentation into
line with the implementation and/or python-dev discussions.
- Bug #1337990: clarified that ``doctest`` does not support examples
requiring both expected output and an exception.
What's New in Python 2.5 alpha 1?
=================================
*Release date: 05-APR-2006*
Core and builtins
-----------------
- PEP 338: -m command line switch now delegates to runpy.run_module
allowing it to support modules in packages and zipfiles
- On Windows, .DLL is not an accepted file name extension for
extension modules anymore; extensions are only found if they
end in .PYD.
- Bug #1421664: sys.stderr.encoding is now set to the same value as
sys.stdout.encoding.
- __import__ accepts keyword arguments.
- Patch #1460496: round() now accepts keyword arguments.
- Fixed bug #1459029 - unicode reprs were double-escaped.
- Patch #1396919: The system scope threads are reenabled on FreeBSD
5.4 and later versions.
- Bug #1115379: Compiling a Unicode string with an encoding declaration
now gives a SyntaxError.
- Previously, Python code had no easy way to access the contents of a
cell object. Now, a ``cell_contents`` attribute has been added
(closes patch #1170323).
- Patch #1123430: Python's small-object allocator now returns an arena to
the system ``free()`` when all memory within an arena becomes unused
again. Prior to Python 2.5, arenas (256KB chunks of memory) were never
freed. Some applications will see a drop in virtual memory size now,
especially long-running applications that, from time to time, temporarily
use a large number of small objects. Note that when Python returns an
arena to the platform C's ``free()``, there's no guarantee that the
platform C library will in turn return that memory to the operating system.
The effect of the patch is to stop making that impossible, and in tests it
appears to be effective at least on Microsoft C and gcc-based systems.
Thanks to Evan Jones for hard work and patience.
- Patch #1434038: property() now uses the getter's docstring if there is
no "doc" argument given. This makes it possible to legitimately use
property() as a decorator to produce a read-only property.
- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
nb_index slot to the PyNumberMethods struct. The slot is consulted instead
of requiring an int or long in slicing and a few other contexts, enabling
other objects (e.g. Numeric Python's integers) to be used as slice indices.
- Fixed various bugs reported by Coverity's Prevent tool.
- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
new exception base class, BaseException, which has a new message attribute.
KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
Raising a string exception now raises a DeprecationWarning.
- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
explicitly relative, using 'from .module import name' to mean 'from the same
package as this module is in. Imports without dots still default to the
old relative-then-absolute, unless 'from __future__ import
absolute_import' is used.
- Properly check if 'warnings' raises an exception (usually when a filter set
to "error" is triggered) when raising a warning for raising string
exceptions.
- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
The name was removed from Include/code.h.
- PEP 308: conditional expressions were added: (x if cond else y).
- Patch 1433928:
- The copy module now "copies" function objects (as atomic objects).
- dict.__getitem__ now looks for a __missing__ hook before raising
KeyError.
- PEP 343: with statement implemented. Needs ``from __future__ import
with_statement``. Use of 'with' as a variable will generate a warning.
Use of 'as' as a variable will also generate a warning (unless it's
part of an import statement).
The following objects have __context__ methods:
- The built-in file type.
- The thread.LockType type.
- The following types defined by the threading module:
Lock, RLock, Condition, Semaphore, BoundedSemaphore.
- The decimal.Context class.
- Fix the encodings package codec search function to only search
inside its own package. Fixes problem reported in patch #1433198.
Note: Codec packages should implement and register their own
codec search function. PEP 100 has the details.
- PEP 353: Using ``Py_ssize_t`` as the index type.
- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
now allow Python to make use of memory blocks exceeding 2**32 bytes for
some purposes on 64-bit boxes. A ``PYMALLOC_DEBUG`` build was limited
to 4-byte allocations before.
- Patch #1400181, fix unicode string formatting to not use the locale.
This is how string objects work. u'%f' could use , instead of .
for the decimal point. Now both strings and unicode always use periods.
- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
configure would break checking curses.h.
- Bug #959576: The pwd module is now built in. This allows Python to be
built on UNIX platforms without $HOME set.
- Bug #1072182, fix some potential problems if characters are signed.
- Bug #889500, fix line number on SyntaxWarning for global declarations.
- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
- Support for converting hex strings to floats no longer works.
This was not portable. float('0x3') now raises a ValueError.
- Patch #1382163: Expose Subversion revision number to Python. New C API
function Py_GetBuildNumber(). New attribute sys.subversion. Build number
is now displayed in interactive prompt banner.
- Implementation of PEP 341 - Unification of try/except and try/finally.
"except" clauses can now be written together with a "finally" clause in
one try statement instead of two nested ones. Patch #1355913.
- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
now encodes backslash correctly.
- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
and long longs.
- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
It was possible for dlerror() to return a NULL pointer, so
it will now use a default error message in this case.
- Replaced most Unicode charmap codecs with new ones using the
new Unicode translate string feature in the built-in charmap
codec; the codecs were created from the mapping tables available
at ftp.unicode.org and contain a few updates (e.g. the Mac OS
encodings now include a mapping for the Apple logo)
- Added a few more codecs for Mac OS encodings
- Sped up some Unicode operations.
- A new AST parser implementation was completed. The abstract
syntax tree is available for read-only (non-compile) access
to Python code; an _ast module was added.
- SF bug #1167751: fix incorrect code being produced for generator expressions.
The following code now raises a SyntaxError: foo(a = i for i in range(10))
- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
- SF Bug #887946: fix segfault when redirecting stdin from a directory.
Provide a warning when a directory is passed on the command line.
- Fix segfault with invalid coding.
- SF bug #772896: unknown encoding results in MemoryError.
- All iterators now have a Boolean value of True. Formerly, some iterators
supported a __len__() method which evaluated to False when the iterator
was empty.
- On 64-bit platforms, when __len__() returns a value that cannot be
represented as a C int, raise OverflowError.
- test__locale is skipped on OS X < 10.4 (only partial locale support is
present).
- SF bug #893549: parsing keyword arguments was broken with a few format
codes.
- Changes donated by Elemental Security to make it work on AIX 5.3
with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
bug #105470: test_pwd fails on 64bit system (Opteron).
- Changes donated by Elemental Security to make it work on HP-UX 11 on
Itanium2 with HP's 64-bit compiler (SF patch #1225212).
- Disallow keyword arguments for type constructors that don't use them
(fixes bug #1119418).
- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
exceptions that cause a function to exit.
- The implementation of set() and frozenset() was revised to use its
own internal data structure. Memory consumption is reduced by 1/3
and there are modest speed-ups as well. The API is unchanged.
- SF bug #1238681: freed pointer is used in longobject.c:long_pow().
- SF bug #1229429: PyObject_CallMethod failed to decrement some
reference counts in some error exit cases.
- SF bug #1185883: Python's small-object memory allocator took over
a block managed by the platform C library whenever a realloc specified
a small new size. However, there's no portable way to know then how
much of the address space following the pointer is valid, so there's no
portable way to copy data from the C-managed block into Python's
small-object space without risking a memory fault. Python's small-object
realloc now leaves such blocks under the control of the platform C
realloc.
- SF bug #1232517: An overflow error was not detected properly when
attempting to convert a large float to an int in os.utime().
- SF bug #1224347: hex longs now print with lowercase letters just
like their int counterparts.
- SF bug #1163563: the original fix for bug #1010677 ("thread Module
Breaks PyGILState_Ensure()") broke badly in the case of multiple
interpreter states; back out that fix and do a better job (see
http://mail.python.org/pipermail/python-dev/2005-June/054258.html
for a longer write-up of the problem).
- SF patch #1180995: marshal now uses a binary format by default when
serializing floats.
- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
the routines that promise to produce IEEE 754 binary representations
of floats now simply copy bytes around.
- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
278.
- patch #1109424: int, long, float, complex, and unicode now check for the
proper magic slot for type conversions when subclassed. Previously the
magic slot was ignored during conversion. Semantics now match the way
subclasses of str always behaved. int/long/float, conversion of an instance
to the base class has been moved to the proper nb_* magic slot and out of
PyNumber_*().
Thanks Walter Dörwald.
- Descriptors defined in C with a PyGetSetDef structure, where the setter is
NULL, now raise an AttributeError when attempting to set or delete the
attribute. Previously a TypeError was raised, but this was inconsistent
with the equivalent pure-Python implementation.
- It is now safe to call PyGILState_Release() before
PyEval_InitThreads() (note that if there is reason to believe there
are multiple threads around you still must call PyEval_InitThreads()
before using the Python API; this fix is for extension modules that
have no way of knowing if Python is multi-threaded yet).
- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
disabled caused a crash.
- Bug #1165306: instancemethod_new allowed the creation of a method
with im_class == im_self == NULL, which caused a crash when called.
- Move exception finalisation later in the shutdown process - this
fixes the crash seen in bug #1165761
- Added two new builtins, any() and all().
- Defining a class with empty parentheses is now allowed
(e.g., ``class C(): pass`` is no longer a syntax error).
Patch #1176012 added support to the 'parser' module and 'compiler' package
(thanks to logistix for that added support).
- Patch #1115086: Support PY_LONGLONG in structmember.
- Bug #1155938: new style classes did not check that __init__() was
returning None.
- Patch #802188: Report characters after line continuation character
('\') with a specific error message.
- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
- Bug #1124295: the __name__ attribute of file objects was
inadvertently made inaccessible in restricted mode.
- Bug #1074011: closing sys.std{out,err} now causes a flush() and
an ferror() call.
- min() and max() now support key= arguments with the same meaning as in
list.sort().
- The peephole optimizer now performs simple constant folding in expressions:
(2+3) --> (5).
- set and frozenset objects can now be marshalled. SF #1098985.
- Bug #1077106: Poor argument checking could cause memory corruption
in calls to os.read().
- The parser did not complain about future statements in illegal
positions. It once again reports a syntax error if a future
statement occurs after anything other than a doc string.
- Change the %s format specifier for str objects so that it returns a
unicode instance if the argument is not an instance of basestring and
calling __str__ on the argument returns a unicode instance.
- Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
current thread state when the auto-GIL-state machinery knows about
it (since the thread state is being deleted, continuing to remember it
can't help, but can hurt if another thread happens to get created with
the same thread id).
Extension Modules
-----------------
- Patch #1380952: fix SSL objects timing out on consecutive read()s
- Patch #1309579: wait3 and wait4 were added to the posix module.
- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
In addition, the existing ulaw code was updated.
- RFE #567972: Socket objects' family, type and proto properties are
now exposed via new attributes.
- Everything under lib-old was removed. This includes the following modules:
Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
util, whatsound, whrandom, zmod
- The following modules were removed: regsub, reconvert, regex, regex_syntax.
- re and sre were swapped, so help(re) provides full help. importing sre
is deprecated. The undocumented re.engine variable no longer exists.
- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
SS2 (single-shift 2) escape sequences correctly.
- The unicodedata module was updated to the 4.1 version of the Unicode
database. The 3.2 version is still available as unicodedata.db_3_2_0
for applications that require this specific version (such as IDNA).
- The timing module is no longer built by default. It was deprecated
in PEP 4 in Python 2.0 or earlier.
- Patch 1433928: Added a new type, defaultdict, to the collections module.
This uses the new __missing__ hook behavior added to dict (see above).
- Bug #854823: socketmodule now builds on Sun platforms even when
INET_ADDRSTRLEN is not defined.
- Patch #1393157: os.startfile() now has an optional argument to specify
a "command verb" to invoke on the file.
- Bug #876637, prevent stack corruption when socket descriptor
is larger than FD_SETSIZE.
- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
mmap.mmap(0, size) should not be used on Windows for anonymous memory.
- Patch #1422385: The nis module now supports access to domains other
than the system default domain.
- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
are reported, the limit on path name lengths is removed, and stat reports
WindowsError now (instead of OSError).
- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
before the env.
- Patch #1103116: Basic AF_NETLINK support.
- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
Also fix ungetmouse() which did not accept arguments properly.
The code now conforms to the documented signature.
- Bug #1400115, Fix segfault when calling curses.panel.userptr()
without prior setting of the userptr.
- Fix 64-bit problems in bsddb.
- Patch #1365916: fix some unsafe 64-bit mmap methods.
- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
problem on AIX.
- Bug #869197: os.setgroups rejects long integer arguments
- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
- Bug #1344508, Fix UNIX mmap leaking file descriptors
- Patch #1338314, Bug #1336623: fix tarfile so it can extract
REGTYPE directories from tarfiles written by old programs.
- Patch #1407992, fixes broken bsddb module db associate when using
BerkeleyDB 3.3, 4.0 or 4.1.
- Get bsddb module to build with BerkeleyDB version 4.4
- Get bsddb module to build with BerkeleyDB version 3.2
- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
but Python incorrectly assumes it is in UTF-8 format
- Fix parse errors in the readline module when compiling without threads.
- Patch #1288833: Removed thread lock from socket.getaddrinfo on
FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
- Patches #1298449 and #1298499: Add some missing checks for error
returns in cStringIO.c.
- Patch #1297028: fix segfault if call type on MultibyteCodec,
MultibyteStreamReader, or MultibyteStreamWriter
- Fix memory leak in posix.access().
- Patch #1213831: Fix typo in unicodedata._getcode.
- Bug #1007046: os.startfile() did not accept unicode strings encoded in
the file system encoding.
- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
platforms that don't have inet_aton().
- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
line without newlines.
- Bug #728515: mmap.resize() now resizes the file on Unix as it did
on Windows.
- Patch #1180695: Add nanosecond stat resolution, and st_gen,
st_birthtime for FreeBSD.
- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
the request code argument, which results in more C-like behaviour
for large or negative values.
- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
implementation treated all integer values except 1 as false.
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
- Patch #1212117: os.stat().st_flags is now accessible as an attribute
if available on the platform.
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
available on the platform.
- Bug #1166660: The readline module could segfault if hook functions
were set in a different thread than that which called readline.
- collections.deque objects now support a remove() method.
- operator.itemgetter() and operator.attrgetter() now support retrieving
multiple fields. This provides direct support for sorting on multiple
keys (primary, secondary, etc).
- os.access now supports Unicode path names on non-Win32 systems.
- Patches #925152, #1118602: Avoid reading after the end of the buffer
in pyexpat.GetInputContext.
- Patches #749830, #1144555: allow UNIX mmap size to default to current
file size.
- Added functional.partial(). See PEP309.
- Patch #1093585: raise a ValueError for negative history items in readline.
{remove_history,replace_history}
- The spwd module has been added, allowing access to the shadow password
database.
- stat_float_times is now True.
- array.array objects are now picklable.
- the cPickle module no longer accepts the deprecated None option in the
args tuple returned by __reduce__().
- itertools.islice() now accepts None for the start and step arguments.
This allows islice() to work more readily with slices:
islice(s.start, s.stop, s.step)
- datetime.datetime() now has a strptime class method which can be used to
create datetime object using a string and format.
- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
Library
-------
- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
been renamed to have only a single underscore prefix. This was done to
make subclassing easier.
- PEP 338: new module runpy defines a run_module function to support
executing modules which provide access to source code or a code object
via the PEP 302 import mechanisms.
- The email module's parsedate_tz function now sets the daylight savings
flag to -1 (unknown) since it can't tell from the date whether it should
be set.
- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
now sport attributes that provide access to the parts of the result.
- Patch #1462498: sgmllib now handles entity and character references
in attribute values.
- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
later to build this - if you have an earlier version, the C extension
module will not be built.
- Bug #1460340: ``random.sample(dict)`` failed in various ways. Dicts
aren't officially supported here, and trying to use them will probably
raise an exception some day. But dicts have been allowed, and "mostly
worked", so support for them won't go away without warning.
- Bug #1445068: getpass.getpass() can now be given an explicit stream
argument to specify where to write the prompt.
- Patch #1462313, bug #1443328: the pickle modules now can handle classes
that have __private names in their __slots__.
- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
- patch #1457316: "setup.py upload" now supports --identity to select the
key to be used for signing the uploaded code.
- Queue.Queue objects now support .task_done() and .join() methods
to make it easier to monitor when daemon threads have completed
processing all enqueued tasks. Patch #1455676.
- popen2.Popen objects now preserve the command in a .cmd attribute.
- Added the ctypes ffi package.
- email 4.0 package now integrated. This is largely the same as the email 3.0
package that was included in Python 2.3, except that PEP 8 module names are
now used (e.g. mail.message instead of email.Message). The MIME classes
have been moved to a subpackage (e.g. email.mime.text instead of
email.MIMEText). The old names are still supported for now. Several
deprecated Message methods have been removed and lots of bugs have been
fixed. More details can be found in the email package documentation.
- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
(a subclass of tuple) that provides incremental decoders and encoders
(a way to use stateful codecs without the stream API). Python functions
codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
have been added.
- Patch #1359365: Calling next() on a closed StringIO.String object raises
a ValueError instead of a StopIteration now (like file and cString.String do).
cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
called before (like file and StringIO.StringIO do).
- A regrtest option -w was added to re-run failed tests in verbose mode.
- Patch #1446372: quit and exit can now be called from the interactive
interpreter to exit.
- The function get_count() has been added to the gc module, and gc.collect()
grew an optional 'generation' argument.
- A library msilib to generate Windows Installer files, and a distutils
command bdist_msi have been added.
- PEP 343: new module contextlib.py defines decorator @contextmanager
and helpful context managers nested() and closing().
- The compiler package now supports future imports after the module docstring.
- Bug #1413790: zipfile now sanitizes absolute archive names that are
not allowed by the specs.
- Patch #1215184: FileInput now can be given an opening hook which can
be used to control how files are opened.
- Patch #1212287: fileinput.input() now has a mode parameter for
specifying the file mode input files should be opened with.
- Patch #1215184: fileinput now has a fileno() function for getting the
current file number.
- Patch #1349274: gettext.install() now optionally installs additional
translation functions other than _() in the builtins namespace.
- Patch #1337756: fileinput now accepts Unicode filenames.
- Patch #1373643: The chunk module can now read chunks larger than
two gigabytes.
- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
- Bug #1430298: It is now possible to send a mail with an empty
return address using smtplib.
- Bug #1432260: The names of lambda functions are now properly displayed
in pydoc.
- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
unless the system is Win32.
- Patch #1349118: urllib now supports user:pass@ style proxy
specifications, raises IOErrors when proxies for unsupported protocols
are defined, and uses the https proxy on https redirections.
- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
- Bug #1407902: Add support for sftp:// URIs to urlparse.
- Bug #1371247: Update Windows locale identifiers in locale.py.
- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
any more.
- Bug #1403410: The warnings module now doesn't get confused
when it can't find out the module name it generates a warning for.
- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
LoadError as documented, instead of IOError. For compatibility,
LoadError subclasses IOError.
- Added the hashlib module. It provides secure hash functions for MD5 and
SHA1, 224, 256, 384, and 512. Note that recent developments make the
historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
Ronald L. Rivest offered this advice for Python:
"The consensus of researchers in this area (at least as
expressed at the NIST Hash Function Workshop 10/31/05),
is that SHA-256 is a good choice for the time being, but
that research should continue, and other alternatives may
arise from this research. The larger SHA's also seem OK."
- Added a subset of Fredrik Lundh's ElementTree package. Available
modules are xml.etree.ElementTree, xml.etree.ElementPath, and
xml.etree.ElementInclude, from ElementTree 1.2.6.
- Patch #1162825: Support non-ASCII characters in IDLE window titles.
- Bug #1365984: urllib now opens "data:" URLs again.
- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
is raised within the method itself on a previous call (e.g., passing in an
illegal argument)
- Bug #1340337: change time.strptime() to always return ValueError when there
is an error in the format string.
- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
- Bug #729103: pydoc.py: Fix docother() method to accept additional
"parent" argument.
- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
for padding.
- Bug #1296004: httplib.py: Limit maximal amount of data read from the
socket to avoid a MemoryError on Windows.
- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
to get the correct encoding.
- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
languages.
- Patch #1268314: Cache lines in StreamReader.readlines for performance.
- Bug #1290505: Fix clearing the regex cache for time.strptime().
- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
functionality.
- Bug #1163178: Make IDNA return an empty string when the input is empty.
- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
separator and do not output trailing semicolon.
- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
ContentTooShortException, when the actually downloaded size does not
match the Content-Length header.
- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
- Bug #1178484: Return complete lines from codec stream readers
even if there is an exception in later lines, resulting in
correct line numbers for decoding errors in source code.
- Bug #1192315: Disallow negative arguments to clear() in pdb.
- Patch #827386: Support absolute source paths in msvccompiler.py.
- Patch #1105730: Apply the new implementation of commonprefix in posixpath
to ntpath, macpath, os2emxpath and riscospath.
- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
__hasattr__ and __delattr__ methods on class Tk that were breaking
Tkdnd.
- Bug #1015140: disambiguated the term "article id" in nntplib docs and
docstrings to either "article number" or "message id".
- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
parameter, but uses the usual "kwargs=None".
- textwrap now processes text chunks at O(n) speed instead of O(n**2).
Patch #1209527 (Contributed by Connelly).
- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
to W3C name (404 -> 'Not Found'). RFE #1216944.
- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
as this can cause problems with apps closing all file descriptors.
- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
it can be missing in embedded interpreters
- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
error messages.
- Bug #1108948: Cookie.py produced invalid JavaScript code.
- The tokenize module now detects and reports indentation errors.
Bug #1224621.
- The tokenize module has a new untokenize() function to support a full
roundtrip from lexed tokens back to Python source code. In addition,
the generate_tokens() function now accepts a callable argument that
terminates by raising StopIteration.
- Bug #1196315: fix weakref.WeakValueDictionary constructor.
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
component of the path.
- Patch #1120353: The xmlrpclib module provides better, more transparent,
support for datetime.{datetime,date,time} objects. With use_datetime set
to True, applications shouldn't have to fiddle with the DateTime wrapper
class at all.
- distutils.commands.upload was added to support uploading distribution
files to PyPI.
- distutils.commands.register now encodes the data as UTF-8 before posting
them to PyPI.
- decimal operator and comparison methods now return NotImplemented
instead of raising a TypeError when interacting with other types. This
allows other classes to implement __radd__ style methods and have them
work as expected.
- Bug #1163325: Decimal infinities failed to hash. Attempting to
hash a NaN raised an InvalidOperation instead of a TypeError.
- Patch #918101: Add tarfile open mode r|* for auto-detection of the
stream compression; add, for symmetry reasons, r:* as a synonym of r.
- Patch #1043890: Add extractall method to tarfile.
- Patch #1075887: Don't require MSVC in distutils if there is nothing
to build.
- Patch #1103407: Properly deal with tarfile iterators when untarring
symbolic links on Windows.
- Patch #645894: Use getrusage for computing the time consumption in
profile.py if available.
- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
- Patch #1117454: Remove code to special-case cookies without values
in LWPCookieJar.
- Patch #1117339: Add cookielib special name tests.
- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
- Patch #1107973: Allow iterating over the lines of a tarfile.ExFileObject.
- Patch #1104111: Alter setup.py --help and --help-commands.
- Patch #1121234: Properly cleanup _exit and tkerror commands.
- Patch #1049151: xdrlib now unpacks booleans as True or False.
- Fixed bug in a NameError bug in cookielib. Patch #1116583.
- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
disables recursive traversal through instance attributes, which can
be exploited in various ways.
- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
flags on the HTTP listening socket.
- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
Fixed by reading the HTTP body in chunks instead of one big socket.read().
- Patches #893642, #1039083: add allow_none, encoding arguments to
constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
- Bug #1110478: Revert os.environ.update to do putenv again.
- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
- Enhancements to the csv module:
+ Dialects are now validated by the underlying C code, better
reflecting its capabilities, and improving its compliance with
PEP 305.
+ Dialect parameter parsing has been re-implemented to improve error
reporting.
+ quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
dictates.
+ the parser now removes the escapechar prefix from escaped characters.
+ when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
types, rather than any object that can be represented as a numeric.
+ when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
to floats.
+ reader now allows \r characters to be quoted (previously it only allowed
\n to be quoted).
+ writer doublequote handling improved.
+ Dialect classes passed to the module are no longer instantiated by
the module before being parsed (the former validation scheme required
this, but the mechanism was unreliable).
+ The dialect registry now contains instances of the internal
C-coded dialect type, rather than references to python objects.
+ the internal c-coded dialect type is now immutable.
+ register_dialect now accepts the same keyword dialect specifications
as the reader and writer, allowing the user to register dialects
without first creating a dialect class.
+ a configurable limit to the size of parsed fields has been added -
previously, an unmatched quote character could result in the entire
file being read into the field buffer before an error was reported.
+ A new module method csv.field_size_limit() has been added that sets
the parser field size limit (returning the former limit). The initial
limit is 128kB.
+ A line_num attribute has been added to the reader object, which tracks
the number of lines read from the source iterator. This is not
the same as the number of records returned, as records can span
multiple lines.
+ reader and writer objects were not being registered with the cyclic-GC.
This has been fixed.
- _DummyThread objects in the threading module now delete self.__block that is
inherited from _Thread since it uses up a lock allocated by 'thread'. The
lock primitives tend to be limited in number and thus should not be wasted on
a _DummyThread object. Fixes bug #1089632.
- The imghdr module now detects Exif files.
- StringIO.truncate() now correctly adjusts the size attribute.
(Bug #951915).
- locale.py now uses an updated locale alias table (built using
Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
alias file); the encoding lookup was enhanced to use Python's
encoding alias table.
- moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
- the pickle module no longer accepts the deprecated None option in the
args tuple returned by __reduce__().
- optparse now optionally imports gettext. This allows its use in setup.py.
- the pickle module no longer uses the deprecated bin parameter.
- the shelve module no longer uses the deprecated binary parameter.
- the pstats module no longer uses the deprecated ignore() method.
- the filecmp module no longer uses the deprecated use_statcache argument.
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
extended or overridden by subclasses. Formerly, the subclassed method would
be ignored by the rest of the module. (Bug #1078905).
- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
the same meaning as in list.sort().
- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
once when a size argument is given. This prevents a buffer overflow in the
tokenizer with very long source lines.
- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
immediately after creating the object, without any intervening
``.decompress()`` calls.
- The reconvert.quote function can now emit triple-quoted strings. The
reconvert module now has some simple documentation.
- ``UserString.MutableString`` now supports negative indices in
``__setitem__`` and ``__delitem__``
- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
correctly.
- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
``codecs.StreamReader.readline()`` has a trailing "\r", read one more
character even if the user has passed a size parameter to get a proper
line ending. Remove the special handling of a "\r\n" that has been split
between two lines.
- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
about illegal code points. The codec now supports PEP 293 style error
handlers.
- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
from the input stream, so that the output is a byte string in the correct
encoding instead of a unicode string.
- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
considering it exactly like a '*'.
- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
``encodings.aliases``.
- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
- Patch #1413711: Certain patterns of differences were making difflib
touch the recursion limit.
- Bug #947906: An object oriented interface has been added to the calendar
module. It's possible to generate HTML calendar now and the module can be
called as a script (e.g. via ``python -mcalendar``). Localized month and
weekday names can be output (even if an exotic encoding is used) using
special classes that use unicode.
Build
-----
- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
by using -mieee gcc option.
- Patch #1432345: Make python compile on DragonFly.
- Build support for Win64-AMD64 was added.
- Patch #1428494: Prefer linking against ncursesw over ncurses library.
- Patch #881820: look for openpty and forkpty also in libbsd.
- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
The zlib module is now built in on Windows.
- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
- Bug #1189330: configure did not correctly determine the necessary
value of LINKCC if python was built with GCC 4.0.
- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
vulnerability in zlib 1.2.1 and 1.2.2.
- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
flags that change binary compatibility. Changes were also made to
distutils.sysconfig to also use the environment variable when used during
compilation of the interpreter and of C extensions through distutils.
- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
and linking has changed (prebinding is now deprecated, and libcc_dynamic
no longer exists). This configure patch makes things right.
- Bug #1158607: Build with --disable-unicode again.
- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
defined. Discovered as a result of not being able to build on OS X.
- setup.py now uses the directories specified in LDFLAGS using the -L option
and in CPPFLAGS using the -I option for adding library and include
directories, respectively, for compiling extension modules against. This has
led to the core being compiled using the values in CPPFLAGS. It also removes
the need for the special-casing of both DarwinPorts and Fink for darwin since
the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
Fink, ``-I/opt/local/include`` for DarwinPorts).
- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
Closes bug #1096244. Thanks Gregory Bond.
C API
-----
- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
``PyObject_{Free, FREE}``. They map to the system ``free()`` now. If memory
is obtained via the ``PyObject_`` family, it must be released via the
``PyObject_`` family, and likewise for the ``PyMem_`` family. This has
always been officially true, but when Python's small-object allocator was
introduced, an attempt was made to cater to a few extension modules
discovered at the time that obtained memory via ``PyObject_New`` but
released it via ``PyMem_DEL``. It's years later, and if such code still
exists it will fail now (probably with segfaults, but calling wrong
low-level memory management functions can yield many symptoms).
- Added a C API for set and frozenset objects.
- Removed PyRange_New().
- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
mapping argument now. This string is used as a mapping table. Byte values
greater than the length of the string and 0xFFFE are treated as undefined
mappings.
Tests
-----
- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
- Patch #1276356: New resource "urlfetch" is implemented. This enables
even impatient people to run tests that require remote files.
Documentation
-------------
- Bug #1402224: Add warning to dl docs about crashes.
- Bug #1396471: Document that Windows' ftell() can return invalid
values for text files with UNIX-style line endings.
- Bug #1274828: Document os.path.splitunc().
- Bug #1190204: Clarify which directories are searched by site.py.
- Bug #1193849: Clarify os.path.expanduser() documentation.
- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
- Bug #755617: Document the effects of os.chown() on Windows.
- Patch #1180012: The documentation for modulefinder is now in the library reference.
- Patch #1213031: Document that os.chown() accepts argument values of -1.
- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
- Bug #1175022: Correct the example code for property().
- Document the IterableUserDict class in the UserDict module.
Closes bug #1166582.
- Remove all latent references for "Macintosh" that referred to semantics for
Mac OS 9 and change to reflect the state for OS X.
Closes patch #1095802. Thanks Jack Jansen.
Mac
---
New platforms
-------------
- FreeBSD 7 support is added.
Tools/Demos
-----------
- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
directory for syntax highlighting in Vim. Vim directory was added and placed
vimrc to it (was previous up a level).
- Added two new files to Tools/scripts: pysource.py, which recursively
finds Python source files, and findnocoding.py, which finds Python
source files that need an encoding declaration.
Patch #784089, credits to Oleg Broytmann.
- Bug #1072853: pindent.py used an uninitialized variable.
- Patch #1177597: Correct Complex.__init__.
- Fixed a display glitch in Pynche, which could cause the right arrow to
wiggle over by a pixel.
What's New in Python 2.4 final?
===============================
*Release date: 30-NOV-2004*
Core and builtins
-----------------
- Bug 875692: Improve signal handling, especially when using threads, by
forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
things_to_do is not cleared by Py_MakePendingCalls().
What's New in Python 2.4 (release candidate 1)
==============================================
*Release date: 18-NOV-2004*
Core and builtins
-----------------
- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
the years-old thread shutdown race bug 225673. Numeric history lesson
aside, all bugs in all three reports are fixed now.
Library
-------
- Bug 1052242: If exceptions are raised by an atexit handler function an
attempt is made to execute the remaining handlers. The last exception
raised is re-raised.
- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
doctests was broken in a dramatic but shallow way. Fixed.
- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
and ``month_abbr`` attributes emulate sequences of locale-correct
spellings of month and day names. Because the locale can change at
any time, the correct spelling is recomputed whenever one of these is
indexed. In the worst case, the index may be a slice object, so these
recomputed every day or month name each time they were indexed. This is
much slower than necessary in the usual case, when the index is just an
integer. In that case, only the single spelling needed is recomputed
now; and, when the index is a slice object, only the spellings needed
by the slice are recomputed now.
- Patch 1061679: Added ``__all__`` to pickletools.py.
Build
-----
- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
which has no known users. Thanks Bob Ippolito.
C API
-----
- The PyRange_New() function is deprecated.
What's New in Python 2.4 beta 2?
================================
*Release date: 03-NOV-2004*
License
-------
The Python Software Foundation changed the license under which Python
is released, to remove Python version numbers. There were no other
changes to the license. So, for example, wherever the license for
Python 2.3 said "Python 2.3", the new license says "Python". The
intent is to make it possible to refer to the PSF license in a more
durable way. For example, some people say they're confused by that
the Open Source Initiative's entry for the Python Software Foundation
License::
https://opensource.org/licenses/PythonSoftFoundation.php
says "Python 2.1.1" all over it, wondering whether it applies only
to Python 2.1.1.
The official name of the new license is the Python Software Foundation
License Version 2.
Core and builtins
-----------------
- Bug #1055820 Cyclic garbage collection was not protecting against that
calling a live weakref to a piece of cyclic trash could resurrect an
insane mutation of the trash if any Python code ran during gc (via
running a dead object's __del__ method, running another callback on a
weakref to a dead object, or via any Python code run in any other thread
that managed to obtain the GIL while a __del__ or callback was running
in the thread doing gc). The most likely symptom was "impossible"
``AttributeError`` exceptions, appearing seemingly at random, on weakly
referenced objects. The cure was to clear all weakrefs to unreachable
objects before allowing any callbacks to run.
- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
Extension Modules
-----------------
- Bug #1048870: the compiler now generates distinct code objects for
functions with identical bodies. This was producing confusing
traceback messages which pointed to the function where the code
object was first defined rather than the function being executed.
Library
-------
- Patch #1056967 changes the semantics of Template.safe_substitute() so that
no ValueError is raised on an 'invalid' match group. Now the delimiter is
returned.
- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
paths with a base path before checking os.path.isfile().
- The whichdb module can now be run from the command line.
- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
the year) when the day of the week and year are also specified.
- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
- Bug #1017553: fix bug in tarfile.filemode()
- Patch #737473: fix bug that old source code is shown in tracebacks even if
the source code is updated and reloaded.
Build
-----
- Patch #1044395: --enable-shared is allowed in FreeBSD also.
What's New in Python 2.4 beta 1?
================================
*Release date: 15-OCT-2004*
Core and builtins
-----------------
- Patch #975056: Restartable signals were not correctly disabled on
BSD systems. Consistently use PyOS_setsig() instead of signal().
- The internal portable implementation of thread-local storage (TLS), used
by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
thread-correct. This could lead to a variety of problems, up to and
including segfaults. See bug 1041645 for an example.
- Added a command line option, -m module, which searches sys.path for the
module and then runs it. (Contributed by Nick Coghlan.)
- The bytecode optimizer now folds tuples of constants into a single
constant.
- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
an integer was compared to a float, the integer was coerced to a float.
That could yield spurious overflow errors (if the integer was very
large), and to anomalies such as
``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
longer performed, and cases like ``long(1e200)-1 < 1e200``,
``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
correctly now.
Extension modules
-----------------
- ``collections.deque`` objects didn't play quite right with garbage
collection, which could lead to a segfault in a release build, or
an assert failure in a debug build. Also, added overflow checks,
better detection of mutation during iteration, and shielded deque
comparisons from unusual subclass overrides of the __iter__() method.
Library
-------
- Patch 1046644: distutils build_ext grew two new options - --swig for
specifying the swig executable to use, and --swig-opts to specify
options to pass to swig. --swig-opts="-c++" is the new way to spell
--swig-cpp.
- Patch 983206: distutils now obeys environment variable LDSHARED, if
it is set.
- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
- time.strptime() now properly escapes timezones and all other locale-specific
strings for regex-specific symbols. Was breaking under Japanese Windows when
the timezone was specified as "Tokyo (standard time)".
Closes bug #1039270.
- Updates for the email package:
+ email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
+ All deprecated APIs that in email 2.x issued warnings have been removed:
_encoder argument to the MIMEText constructor, Message.add_payload(),
Utils.dump_address_pair(), Utils.decode(), Utils.encode()
+ New deprecations: Generator.__call__(), Message.get_type(),
Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
the Parser constructor. These will be removed in email 3.1.
+ Support for Python earlier than 2.3 has been removed (see PEP 291).
+ All defect classes have been renamed to end in 'Defect'.
+ Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
added to messages that claim to be multipart but really aren't.
+ Updates to documentation.
- re's findall() and finditer() functions now take an optional flags argument
just like the compile(), search(), and match() functions. Also, documented
the previously existing start and stop parameters for the findall() and
finditer() methods of regular expression objects.
- rfc822 Messages now support iterating over the headers.
- The (undocumented) tarfile.Tarfile.membernames has been removed;
applications should use the getmember function.
- httplib now offers symbolic constants for the HTTP status codes.
- SF bug #1028306: Trying to compare a ``datetime.date`` to a
``datetime.datetime`` mistakenly compared only the year, month and day.
Now it acts like a mixed-type comparison: ``False`` for ``==``,
``True`` for ``!=``, and raises ``TypeError`` for other comparison
operators. Because datetime is a subclass of date, comparing only the
base class (date) members can still be done, if that's desired, by
forcing using of the appropriate date method; e.g.,
``a_date.__eq__(a_datetime)`` is true if and only if the year, month
and day members of ``a_date`` and ``a_datetime`` are equal.
- bdist_rpm now supports command line options --force-arch,
{pre,post}-install, {pre,post}-uninstall, and
{prep,build,install,clean,verify}-script.
- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
decoding incomplete input (when the input stream is temporarily exhausted).
``codecs.StreamReader`` now implements buffering, which enables proper
readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
has a new argument ``chars`` which specifies the number of characters to
return. ``codecs.StreamReader.readline()`` and
``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
- The documentation for doctest is greatly expanded, and now covers all
the new public features (of which there are many).
- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
updates it. This isn't good, because every ``testmod()`` call
contributes to bloating the "hidden" state of ``doctest.master``, but
some old code apparently relies on it. For now, all we can do is
encourage people to stitch doctests together via doctest's unittest
integration features instead.
- httplib now handles ipv6 address/port pairs.
- SF bug #1017864: ConfigParser now correctly handles default keys,
processing them with ``ConfigParser.optionxform`` when supplied,
consistent with the handling of config file entries and runtime-set
options.
- SF bug #997050: Document, test, & check for non-string values in
ConfigParser. Moved the new string-only restriction added in
rev. 1.65 to the SafeConfigParser class, leaving existing
ConfigParser & RawConfigParser behavior alone, and documented the
conditions under which non-string values work.
Build
-----
- Building on darwin now includes /opt/local/include and /opt/local/lib for
building extension modules. This is so as to include software installed as
a DarwinPorts port <http://darwinports.opendarwin.org/>
- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
platform C computes true for ``x != x`` if and only if X is a NaN.
Other platforms can override the default definition with a platform-
specific spelling in that platform's pyconfig.h. You can also override
pyport.h's default Py_IS_INFINITY definition now.
C API
-----
- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
non-zero if PyEval_InitThreads() has been called.
- The undocumented and unused extern int ``_PyThread_Started`` was removed.
- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
are two of the very few advertised as being safe to call without holding
the GIL. However, this wasn't true in a debug build, as bug 1041645
demonstrated. In a debug build, Python redirects the ``PyMem`` family
of calls to Python's small-object allocator, to get the benefit of
its extra debugging capabilities. But Python's small-object allocator
isn't threadsafe, relying on the GIL to avoid the expense of doing its
own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
call the platform ``malloc()`` directly now, regardless of build type.
- PyLong_AsUnsignedLong[Mask] now support int objects as well.
- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
decoding.
Tests
-----
- test__locale ported to unittest
Mac
---
- ``plistlib`` now supports non-dict root objects. There is also a new
interface for reading and writing plist files: ``readPlist(pathOrFile)``
and ``writePlist(rootObject, pathOrFile)``
Tools/Demos
-----------
- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
read the input files in universal-newline mode. This spares them
from consuming a great deal of time to deduce the useless result that,
e.g., a file with Windows line ends and a file with Linux line ends
have no lines in common.
What's New in Python 2.4 alpha 3?
=================================
*Release date: 02-SEP-2004*
Core and builtins
-----------------
- SF patch #1007189: ``from ... import ...`` statements now allow the name
list to be surrounded by parentheses.
- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
multiplication was sped a little by optimizing the C code. Gradeschool
squaring was sped by about a factor of 2, by exploiting that about half
the digit products are duplicates in a square. Because exponentiation
uses squaring often, this also speeds long power. For example, the time
to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
to this much. The cutoff for Karatsuba multiplication was raised,
since gradeschool multiplication got quicker, and the cutoff was
aggressively small regardless. The exponentiation algorithm was switched
from right-to-left to left-to-right, which is more efficient for small
bases. In addition, if the exponent is large, the algorithm now does
5 bits (instead of 1 bit) at a time. That cut the time to compute
17**1000000 on my box in half again, down to about 4.5 seconds.
- OverflowWarning is no longer generated. PEP 237 scheduled this to
occur in Python 2.3, but since OverflowWarning was disabled by default,
nobody realized it was still being generated. On the chance that user
code is still using them, the Python builtin OverflowWarning, and
corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
- Py_InitializeEx has been added.
- Fix the order of application of decorators. The proper order is bottom-up;
the first decorator listed is the last one called.
- SF patch #1005778. Fix a seg fault if the list size changed while
calling list.index(). This could happen if a rich comparison function
modified the list.
- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
functions is now writable.
- code_new (a.k.a new.code()) now checks its arguments sufficiently
carefully that passing them on to PyCode_New() won't trigger calls
to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
that the returned code object might be entirely insane.
- Subclasses of string can no longer be interned. The semantics of
interning were not clear here -- a subclass could be mutable, for
example -- and had bugs. Explicitly interning a subclass of string
via intern() will raise a TypeError. Internal operations that attempt
to intern a string subclass will have no effect.
- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
what xrange() intends, and repaired tests accordingly.
Extension modules
-----------------
- difflib now supports HTML side-by-side diff.
- os.urandom has been added for systems that support sources of random
data.
- Patch 1012740: truncate() on a writable cStringIO now resets the
position to the end of the stream. This is consistent with the original
StringIO module and avoids inadvertently resurrecting data that was
supposed to have been truncated away.
- Added socket.socketpair().
- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
members to xml.parsers.expat.XMLParser object.
- The mpz, rotor, and xreadlines modules, all deprecated in earlier
versions of Python, have now been removed.
Library
-------
- Patch #934356: if a module defines __all__, believe that rather than using
heuristics for filtering out imported names.
- Patch #941486: added os.path.lexists(), which returns True for broken
symlinks, unlike os.path.exists().
- the random module now uses os.urandom() for seeding if it is available.
Added a new generator based on os.urandom().
- difflib and diff.py can now generate HTML.
- bdist_rpm now includes version and release in the BuildRoot, and
replaces - by ``_`` in version and release.
- distutils build/build_scripts now has an -e option to specify the
path to the Python interpreter for installed scripts.
- PEP 292 classes Template and SafeTemplate are added to the string module.
- tarfile now generates GNU tar files by default.
- HTTPResponse has now a getheaders method.
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
Percivall.
- logging.handlers.SMTPHandler.date_time has been removed;
the class now uses email.Utils.formatdate to generate the time stamp.
- A new function tkFont.nametofont was added to return an existing
font. The Font class constructor now has an additional exists argument
which, if True, requests to return/configure an existing font, rather
than creating a new one.
- Updated the decimal package's min() and max() methods to match the
latest revision of the General Decimal Arithmetic Specification.
Quiet NaNs are ignored and equal values are sorted based on sign
and exponent.
- The decimal package's Context.copy() method now returns deep copies.
- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
attribute will be kept around for backwards compatibility and atexit
will just become the one preferred way to do it.
- patch #675551: Add get_history_item and replace_history_item functions
to the readline module.
- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
frame, u(p) to an older frame, not the other way around.
- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
path, as normalizing the path may alter the meaning of the path if it
contains symlinks.
- bug #851123: shutil.copyfile will raise an exception when trying to copy a
file onto a link to itself. Thanks Gregory Ball.
- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
so as to properly list all functions in a module when the module itself is
reached through a symlink. Thanks Johannes Gijsbers.
- doctest refactoring continued. See the docs for details. As part of
this effort, some old and little- (never?) used features are now
deprecated: the Tester class, the module is_private() function, and the
isprivate argument to testmod(). The Tester class supplied a feeble
"by hand" way to combine multiple doctests, if you knew exactly what
you were doing. The newer doctest features for unittest integration
already did a better job of that, are stronger now than ever, and the
new DocTestRunner class is a saner foundation if you want to do it by
hand. The "private name" filtering gimmick was a mistake from the
start, and testmod() changed long ago to ignore it by default. If
you want to filter out tests, the new DocTestFinder class can be used
to return a list of all doctests, and you can filter that list by
any computable criteria before passing it to a DocTestRunner instance.
- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
Tools/Demos
-----------
- IDLE's shortcut keys for windows are now case insensitive so that
Control-V works the same as Control-v.
- pygettext.py: Generate POT-Creation-Date header in ISO format.
Build
-----
- Backward incompatibility: longintrepr.h now triggers a compile-time
error if SHIFT (the number of bits in a Python long "digit") isn't
divisible by 5. This new requirement allows simple code for the new
5-bits-at-a-time long_pow() implementation. If necessary, the
restriction could be removed (by complicating long_pow(), or by
falling back to the 1-bit-at-a-time algorithm), but there are no
plans to do so.
- bug #991962: When building with --disable-toolbox-glue on Darwin no
attempt to build Mac-specific modules occurs.
- The --with-tsc flag to configure to enable VM profiling with the
processor's timestamp counter now works on PPC platforms.
- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
GCC's definition and avoid redefinition warnings.
- Detect pthreads support (provided by gnu pth pthread emulation) on
GNU/k*BSD systems.
- bug #1005737, #1007249: Fixed several build problems and warnings
found on old/legacy C compilers of HP-UX, IRIX and Tru64.
C API
-----
..
Documentation
-------------
- patch #1005936, bug #1009373: fix index entries which contain
an underscore when viewed with Acrobat.
- bug #990669: os.path.normpath may alter the meaning of a path if
it contains symbolic links. This has been documented in a comment
since 1992, but is now in the library reference as well.
New platforms
-------------
- FreeBSD 6 is now supported.
Tests
-----
..
Windows
-------
- Boosted the stack reservation for python.exe and pythonw.exe from
the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
bigger than under VC 6.0 for 2.3.4 that deeply recursive programs
within the default sys.getrecursionlimit() default value of 1000 were
able to suffer undetected C stack overflows. The standard test program
test_compiler was one such program. If a Python process on Windows
"just vanishes" without a trace, and without an error message of any
kind, but with an exit code of 128, undetected stack overflow may be
the problem.
Mac
---
..
What's New in Python 2.4 alpha 2?
=================================
*Release date: 05-AUG-2004*
Core and builtins
-----------------
- Patch #980695: Implements efficient string concatenation for statements
of the form s=s+t and s+=t. This will vary across implementations.
Accordingly, the str.join() method is strongly preferred for performance
sensitive code.
- PEP-0318, Function Decorators have been added to the language. These are
implemented using the Java-style @decorator syntax, like so::
@staticmethod
def foo(bar):
(The PEP needs to be updated to reflect the current state)
- When importing a module M raises an exception, Python no longer leaves M
in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
succeed, picking up a module object from sys.modules reflecting as much
of the initialization of M as completed before the exception was raised.
Subsequent imports got no indication that M was in a partially-
initialized state, and the importers could get into arbitrarily bad
trouble as a result (the M they got was in an unintended state,
arbitrarily far removed from M's author's intent). Now subsequent
imports of M will continue raising exceptions (but if, for example, the
source code for M is edited between import attempts, then perhaps later
attempts will succeed, or raise a different exception).
This can break existing code, but in such cases the code was probably
working before by accident. In the Python source, the only case of
breakage discovered was in a test accidentally relying on a damaged
module remaining in sys.modules. Cases are also known where tests
deliberately provoking import errors remove damaged modules from
sys.modules themselves, and such tests will break now if they do an
unconditional del sys.modules[M].
- u'%s' % obj will now try obj.__unicode__() first and fallback to
obj.__str__() if no __unicode__ method can be found.
- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
- Allow string and unicode return types from .encode()/.decode()
methods on string and unicode objects. Added unicode.decode()
which was missing for no apparent reason.
- An attempt to fix the mess that is Python's behaviour with
signal handlers and threads, complicated by readline's behaviour.
It's quite possible that there are still bugs here.
- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
types that support garbage collection.
- Compiler now treats None as a constant.
- The type of values returned by __int__, __float__, __long__,
__oct__, and __hex__ are now checked. Returning an invalid type
will cause a TypeError to be raised. This matches the behavior of
Jython.
- Implemented bind_textdomain_codeset() in locale module.
- Added a workaround for proper string operations in BSDs. str.split
and str.is* methods can now work correctly with UTF-8 locales.
- Bug #989185: unicode.iswide() and unicode.width() is dropped and
the East Asian Width support is moved to unicodedata extension
module.
- Patch #941229: The source code encoding in interactive mode
now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
allows for non-latin-1 users to write unicode strings directly.
Extension modules
-----------------
- cpickle now supports the same keyword arguments as pickle.
Library
-------
- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
TIS-620
- Thanks to Edward Loper, doctest has been massively refactored, and
many new features were added. Full docs will appear later. For now
the doctest module comments and new test cases give good coverage.
The refactoring provides many hook points for customizing behavior
(such as how to report errors, and how to compare expected to actual
output). New features include a <BLANKLINE> marker for expected
output containing blank lines, options to produce unified or context
diffs when actual output doesn't match expectations, an option to
normalize whitespace before comparing, and an option to use an
ellipsis to signify "don't care" regions of output.
- Tkinter now supports the wish -sync and -use options.
- The following methods in time support passing of None: ctime(), gmtime(),
and localtime(). If None is provided, the current time is used (the
same as when the argument is omitted).
[SF bug 658254, patch 663482]
- nntplib does now allow ignoring a .netrc file.
- urllib2 now recognizes Basic authentication even if other authentication
schemes are offered.
- Bug #1001053. wave.open() now accepts unicode filenames.
- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
underlying file object (provided it has a fileno() method). This is
needed if you want to use os.fsync() on a GzipFile.
- imaplib has two new methods: deleteacl and myrights.
- nntplib has two new methods: description and descriptions. They
use a more RFC-compliant way of getting a newsgroup description.
- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
raised during interpreter shutdown from a registered function with atexit
when dummy_threading is being used.
- Bug #857297/Patch #916874. Fix an error when extracting a hard link
from a tarfile.
- Patch #846659. Fix an error in tarfile.py when using
GNU longname/longlink creation.
- The obsolete FCNTL.py has been deleted. The built-in fcntl module
has been available (on platforms that support fcntl) since Python
1.5a3, and all FCNTL.py did is export fcntl's names, after generating
a deprecation warning telling you to use fcntl directly.
- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
iso2022_jp_2004, shift_jis_2004.
- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
implementations, exploiting Conditions (which didn't exist at the time
Queue was introduced). A minor semantic change is that the Full and
Empty exceptions raised by non-blocking calls now occur only if the
queue truly was full or empty at the instant the queue was checked (of
course the Queue may no longer be full or empty by the time a calling
thread sees those exceptions, though). Before, the exceptions could
also be raised if it was "merely inconvenient" for the implementation
to determine the true state of the Queue (because the Queue was locked
by some other method in progress).
- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
case of comparing two empty lists. This affected both context_diff() and
unified_diff(),
- Bug #980938: smtplib now prints debug output to sys.stderr.
- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
returning the last point in the path that was not part of any loop. Thanks
AM Kuchling.
- Bug #980327: ntpath not handles compressing erroneous slashes between the
drive letter and the rest of the path. Also clearly handles UNC addresses now
as well. Thanks Paul Moore.
- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
for file sizes (compressed and uncompressed) was being stored as signed
instead of unsigned.
- decimal.py now only uses signals in the IBM spec. The other conditions are
no longer part of the public API.
- codecs module now has two new generic APIs: encode() and decode()
which don't restrict the return types (unlike the unicode and
string methods of the same name).
- Non-blocking SSL sockets work again; they were broken in Python 2.3.
SF patch 945642.
- doctest unittest integration improvements:
o Improved the unitest test output for doctest-based unit tests
o Can now pass setUp and tearDown functions when creating
DocTestSuites.
- The threading module has a new class, local, for creating objects
that provide thread-local data.
- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
no longer returns spurious empty fields.
- Implemented bind_textdomain_codeset() in gettext module.
- Introduced in gettext module the l*gettext() family of functions,
which return translation strings encoded in the preferred encoding,
as informed by locale module's getpreferredencoding().
- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
- Add expansion of default values in help text: the string
"%default" in an option's help string is expanded to str() of
that option's default value, or "none" if no default value.
- Bug #955889: option default values that happen to be strings are
now processed in the same way as values from the command line; this
allows generation of nicer help when using custom types. Can
be disabled with parser.set_process_default_values(False).
- Bug #960515: don't crash when generating help for callback
options that specify 'type', but not 'dest' or 'metavar'.
- Feature #815264: change the default help format for short options
that take an argument from e.g. "-oARG" to "-o ARG"; add
set_short_opt_delimiter() and set_long_opt_delimiter() methods to
HelpFormatter to allow (slight) customization of the formatting.
- Patch #736940: internationalize Optik: all built-in user-
targeted literal strings are passed through gettext.gettext(). (If
you want translations (.po files), they're not included with Python
-- you'll find them in the Optik source distribution from
http://optik.sourceforge.net/ .)
- Bug #878453: respect $COLUMNS environment variable for
wrapping help output.
- Feature #988122: expand "%prog" in the 'description' passed
to OptionParser, just like in the 'usage' and 'version' strings.
(This is *not* done in the 'description' passed to OptionGroup.)
C API
-----
- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
error occurs while loading the module, these now delete the module's
entry from sys.modules. All ways of loading modules eventually call
one of these, so this is an error-case change in semantics for all
ways of loading modules. In rare cases, a module loader may wish
to keep a module object in sys.modules despite that the module's
code cannot be executed. In such cases, the module loader must
arrange to reinsert the name and module object in sys.modules.
PyImport_ReloadModule() has been changed to reinsert the original
module object into sys.modules if the module reload fails, so that
its visible semantics have not changed.
- A large pile of datetime field-extraction macros is now documented,
thanks to Anthony Tuininga (patch #986010).
Documentation
-------------
- Improved the tutorial on creating types in C.
- point out the importance of reassigning data members before
assigning their values
- correct my misconception about return values from visitprocs. Sigh.
- mention the labor saving Py_VISIT and Py_CLEAR macros.
- Major rewrite of the math module docs, to address common confusions.
Tests
-----
- The test data files for the decimal test suite are now installed on
platforms that use the Makefile.
- SF patch 995225: The test file testtar.tar accidentally contained
CVS keywords (like $Id$), which could cause spurious failures in
test_tarfile.py depending on how the test file was checked out.
What's New in Python 2.4 alpha 1?
=================================
*Release date: 08-JUL-2004*
Core and builtins
-----------------
- weakref.ref is now the type object also known as
weakref.ReferenceType; it can be subclassed like any other new-style
class. There's less per-entry overhead in WeakValueDictionary
objects now (one object instead of three).
- Bug #951851: Python crashed when reading import table of certain
Windows DLLs.
- Bug #215126. The locals argument to eval(), execfile(), and exec now
accept any mapping type.
- marshal now shares interned strings. This change introduces
a new .pyc magic.
- Bug #966623. classes created with type() in an exec(, {}) don't
have a __module__, but code in typeobject assumed it would always
be there.
- Python no longer relies on the LC_NUMERIC locale setting to be
the "C" locale; as a result, it no longer tries to prevent changing
the LC_NUMERIC category.
- Bug #952807: Unpickling pickled instances of subclasses of
datetime.date, datetime.datetime and datetime.time could yield insane
objects. Thanks to Jiwon Seo for a fix.
- Bug #845802: Python crashes when __init__.py is a directory.
- Unicode objects received two new methods: iswide() and width().
These query East Asian width information, as specified in Unicode
TR11.
- Improved the tuple hashing algorithm to give fewer collisions in
common cases. Fixes bug #942952.
- Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
- Enabled the profiling of C extension functions (and builtins) - check
new documentation and modified profile and bdb modules for more details
- Set file.name to the object passed to open (instead of a new string)
- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
- Optimized the byte coding for multiple assignments like "a,b=b,a" and
"a,b,c=1,2,3". Improves their speed by 25% to 30%.
- Limit the nested depth of a tuple for the second argument to isinstance()
and issubclass() to the recursion limit of the interpreter.
Fixes bug #858016 .
- Optimized dict iterators, creating separate types for each
and having them reveal their length. Also optimized the
methods: keys(), values(), and items().
- Implemented a newcode opcode, LIST_APPEND, that simplifies
the generated bytecode for list comprehensions and further
improves their performance (about 35%).
- Implemented rich comparisons for floats, which seems to make
comparisons involving NaNs somewhat less surprising when the
underlying C compiler actually implements C99 semantics.
- Optimized list.extend() to save memory and no longer create
intermediate sequences. Also, extend() now pre-allocates the
needed memory whenever the length of the iterable is known in
advance -- this halves the time to extend the list.
- Optimized list resize operations to make fewer calls to the system
realloc(). Significantly speeds up list appends, list pops,
list comprehensions, and the list constructor (when the input iterable
length is not known).
- Changed the internal list over-allocation scheme. For larger lists,
overallocation ranged between 3% and 25%. Now, it is a constant 12%.
For smaller lists (n<8), overallocation was upto eight elements. Now,
the overallocation is no more than three elements -- this improves space
utilization for applications that have large numbers of small lists.
- Most list bodies now get re-used rather than freed. Speeds up list
instantiation and deletion by saving calls to malloc() and free().
- The dict.update() method now accepts all the same argument forms
as the dict() constructor. This now includes item lists and/or
keyword arguments.
- Support for arbitrary objects supporting the read-only buffer
interface as the co_code field of code objects (something that was
only possible to create from C code) has been removed.
- Made omitted callback and None equivalent for weakref.ref() and
weakref.proxy(); the None case wasn't handled correctly in all
cases.
- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
assumed that initial existing entries in an object's weakref list
would not be removed while allocating a new weakref object. Since
GC could be invoked at that time, however, that assumption was
invalid. In a truly obscure case of GC being triggered during
creation for a new weakref object for a referent which already
has a weakref without a callback which is only referenced from
cyclic trash, a memory error can occur. This consistently created a
segfault in a debug build, but provided less predictable behavior in
a release build.
- input() built-in function now respects compiler flags such as
__future__ statements. SF patch 876178.
- Removed PendingDeprecationWarning from apply(). apply() remains
deprecated, but the nuisance warning will not be issued.
- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
collection twice, both before and after tearing down modules. The
call after tearing down modules has been disabled, because too much
of Python has been torn down then for __del__ methods and weakref
callbacks to execute sanely. The most common symptom was a sequence
of uninformative messages on stderr when Python shut down, produced
by threads trying to raise exceptions, but unable to report the nature
of their problems because too much of the sys module had already been
destroyed.
- Removed FutureWarnings related to hex/oct literals and conversions
and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
This addresses most of the remaining semantic changes promised by
PEP 237, except for repr() of a long, which still shows the trailing
'L'. The PEP appears to promise warnings for operations that
changed semantics compared to Python 2.3, but this is not
implemented; we've suffered through enough warnings related to
hex/oct literals and I think it's best to be silent now.
- For str and unicode objects, the ljust(), center(), and rjust()
methods now accept an optional argument specifying a fill
character other than a space.
- When method objects have an attribute that can be satisfied either
by the function object or by the method object, the function
object's attribute usually wins. Christian Tismer pointed out that
this is really a mistake, because this only happens for special
methods (like __reduce__) where the method object's version is
really more appropriate than the function's attribute. So from now
on, all method attributes will have precedence over function
attributes with the same name.
- Critical bugfix, for SF bug 839548: if a weakref with a callback,
its callback, and its weakly referenced object, all became part of
cyclic garbage during a single run of garbage collection, the order
in which they were torn down was unpredictable. It was possible for
the callback to see partially-torn-down objects, leading to immediate
segfaults, or, if the callback resurrected garbage objects, to
resurrect insane objects that caused segfaults (or other surprises)
later. In one sense this wasn't surprising, because Python's cyclic gc
had no knowledge of Python's weakref objects. It does now. When
weakrefs with callbacks become part of cyclic garbage now, those
weakrefs are cleared first. The callbacks don't trigger then,
preventing the problems. If you need callbacks to trigger, then just
as when cyclic gc is not involved, you need to write your code so
that weakref objects outlive the objects they weakly reference.
- Critical bugfix, for SF bug 840829: if cyclic garbage collection
happened to occur during a weakref callback for a new-style class
instance, subtle memory corruption was the result (in a release build;
in a debug build, a segfault occurred reliably very soon after).
This has been repaired.
- Compiler flags set in PYTHONSTARTUP are now active in __main__.
- Added two built-in types, set() and frozenset().
- Added a reversed() built-in function that returns a reverse iterator
over a sequence.
- Added a sorted() built-in function that returns a new sorted list
from any iterable.
- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
- list.sort() now supports three keyword arguments: cmp, key, and reverse.
The key argument can be a function of one argument that extracts a
comparison key from the original record: mylist.sort(key=str.lower).
The reverse argument is a boolean value and if True will change the
sort order as if the comparison arguments were reversed. In addition,
the documentation has been amended to provide a guarantee that all sorts
starting with Py2.3 are guaranteed to be stable (the relative order of
records with equal keys is unchanged).
- Added test whether wchar_t is signed or not. A signed wchar_t is not
usable as internal unicode type base for Py_UNICODE since the
unicode implementation assumes an unsigned type.
- Fixed a bug in the cache of length-one Unicode strings that could
lead to a seg fault. The specific problem occurred when an earlier,
non-fatal error left an uninitialized Unicode object in the
freelist.
- The % formatting operator now supports '%F' which is equivalent to
'%f'. This has always been documented but never implemented.
- complex(obj) could leak a little memory if obj wasn't a string or
number.
- zip() with no arguments now returns an empty list instead of raising
a TypeError exception.
- obj.__contains__() now returns True/False instead of 1/0. SF patch
820195.
- Python no longer tries to be smart about recursive comparisons.
When comparing containers with cyclic references to themselves it
will now just hit the recursion limit. See SF patch 825639.
- str and unicode built-in types now have an rsplit() method that is
same as split() except that it scans the string from the end
working towards the beginning. See SF feature request 801847.
- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
to clear the error when attempts to get the __getstate__ attribute
fail caused intermittent errors and odd behavior.
- buffer objects based on other objects no longer cache a pointer to
the data and the data length. Instead, the appropriate tp_as_buffer
method is called as necessary.
- fixed: if a file is opened with an explicit buffer size >= 1, repeated
close() calls would attempt to free() the buffer already free()ed on
the first call.
Extension modules
-----------------
- Added socket.getservbyport(), and make the second argument in
getservbyname() and getservbyport() optional.
- time module code that deals with input POSIX timestamps will now raise
ValueError if more than a second is lost in precision when the
timestamp is cast to the platform C time_t type. There's no chance
that the platform will do anything sensible with the result in such
cases. This includes ctime(), localtime() and gmtime(). Assorted
fromtimestamp() and utcfromtimestamp() methods in the datetime module
were also protected. Closes bugs #919012 and 975996.
- fcntl.ioctl now warns if the mutate flag is not specified.
- nt now properly allows referring to UNC roots, e.g. in nt.stat().
- the weakref module now supports additional objects: array.array,
sre.pattern_objects, file objects, and sockets.
- operator.isMappingType() and operator.isSequenceType() now give
fewer false positives.
- socket.sslerror is now a subclass of socket.error . Also added
socket.error to the socket module's C API.
- Bug #920575: A problem where the _locale module segfaults on
nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
- array objects now support the copy module. Also, their resizing
scheme has been updated to match that used for list objects. This improves
the performance (speed and memory usage) of append() operations.
Also, array.array() and array.extend() now accept any iterable argument
for repeated appends without needing to create another temporary array.
- cStringIO.writelines() now accepts any iterable argument and writes
the lines one at a time rather than joining them and writing once.
Made a parallel change to StringIO.writelines(). Saves memory and
makes suitable for use with generator expressions.
- time.strftime() now checks that the values in its time tuple argument
are within the proper boundaries to prevent possible crashes from the
platform's C library implementation of strftime(). Can possibly
break code that uses values outside the range that didn't cause
problems previously (such as sitting day of year to 0). Fixes bug
#897625.
- The socket module now supports Bluetooth sockets, if the
system has <bluetooth/bluetooth.h>
- Added a collections module containing a new datatype, deque(),
offering high-performance, thread-safe, memory friendly appends
and pops on either side of the deque.
- Several modules now take advantage of collections.deque() for
improved performance: Queue, mutex, shlex, threading, and pydoc.
- The operator module has two new functions, attrgetter() and
itemgetter() which are useful for creating fast data extractor
functions for map(), list.sort(), itertools.groupby(), and
other functions that expect a function argument.
- socket.SHUT_{RD,WR,RDWR} was added.
- os.getsid was added.
- The pwd module incorrectly advertised its struct type as
struct_pwent; this has been renamed to struct_passwd. (The old name
is still supported for backwards compatibility.)
- The xml.parsers.expat module now provides Expat 1.95.7.
- socket.IPPROTO_IPV6 was added.
- readline.clear_history was added.
- select.select() now accepts sequences for its first three arguments.
- cStringIO now supports the f.closed attribute.
- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
- curses module now supports use_default_colors(). [patch #739124]
- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
- Implemented non-recursive SRE matching scheme (#757624).
- Implemented (?(id/name)yes|no) support in SRE (#572936).
- random.seed() with no arguments or None uses time.time() as a default
seed. Modified to match Py2.2 behavior and use fractional seconds so
that successive runs are more likely to produce different sequences.
- random.Random has a new method, getrandbits(k), which returns an int
with k random bits. This method is now an optional part of the API
for user defined generators. Any generator that defines genrandbits()
can now use randrange() for ranges with a length >= 2**53. Formerly,
randrange would return only even numbers for ranges that large (see
SF bug #812202). Generators that do not define genrandbits() now
issue a warning when randrange() is called with a range that large.
- itertools has a new function, groupby() for aggregating iterables
into groups sharing the same key (as determined by a key function).
It offers some of functionality of SQL's groupby keyword and of
the Unix uniq filter.
- itertools now has a new tee() function which produces two independent
iterators from a single iterable.
- itertools.izip() with no arguments now returns an empty iterator instead
of raising a TypeError exception.
- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
as parameter.
Library
-------
- Added a new module: cProfile, a C profiler with the same interface as the
profile module. cProfile avoids some of the drawbacks of the hotshot
profiler and provides a bit more information than the other two profilers.
Based on "lsprof" (patch #1212837).
- Bug #1266283: The new function "lexists" is now in os.path.__all__.
- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
the documented behavior: the function passed to the onerror()
handler can now also be os.listdir.
- Bug #754449: threading.Thread objects no longer mask exceptions raised during
interpreter shutdown with another exception from attempting to handle the
original exception.
- Added decimal.py per PEP 327.
- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
"netloc" portion of a URL.
- Bug #919012: shutil.move() will not try to move a directory into itself.
Thanks Johannes Gijsbers.
- Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
- Bug #823209: cmath.log() now takes an optional base argument so that its
API matches math.log().
- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
that generate a -debuginfo.rpm
- os.path.devnull has been added for all supported platforms.
- Fixed #877165: distutils now picks the right C++ compiler command
on cygwin and mingw32.
- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
- refactored site.py into functions. Also wrote regression tests for the
module.
- The distutils install command now supports the --home option and
installation scheme for all platforms.
- asyncore.loop now has a repeat count parameter that defaults to
looping forever.
- The distutils sdist command now ignores all .svn directories, in
addition to CVS and RCS directories. .svn directories hold
administrative files for the Subversion source control system.
- Added a new module: cookielib. Automatic cookie handling for HTTP
clients. Also, support for cookielib has been added to urllib2, so
urllib2.urlopen() can transparently handle cookies.
- stringprep.py now uses built-in set() instead of sets.Set().
- Bug #876278: Unbounded recursion in modulefinder
- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
Applications relying on the wrong order need to be corrected.
- Bug #926075: Fixed a bug that returns a wrong pattern object
for a string or unicode object in sre.compile() when a different
type pattern with the same value exists.
- Added countcallers arg to trace.Trace class (--trackcalls command line arg
when run from the command prompt).
- Fixed a caching bug in platform.platform() where the argument of 'terse' was
not taken into consideration when caching value.
- Added two new command-line arguments for profile (output file and
default sort).
- Added global runctx function to profile module
- Add hlist missing entryconfigure and entrycget methods.
- The ptcp154 codec was added for Kazakh character set support.
- Support non-anonymous ftp URLs in urllib2.
- The encodings package will now apply codec name aliases
first before starting to try the import of the codec module.
This simplifies overriding built-in codecs with external
packages, e.g. the included CJK codecs with the JapaneseCodecs
package, by adjusting the aliases dictionary in encodings.aliases
accordingly.
- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
decoding standards.
- urllib2 now supports processors. A processor is a handler that
implements an xxx_request or xxx_response method. These methods are
called for all requests.
- distutils compilers now compile source files in the same order as
they are passed to the compiler.
- pprint.pprint() and pprint.pformat() now have additional parameters
indent, width and depth.
- Patch #750542: pprint now will pretty print subclasses of list, tuple
and dict too, as long as they don't overwrite __repr__().
- Bug #848614: distutils' msvccompiler fails to find the MSVC6
compiler because of incomplete registry entries.
- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
- Patch #841977: modulefinder didn't find extension modules in packages
- imaplib.IMAP4.thread was added.
- Plugged a minor hole in tempfile.mktemp() due to the use of
os.path.exists(), switched to using os.lstat() directly if possible.
- bisect.py and heapq.py now have underlying C implementations
for better performance.
- heapq.py has two new functions, nsmallest() and nlargest().
- traceback.format_exc has been added (similar to print_exc but it returns
a string).
- xmlrpclib.MultiCall has been added.
- poplib.POP3_SSL has been added.
- tmpfile.mkstemp now returns an absolute path even if dir is relative.
- urlparse is RFC 2396 compliant.
- The fieldnames argument to the csv module's DictReader constructor is now
optional. If omitted, the first row of the file will be used as the
list of fieldnames.
- encodings.bz2_codec was added for access to bz2 compression
using "a long string".encode('bz2')
- Various improvements to unittest.py, realigned with PyUnit CVS.
- dircache now passes exceptions to the caller, instead of returning
empty lists.
- The bsddb module and dbhash module now support the iterator and
mapping protocols which make them more substitutable for dictionaries
and shelves.
- The csv module's DictReader and DictWriter classes now accept keyword
arguments. This was an omission in the initial implementation.
- The email package handles some RFC 2231 parameters with missing
CHARSET fields better. It also includes a patch to parameter
parsing when semicolons appear inside quotes.
- sets.py now runs under Py2.2. In addition, the argument restrictions
for most set methods (but not the operators) have been relaxed to
allow any iterable.
- _strptime.py now has a behind-the-scenes caching mechanism for the most
recent TimeRE instance used along with the last five unique directive
patterns. The overall module was also made more thread-safe.
- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
and removed in Py2.4.
- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
- Patch #873597: CJK codecs are imported into rank of default codecs.
Tools/Demos
-----------
- A hotshotmain script was added to the Tools/scripts directory that
makes it easy to run a script under control of the hotshot profiler.
- The db2pickle and pickle2db scripts can now dump/load gdbm files.
- The file order on the command line of the pickle2db script was reversed.
It is now [ picklefile ] dbfile. This provides better symmetry with
db2pickle. The file arguments to both scripts are now source followed by
destination in situations where both files are given.
- The pydoc script will display a link to the module documentation for
modules determined to be part of the core distribution. The documentation
base directory defaults to http://www.python.org/doc/current/lib/ but can
be changed by setting the PYTHONDOCS environment variable.
- texcheck.py now detects double word errors.
- md5sum.py mistakenly opened input files in text mode by default, a
silent and dangerous change from previous releases. It once again
opens input files in binary mode by default. The -t and -b flags
remain for compatibility with the 2.3 release, but -b is the default
now.
- py-electric-colon now works when pending-delete/delete-selection mode is
in effect
- py-help-at-point is no longer bound to the F1 key - it's still bound to
C-c C-h
- Pynche was fixed to not crash when there is no ~/.pynche file and no
-d option was given.
Build
-----
- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
build under OS X.
- Profiling using gprof is now available if Python is configured with
--enable-profiling.
- Profiling the VM using the Pentium TSC is now possible if Python
is configured --with-tsc.
- In order to find libraries, setup.py now also looks in /lib64, for use
on AMD64.
- Bug #934635: Fixed a bug where the configure script couldn't detect
getaddrinfo() properly if the KAME stack had SCTP support.
- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
removed.
- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
supported (see PEP 11).
- Universal newline support can no longer be disabled (see PEP 11).
- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
(see PEP 11).
- Tests for sizeof(char) were removed since ANSI C mandates that
sizeof(char) must be 1.
C API
-----
- Thanks to Anthony Tuininga, the datetime module now supplies a C API
containing type-check macros and constructors. See new docs in the
Python/C API Reference Manual for details.
- Private function _PyTime_DoubleToTimet added, to convert a Python
timestamp (C double) to platform time_t with some out-of-bounds
checking. Declared in new header file timefuncs.h. It would be
good to expose some other internal timemodule.c functions there.
- New public functions PyEval_EvaluateFrame and PyGen_New to expose
generator objects.
- New public functions Py_IncRef() and Py_DecRef(), exposing the
functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
runtime dynamic embedding of Python. See patch #938302, by Bob
Ippolito.
- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
underlying array of PyObject pointers. Useful for high speed looping.
- Created a new method flag, METH_COEXIST, which causes a method to be loaded
even if already defined by a slot wrapper. This allows a __contains__
method, for example, to co-exist with a defined sq_contains slot. This
is helpful because the PyCFunction can take advantage of optimized calls
whenever METH_O or METH_NOARGS flags are defined.
- Added a new function, PyDict_Contains(d, k) which is like
PySequence_Contains() but is specific to dictionaries and executes
about 10% faster.
- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
Each return the singleton they mention after Py_INCREF()ing them.
- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
variable length argument list of Python objects without having to invoke
the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
is equivalent to Py_BuildValue("(OOO)", a, b, c).
Windows
-------
- The _winreg module could segfault when reading very large registry
values, due to unchecked alloca() calls (SF bug 851056). The fix is
uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
as appropriate, followed by a size check.
- file.truncate() could misbehave if the file was open for update
(modes r+, rb+, w+, wb+), and the most recent file operation before
the truncate() call was an input operation. SF bug 801631.
What's New in Python 2.3 final?
===============================
*Release date: 29-Jul-2003*
IDLE
----
- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
This was unique to Windows, and was fixed by adding an -n switch to
the command the Windows installer creates to execute "Edit with IDLE"
context-menu actions.
- IDLE displays a new message upon startup: some "personal firewall"
kinds of programs (for example, ZoneAlarm) open a dialog of their
own when any program opens a socket. IDLE does use sockets, talking
on the computer's internal loopback interface. This connection is not
visible on any external interface and no data is sent to or received
from the internet. So, if you get such a dialog when opening IDLE,
asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
and rest assured no communication external to your machine is taking
place. If you don't allow it, IDLE won't be able to start.
What's New in Python 2.3 release candidate 2?
=============================================
*Release date: 24-Jul-2003*
Core and builtins
-----------------
- It is now possible to import from zipfiles containing additional
data bytes before the zip compatible archive. Zipfiles containing a
comment at the end are still unsupported.
Extension modules
-----------------
- A longstanding bug in the parser module's initialization could cause
fatal internal refcount confusion when the module got initialized more
than once. This has been fixed.
- Fixed memory leak in pyexpat; using the parser's ParseFile() method
with open files that aren't instances of the standard file type
caused an instance of the bound .read() method to be leaked on every
call.
- Fixed some leaks in the locale module.
Library
-------
- Lib/encodings/rot_13.py when used as a script, now more properly
uses the first Python interpreter on your path.
- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
fix a locale related bug in the test suite. Although another patch
was needed to actually fix the problem, the cache code was not
restored.
IDLE
----
- Calltips patches.
Build
-----
- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
on Panther (OSX 10.3).
C API
-----
Windows
-------
- The tempfile module could do insane imports on Windows if PYTHONCASEOK
was set, making temp file creation impossible. Repaired.
- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
Mac
---
- Various fixes to pimp.
- Scripts runs with pythonw no longer had full window manager access.
- Don't force boot-disk-only install, for reasons unknown it causes
more problems than it solves.
What's New in Python 2.3 release candidate 1?
=============================================
*Release date: 18-Jul-2003*
Core and builtins
-----------------
- The new function sys.getcheckinterval() returns the last value set
by sys.setcheckinterval().
- Several bugs in the symbol table phase of the compiler have been
fixed. Errors could be lost and compilation could fail without
reporting an error. SF patch 763201.
- The interpreter is now more robust about importing the warnings
module. In an executable generated by freeze or similar programs,
earlier versions of 2.3 would fail if the warnings module could
not be found on the file system. Fixes SF bug 771097.
- A warning about assignments to module attributes that shadow
builtins, present in earlier releases of 2.3, has been removed.
- It is not possible to create subclasses of built-in types like str
and tuple that define an itemsize. Earlier releases of Python 2.3
allowed this by mistake, leading to crashes and other problems.
- The thread_id is now initialized to 0 in a non-thread build. SF bug
770247.
- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
Extension modules
-----------------
- weakref.proxy() can now handle "del obj[i]" for proxy objects
defining __delitem__. Formerly, it generated a SystemError.
- SSL no longer crashes the interpreter when the remote side disconnects.
- On Unix the mmap module can again be used to map device files.
- time.strptime now exclusively uses the Python implementation
contained within the _strptime module.
- The print slot of weakref proxy objects was removed, because it was
not consistent with the object's repr slot.
- The mmap module only checks file size for regular files, not
character or block devices. SF patch 708374.
- The cPickle Pickler garbage collection support was fixed to traverse
the find_class attribute, if present.
- There are several fixes for the bsddb3 wrapper module.
bsddb3 no longer crashes if an environment is closed before a cursor
(SF bug 763298).
The DB and DBEnv set_get_returns_none function was extended to take
a level instead of a boolean flag. The new level 2 means that in
addition, cursor.set()/.get() methods return None instead of raising
an exception.
A typo was fixed in DBCursor.join_item(), preventing a crash.
Library
-------
- distutils now supports MSVC 7.1
- doctest now examines all docstrings by default. Previously, it would
skip over functions with private names (as indicated by the underscore
naming convention). The old default created too much of a risk that
user tests were being skipped inadvertently. Note, this change could
break code in the unlikely case that someone had intentionally put
failing tests in the docstrings of private functions. The breakage
is easily fixable by specifying the old behavior when calling testmod()
or Tester().
- There were several fixes to the way dumbdbms are closed. It's vital
that a dumbdbm database be closed properly, else the on-disk data
and directory files can be left in mutually inconsistent states.
dumbdbm.py's _Database.__del__() method attempted to close the
database properly, but a shutdown race in _Database._commit() could
prevent this from working, so that a program trusting __del__() to
get the on-disk files in synch could be badly surprised. The race
has been repaired. A sync() method was also added so that shelve
can guarantee data is written to disk.
The close() method can now be called more than once without complaint.
- The classes in threading.py are now new-style classes. That they
weren't before was an oversight.
- The urllib2 digest authentication handlers now define the correct
auth_header. The earlier versions would fail at runtime.
- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
when there are no lines.
- SF bug 763637: fix exception in Tkinter with after_cancel
which could occur with Tk 8.4
- SF bug 770601: CGIHTTPServer.py now passes the entire environment
to child processes.
- SF bug 765238: add filter to fnmatch's __all__.
- SF bug 748201: make time.strptime() error messages more helpful.
- SF patch 764470: Do not dump the args attribute of a Fault object in
xmlrpclib.
- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
responses.
- SF patch 766650: The whichdb module was fixed to recognize dbm files
generated by gdbm on OS/2 EMX.
- SF bugs 763047 and 763052: fixes bug of timezone value being left as
-1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
is true when it should only when time.daylight is true.
- SF bug 764548: re now allows subclasses of str and unicode to be
used as patterns.
- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
of varying sizes. Tk 8.4 returns a different number of values
than Tk 8.3.
- SF bug 763023: difflib.ratio() did not catch zero division.
- The Queue module now has an __all__ attribute.
Tools/Demos
-----------
- See Lib/idlelib/NEWS.txt for IDLE news.
- SF bug 753592: webchecker/wsgui now handles user supplied directories.
- The trace.py script has been removed. It is now in the standard library.
Build
-----
- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
- The socket module compiles on IRIX 6.5.10.
- An irix64 system is treated the same way as an irix6 system (SF
patch 764560).
- Several definitions were missing on FreeBSD 5.x unless the
__BSD_VISIBLE symbol was defined. configure now defines it as
needed.
C API
-----
- Unicode objects now support mbcs as a built-in encoding, so the C
API can use it without deferring to the encodings package.
Windows
-------
- The Windows implementation of PyThread_start_new_thread() never
checked error returns from Windows functions correctly. As a result,
it could claim to start a new thread even when the Microsoft
_beginthread() function failed (due to "too many threads" -- this is
on the order of thousands when it happens). In these cases, the
Python exception ::
thread.error: can't start new thread
is raised now.
- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
use. The interpreter now calls WSACleanup() from Py_Finalize()
instead of from DLL teardown.
Mac
---
- Bundlebuilder now inherits default values in the right way. It was
previously possible for app bundles to get a type of "BNDL" instead
of "APPL." Other improvements include, a --build-id option to
specify the CFBundleIdentifier and using the --python option to set
the executable in the bundle.
- Fixed two bugs in MacOSX framework handling.
- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
- Python is now compiled with -mno-fused-madd, making all tests pass
on Panther.
What's New in Python 2.3 beta 2?
================================
*Release date: 29-Jun-2003*
Core and builtins
-----------------
- A program can now set the environment variable PYTHONINSPECT to some
string value in Python, and cause the interpreter to enter the
interactive prompt at program exit, as if Python had been invoked
with the -i option.
- list.index() now accepts optional start and stop arguments. Similar
changes were made to UserList.index(). SF feature request 754014.
- SF patch 751998 fixes an unwanted side effect of the previous fix
for SF bug 742860 (the next item).
- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
wasn't threadsafe, was very inefficient (expected time O(len(dict))
instead of O(1)), and could raise a spurious RuntimeError if another
thread mutated the dict during __delitem__, or if a comparison function
mutated it. It also neglected to raise KeyError when the key wasn't
present; didn't raise TypeError when the key wasn't of a weakly
referencable type; and broke various more-or-less obscure dict
invariants by using a sequence of equality comparisons over the whole
set of dict keys instead of computing the key's hash code to narrow
the search to those keys with the same hash code. All of these are
considered to be bugs. A new implementation of __delitem__ repairs all
that, but note that fixing these bugs may change visible behavior in
code relying (whether intentionally or accidentally) on old behavior.
- SF bug 734869: Fixed a compiler bug that caused a fatal error when
compiling a list comprehension that contained another list comprehension
embedded in a lambda expression.
- SF bug 705231: builtin pow() no longer lets the platform C pow()
raise -1.0 to integer powers, because (at least) glibc gets it wrong
in some cases. The result should be -1.0 if the power is odd and 1.0
if the power is even, and any float with a sufficiently large exponent
is (mathematically) an exact even integer.
- SF bug 759227: A new-style class that implements __nonzero__() must
return a bool or int (but not an int subclass) from that method. This
matches the restriction on classic classes.
- The encoding attribute has been added for file objects, and set to
the terminal encoding on Unix and Windows.
- The softspace attribute of file objects became read-only by oversight.
It's writable again.
- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
tuple. By default, the iterators now access data elements directly
instead of going through __getitem__. If __getitem__ access is
preferred, then __iter__ can be overridden.
- SF bug 735247: The staticmethod and super types participate in
garbage collection. Before this change, it was possible for leaks to
occur in functions with non-global free variables that used these types.
Extension modules
-----------------
- the socket module has a new exception, socket.timeout, to allow
timeouts to be handled separately from other socket errors.
- SF bug 751276: cPickle has fixed to propagate exceptions raised in
user code. In earlier versions, cPickle caught and ignored any
exception when it performed operations that it expected to raise
specific exceptions like AttributeError.
- cPickle Pickler and Unpickler objects now participate in garbage
collection.
- mimetools.choose_boundary() could return duplicate strings at times,
especially likely on Windows. The strings returned are now guaranteed
unique within a single program run.
- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
dummy_thread has also been modified to try to simulate the behavior.
- array.array.insert() now treats negative indices as being relative
to the end of the array, just like list.insert() does. (SF bug #739313)
- The datetime module classes datetime, time, and timedelta are now
properly subclassable.
- _tkinter.{get|set}busywaitinterval was added.
- itertools.islice() now accepts stop=None as documented.
Fixes SF bug #730685.
- the bsddb185 module is built in one restricted instance -
/usr/include/db.h exists and defines HASHVERSION to be 2. This is true
for many BSD-derived systems.
Library
-------
- Some happy doctest extensions from Jim Fulton have been added to
doctest.py. These are already being used in Zope3. The two
primary ones:
doctest.debug(module, name) extracts the doctests from the named object
in the given module, puts them in a temp file, and starts pdb running
on that file. This is great when a doctest fails.
doctest.DocTestSuite(module=None) returns a synthesized unittest
TestSuite instance, to be run by the unittest framework, which
runs all the doctests in the module. This allows writing tests in
doctest style (which can be clearer and shorter than writing tests
in unittest style), without losing unittest's powerful testing
framework features (which doctest lacks).
- For compatibility with doctests created before 2.3, if an expected
output block consists solely of "1" and the actual output block
consists solely of "True", it's accepted as a match; similarly
for "0" and "False". This is quite un-doctest-like, but is practical.
The behavior can be disabled by passing the new doctest module
constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
argument.
- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
a bare except caught to much and reported all errors as a problem
in the archive.
- The logging module now has a new function, makeLogRecord() making
LogHandler easier to interact with DatagramHandler and SocketHandler.
- The cgitb module has been extended to support plain text display (SF patch
569574).
- A brand new version of IDLE (from the IDLEfork project at
SourceForge) is now included as Lib/idlelib. The old Tools/idle is
no more.
- Added a new module: trace (documentation missing). This module used
to be distributed in Tools/scripts. It uses sys.settrace() to trace
code execution -- either function calls or individual lines. It can
generate tracing output during execution or a post-mortem report of
code coverage.
- The threading module has new functions settrace() and setprofile()
that cooperate with the functions of the same name in the sys
module. A function registered with the threading module will
be used for all threads it creates. The new trace module uses this
to provide tracing for code running in threads.
- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
Taschuk. Copying a new-style class that had a reference to itself
didn't work. (The same thing worked fine for old-style classes.)
Builtin functions are now treated as atomic, fixing bug #746304.
- difflib.py has two new functions: context_diff() and unified_diff().
- More fixes to urllib (SF 549151): (a) When redirecting, always use
GET. This is common practice and more-or-less sanctioned by the
HTTP standard. (b) Add a handler for 307 redirection, which becomes
an error for POST, but a regular redirect for GET and HEAD
- Added optional 'onerror' argument to os.walk(), to control error
handling.
- inspect.is{method|data}descriptor was added, to allow pydoc display
__doc__ of data descriptors.
- Fixed socket speed loss caused by use of the _socketobject wrapper class
in socket.py.
- timeit.py now checks the current directory for imports.
- urllib2.py now knows how to order proxy classes, so the user doesn't
have to insert it in front of other classes, nor do dirty tricks like
inserting a "dummy" HTTPHandler after a ProxyHandler when building an
opener with proxy support.
- Iterators have been added for dbm keys.
- random.Random objects can now be pickled.
Tools/Demos
-----------
- pydoc now offers help on keywords and topics.
- Tools/idle is gone; long live Lib/idlelib.
- diff.py prints file diffs in context, unified, or ndiff formats,
providing a command line interface to difflib.py.
- texcheck.py is a new script for making a rough validation of Python LaTeX
files.
Build
-----
- Setting DESTDIR during 'make install' now allows specifying a
different root directory.
C API
-----
- PyType_Ready(): If a type declares that it participates in gc
(Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
tp_free slot is the default _PyObject_Del, and type does not define
a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
Previously _PyObject_Del was inherited, which could at best lead to a
segfault. In addition, if even after this magic the type's tp_free
slot is _PyObject_Del or NULL, and the type is a base type
(Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
type, its dealloc function must call type->tp_free, and since the type
is gc'able, tp_free must not be NULL or _PyObject_Del.
- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
from C) to interrupt a thread by sending it an exception. It is
intentional that you have to write your own C extension to call it
from Python.
New platforms
-------------
None this time.
Tests
-----
- test_imp rewritten so that it doesn't raise RuntimeError if run as a
side effect of being imported ("import test.autotest").
Windows
-------
- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
- The installer always suggested that Python be installed on the C:
drive, due to a hardcoded "C:" generated by the Wise installation
wizard. People with machines where C: is not the system drive
usually want Python installed on whichever drive is their system drive
instead. We removed the hardcoded "C:", and two testers on machines
where C: is not the system drive report that the installer now
suggests their system drive. Note that you can always select the
directory you want in the "Select Destination Directory" dialog --
that's what it's for.
Mac
---
- There's a new module called "autoGIL", which offers a mechanism to
automatically release the Global Interpreter Lock when an event loop
goes to sleep, allowing other threads to run. It's currently only
supported on OSX, in the Mach-O version.
- The OSA modules now allow direct access to properties of the
toplevel application class (in AppleScript terminology).
- The Package Manager can now update itself.
SourceForge Bugs and Patches Applied
------------------------------------
430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
What's New in Python 2.3 beta 1?
================================
*Release date: 25-Apr-2003*
Core and builtins
-----------------
- New format codes B, H, I, k and K have been implemented for
PyArg_ParseTuple and PyBuild_Value.
- New built-in function sum(seq, start=0) returns the sum of all the
items in iterable object seq, plus start (items are normally numbers,
and cannot be strings).
- bool() called without arguments now returns False rather than
raising an exception. This is consistent with calling the
constructors for the other built-in types -- called without argument
they all return the false value of that type. (SF patch #724135)
- In support of PEP 269 (making the pgen parser generator accessible
from Python), some changes to the pgen code structure were made; a
few files that used to be linked only with pgen are now linked with
Python itself.
- The repr() of a weakref object now shows the __name__ attribute of
the referenced object, if it has one.
- super() no longer ignores data descriptors, except __class__. See
the thread started at
http://mail.python.org/pipermail/python-dev/2003-April/034338.html
- list.insert(i, x) now interprets negative i as it would be
interpreted by slicing, so negative values count from the end of the
list. This was the only place where such an interpretation was not
placed on a list index.
- range() now works even if the arguments are longs with magnitude
larger than sys.maxint, as long as the total length of the sequence
fits. E.g., range(2**100, 2**101, 2**100) is the following list:
[1267650600228229401496703205376L]. (SF patch #707427.)
- Some horridly obscure problems were fixed involving interaction
between garbage collection and old-style classes with "ambitious"
getattr hooks. If an old-style instance didn't have a __del__ method,
but did have a __getattr__ hook, and the instance became reachable
only from an unreachable cycle, and the hook resurrected or deleted
unreachable objects when asked to resolve "__del__", anything up to
a segfault could happen. That's been repaired.
- dict.pop now takes an optional argument specifying a default
value to return if the key is not in the dict. If a default is not
given and the key is not found, a KeyError will still be raised.
Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
[SF patch #693753] (contributed by Michael Stone.)
- sys.getfilesystemencoding() was added to expose
Py_FileSystemDefaultEncoding.
- New function sys.exc_clear() clears the current exception. This is
rarely needed, but can sometimes be useful to release objects
referenced by the traceback held in sys.exc_info()[2]. (SF patch
#693195.)
- On 64-bit systems, a dictionary could contain duplicate long/int keys
if the key value was larger than 2**32. See SF bug #689659.
- Fixed SF bug #663074. The codec system was using global static
variables to store internal data. As a result, any attempts to use the
unicode system with multiple active interpreters, or successive
interpreter executions, would fail.
- "%c" % u"a" now returns a unicode string instead of raising a
TypeError. u"%c" % 0xffffffff now raises an OverflowError instead
of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
Extension modules
-----------------
- The socket module now provides the functions inet_pton and inet_ntop
for converting between string and packed representation of IP
addresses. There is also a new module variable, has_ipv6, which is
True iff the current Python has IPv6 support. See SF patch #658327.
- Tkinter wrappers around Tcl variables now pass objects directly
to Tcl, instead of first converting them to strings.
- The .*? pattern in the re module is now special-cased to avoid the
recursion limit. (SF patch #720991 -- many thanks to Gary Herron
and Greg Chapman.)
- New function sys.call_tracing() allows pdb to debug code
recursively.
- New function gc.get_referents(obj) returns a list of objects
directly referenced by obj. In effect, it exposes what the object's
tp_traverse slot does, and can be helpful when debugging memory
leaks.
- The iconv module has been removed from this release.
- The platform-independent routines for packing floats in IEEE formats
(struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
pickling of floats) ignored that rounding can cause a carry to
propagate. The worst consequence was that, in rare cases, <f and >f
could produce strings that, when unpacked again, were a factor of 2
away from the original float. This has been fixed. See SF bug
#705836.
- New function time.tzset() provides access to the C library tzset()
function, if supported. (SF patch #675422.)
- Using createfilehandler, deletefilehandler, createtimerhandler functions
on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
See SF bug #692416.
- Modified the fcntl.ioctl() function to allow modification of a passed
mutable buffer (for details see the reference documentation).
- Made user requested changes to the itertools module.
Subsumed the times() function into repeat().
Added chain() and cycle().
- The rotor module is now deprecated; the encryption algorithm it uses
is not believed to be secure, and including crypto code with Python
has implications for exporting and importing it in various countries.
- The socket module now always uses the _socketobject wrapper class, even on
platforms which have dup(2). The makefile() method is built directly
on top of the socket without duplicating the file descriptor, allowing
timeouts to work properly.
Library
-------
- New generator function os.walk() is an easy-to-use alternative to
os.path.walk(). See os module docs for details. os.path.walk()
isn't deprecated at this time, but may become deprecated in a
future release.
- Added new module "platform" which provides a wide range of tools
for querying platform dependent features.
- netrc now allows ASCII punctuation characters in passwords.
- shelve now supports the optional writeback argument, and exposes
pickle protocol versions.
- Several methods of nntplib.NNTP have grown an optional file argument
which specifies a file where to divert the command's output
(already supported by the body() method). (SF patch #720468)
- The self-documenting XML server library DocXMLRPCServer was added.
- Support for internationalized domain names has been added through
the 'idna' and 'punycode' encodings, the 'stringprep' module, the
'mkstringprep' tool, and enhancements to the socket and httplib
modules.
- htmlentitydefs has two new dictionaries: name2codepoint maps
HTML entity names to Unicode codepoints (as integers).
codepoint2name is the reverse mapping. See SF patch #722017.
- pdb has a new command, "debug", which lets you step through
arbitrary code from the debugger's (pdb) prompt.
- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
return 'not a == b' rather than 'a != b'. This gives the desired
result for classes that define __eq__ without defining __ne__.
- sgmllib now supports SGML marked sections, in particular the
MS Office extensions.
- The urllib module now offers support for the iterator protocol.
SF patch 698520 contributed by Brett Cannon.
- New module timeit provides a simple framework for timing the
execution speed of expressions and statements.
- sets.Set objects now support mixed-type __eq__ and __ne__, instead
of raising TypeError. If x is a Set object and y is a non-Set object,
x == y is False, and x != y is True. This is akin to the change made
for mixed-type comparisons of datetime objects in 2.3a2; more info
about the rationale is in the NEWS entry for that. See also SF bug
report <https://bugs.python.org/issue693121>.
- On Unix platforms, if os.listdir() is called with a Unicode argument,
it now returns Unicode strings. (This behavior was added earlier
to the Windows NT/2k/XP version of os.listdir().)
- Distutils: both 'py_modules' and 'packages' keywords can now be specified
in core.setup(). Previously you could supply one or the other, but
not both of them. (SF patch #695090 from Bernhard Herzog)
- New csv package makes it easy to read/write CSV files.
- Module shlex has been extended to allow posix-like shell parsings,
including a split() function for easy spliting of quoted strings and
commands. An iterator interface was also implemented.
Tools/Demos
-----------
- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
See the module docstring for details.
Build
-----
- Fix problem building on OSF1 because the compiler only accepted
preprocessor directives that start in column 1. (SF bug #691793.)
C API
-----
- Added PyGC_Collect(), equivalent to calling gc.collect().
- PyThreadState_GetDict() was changed not to raise an exception or
issue a fatal error when no current thread state is available. This
makes it possible to print dictionaries when no thread is active.
- LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
need compatibility with previous versions can use this:
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
- Added PyObject_SelfIter() to fill the tp_iter slot for the
typical case where the method returns its self argument.
- The extended type structure used for heap types (new-style
classes defined by Python code using a class statement) is now
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
New platforms
-------------
None this time.
Tests
-----
- test_timeout now requires -u network to be passed to regrtest to run.
See SF bug #692988.
Windows
-------
- os.fsync() now exists on Windows, and calls the Microsoft _commit()
function.
- New function winsound.MessageBeep() wraps the Win32 API
MessageBeep().
Mac
---
- os.listdir() now returns Unicode strings on MacOS X when called with
a Unicode argument. See the general news item under "Library".
- A new method MacOS.WMAvailable() returns true if it is safe to access
the window manager, false otherwise.
- EasyDialogs dialogs are now movable-modal, and if the application is
currently in the background they will ask to be moved to the foreground
before displaying.
- OSA Scripting support has improved a lot, and gensuitemodule.py can now
be used by mere mortals. The documentation is now also more or less
complete.
- The IDE (in a framework build) now includes introductory documentation
in Apple Help Viewer format.
What's New in Python 2.3 alpha 2?
=================================
*Release date: 19-Feb-2003*
Core and builtins
-----------------
- Negative positions returned from PEP 293 error callbacks are now
treated as being relative to the end of the input string. Positions
that are out of bounds raise an IndexError.
- sys.path[0] (the directory from which the script is loaded) is now
turned into an absolute pathname, unless it is the empty string.
(SF patch #664376.)
- Finally fixed the bug in compile() and exec where a string ending
with an indented code block but no newline would raise SyntaxError.
This would have been a four-line change in parsetok.c... Except
codeop.py depends on this behavior, so a compilation flag had to be
invented that causes the tokenizer to revert to the old behavior;
this required extra changes to 2 .h files, 2 .c files, and 2 .py
files. (Fixes SF bug #501622.)
- If a new-style class defines neither __new__ nor __init__, its
constructor would ignore all arguments. This is changed now: the
constructor refuses arguments in this case. This might break code
that worked under Python 2.2. The simplest fix is to add a no-op
__init__: ``def __init__(self, *args, **kw): pass``.
- Through a bytecode optimizer bug (and I bet you didn't even know
Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
with a leading minus sign would come out with the wrong sign.
("Unsigned" hex/oct constants are those with a face value in the
range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
always been interpreted as negative numbers through sign folding.)
E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
come out as -4294967295. This was the case in Python 2.2 through
2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
value, but according to PEP 237 it really needs to be 1 now. This
will be backported to Python 2.2.3 a well. (SF #660455)
- int(s, base) sometimes sign-folds hex and oct constants; it only
does this when base is 0 and s.strip() starts with a '0'. When the
sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
machine, which returns -1, a FutureWarning is now issued; in Python
2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
int("0xffffffff", 16) right now. (PEP 347)
- super(X, x): x may now be a proxy for an X instance, i.e.
issubclass(x.__class__, X) but not issubclass(type(x), X).
- isinstance(x, X): if X is a new-style class, this is now equivalent
to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
only type(x) was tested. (For classic classes this was already the
case.)
- compile(), eval() and the exec statement now fully support source code
passed as unicode strings.
- int subclasses can be initialized with longs if the value fits in an int.
See SF bug #683467.
- long(string, base) takes time linear in len(string) when base is a power
of 2 now. It used to take time quadratic in len(string).
- filter returns now Unicode results for Unicode arguments.
- raw_input can now return Unicode objects.
- List objects' sort() method now accepts None as the comparison function.
Passing None is semantically identical to calling sort() with no
arguments.
- Fixed crash when printing a subclass of str and __str__ returned self.
See SF bug #667147.
- Fixed an invalid RuntimeWarning and an undetected error when trying
to convert a long integer into a float which couldn't fit.
See SF bug #676155.
- Function objects now have a __module__ attribute that is bound to
the name of the module in which the function was defined. This
applies for C functions and methods as well as functions and methods
defined in Python. This attribute is used by pickle.whichmodule(),
which changes the behavior of whichmodule slightly. In Python 2.2
whichmodule() returns "__main__" for functions that are not defined
at the top-level of a module (examples: methods, nested functions).
Now whichmodule() will return the proper module name.
Extension modules
-----------------
- operator.isNumberType() now checks that the object has a nb_int or
nb_float slot, rather than simply checking whether it has a non-NULL
tp_as_number pointer.
- The imp module now has ways to acquire and release the "import
lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
reentrant lock, so releasing the lock only truly releases it when
this is the last release_lock() call. You can check with
imp.lock_held(). (SF bug #580952 and patch #683257.)
- Change to cPickle to match pickle.py (see below and PEP 307).
- Fix some bugs in the parser module. SF bug #678518.
- Thanks to Scott David Daniels, a subtle bug in how the zlib
extension implemented flush() was fixed. Scott also rewrote the
zlib test suite using the unittest module. (SF bug #640230 and
patch #678531.)
- Added an itertools module containing high speed, memory efficient
looping constructs inspired by tools from Haskell and SML.
- The SSL module now handles sockets with a timeout set correctly (SF
patch #675750, fixing SF bug #675552).
- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
- Fixed broken threadstate swap in readline that could cause fatal
errors when a readline hook was being invoked while a background
thread was active. (SF bugs #660476 and #513033.)
- fcntl now exposes the strops.h I_* constants.
- Fix a crash on Solaris that occurred when calling close() on
an mmap'ed file which was already closed. (SF patch #665913)
- Fixed several serious bugs in the zipimport implementation.
- datetime changes:
The date class is now properly subclassable. (SF bug #720908)
The datetime and datetimetz classes have been collapsed into a single
datetime class, and likewise the time and timetz classes into a single
time class. Previously, a datetimetz object with tzinfo=None acted
exactly like a datetime object, and similarly for timetz. This wasn't
enough of a difference to justify distinct classes, and life is simpler
now.
today() and now() now round system timestamps to the closest
microsecond <https://bugs.python.org/issue661086>. This repairs an
irritation most likely seen on Windows systems.
In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
as 0 instead, but a tzinfo subclass wishing to participate in
time zone conversion has to take a stand on whether it supports
DST; if you don't care about DST, then code dst() to return 0 minutes,
meaning that DST is never in effect).
The tzinfo methods utcoffset() and dst() must return a timedelta object
(or None) now. In 2.3a1 they could also return an int or long, but that
was an unhelpfully redundant leftover from an earlier version wherein
they couldn't return a timedelta. TOOWTDI.
The example tzinfo class for local time had a bug. It was replaced
by a later example coded by Guido.
datetime.astimezone(tz) no longer raises an exception when the
input datetime has no UTC equivalent in tz. For typical "hybrid" time
zones (a single tzinfo subclass modeling both standard and daylight
time), this case can arise one hour per year, at the hour daylight time
ends. See new docs for details. In short, the new behavior mimics
the local wall clock's behavior of repeating an hour in local time.
dt.astimezone() can no longer be used to convert between naive and aware
datetime objects. If you merely want to attach, or remove, a tzinfo
object, without any conversion of date and time members, use
dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
tzinfo subclass instance.
A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
to give complete control over how a UTC time is to be converted to
a local time. The default astimezone() implementation calls fromutc()
as its last step, so a tzinfo subclass can affect that too by overriding
fromutc(). It's expected that the default fromutc() implementation will
be suitable as-is for "almost all" time zone subclasses, but the
creativity of political time zone fiddling appears unbounded -- fromutc()
allows the highly motivated to emulate any scheme expressible in Python.
datetime.now(): The optional tzinfo argument was undocumented (that's
repaired), and its name was changed to tz ("tzinfo" is overloaded enough
already). With a tz argument, now(tz) used to return the local date
and time, and attach tz to it, without any conversion of date and time
members. This was less than useful. Now now(tz) returns the current
date and time as local time in tz's time zone, akin to ::
tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
where "utc" is an instance of a tzinfo subclass modeling UTC. Without
a tz argument, now() continues to return the current local date and time,
as a naive datetime object.
datetime.fromtimestamp(): Like datetime.now() above, this had less than
useful behavior when the optional tinzo argument was specified. See
also SF bug report <https://bugs.python.org/issue660872>.
date and datetime comparison: In order to prevent comparison from
falling back to the default compare-object-addresses strategy, these
raised TypeError whenever they didn't understand the other object type.
They still do, except when the other object has a "timetuple" attribute,
in which case they return NotImplemented now. This gives other
datetime objects (e.g., mxDateTime) a chance to intercept the
comparison.
date, time, datetime and timedelta comparison: When the exception
for mixed-type comparisons in the last paragraph doesn't apply, if
the comparison is == then False is returned, and if the comparison is
!= then True is returned. Because dict lookup and the "in" operator
only invoke __eq__, this allows, for example, ::
if some_datetime in some_sequence:
and ::
some_dict[some_timedelta] = whatever
to work as expected, without raising TypeError just because the
sequence is heterogeneous, or the dict has mixed-type keys. [This
seems like a good idea to implement for all mixed-type comparisons
that don't want to allow falling back to address comparison.]
The constructors building a datetime from a timestamp could raise
ValueError if the platform C localtime()/gmtime() inserted "leap
seconds". Leap seconds are ignored now. On such platforms, it's
possible to have timestamps that differ by a second, yet where
datetimes constructed from them are equal.
The pickle format of date, time and datetime objects has changed
completely. The undocumented pickler and unpickler functions no
longer exist. The undocumented __setstate__() and __getstate__()
methods no longer exist either.
Library
-------
- The logging module was updated slightly; the WARN level was renamed
to WARNING, and the matching function/method warn() to warning().
- The pickle and cPickle modules were updated with a new pickling
protocol (documented by pickletools.py, see below) and several
extensions to the pickle customization API (__reduce__, __setstate__
etc.). The copy module now uses more of the pickle customization
API to copy objects that don't implement __copy__ or __deepcopy__.
See PEP 307 for details.
- The distutils "register" command now uses http://www.python.org/pypi
as the default repository. (See PEP 301.)
- the platform dependent path related variables sep, altsep,
pathsep, curdir, pardir and defpath are now defined in the platform
dependent path modules (e.g. ntpath.py) rather than os.py, so these
variables are now available via os.path. They continue to be
available from the os module.
(see <https://bugs.python.org/issue680789>).
- array.array was added to the types repr.py knows about (see
<https://bugs.python.org/issue680789>).
- The new pickletools.py contains lots of documentation about pickle
internals, and supplies some helpers for working with pickles, such as
a symbolic pickle disassembler.
- xmlrpclib.py now supports the built-in boolean type.
- py_compile has a new 'doraise' flag and a new PyCompileError
exception.
- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
class.
- The sets module now raises TypeError in __cmp__, to clarify that
sets are not intended to be three-way-compared; the comparison
operators are overloaded as subset/superset tests.
- Bastion.py and rexec.py are disabled. These modules are not safe in
Python 2.2. or 2.3.
- realpath is now exported when doing ``from poxixpath import *``.
It is also exported for ntpath, macpath, and os2emxpath.
See SF bug #659228.
- New module tarfile from Lars Gustäbel provides a comprehensive interface
to tar archive files with transparent gzip and bzip2 compression.
See SF patch #651082.
- urlparse can now parse imap:// URLs. See SF feature request #618024.
- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
the gain value which is passed to Tk. SF bug# 602259.
- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
See SF patch #642974.
- The dospath module was deleted. Use the ntpath module when manipulating
DOS paths from other platforms.
Tools/Demos
-----------
- Two new scripts (db2pickle.py and pickle2db.py) were added to the
Tools/scripts directory to facilitate conversion from the old bsddb module
to the new one. While the user-visible API of the new module is
compatible with the old one, it's likely that the version of the
underlying database library has changed. To convert from the old library,
run the db2pickle.py script using the old version of Python to convert it
to a pickle file. After upgrading Python, run the pickle2db.py script
using the new version of Python to reconstitute your database. For
example:
% python2.2 db2pickle.py -h some.db > some.pickle
% python2.3 pickle2db.py -h some.db.new < some.pickle
Run the scripts without any args to get a usage message.
Build
-----
- The audio driver tests (test_ossaudiodev.py and
test_linuxaudiodev.py) are no longer run by default. This is
because they don't always work, depending on your hardware and
software. To run these tests, you must use an invocation like ::
./python Lib/test/regrtest.py -u audio test_ossaudiodev
- On systems which build using the configure script, compiler flags which
used to be lumped together using the OPT flag have been split into two
groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
compiler flags that are required to get a clean compile. On some
platforms (many Linux flavors in particular) BASECFLAGS will be empty by
default. On others, such as Mac OS X and SCO, it will contain required
flags. This change allows people building Python to override OPT without
fear of clobbering compiler flags which are required to get a clean build.
- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
relevant search lists in setup.py. This allows users building Python to
take advantage of the many packages available from the fink project
<http://fink.sf.net/>.
- A new Makefile target, scriptsinstall, installs a number of useful scripts
from the Tools/scripts directory.
C API
-----
- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
instead of a plain ``PyObject *``. (SF patch #686601.)
- PyNumber_Check() now checks that the object has a nb_int or nb_float
slot, rather than simply checking whether it has a non-NULL
tp_as_number pointer.
- A C type that inherits from a base type that defines tp_as_buffer
will now inherit the tp_as_buffer pointer if it doesn't define one.
(SF #681367)
- The PyArg_Parse functions now issue a DeprecationWarning if a float
argument is provided when an integer is specified (this affects the 'b',
'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
raise a TypeError.
Tests
-----
- Several tests weren't being run from regrtest.py (test_timeout.py,
test_tarfile.py, test_netrc.py, test_multifile.py,
test_importhooks.py and test_imp.py). Now they are. (Note to
developers: please read Lib/test/README when creating a new test, to
make sure to do it right! All tests need to use either unittest or
pydoc.)
- Added test_posix.py, a test suite for the posix module.
- Added test_hexoct.py, a test suite for hex/oct constant folding.
Windows
-------
- The timeout code for socket connect() didn't work right; this has
now been fixed. test_timeout.py should pass (at least most of the
time).
- distutils' msvccompiler class now passes the preprocessor options to
the resource compiler. See SF patch #669198.
- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
release without strong cryptography.
- sys.path[0], if it contains a directory name, is now always an
absolute pathname. (SF patch #664376.)
- The new logging package is now installed by the Windows installer. It
wasn't in 2.3a1 due to oversight.
Mac
---
- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
- Most of the standard library now uses pathnames or FSRefs in preference
of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
in stead of macfs. macfs will probably be deprecated in the future.
- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
This also makes macfs.FSSpec.SetDates() work again.
- There is a new module pimp, the package install manager for Python, and
accompanying applet PackageManager. These allow you to easily download
and install pretested extension packages either in source or binary
form. Only in MacPython-OSX.
- Applets are now built with bundlebuilder in MacPython-OSX, which should make
them more robust and also provides a path towards BuildApplication. The
downside of this change is that applets can no longer be run from the
Terminal window, this will hopefully be fixed in the 2.3b1.
What's New in Python 2.3 alpha 1?
=================================
*Release date: 31-Dec-2002*
Type/class unification and new-style classes
--------------------------------------------
- One can now assign to __bases__ and __name__ of new-style classes.
- dict() now accepts keyword arguments so that dict(one=1, two=2)
is the equivalent of {"one": 1, "two": 2}. Accordingly,
the existing (but undocumented) 'items' keyword argument has
been eliminated. This means that dict(items=someMapping) now has
a different meaning than before.
- int() now returns a long object if the argument is outside the
integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
all return long objects instead of raising an OverflowError.
- Assignment to __class__ is disallowed if either the old or the new
class is a statically allocated type object (such as defined by an
extension module). This prevents anomalies like 2.__class__ = bool.
- New-style object creation and deallocation have been sped up
significantly; they are now faster than classic instance creation
and deallocation.
- The __slots__ variable can now mention "private" names, and the
right thing will happen (e.g. __slots__ = ["__foo"]).
- The built-ins slice() and buffer() are now callable types. The
types classobj (formerly class), code, function, instance, and
instancemethod (formerly instance-method), which have no built-in
names but are accessible through the types module, are now also
callable. The type dict-proxy is renamed to dictproxy.
- Cycles going through the __class__ link of a new-style instance are
now detected by the garbage collector.
- Classes using __slots__ are now properly garbage collected.
[SF bug 519621]
- Tightened the __slots__ rules: a slot name must be a valid Python
identifier.
- The constructor for the module type now requires a name argument and
takes an optional docstring argument. Previously, this constructor
ignored its arguments. As a consequence, deriving a class from a
module (not from the module type) is now illegal; previously this
created an unnamed module, just like invoking the module type did.
[SF bug 563060]
- A new type object, 'basestring', is added. This is a common base type
for 'str' and 'unicode', and can be used instead of
types.StringTypes, e.g. to test whether something is "a string":
isinstance(x, basestring) is True for Unicode and 8-bit strings. This
is an abstract base class and cannot be instantiated directly.
- Changed new-style class instantiation so that when C's __new__
method returns something that's not a C instance, its __init__ is
not called. [SF bug #537450]
- Fixed super() to work correctly with class methods. [SF bug #535444]
- If you try to pickle an instance of a class that has __slots__ but
doesn't define or override __getstate__, a TypeError is now raised.
This is done by adding a bozo __getstate__ to the class that always
raises TypeError. (Before, this would appear to be pickled, but the
state of the slots would be lost.)
Core and builtins
-----------------
- Import from zipfiles is now supported. The name of a zipfile placed
on sys.path causes the import statement to look for importable Python
modules (with .py, pyc and .pyo extensions) and packages inside the
zipfile. The zipfile import follows the specification (though not
the sample implementation) of PEP 273. The semantics of __path__ are
compatible with those that have been implemented in Jython since
Jython 2.1.
- PEP 302 has been accepted. Although it was initially developed to
support zipimport, it offers a new, general import hook mechanism.
Several new variables have been added to the sys module:
sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
make extending the import statement much more convenient than
overriding the __import__ built-in function. For a description of
these, see PEP 302.
- A frame object's f_lineno attribute can now be written to from a
trace function to change which line will execute next. A command to
exploit this from pdb has been added. [SF patch #643835]
- The _codecs support module for codecs.py was turned into a built-in
module to assure that at least the built-in codecs are available
to the Python parser for source code decoding according to PEP 263.
- issubclass now supports a tuple as the second argument, just like
isinstance does. ``issubclass(X, (A, B))`` is equivalent to
``issubclass(X, A) or issubclass(X, B)``.
- Thanks to Armin Rigo, the last known way to provoke a system crash
by cleverly arranging for a comparison function to mutate a list
during a list.sort() operation has been fixed. The effect of
attempting to mutate a list, or even to inspect its contents or
length, while a sort is in progress, is not defined by the language.
The C implementation of Python 2.3 attempts to detect mutations,
and raise ValueError if one occurs, but there's no guarantee that
all mutations will be caught, or that any will be caught across
releases or implementations.
- Unicode file name processing for Windows (PEP 277) is implemented.
All platforms now have an os.path.supports_unicode_filenames attribute,
which is set to True on Windows NT/2000/XP, and False elsewhere.
- Codec error handling callbacks (PEP 293) are implemented.
Error handling in unicode.encode or str.decode can now be customized.
- A subtle change to the semantics of the built-in function intern():
interned strings are no longer immortal. You must keep a reference
to the return value intern() around to get the benefit.
- Use of 'None' as a variable, argument or attribute name now
issues a SyntaxWarning. In the future, None may become a keyword.
- SET_LINENO is gone. co_lnotab is now consulted to determine when to
call the trace function. C code that accessed f_lineno should call
PyCode_Addr2Line instead (f_lineno is still there, but only kept up
to date when there is a trace function set).
- There's a new warning category, FutureWarning. This is used to warn
about a number of situations where the value or sign of an integer
result will change in Python 2.4 as a result of PEP 237 (integer
unification). The warnings implement stage B0 mentioned in that
PEP. The warnings are about the following situations:
- Octal and hex literals without 'L' prefix in the inclusive range
[0x80000000..0xffffffff]; these are currently negative ints, but
in Python 2.4 they will be positive longs with the same bit
pattern.
- Left shifts on integer values that cause the outcome to lose
bits or have a different sign than the left operand. To be
precise: x<<n where this currently doesn't yield the same value
as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
- Conversions from ints to string that show negative values as
unsigned ints in the inclusive range [0x80000000..0xffffffff];
this affects the functions hex() and oct(), and the string
formatting codes %u, %o, %x, and %X. In Python 2.4, these will
show signed values (e.g. hex(-1) currently returns "0xffffffff";
in Python 2.4 it will return "-0x1").
- The bits manipulated under the cover by sys.setcheckinterval() have
been changed. Both the check interval and the ticker used to be
per-thread values. They are now just a pair of global variables.
In addition, the default check interval was boosted from 10 to 100
bytecode instructions. This may have some effect on systems that
relied on the old default value. In particular, in multi-threaded
applications which try to be highly responsive, response time will
increase by some (perhaps imperceptible) amount.
- When multiplying very large integers, a version of the so-called
Karatsuba algorithm is now used. This is most effective if the
inputs have roughly the same size. If they both have about N digits,
Karatsuba multiplication has O(N**1.58) runtime (the exponent is
log_base_2(3)) instead of the previous O(N**2). Measured results may
be better or worse than that, depending on platform quirks. Besides
the O() improvement in raw instruction count, the Karatsuba algorithm
appears to have much better cache behavior on extremely large integers
(starting in the ballpark of a million bits). Note that this is a
simple implementation, and there's no intent here to compete with,
e.g., GMP. It gives a very nice speedup when it applies, but a package
devoted to fast large-integer arithmetic should run circles around it.
- u'%c' will now raise a ValueError in case the argument is an
integer outside the valid range of Unicode code point ordinals.
- The tempfile module has been overhauled for enhanced security. The
mktemp() function is now deprecated; new, safe replacements are
mkstemp() (for files) and mkdtemp() (for directories), and the
higher-level functions NamedTemporaryFile() and TemporaryFile().
Use of some global variables in this module is also deprecated; the
new functions have keyword arguments to provide the same
functionality. All Lib, Tools and Demo modules that used the unsafe
interfaces have been updated to use the safe replacements. Thanks
to Zack Weinberg!
- When x is an object whose class implements __mul__ and __rmul__,
1.0*x would correctly invoke __rmul__, but 1*x would erroneously
invoke __mul__. This was due to the sequence-repeat code in the int
type. This has been fixed now.
- Previously, "str1 in str2" required str1 to be a string of length 1.
This restriction has been relaxed to allow str1 to be a string of
any length. Thus "'el' in 'hello world'" returns True now.
- File objects are now their own iterators. For a file f, iter(f) now
returns f (unless f is closed), and f.next() is similar to
f.readline() when EOF is not reached; however, f.next() uses a
readahead buffer that messes up the file position, so mixing
f.next() and f.readline() (or other methods) doesn't work right.
Calling f.seek() drops the readahead buffer, but other operations
don't. It so happens that this gives a nice additional speed boost
to "for line in file:"; the xreadlines method and corresponding
module are now obsolete. Thanks to Oren Tirosh!
- Encoding declarations (PEP 263, phase 1) have been implemented. A
comment of the form "# -*- coding: <encodingname> -*-" in the first
or second line of a Python source file indicates the encoding.
- list.sort() has a new implementation. While cross-platform results
may vary, and in data-dependent ways, this is much faster on many
kinds of partially ordered lists than the previous implementation,
and reported to be just as fast on randomly ordered lists on
several major platforms. This sort is also stable (if A==B and A
precedes B in the list at the start, A precedes B after the sort too),
although the language definition does not guarantee stability. A
potential drawback is that list.sort() may require temp space of
len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
for list.sort() to raise MemoryError now, even if a comparison function
does not. See <https://bugs.python.org/issue587076> for full details.
- All standard iterators now ensure that, once StopIteration has been
raised, all future calls to next() on the same iterator will also
raise StopIteration. There used to be various counterexamples to
this behavior, which could have caused confusion or subtle program
breakage, without any benefits. (Note that this is still an
iterator's responsibility; the iterator framework does not enforce
this.)
- Ctrl+C handling on Windows has been made more consistent with
other platforms. KeyboardInterrupt can now reliably be caught,
and Ctrl+C at an interactive prompt no longer terminates the
process under NT/2k/XP (it never did under Win9x). Ctrl+C will
interrupt time.sleep() in the main thread, and any child processes
created via the popen family (on win2k; we can't make win9x work
reliably) are also interrupted (as generally happens on for Linux/Unix.)
[SF bugs 231273, 439992 and 581232]
- sys.getwindowsversion() has been added on Windows. This
returns a tuple with information about the version of Windows
currently running.
- Slices and repetitions of buffer objects now consistently return
a string. Formerly, strings would be returned most of the time,
but a buffer object would be returned when the repetition count
was one or when the slice range was all inclusive.
- Unicode objects in sys.path are no longer ignored but treated
as directory names.
- Fixed string.startswith and string.endswith built-in methods
so they accept negative indices. [SF bug 493951]
- Fixed a bug with a continue inside a try block and a yield in the
finally clause. [SF bug 567538]
- Most built-in sequences now support "extended slices", i.e. slices
with a third "stride" parameter. For example, "hello world"[::-1]
gives "dlrow olleh".
- A new warning PendingDeprecationWarning was added to provide
direction on features which are in the process of being deprecated.
The warning will not be printed by default. To see the pending
deprecations, use -Walways::PendingDeprecationWarning::
as a command line option or warnings.filterwarnings() in code.
- Deprecated features of xrange objects have been removed as
promised. The start, stop, and step attributes and the tolist()
method no longer exist. xrange repetition and slicing have been
removed.
- New built-in function enumerate(x), from PEP 279. Example:
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
The argument can be an arbitrary iterable object.
- The assert statement no longer tests __debug__ at runtime. This means
that assert statements cannot be disabled by assigning a false value
to __debug__.
- A method zfill() was added to str and unicode, that fills a numeric
string to the left with zeros. For example,
"+123".zfill(6) -> "+00123".
- Complex numbers supported divmod() and the // and % operators, but
these make no sense. Since this was documented, they're being
deprecated now.
- String and unicode methods lstrip(), rstrip() and strip() now take
an optional argument that specifies the characters to strip. For
example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
- There's a new dictionary constructor (a class method of the dict
class), dict.fromkeys(iterable, value=None). It constructs a
dictionary with keys taken from the iterable and all values set to a
single value. It can be used for building sets and for removing
duplicates from sequences.
- Added a new dict method pop(key). This removes and returns the
value corresponding to key. [SF patch #539949]
- A new built-in type, bool, has been added, as well as built-in
names for its two values, True and False. Comparisons and sundry
other operations that return a truth value have been changed to
return a bool instead. Read PEP 285 for an explanation of why this
is backward compatible.
- Fixed two bugs reported as SF #535905: under certain conditions,
deallocating a deeply nested structure could cause a segfault in the
garbage collector, due to interaction with the "trashcan" code;
access to the current frame during destruction of a local variable
could access a pointer to freed memory.
- The optional object allocator ("pymalloc") has been enabled by
default. The recommended practice for memory allocation and
deallocation has been streamlined. A header file is included,
Misc/pymemcompat.h, which can be bundled with 3rd party extensions
and lets them use the same API with Python versions from 1.5.2
onwards.
- PyErr_Display will provide file and line information for all exceptions
that have an attribute print_file_and_line, not just SyntaxErrors.
- The UTF-8 codec will now encode and decode Unicode surrogates
correctly and without raising exceptions for unpaired ones.
- Universal newlines (PEP 278) is implemented. Briefly, using 'U'
instead of 'r' when opening a text file for reading changes the line
ending convention so that any of '\r', '\r\n', and '\n' is
recognized (even mixed in one file); all three are converted to
'\n', the standard Python line end character.
- file.xreadlines() now raises a ValueError if the file is closed:
Previously, an xreadlines object was returned which would raise
a ValueError when the xreadlines.next() method was called.
- sys.exit() inadvertently allowed more than one argument.
An exception will now be raised if more than one argument is used.
- Changed evaluation order of dictionary literals to conform to the
general left to right evaluation order rule. Now {f1(): f2()} will
evaluate f1 first.
- Fixed bug #521782: when a file was in non-blocking mode, file.read()
could silently lose data or wrongly throw an unknown error.
- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
slots are now always tried after trying the corresponding nb_* slots.
This fixes a number of minor bugs (see bug #624807).
- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
Extension modules
-----------------
- Added three operators to the operator module:
operator.pow(a,b) which is equivalent to: a**b.
operator.is_(a,b) which is equivalent to: a is b.
operator.is_not(a,b) which is equivalent to: a is not b.
- posix.openpty now works on all systems that have /dev/ptmx.
- A module zipimport exists to support importing code from zip
archives.
- The new datetime module supplies classes for manipulating dates and
times. The basic design came from the Zope "fishbowl process", and
favors practical commercial applications over calendar esoterica. See
http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
- _tkinter now returns Tcl objects, instead of strings. Objects which
have Python equivalents are converted to Python objects, other objects
are wrapped. This can be configured through the wantobjects method,
or Tkinter.wantobjects.
- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
been added as the package bsddb. The traditional bsddb module is
still available in source code, but not built automatically anymore,
and is now named bsddb185. This supports Berkeley DB versions from
3.0 to 4.1. For help converting your databases from the old module (which
probably used an obsolete version of Berkeley DB) to the new module, see
the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
section above.
- unicodedata was updated to Unicode 3.2. It supports normalization
and names for Hangul syllables and CJK unified ideographs.
- resource.getrlimit() now returns longs instead of ints.
- readline now dynamically adjusts its input/output stream if
sys.stdin/stdout changes.
- The _tkinter module (and hence Tkinter) has dropped support for
Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
supported.
- cPickle.BadPickleGet is now a class.
- The time stamps in os.stat_result are floating point numbers
after stat_float_times has been called.
- If the size passed to mmap.mmap() is larger than the length of the
file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
- The xreadlines module is slated for obsolescence.
- The strptime function in the time module is now always available (a
Python implementation is used when the C library doesn't define it).
- The 'new' module is no longer an extension, but a Python module that
only exists for backwards compatibility. Its contents are no longer
functions but callable type objects.
- The bsddb.*open functions can now take 'None' as a filename.
This will create a temporary in-memory bsddb that won't be
written to disk.
- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
posix.getpgid have been added where available.
- The locale module now exposes the C library's gettext interface. It
also has a new function getpreferredencoding.
- A security hole ("double free") was found in zlib-1.1.3, a popular
third party compression library used by some Python modules. The
hole was quickly plugged in zlib-1.1.4, and the Windows build of
Python now ships with zlib-1.1.4.
- pwd, grp, and resource return enhanced tuples now, with symbolic
field names.
- array.array is now a type object. A new format character
'u' indicates Py_UNICODE arrays. For those, .tounicode and
.fromunicode methods are available. Arrays now support __iadd__
and __imul__.
- dl now builds on every system that has dlfcn.h. Failure in case
of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
is called.
- The sys module acquired a new attribute, api_version, which evaluates
to the value of the PYTHON_API_VERSION macro with which the
interpreter was compiled.
- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
returns (None, None, 'ab'), as expected. Also fixed handling of
lastindex/lastgroup match attributes in similar cases. For example,
when running the expression r'(a)(b)?b' over 'ab', lastindex must be
1, not 2.
- Fixed bug #581080: sre scanner was not checking the buffer limit
before increasing the current pointer. This was creating an infinite
loop in the search function, once the pointer exceeded the buffer
limit.
- The os.fdopen function now enforces a file mode starting with the
letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
bug #623464.
- The linuxaudiodev module is now deprecated; it is being replaced by
ossaudiodev. The interface has been extended to cover a lot more of
OSS (see www.opensound.com), including most DSP ioctls and the
OSS mixer API. Documentation forthcoming in 2.3a2.
Library
-------
- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
- Freeze's modulefinder.py has been moved to the standard library;
slightly improved so it will issue less false missing submodule
reports (see sf path #643711 for details). Documentation will follow
with Python 2.3a2.
- os.path exposes getctime.
- unittest.py now has two additional methods called assertAlmostEqual()
and failIfAlmostEqual(). They implement an approximate comparison
by rounding the difference between the two arguments and comparing
the result to zero. Approximate comparison is essential for
unit tests of floating point results.
- calendar.py now depends on the new datetime module rather than
the time module. As a result, the range of allowable dates
has been increased.
- pdb has a new 'j(ump)' command to select the next line to be
executed.
- The distutils created windows installers now can run a
postinstallation script.
- doctest.testmod can now be called without argument, which means to
test the current module.
- When canceling a server that implemented threading with a keyboard
interrupt, the server would shut down but not terminate (waiting on
client threads). A new member variable, daemon_threads, was added to
the ThreadingMixIn class in SocketServer.py to make it explicit that
this behavior needs to be controlled.
- A new module, optparse, provides a fancy alternative to getopt for
command line parsing. It is a slightly modified version of Greg
Ward's Optik package.
- UserDict.py now defines a DictMixin class which defines all dictionary
methods for classes that already have a minimum mapping interface.
This greatly simplifies writing classes that need to be substitutable
for dictionaries (such as the shelve module).
- shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
all dictionary methods. This eases the transition to persistent
storage for scripts originally written with dictionaries in mind.
- shelve.open and the various classes in shelve.py now accept an optional
binary flag, which defaults to False. If True, the values stored in the
shelf are binary pickles.
- A new package, logging, implements the logging API defined by PEP
282. The code is written by Vinay Sajip.
- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
modules are iterators now.
- gzip.py now handles files exceeding 2GB. Files over 4GB also work
now (provided the OS supports it, and Python is configured with large
file support), but in that case the underlying gzip file format can
record only the least-significant 32 bits of the file size, so that
some tools working with gzipped files may report an incorrect file
size.
- xml.sax.saxutils.unescape has been added, to replace entity references
with their entity value.
- Queue.Queue.{put,get} now support an optional timeout argument.
- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
option of tkFileDialog is exposed as function askopenfile{,name}s.
- Various configure methods of Tkinter have been stream-lined, so that
tag_configure, image_configure, window_configure now return a
dictionary when invoked with no argument.
- Importing the readline module now no longer has the side effect of
calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
whatever locale is explicitly set by the user, is preserved. If you
want repr() of 8-bit strings in your preferred encoding to preserve
all printable characters of that encoding, you have to add the
following code to your $PYTHONSTARTUP file or to your application's
main():
import locale
locale.setlocale(locale.LC_CTYPE, "")
- shutil.move was added. shutil.copytree now reports errors as an
exception at the end, instead of printing error messages.
- Encoding name normalization was generalized to not only
replace hyphens with underscores, but also all other non-alphanumeric
characters (with the exception of the dot which is used for Python
package names during lookup). The aliases.py mapping was updated
to the new standard.
- mimetypes has two new functions: guess_all_extensions() which
returns a list of all known extensions for a mime type, and
add_type() which adds one mapping between a mime type and
an extension to the database.
- New module: sets, defines the class Set that implements a mutable
set type using the keys of a dict to represent the set. There's
also a class ImmutableSet which is useful when you need sets of sets
or when you need to use sets as dict keys, and a class BaseSet which
is the base class of the two.
- Added random.sample(population,k) for random sampling without replacement.
Returns a k length list of unique elements chosen from the population.
- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
OverflowError. That is, it now accepts any combination of 'start'
and 'stop' arguments so long as each is in the range of Python's
bounded integers.
- Thanks to Raymond Hettinger, random.random() now uses a new core
generator. The Mersenne Twister algorithm is implemented in C,
threadsafe, faster than the previous generator, has an astronomically
large period (2**19937-1), creates random floats to full 53-bit
precision, and may be the most widely tested random number generator
in existence.
The random.jumpahead(n) method has different semantics for the new
generator. Instead of jumping n steps ahead, it uses n and the
existing state to create a new state. This means that jumpahead()
continues to support multi-threaded code needing generators of
non-overlapping sequences. However, it will break code which relies
on jumpahead moving a specific number of steps forward.
The attributes random.whseed and random.__whseed have no meaning for
the new generator. Code using these attributes should switch to a
new class, random.WichmannHill which is provided for backward
compatibility and to make an alternate generator available.
- New "algorithms" module: heapq, implements a heap queue. Thanks to
Kevin O'Connor for the code and François Pinard for an entertaining
write-up explaining the theory and practical uses of heaps.
- New encoding for the Palm OS character set: palmos.
- binascii.crc32() and the zipfile module had problems on some 64-bit
platforms. These have been fixed. On a platform with 8-byte C longs,
crc32() now returns a signed-extended 4-byte result, so that its value
as a Python int is equal to the value computed a 32-bit platform.
- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
argument.
- Some fixes in the copy module: when an object is copied through its
__reduce__ method, there was no check for a __setstate__ method on
the result [SF patch 565085]; deepcopy should treat instances of
custom metaclasses the same way it treats instances of type 'type'
[SF patch 560794].
- Sockets now support timeout mode. After s.settimeout(T), where T is
a float expressing seconds, subsequent operations raise an exception
if they cannot be completed within T seconds. To disable timeout
mode, use s.settimeout(None). There's also a module function,
socket.setdefaulttimeout(T), which sets the default for all sockets
created henceforth.
- getopt.gnu_getopt was added. This supports GNU-style option
processing, where options can be mixed with non-option arguments.
- Stop using strings for exceptions. String objects used for
exceptions are now classes deriving from Exception. The objects
changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
tabnanny.NannyNag, and xdrlib.Error.
- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
big endian systems were added to the codecs module. The old names
BOM32_* and BOM64_* were off by a factor of 2.
- Added conversion functions math.degrees() and math.radians().
- math.log() now takes an optional argument: math.log(x[, base]).
- ftplib.retrlines() now tests for callback is None rather than testing
for False. Was causing an error when given a callback object which
was callable but also returned len() as zero. The change may
create new breakage if the caller relied on the undocumented behavior
and called with callback set to [] or some other False value not
identical to None.
- random.gauss() uses a piece of hidden state used by nothing else,
and the .seed() and .whseed() methods failed to reset it. In other
words, setting the seed didn't completely determine the sequence of
results produced by random.gauss(). It does now. Programs repeatedly
mixing calls to a seed method with calls to gauss() may see different
results now.
- The pickle.Pickler class grew a clear_memo() method to mimic that
provided by cPickle.Pickler.
- difflib's SequenceMatcher class now does a dynamic analysis of
which elements are so frequent as to constitute noise. For
comparing files as sequences of lines, this generally works better
than the IS_LINE_JUNK function, and function ndiff's linejunk
argument defaults to None now as a result. A happy benefit is
that SequenceMatcher may run much faster now when applied
to large files with many duplicate lines (for example, C program
text with lots of repeated "}" and "return NULL;" lines).
- New Text.dump() method in Tkinter module.
- New distutils commands for building packagers were added to
support pkgtool on Solaris and swinstall on HP-UX.
- distutils now has a new abstract binary packager base class
command/bdist_packager, which simplifies writing packagers.
This will hopefully provide the missing bits to encourage
people to submit more packagers, e.g. for Debian, FreeBSD
and other systems.
- The UTF-16, -LE and -BE stream readers now raise a
NotImplementedError for all calls to .readline(). Previously, they
used to just produce garbage or fail with an encoding error --
UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
work well with these.
- compileall now supports quiet operation.
- The BaseHTTPServer now implements optional HTTP/1.1 persistent
connections.
- socket module: the SSL support was broken out of the main
_socket module C helper and placed into a new _ssl helper
which now gets imported by socket.py if available and working.
- encodings package: added aliases for all supported IANA character
sets
- ftplib: to safeguard the user's privacy, anonymous login will use
"anonymous@" as default password, rather than the real user and host
name.
- webbrowser: tightened up the command passed to os.system() so that
arbitrary shell code can't be executed because a bogus URL was
passed in.
- gettext.translation has an optional fallback argument, and
gettext.find an optional all argument. Translations will now fallback
on a per-message basis. The module supports plural forms, by means
of gettext.[d]ngettext and Translation.[u]ngettext.
- distutils bdist commands now offer a --skip-build option.
- warnings.warn now accepts a Warning instance as first argument.
- The xml.sax.expatreader.ExpatParser class will no longer create
circular references by using itself as the locator that gets passed
to the content handler implementation. [SF bug #535474]
- The email.Parser.Parser class now properly parses strings regardless
of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
or CRLF). Also, the Header class's constructor default arguments
has changed slightly so that an explicit maxlinelen value is always
honored, and so unicode conversion error handling can be specified.
- distutils' build_ext command now links C++ extensions with the C++
compiler available in the Makefile or CXX environment variable, if
running under \*nix.
- New module bz2: provides a comprehensive interface for the bz2 compression
library. It implements a complete file interface, one-shot (de)compression
functions, and types for sequential (de)compression.
- New pdb command 'pp' which is like 'p' except that it pretty-prints
the value of its expression argument.
- Now bdist_rpm distutils command understands a verify_script option in
the config file, including the contents of the referred filename in
the "%verifyscript" section of the rpm spec file.
- Fixed bug #495695: webbrowser module would run graphic browsers in a
unix environment even if DISPLAY was not set. Also, support for
skipstone browser was included.
- Fixed bug #636769: rexec would run unallowed code if subclasses of
strings were used as parameters for certain functions.
Tools/Demos
-----------
- pygettext.py now supports globbing on Windows, and accepts module
names in addition to accepting file names.
- The SGI demos (Demo/sgi) have been removed. Nobody thought they
were interesting any more. (The SGI library modules and extensions
are still there; it is believed that at least some of these are
still used and useful.)
- IDLE supports the new encoding declarations (PEP 263); it can also
deal with legacy 8-bit files if they use the locale's encoding. It
allows non-ASCII strings in the interactive shell and executes them
in the locale's encoding.
- freeze.py now produces binaries which can import shared modules,
unlike before when this failed due to missing symbol exports in
the generated binary.
Build
-----
- On Unix, IDLE is now installed automatically.
- The fpectl module is not built by default; it's dangerous or useless
except in the hands of experts.
- The public Python C API will generally be declared using PyAPI_FUNC
and PyAPI_DATA macros, while Python extension module init functions
will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
are deprecated.
- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
get into infinite loops, when a new-style class got garbage-collected.
Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
that new-style classes be immortal in COUNT_ALLOCS builds. Note that
COUNT_ALLOCS is not enabled by default, in either release or debug
builds, and that new-style classes are immortal only in COUNT_ALLOCS
builds.
- Compiling out the cyclic garbage collector is no longer an option.
The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
that it's always defined (for the benefit of any extension modules
that may be conditionalizing on it). A bonus is that any extension
type participating in cyclic gc can choose to participate in the
Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
to require editing the core to teach the trashcan mechanism about the
new type.
- According to Annex F of the current C standard,
The Standard C macro HUGE_VAL and its float and long double analogs,
HUGE_VALF and HUGE_VALL, expand to expressions whose values are
positive infinities.
Python only uses the double HUGE_VAL, and only to #define its own symbol
Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
pyport.h used to try to worm around that, but the workarounds triggered
other bugs on other platforms, so we gave up. If your platform defines
HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
that works on your platform. The only instance of this I'm sure about
is on an unknown subset of Cray systems, described here:
http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
- The configure option --without-doc-strings can be used to remove the
doc strings from the built-in functions and modules; this reduces the
size of the executable.
- The universal newlines option (PEP 278) is on by default. On Unix
it can be disabled by passing --without-universal-newlines to the
configure script. On other platforms, remove
WITH_UNIVERSAL_NEWLINES from pyconfig.h.
- On Unix, a shared libpython2.3.so can be created with --enable-shared.
- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
preprocessor symbols were eliminated. The internal decisions they
controlled stopped being experimental long ago.
- The tools used to build the documentation now work under Cygwin as
well as Unix.
- The bsddb and dbm module builds have been changed to try and avoid version
skew problems and disable linkage with Berkeley DB 1.85 unless the
installer knows what s/he's doing. See the section on building these
modules in the README file for details.
C API
-----
- PyNumber_Check() now returns true for string and unicode objects.
This is a result of these types having a partially defined
tp_as_number slot. (This is not a feature, but an indication that
PyNumber_Check() is not very useful to determine numeric behavior.
It may be deprecated.)
- The string object's layout has changed: the pointer member
ob_sinterned has been replaced by an int member ob_sstate. On some
platforms (e.g. most 64-bit systems) this may change the offset of
the ob_sval member, so as a precaution the API_VERSION has been
incremented. The apparently unused feature of "indirect interned
strings", supported by the ob_sinterned member, is gone. Interned
strings are now usually mortal; there is a new API,
PyString_InternImmortal() that creates immortal interned strings.
(The ob_sstate member can only take three values; however, while
making it a char saves a few bytes per string object on average, in
it also slowed things down a bit because ob_sval was no longer
aligned.)
- The Py_InitModule*() functions now accept NULL for the 'methods'
argument. Modules without global functions are becoming more common
now that factories can be types rather than functions.
- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
level.
- New functions PyErr_SetExcFromWindowsErr() and
PyErr_SetExcFromWindowsErrWithFilename(). Similar to
PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetFromWindowsErr(), but they allow specifying
the exception type to raise. Available on Windows.
- Py_FatalError() is now declared as taking a const char* argument. It
was previously declared without const. This should not affect working
code.
- Added new macro PySequence_ITEM(o, i) that directly calls
sq_item without rechecking that o is a sequence and without
adjusting for negative indices.
- PyRange_New() now raises ValueError if the fourth argument is not 1.
This is part of the removal of deprecated features of the xrange
object.
- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
coercion if both arguments have the same type but this type has the
CHECKTYPES flag set. This is to better support proxies.
- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
"``void (*)(void *)``".
- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
- A type can now inherit its metatype from its base type. Previously,
when PyType_Ready() was called, if ob_type was found to be NULL, it
was always set to &PyType_Type; now it is set to base->ob_type,
where base is tp_base, defaulting to &PyObject_Type.
- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
- The PyCore_* family of APIs have been removed.
- The "u#" parser marker will now pass through Unicode objects as-is
without going through the buffer API.
- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
- An old #define of ANY as void has been removed from pyport.h. This
hasn't been used since Python's pre-ANSI days, and the #define has
been marked as obsolete since then. SF bug 495548 says it created
conflicts with other packages, so keeping it around wasn't harmless.
- Because Python's magic number scheme broke on January 1st, we decided
to stop Python development. Thanks for all the fish!
- Some of us don't like fish, so we changed Python's magic number
scheme to a new one. See Python/import.c for details.
New platforms
-------------
- OpenVMS is now supported.
- AtheOS is now supported.
- the EMX runtime environment on OS/2 is now supported.
- GNU/Hurd is now supported.
Tests
-----
- The regrtest.py script's -u option now provides a way to say "allow
all resources except this one." For example, to allow everything
except bsddb, give the option '-uall,-bsddb'.
Windows
-------
- The Windows distribution now ships with version 4.0.14 of the
Sleepycat Berkeley database library. This should be a huge
improvement over the previous Berkeley DB 1.85, which had many
bugs.
XXX What are the licensing issues here?
XXX If a user has a database created with a previous version of
XXX Python, what must they do to convert it?
XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
XXX The version # is likely to change before 2.3a1.
- The Windows distribution now ships with a Secure Sockets Library (SLL)
module (_ssl.pyd)
- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
previously shipped with Tcl/Tk 8.3.2).
- When Python is built under a Microsoft compiler, sys.version now
includes the compiler version number (_MSC_VER). For example, under
MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
the value of _MSC_VER under MSVC 6.
- Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
of that has been fixed in the installer (disabled Wise's "delete in-
use files" uninstall option).
- Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
- The installer now installs Start menu shortcuts under (the local
equivalent of) "All Users" when doing an Admin install.
- file.truncate([newsize]) now works on Windows for all newsize values.
It used to fail if newsize didn't fit in 32 bits, reflecting a
limitation of MS _chsize (which is no longer used).
- os.waitpid() is now implemented for Windows, and can be used to block
until a specified process exits. This is similar to, but not exactly
the same as, os.waitpid() on POSIX systems. If you're waiting for
a specific process whose pid was obtained from one of the spawn()
functions, the same Python os.waitpid() code works across platforms.
See the docs for details. The docs were changed to clarify that
spawn functions return, and waitpid requires, a process handle on
Windows (not the same thing as a Windows process id).
- New tempfile.TemporaryFile implementation for Windows: this doesn't
need a TemporaryFileWrapper wrapper anymore, and should be immune
to a nasty problem: before 2.3, if you got a temp file on Windows, it
got wrapped in an object whose close() method first closed the
underlying file, then deleted the file. This usually worked fine.
However, the spawn family of functions on Windows create (at a low C
level) the same set of open files in the spawned process Q as were
open in the spawning process P. If a temp file f was among them, then
doing f.close() in P first closed P's C-level file handle on f, but Q's
C-level file handle on f remained open, so the attempt in P to delete f
blew up with a "Permission denied" error (Windows doesn't allow
deleting open files). This was surprising, subtle, and difficult to
work around.
- The os module now exports all the symbolic constants usable with the
low-level os.open() on Windows: the new constants in 2.3 are
O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
(so specify both if you want both; note that neither is useful unless
specified with O_CREAT too).
Mac
----
- Mac/Relnotes is gone, the release notes are now here.
- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
version) now fully supports unicode strings as arguments to various file
system calls, eg. open(), file(), os.stat() and os.listdir().
- The current naming convention for Python on the Macintosh is that MacPython
refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
CFM-based version that runs on both OS9 and OSX.
- All MacPython-OS9 functionality is now available in an OSX unix build,
including the Carbon modules, the IDE, OSA support, etc. A lot of this
will only work correctly in a framework build, though, because you cannot
talk to the window manager unless your application is run from a .app
bundle. There is a command line tool "pythonw" that runs your script
with an interpreter living in such a .app bundle, this interpreter should
be used to run any Python script using the window manager (including
Tkinter or wxPython scripts).
- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
are specifically for MacPython-OS9 (CFM support, preference resources, etc).
- A new utility PythonLauncher will start a Python interpreter when a .py or
.pyw script is double-clicked in the Finder. By default .py scripts are
run with a normal Python interpreter in a Terminal window and .pyw
files are run with a window-aware pythonw interpreter without a Terminal
window, but all this can be customized.
- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
releases.
- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
line interface too.
- All the Carbon classes are now PEP253 compliant, meaning that you can
subclass them from Python. Most of the attributes have gone, you should
now use the accessor function call API, which is also what Apple's
documentation uses. Some attributes such as grafport.visRgn are still
available for convenience.
- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
and Folder (APIs from Folders.h). The old macfs built-in module is
gone, and replaced by a Python wrapper around the new modules.
- Pathname handling should now be fully consistent: MacPython-OSX always uses
unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
(also when running on Mac OS X).
- New Carbon modules Help and AH give access to the Carbon Help Manager.
There are hooks in the IDE to allow accessing the Python documentation
(and Apple's Carbon and Cocoa documentation) through the Help Viewer.
See Mac/OSX/README for converting the Python documentation to a
Help Viewer compatible form and installing it.
- OSA support has been redesigned and the generated Python classes now
mirror the inheritance defined by the underlying OSA classes.
- MacPython no longer maps both \r and \n to \n on input for any text file.
This feature has been replaced by universal newline support (PEP278).
- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
mac-roman (or whatever your local Mac encoding was) but "ascii", like on
other platforms. If you really need sourcefiles with Mac characters in them
you can change this in site.py.
What's New in Python 2.2 final?
===============================
*Release date: 21-Dec-2001*
Type/class unification and new-style classes
--------------------------------------------
- pickle.py, cPickle: allow pickling instances of new-style classes
with a custom metaclass.
Core and builtins
-----------------
- weakref proxy object: when comparing, unwrap both arguments if both
are proxies.
Extension modules
-----------------
- binascii.b2a_base64(): fix a potential buffer overrun when encoding
very short strings.
- cPickle: the obscure "fast" mode was suspected of causing stack
overflows on the Mac. Hopefully fixed this by setting the recursion
limit much smaller. If the limit is too low (it only affects
performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
when compiling cPickle.c (or in pyconfig.h).
Library
-------
- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
close or delete time).
- rfc822.py: fixed a bug where the address '<>' was converted to None
instead of an empty string (also fixes the email.Utils module).
- xmlrpclib.py: version 1.0.0; uses precision for doubles.
- test suite: the pickle and cPickle tests were not executing any code
when run from the standard regression test.
Tools/Demos
-----------
Build
-----
C API
-----
New platforms
-------------
Tests
-----
Windows
-------
- distutils package: fixed broken Windows installers (bdist_wininst).
- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
instances are deleted at process exit time.
- socket.py: prevent mysterious warnings when socket instances are
deleted at process exit time.
- posixmodule.c: fix a Windows crash with stat() of a filename ending
in backslash.
Mac
----
- The Carbon toolbox modules have been upgraded to Universal Headers
3.4, and experimental CoreGraphics and CarbonEvents modules have
been added. All only for framework-enabled MacOSX.
What's New in Python 2.2c1?
===========================
*Release date: 14-Dec-2001*
Type/class unification and new-style classes
--------------------------------------------
- Guido's tutorial introduction to the new type/class features has
been extensively updated. See
http://www.python.org/2.2/descrintro.html
That remains the primary documentation in this area.
- Fixed a leak: instance variables declared with __slots__ were never
deleted!
- The "delete attribute" method of descriptor objects is called
__delete__, not __del__. In previous releases, it was mistakenly
called __del__, which created an unfortunate overloading condition
with finalizers. (The "get attribute" and "set attribute" methods
are still called __get__ and __set__, respectively.)
- Some subtle issues with the super built-in were fixed:
(a) When super itself is subclassed, its __get__ method would still
return an instance of the base class (i.e., of super).
(b) super(C, C()).__class__ would return C rather than super. This
is confusing. To fix this, I decided to change the semantics of
super so that it only applies to code attributes, not to data
attributes. After all, overriding data attributes is not
supported anyway.
(c) The __get__ method didn't check whether the argument was an
instance of the type used in creation of the super instance.
- Previously, hash() of an instance of a subclass of a mutable type
(list or dictionary) would return some value, rather than raising
TypeError. This has been fixed. Also, directly calling
dict.__hash__ and list.__hash__ now raises the same TypeError
(previously, these were the same as object.__hash__).
- New-style objects now support deleting their __dict__. This is for
all intents and purposes equivalent to assigning a brand new empty
dictionary, but saves space if the object is not used further.
Core and builtins
-----------------
- -Qnew now works as documented in PEP 238: when -Qnew is passed on
the command line, all occurrences of "/" use true division instead
of classic division. See the PEP for details. Note that "all"
means all instances in library and 3rd-party modules, as well as in
your own code. As the PEP says, -Qnew is intended for use only in
educational environments with control over the libraries in use.
Note that test_coercion.py in the standard Python test suite fails
under -Qnew; this is expected, and won't be repaired until true
division becomes the default (in the meantime, test_coercion is
testing the current rules).
- complex() now only allows the first argument to be a string
argument, and raises TypeError if either the second arg is a string
or if the second arg is specified when the first is a string.
Extension modules
-----------------
- gc.get_referents was renamed to gc.get_referrers.
Library
-------
- Functions in the os.spawn() family now release the global interpreter
lock around calling the platform spawn. They should always have done
this, but did not before 2.2c1. Multithreaded programs calling
an os.spawn function with P_WAIT will no longer block all Python threads
until the spawned program completes. It's possible that some programs
relies on blocking, although more likely by accident than by design.
- webbrowser defaults to netscape.exe on OS/2 now.
- Tix.ResizeHandle exposes detach_widget, hide, and show.
- The charset alias windows_1252 has been added.
- types.StringTypes is a tuple containing the defined string types;
usually this will be (str, unicode), but if Python was compiled
without Unicode support it will be just (str,).
- The pulldom and minidom modules were synchronized to PyXML.
Tools/Demos
-----------
- A new script called Tools/scripts/google.py was added, which fires
off a search on Google.
Build
-----
- Note that release builds of Python should arrange to define the
preprocessor symbol NDEBUG on the command line (or equivalent).
In the 2.2 pre-release series we tried to define this by magic in
Python.h instead, but it proved to cause problems for extension
authors. The Unix, Windows and Mac builds now all define NDEBUG in
release builds via cmdline (or equivalent) instead. Ports to
other platforms should do likewise.
- It is no longer necessary to use --with-suffix when building on a
case-insensitive file system (such as Mac OS X HFS+). In the build
directory an extension is used, but not in the installed python.
C API
-----
- New function PyDict_MergeFromSeq2() exposes the built-in dict
constructor's logic for updating a dictionary from an iterable object
producing key-value pairs.
- PyArg_ParseTupleAndKeywords() requires that the number of entries in
the keyword list equal the number of argument specifiers. This
wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
dump core in some bad cases. This has been repaired. As a result,
PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
previously went unchallenged.
New platforms
-------------
Tests
-----
Windows
-------
Mac
----
- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
without any trailing digits.
- Changed logic for finding python home in Mac OS X framework Pythons.
Now sys.executable points to the executable again, in stead of to
the shared library. The latter is used only for locating the python
home.
What's New in Python 2.2b2?
===========================
*Release date: 16-Nov-2001*
Type/class unification and new-style classes
--------------------------------------------
- Multiple inheritance mixing new-style and classic classes in the
list of base classes is now allowed, so this works now:
class Classic: pass
class Mixed(Classic, object): pass
The MRO (method resolution order) for each base class is respected
according to its kind, but the MRO for the derived class is computed
using new-style MRO rules if any base class is a new-style class.
This needs to be documented.
- The new built-in dictionary() constructor, and dictionary type, have
been renamed to dict. This reflects a decade of common usage.
- dict() now accepts an iterable object producing 2-sequences. For
example, dict(d.items()) == d for any dictionary d. The argument,
and the elements of the argument, can be any iterable objects.
- New-style classes can now have a __del__ method, which is called
when the instance is deleted (just like for classic classes).
- Assignment to object.__dict__ is now possible, for objects that are
instances of new-style classes that have a __dict__ (unless the base
class forbids it).
- Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored). The only built-in methods
that take keyword arguments are __call__, __init__ and __new__.
- The socket function has been converted to a type; see below.
Core and builtins
-----------------
- Assignment to __debug__ raises SyntaxError at compile-time. This
was promised when 2.1c1 was released as "What's New in Python 2.1c1"
(see below) says.
- Clarified the error messages for unsupported operands to an operator
(like 1 + '').
Extension modules
-----------------
- mmap has a new keyword argument, "access", allowing a uniform way for
both Windows and Unix users to create read-only, write-through and
copy-on-write memory mappings. This was previously possible only on
Unix. A new keyword argument was required to support this in a
uniform way because the mmap() signatures had diverged across
platforms. Thanks to Jay T Miller for repairing this!
- By default, the gc.garbage list now contains only those instances in
unreachable cycles that have __del__ methods; in 2.1 it contained all
instances in unreachable cycles. "Instances" here has been generalized
to include instances of both new-style and old-style classes.
- The socket module defines a new method for socket objects,
sendall(). This is like send() but may make multiple calls to
send() until all data has been sent. Also, the socket function has
been converted to a subclassable type, like list and tuple (etc.)
before it; socket and SocketType are now the same thing.
- Various bugfixes to the curses module. There is now a test suite
for the curses module (you have to run it manually).
- binascii.b2a_base64 no longer places an arbitrary restriction of 57
bytes on its input.
Library
-------
- tkFileDialog exposes a Directory class and askdirectory
convenience function.
- Symbolic group names in regular expressions must be unique. For
example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
single name can't mean both "group 1" and "group 2" simultaneously.
Python 2.2 detects this error at regexp compilation time;
previously, the error went undetected, and results were
unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
pattern.subn() methods have been rewritten in C. Also, an
experimental function/method finditer() has been added, which works
like findall() but returns an iterator.
- Tix exposes more commands through the classes DirSelectBox,
DirSelectDialog, ListNoteBook, Meter, CheckList, and the
methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
- Traceback objects are now scanned by cyclic garbage collection, so
cycles created by casual use of sys.exc_info() no longer cause
permanent memory leaks (provided garbage collection is enabled).
- mimetypes.py has optional support for non-standard, but commonly
found types. guess_type() and guess_extension() now accept an
optional 'strict' flag, defaulting to true, which controls whether
recognize non-standard types or not. A few non-standard types we
know about have been added. Also, when run as a script, there are
new -l and -e options.
- statcache is now deprecated.
- email.Utils.formatdate() now produces the preferred RFC 2822 style
dates with numeric timezones (it used to produce obsolete dates
hard coded to "GMT" timezone). An optional 'localtime' flag is
added to produce dates in the local timezone, with daylight savings
time properly taken into account.
- In pickle and cPickle, instead of masking errors in load() by
transforming them into SystemError, we let the original exception
propagate out. Also, implement support for __safe_for_unpickling__
in pickle, as it already was supported in cPickle.
Tools/Demos
-----------
Build
-----
- The dbm module is built using libdb1 if available. The bsddb module
is built with libdb3 if available.
- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
C API
-----
- New function PySequence_Fast_GET_SIZE() returns the size of a non-
NULL result from PySequence_Fast(), more quickly than calling
PySequence_Size().
- New argument unpacking function PyArg_UnpackTuple() added.
- New functions PyObject_CallFunctionObjArgs() and
PyObject_CallMethodObjArgs() have been added to make it more
convenient and efficient to call functions and methods from C.
- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
possible that this will propagate errors it didn't before.
- New function PyObject_CheckReadBuffer(), which returns true if its
argument supports the single-segment readable buffer interface.
New platforms
-------------
- We've finally confirmed that this release builds on HP-UX 11.00,
*with* threads, and passes the test suite.
- Thanks to a series of patches from Michael Muller, Python may build
again under OS/2 Visual Age C++.
- Updated RISCOS port by Dietmar Schwertberger.
Tests
-----
- Added a test script for the curses module. It isn't run automatically;
regrtest.py must be run with '-u curses' to enable it.
Windows
-------
Mac
----
- PythonScript has been moved to unsupported and is slated to be
removed completely in the next release.
- It should now be possible to build applets that work on both OS9 and
OSX.
- The core is now linked with CoreServices not Carbon; as a side
result, default 8bit encoding on OSX is now ASCII.
- Python should now build on OSX 10.1.1
What's New in Python 2.2b1?
===========================
*Release date: 19-Oct-2001*
Type/class unification and new-style classes
--------------------------------------------
- New-style classes are now always dynamic (except for built-in and
extension types). There is no longer a performance penalty, and I
no longer see another reason to keep this baggage around. One relic
remains: the __dict__ of a new-style class is a read-only proxy; you
must set the class's attribute to modify it. As a consequence, the
__defined__ attribute of new-style types no longer exists, for lack
of need: there is once again only one __dict__ (although in the
future a __cache__ may be resurrected with a similar function, if I
can prove that it actually speeds things up).
- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
always returned None, even when there was a class docstring).
- doctest now finds and runs docstrings attached to new-style classes,
class methods, static methods, and properties.
Core and builtins
-----------------
- A very subtle syntactical pitfall in list comprehensions was fixed.
For example: [a+b for a in 'abc', for b in 'def']. The comma in
this example is a mistake. Previously, this would silently let 'a'
iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
Note that [a for a in <singleton>] is a convoluted way to say
[<singleton>] anyway, so it's not like any expressiveness is lost.
- getattr(obj, name, default) now only catches AttributeError, as
documented, rather than returning the default value for all
exceptions (which could mask bugs in a __getattr__ hook, for
example).
- Weak reference objects are now part of the core and offer a C API.
A bug which could allow a core dump when binary operations involved
proxy reference has been fixed. weakref.ReferenceError is now a
built-in exception.
- unicode(obj) now behaves more like str(obj), accepting arbitrary
objects, and calling a __unicode__ method if it exists.
unicode(obj, encoding) and unicode(obj, encoding, errors) still
require an 8-bit string or character buffer argument.
- isinstance() now allows any object as the first argument and a
class, a type or something with a __bases__ tuple attribute for the
second argument. The second argument may also be a tuple of a
class, type, or something with __bases__, in which case isinstance()
will return true if the first argument is an instance of any of the
things contained in the second argument tuple. E.g.
isinstance(x, (A, B))
returns true if x is an instance of A or B.
Extension modules
-----------------
- thread.start_new_thread() now returns the thread ID (previously None).
- binascii has now two quopri support functions, a2b_qp and b2a_qp.
- readline now supports setting the startup_hook and the
pre_event_hook, and adds the add_history() function.
- os and posix supports chroot(), setgroups() and unsetenv() where
available. The stat(), fstat(), statvfs() and fstatvfs() functions
now return "pseudo-sequences" -- the various fields can now be
accessed as attributes (e.g. os.stat("/").st_mtime) but for
backwards compatibility they also behave as a fixed-length sequence.
Some platform-specific fields (e.g. st_rdev) are only accessible as
attributes.
- time: localtime(), gmtime() and strptime() now return a
pseudo-sequence similar to the os.stat() return value, with
attributes like tm_year etc.
- Decompression objects in the zlib module now accept an optional
second parameter to decompress() that specifies the maximum amount
of memory to use for the uncompressed data.
- optional SSL support in the socket module now exports OpenSSL
functions RAND_add(), RAND_egd(), and RAND_status(). These calls
are useful on platforms like Solaris where OpenSSL does not
automatically seed its PRNG. Also, the keyfile and certfile
arguments to socket.ssl() are now optional.
- posixmodule (and by extension, the os module on POSIX platforms) now
exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
Library
-------
- doctest now excludes functions and classes not defined by the module
being tested, thanks to Tim Hochberg.
- HotShot, a new profiler implemented using a C-based callback, has
been added. This substantially reduces the overhead of profiling,
but it is still quite preliminary. Support modules and
documentation will be added in upcoming releases (before 2.2 final).
- profile now produces correct output in situations where an exception
raised in Python is cleared by C code (e.g. hasattr()). This used
to cause wrong output, including spurious claims of recursive
functions and attribution of time spent to the wrong function.
The code and documentation for the derived OldProfile and HotProfile
profiling classes was removed. The code hasn't worked for years (if
you tried to use them, they raised exceptions). OldProfile
intended to reproduce the behavior of the profiler Python used more
than 7 years ago, and isn't interesting anymore. HotProfile intended
to provide a faster profiler (but producing less information), and
that's a worthy goal we intend to meet via a different approach (but
without losing information).
- Profile.calibrate() has a new implementation that should deliver
a much better system-specific calibration constant. The constant can
now be specified in an instance constructor, or as a Profile class or
instance variable, instead of by editing profile.py's source code.
Calibration must still be done manually (see the docs for the profile
module).
Note that Profile.calibrate() must be overridden by subclasses.
Improving the accuracy required exploiting detailed knowledge of
profiler internals; the earlier method abstracted away the details
and measured a simplified model instead, but consequently computed
a constant too small by a factor of 2 on some modern machines.
- quopri's encode and decode methods take an optional header parameter,
which indicates whether output is intended for the header 'Q'
encoding.
- The SocketServer.ThreadingMixIn class now closes the request after
finish_request() returns. (Not when it errors out though.)
- The nntplib module's NNTP.body() method has grown a 'file' argument
to allow saving the message body to a file.
- The email package has added a class email.Parser.HeaderParser which
only parses headers and does not recurse into the message's body.
Also, the module/class MIMEAudio has been added for representing
audio data (contributed by Anthony Baxter).
- ftplib should be able to handle files > 2GB.
- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
ON, and OFF.
- xml.dom.minidom NodeList objects now support the length attribute
and item() method as required by the DOM specifications.
Tools/Demos
-----------
- Demo/dns was removed. It no longer serves any purpose; a package
derived from it is now maintained by Anthony Baxter, see
http://PyDNS.SourceForge.net.
- The freeze tool has been made more robust, and two new options have
been added: -X and -E.
Build
-----
- configure will use CXX in LINKCC if CXX is used to build main() and
the system requires to link a C++ main using the C++ compiler.
C API
-----
- The documentation for the tp_compare slot is updated to require that
the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
not correct. This is not yet enforced but will be enforced in
Python 2.3; even later, we may use -2 to indicate errors and +2 for
"NotImplemented". Right now, -1 should be used for an error return.
- PyLong_AsLongLong() now accepts int (as well as long) arguments.
Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
as long) arguments.
- PyThread_start_new_thread() now returns a long int giving the thread
ID, if one can be calculated; it returns -1 for error, 0 if no
thread ID is calculated (this is an incompatible change, but only
the thread module used this API). This code has only really been
tested on Linux and Windows; other platforms please beware (and
report any bugs or strange behavior).
- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
input.
New platforms
-------------
Tests
-----
Windows
-------
- Installer: If you install IDLE, and don't disable file-extension
registration, a new "Edit with IDLE" context (right-click) menu entry
is created for .py and .pyw files.
- The signal module now supports SIGBREAK on Windows, thanks to Steven
Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
action remains to call Win32 ExitProcess(). This can be changed via
signal.signal(). For example::
# Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
# (SIGINT) behavior.
import signal
signal.signal(signal.SIGBREAK, signal.default_int_handler)
try:
while 1:
pass
except KeyboardInterrupt:
# We get here on Ctrl+C or Ctrl+Break now; if we had not changed
# SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
# program without the possibility for any Python-level cleanup).
print "Clean exit"
What's New in Python 2.2a4?
===========================
*Release date: 28-Sep-2001*
Type/class unification and new-style classes
--------------------------------------------
- pydoc and inspect are now aware of new-style classes;
e.g. help(list) at the interactive prompt now shows proper
documentation for all operations on list objects.
- Applications using Jim Fulton's ExtensionClass module can now safely
be used with Python 2.2. In particular, Zope 2.4.1 now works with
Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
examples also work again. It is hoped that Gtk and Boost also work
with 2.2a4 and beyond. (If you can confirm this, please write
webmaster@python.org; if there are still problems, please open a bug
report on SourceForge.)
- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
in the constructed property object. fget, fset and fdel weren't
discoverable from Python in 2.2a3. __doc__ is new, and allows
associating a docstring with a property.
- Comparison overloading is now more completely implemented. For
example, a str subclass instance can properly be compared to a str
instance, and it can properly overload comparison. Ditto for most
other built-in object types.
- The repr() of new-style classes has changed; instead of <type
'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
*except* for built-in types, which are still rendered as <type
'Foo'> (to avoid upsetting existing code that might parse or
otherwise rely on repr() of certain type objects).
- The repr() of new-style objects is now always <Foo object at XXX>;
previously, it was sometimes <Foo instance at XXX>.
- For new-style classes, what was previously called __getattr__ is now
called __getattribute__. This method, if defined, is called for
*every* attribute access. A new __getattr__ hook more similar to the
one in classic classes is defined which is called only if regular
attribute access raises AttributeError; to catch *all* attribute
access, you can use __getattribute__ (for new-style classes). If
both are defined, __getattribute__ is called first, and if it raises
AttributeError, __getattr__ is called.
- The __class__ attribute of new-style objects can be assigned to.
The new class must have the same C-level object layout as the old
class.
- The built-in file type can be subclassed now. In the usual pattern,
"file" is the name of the built-in type, and file() is a new built-in
constructor, with the same signature as the built-in open() function.
file() is now the preferred way to open a file.
- Previously, __new__ would only see sequential arguments passed to
the type in a constructor call; __init__ would see both sequential
and keyword arguments. This made no sense whatsoever any more, so
now both __new__ and __init__ see all arguments.
- Previously, hash() applied to an instance of a subclass of str or
unicode always returned 0. This has been repaired.
- Previously, an operation on an instance of a subclass of an
immutable type (int, long, float, complex, tuple, str, unicode),
where the subtype didn't override the operation (and so the
operation was handled by the built-in type), could return that
instance instead a value of the base type. For example, if s was of
a str subclass type, s[:] returned s as-is. Now it returns a str
with the same value as s.
- Provisional support for pickling new-style objects has been added.
Core
----
- file.writelines() now accepts any iterable object producing strings.
- PyUnicode_FromEncodedObject() now works very much like
PyObject_Str(obj) in that it tries to use __str__/tp_str
on the object if the object is not a string or buffer. This
makes unicode() behave like str() when applied to non-string/buffer
objects.
- PyFile_WriteObject now passes Unicode objects to the file's write
method. As a result, all file-like objects which may be the target
of a print statement must support Unicode objects, i.e. they must
at least convert them into ASCII strings.
- Thread scheduling on Solaris should be improved; it is no longer
necessary to insert a small sleep at the start of a thread in order
to let other runnable threads be scheduled.
Library
-------
- StringIO.StringIO instances and cStringIO.StringIO instances support
read character buffer compatible objects for their .write() methods.
These objects are converted to strings and then handled as such
by the instances.
- The "email" package has been added. This is basically a port of the
mimelib package <http://sf.net/projects/mimelib> with API changes
and some implementations updated to use iterators and generators.
- difflib.ndiff() and difflib.Differ.compare() are generators now. This
restores the ability of Tools/scripts/ndiff.py to start producing output
before the entire comparison is complete.
- StringIO.StringIO instances and cStringIO.StringIO instances support
iteration just like file objects (i.e. their .readline() method is
called for each iteration until it returns an empty string).
- The codecs module has grown four new helper APIs to access
built-in codecs: getencoder(), getdecoder(), getreader(),
getwriter().
- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
simplifies writing XML RPC servers.
- os.path.realpath(): a new function that returns the absolute pathname
after interpretation of symbolic links. On non-Unix systems, this
is an alias for os.path.abspath().
- operator.indexOf() (PySequence_Index() in the C API) now works with any
iterable object.
- smtplib now supports various authentication and security features of
the SMTP protocol through the new login() and starttls() methods.
- hmac: a new module implementing keyed hashing for message
authentication.
- mimetypes now recognizes more extensions and file types. At the
same time, some mappings not sanctioned by IANA were removed.
- The "compiler" package has been brought up to date to the state of
Python 2.2 bytecode generation. It has also been promoted from a
Tool to a standard library package. (Tools/compiler still exists as
a sample driver.)
Build
-----
- Large file support (LFS) is now automatic when the platform supports
it; no more manual configuration tweaks are needed. On Linux, at
least, it's possible to have a system whose C library supports large
files but whose kernel doesn't; in this case, large file support is
still enabled but doesn't do you any good unless you upgrade your
kernel or share your Python executable with another system whose
kernel has large file support.
- The configure script now supplies plausible defaults in a
cross-compilation environment. This doesn't mean that the supplied
values are always correct, or that cross-compilation now works
flawlessly -- but it's a first step (and it shuts up most of
autoconf's warnings about AC_TRY_RUN).
- The Unix build is now a bit less chatty, courtesy of the parser
generator. The build is completely silent (except for errors) when
using "make -s", thanks to a -q option to setup.py.
C API
-----
- The "structmember" API now supports some new flag bits to deny read
and/or write access to attributes in restricted execution mode.
New platforms
-------------
- Compaq's iPAQ handheld, running the "familiar" Linux distribution
(http://familiar.handhelds.org).
Tests
-----
- The "classic" standard tests, which work by comparing stdout to
an expected-output file under Lib/test/output/, no longer stop at
the first mismatch. Instead the test is run to completion, and a
variant of ndiff-style comparison is used to report all differences.
This is much easier to understand than the previous style of reporting.
- The unittest-based standard tests now use regrtest's test_main()
convention, instead of running as a side-effect of merely being
imported. This allows these tests to be run in more natural and
flexible ways as unittests, outside the regrtest framework.
- regrtest.py is much better integrated with unittest and doctest now,
especially in regard to reporting errors.
Windows
-------
- Large file support now also works for files > 4GB, on filesystems
that support it (NTFS under Windows 2000). See "What's New in
Python 2.2a3" for more detail.
What's New in Python 2.2a3?
===========================
*Release Date: 07-Sep-2001*
Core
----
- Conversion of long to float now raises OverflowError if the long is too
big to represent as a C double.
- The 3-argument builtin pow() no longer allows a third non-None argument
if either of the first two arguments is a float, or if both are of
integer types and the second argument is negative (in which latter case
the arguments are converted to float, so this is really the same
restriction).
- The builtin dir() now returns more information, and sometimes much
more, generally naming all attributes of an object, and all attributes
reachable from the object via its class, and from its class's base
classes, and so on from them too. Example: in 2.2a2, dir([]) returned
an empty list. In 2.2a3,
>>> dir([])
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
'__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
'__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
'__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
'__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']
dir(module) continues to return only the module's attributes, though.
- Overflowing operations on plain ints now return a long int rather
than raising OverflowError. This is a partial implementation of PEP
237. You can use -Wdefault::OverflowWarning to enable a warning for
this situation, and -Werror::OverflowWarning to revert to the old
OverflowError exception.
- A new command line option, -Q<arg>, is added to control run-time
warnings for the use of classic division. (See PEP 238.) Possible
values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
-Qold, meaning the / operator has its classic meaning and no
warnings are issued. Using -Qwarn issues a run-time warning about
all uses of classic division for int and long arguments; -Qwarnall
also warns about classic division for float and complex arguments
(for use with fixdiv.py).
[Note: the remainder of this item (preserved below) became
obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
Using -Qnew is questionable; it turns on new division by default, but
only in the __main__ module. You can usefully combine -Qwarn or
-Qwarnall and -Qnew: this gives the __main__ module new division, and
warns about classic division everywhere else.
- Many built-in types can now be subclassed. This applies to int,
long, float, str, unicode, and tuple. (The types complex, list and
dictionary can also be subclassed; this was introduced earlier.)
Note that restrictions apply when subclassing immutable built-in
types: you can only affect the value of the instance by overloading
__new__. You can add mutable attributes, and the subclass instances
will have a __dict__ attribute, but you cannot change the "value"
(as implemented by the base class) of an immutable subclass instance
once it is created.
- The dictionary constructor now takes an optional argument, a
mapping-like object, and initializes the dictionary from its
(key, value) pairs.
- A new built-in type, super, has been added. This facilitates making
"cooperative super calls" in a multiple inheritance setting. For an
explanation, see http://www.python.org/2.2/descrintro.html#cooperation
- A new built-in type, property, has been added. This enables the
creation of "properties". These are attributes implemented by
getter and setter functions (or only one of these for read-only or
write-only attributes), without the need to override __getattr__.
See http://www.python.org/2.2/descrintro.html#property
- The syntax of floating-point and imaginary literals has been
liberalized, to allow leading zeroes. Examples of literals now
legal that were SyntaxErrors before:
00.0 0e3 0100j 07.5 00000000000000000008.
- An old tokenizer bug allowed floating point literals with an incomplete
exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
Library
-------
- telnetlib includes symbolic names for the options, and support for
setting an option negotiation callback. It also supports processing
of suboptions.
- The new C standard no longer requires that math libraries set errno to
ERANGE on overflow. For platform libraries that exploit this new
freedom, Python's overflow-checking was wholly broken. A new overflow-
checking scheme attempts to repair that, but may not be reliable on all
platforms (C doesn't seem to provide anything both useful and portable
in this area anymore).
- Asynchronous timeout actions are available through the new class
threading.Timer.
- math.log and math.log10 now return sensible results for even huge
long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
- A new function, imp.lock_held(), returns 1 when the import lock is
currently held. See the docs for the imp module.
- pickle, cPickle and marshal on 32-bit platforms can now correctly read
dumps containing ints written on platforms where Python ints are 8 bytes.
When read on a box where Python ints are 4 bytes, such values are
converted to Python longs.
- In restricted execution mode (using the rexec module), unmarshalling
code objects is no longer allowed. This plugs a security hole.
- unittest.TestResult instances no longer store references to tracebacks
generated by test failures. This prevents unexpected dangling references
to objects that should be garbage collected between tests.
Tools
-----
- Tools/scripts/fixdiv.py has been added which can be used to fix
division operators as per PEP 238.
Build
-----
- If you are an adventurous person using Mac OS X you may want to look at
Mac/OSX. There is a Makefile there that will build Python as a real Mac
application, which can be used for experimenting with Carbon or Cocoa.
Discussion of this on pythonmac-sig, please.
C API
-----
- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
- Note that PyLong_AsDouble can fail! This has always been true, but no
callers checked for it. It's more likely to fail now, because overflow
errors are properly detected now. The proper way to check::
double x = PyLong_AsDouble(some_long_object);
if (x == -1.0 && PyErr_Occurred()) {
/* The conversion failed. */
}
- The GC API has been changed. Extensions that use the old API will still
compile but will not participate in GC. To upgrade an extension
module:
- rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
- use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
PyObject_GC_Del to deallocate them
- rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
to PyObject_GC_UnTrack
- remove PyGC_HEAD_SIZE from object size calculations
- remove calls to PyObject_AS_GC and PyObject_FROM_GC
- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
These can be used safely to construct string objects from a
sprintf-style format string (similar to the format string supported
by PyErr_Format()).
New platforms
-------------
- Stephen Hansen contributed patches sufficient to get a clean compile
under Borland C (Windows), but he reports problems running it and ran
out of time to complete the port. Volunteers? Expect a MemoryError
when importing the types module; this is probably shallow, and
causing later failures too.
Tests
-----
Windows
-------
- Large file support is now enabled on Win32 platforms as well as on
Win64. This means that, for example, you can use f.tell() and f.seek()
to manipulate files larger than 2 gigabytes (provided you have enough
disk space, and are using a Windows filesystem that supports large
partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
filesize limit, and large file support makes no difference there.
FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
NTFS has no practical limit on file size, and files of any size can be
used from Python now.
- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
points to command.com (patch from Brian Quinlan).
What's New in Python 2.2a2?
===========================
*Release Date: 22-Aug-2001*
Build
-----
- Tim Peters developed a brand new Windows installer using Wise 8.1,
generously donated to us by Wise Solutions.
- configure supports a new option --enable-unicode, with the values
ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
type and supporting code is completely removed from the interpreter.
- A new configure option --enable-framework builds a Mac OS X framework,
which "make frameworkinstall" will install. This provides a starting
point for more mac-like functionality, join pythonmac-sig@python.org
if you are interested in helping.
- The NeXT platform is no longer supported.
- The 'new' module is now statically linked.
Tools
-----
- The new Tools/scripts/cleanfuture.py can be used to automatically
edit out obsolete future statements from Python source code. See
the module docstring for details.
Tests
-----
- regrtest.py now knows which tests are expected to be skipped on some
platforms, allowing clearer test result output to be given. regrtest
also has optional --use/-u switch to run normally disabled tests
which require network access or consume significant disk resources.
- Several new tests in the standard test suite, with special thanks to
Nick Mathewson.
Core
----
- The floor division operator // has been added as outlined in PEP
238. The / operator still provides classic division (and will until
Python 3.0) unless "from __future__ import division" is included, in
which case the / operator will provide true division. The operator
module provides truediv() and floordiv() functions. Augmented
assignment variants are included, as are the equivalent overloadable
methods and C API methods. See the PEP for a full discussion:
<http://python.sf.net/peps/pep-0238.html>
- Future statements are now effective in simulated interactive shells
(like IDLE). This should "just work" by magic, but read Michael
Hudson's "Future statements in simulated shells" PEP 264 for full
details: <http://python.sf.net/peps/pep-0264.html>.
- The type/class unification (PEP 252-253) was integrated into the
trunk and is not so tentative any more (the exact specification of
some features is still tentative). A lot of work has done on fixing
bugs and adding robustness and features (performance still has to
come a long way).
- Warnings about a mismatch in the Python API during extension import
now use the Python warning framework (which makes it possible to
write filters for these warnings).
- A function's __dict__ (aka func_dict) will now always be a
dictionary. It used to be possible to delete it or set it to None,
but now both actions raise TypeErrors. It is still legal to set it
to a dictionary object. Getting func.__dict__ before any attributes
have been assigned now returns an empty dictionary instead of None.
- A new command line option, -E, was added which disables the use of
all environment variables, or at least those that are specifically
significant to Python. Usually those have a name starting with
"PYTHON". This was used to fix a problem where the tests fail if
the user happens to have PYTHONHOME or PYTHONPATH pointing to an
older distribution.
Library
-------
- New class Differ and new functions ndiff() and restore() in difflib.py.
These package the algorithms used by the popular Tools/scripts/ndiff.py,
for programmatic reuse.
- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
value using the minimal quoting required for the value; more
reliable than using xml.sax.saxutils.escape() for attribute values.
- Readline completion support for cmd.Cmd was added.
- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
- Added function threading.BoundedSemaphore()
- Added Ka-Ping Yee's cgitb.py module.
- The 'new' module now exposes the CO_xxx flags.
- The gc module offers the get_referents function.
New platforms
-------------
C API
-----
- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
which provide a cross-platform implementations for the
relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
the standard sprintf() and vsprintf() C lib APIs, these versions
apply bounds checking on the used buffer which enhances protection
against buffer overruns.
- Unicode APIs now use name mangling to assure that mixing interpreters
and extensions using different Unicode widths is rendered next to
impossible. Trying to import an incompatible Unicode-aware extension
will result in an ImportError. Unicode extensions writers must make
sure to check the Unicode width compatibility in their extensions by
using at least one of the mangled Unicode APIs in the extension.
- Two new flags METH_NOARGS and METH_O are available in method definition
tables to simplify implementation of methods with no arguments and a
single untyped argument. Calling such methods is more efficient than
calling corresponding METH_VARARGS methods. METH_OLDARGS is now
deprecated.
Windows
-------
- "import module" now compiles module.pyw if it exists and nothing else
relevant is found.
What's New in Python 2.2a1?
===========================
*Release date: 18-Jul-2001*
Core
----
- TENTATIVELY, a large amount of code implementing much of what's
described in PEP 252 (Making Types Look More Like Classes) and PEP
253 (Subtyping Built-in Types) was added. This will be released
with Python 2.2a1. Documentation will be provided separately
through http://www.python.org/2.2/. The purpose of releasing this
with Python 2.2a1 is to test backwards compatibility. It is
possible, though not likely, that a decision is made not to release
this code as part of 2.2 final, if any serious backwards
incompatibilities are found during alpha testing that cannot be
repaired.
- Generators were added; this is a new way to create an iterator (see
below) using what looks like a simple function containing one or
more 'yield' statements. See PEP 255. Since this adds a new
keyword to the language, this feature must be enabled by including a
future statement: "from __future__ import generators" (see PEP 236).
Generators will become a standard feature in a future release
(probably 2.3). Without this future statement, 'yield' remains an
ordinary identifier, but a warning is issued each time it is used.
(These warnings currently don't conform to the warnings framework of
PEP 230; we intend to fix this in 2.2a2.)
- The UTF-16 codec was modified to be more RFC compliant. It will now
only remove BOM characters at the start of the string and then
only if running in native mode (UTF-16-LE and -BE won't remove a
leading BMO character).
- Strings now have a new method .decode() to complement the already
existing .encode() method. These two methods provide direct access
to the corresponding decoders and encoders of the registered codecs.
To enhance the usability of the .encode() method, the special
casing of Unicode object return values was dropped (Unicode objects
were auto-magically converted to string using the default encoding).
Both methods will now return whatever the codec in charge of the
requested encoding returns as object, e.g. Unicode codecs will
return Unicode objects when decoding is requested ("äöü".decode("latin-1")
will return u"äöü"). This enables codec writer to create codecs
for various simple to use conversions.
New codecs were added to demonstrate these new features (the .encode()
and .decode() columns indicate the type of the returned objects):
+---------+-----------+-----------+-----------------------------+
|Name | .encode() | .decode() | Description |
+=========+===========+===========+=============================+
|uu | string | string | UU codec (e.g. for email) |
+---------+-----------+-----------+-----------------------------+
|base64 | string | string | base64 codec |
+---------+-----------+-----------+-----------------------------+
|quopri | string | string | quoted-printable codec |
+---------+-----------+-----------+-----------------------------+
|zlib | string | string | zlib compression |
+---------+-----------+-----------+-----------------------------+
|hex | string | string | 2-byte hex codec |
+---------+-----------+-----------+-----------------------------+
|rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
+---------+-----------+-----------+-----------------------------+
- Some operating systems now support the concept of a default Unicode
encoding for file system operations. Notably, Windows supports 'mbcs'
as the default. The Macintosh will also adopt this concept in the medium
term, although the default encoding for that platform will be other than
'mbcs'.
On operating system that support non-ASCII filenames, it is common for
functions that return filenames (such as os.listdir()) to return Python
string objects pre-encoded using the default file system encoding for
the platform. As this encoding is likely to be different from Python's
default encoding, converting this name to a Unicode object before passing
it back to the Operating System would result in a Unicode error, as Python
would attempt to use its default encoding (generally ASCII) rather than
the default encoding for the file system.
In general, this change simply removes surprises when working with
Unicode and the file system, making these operations work as you expect,
increasing the transparency of Unicode objects in this context.
See [????] for more details, including examples.
- Float (and complex) literals in source code were evaluated to full
precision only when running from a .py file; the same code loaded from a
.pyc (or .pyo) file could suffer numeric differences starting at about the
12th significant decimal digit. For example, on a machine with IEEE-754
floating arithmetic,
x = 9007199254740992.0
print long(x)
printed 9007199254740992 if run directly from .py, but 9007199254740000
if from a compiled (.pyc or .pyo) file. This was due to marshal using
str(float) instead of repr(float) when building code objects. marshal
now uses repr(float) instead, which should reproduce floats to full
machine precision (assuming the platform C float<->string I/O conversion
functions are of good quality).
This may cause floating-point results to change in some cases, and
usually for the better, but may also cause numerically unstable
algorithms to break.
- The implementation of dicts suffers fewer collisions, which has speed
benefits. However, the order in which dict entries appear in dict.keys(),
dict.values() and dict.items() may differ from previous releases for a
given dict. Nothing is defined about this order, so no program should
rely on it. Nevertheless, it's easy to write test cases that rely on the
order by accident, typically because of printing the str() or repr() of a
dict to an "expected results" file. See Lib/test/test_support.py's new
sortdict(dict) function for a simple way to display a dict in sorted
order.
- Many other small changes to dicts were made, resulting in faster
operation along the most common code paths.
- Dictionary objects now support the "in" operator: "x in dict" means
the same as dict.has_key(x).
- The update() method of dictionaries now accepts generic mapping
objects. Specifically the argument object must support the .keys()
and __getitem__() methods. This allows you to say, for example,
{}.update(UserDict())
- Iterators were added; this is a generalized way of providing values
to a for loop. See PEP 234. There's a new built-in function iter()
to return an iterator. There's a new protocol to get the next value
from an iterator using the next() method (in Python) or the
tp_iternext slot (in C). There's a new protocol to get iterators
using the __iter__() method (in Python) or the tp_iter slot (in C).
Iterating (i.e. a for loop) over a dictionary generates its keys.
Iterating over a file generates its lines.
- The following functions were generalized to work nicely with iterator
arguments::
map(), filter(), reduce(), zip()
list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
max(), min()
join() method of strings
extend() method of lists
'x in y' and 'x not in y' (PySequence_Contains() in C API)
operator.countOf() (PySequence_Count() in C API)
right-hand side of assignment statements with multiple targets, such as ::
x, y, z = some_iterable_object_returning_exactly_3_values
- Accessing module attributes is significantly faster (for example,
random.random or os.path or yourPythonModule.yourAttribute).
- Comparing dictionary objects via == and != is faster, and now works even
if the keys and values don't support comparisons other than ==.
- Comparing dictionaries in ways other than == and != is slower: there were
insecurities in the dict comparison implementation that could cause Python
to crash if the element comparison routines for the dict keys and/or
values mutated the dicts. Making the code bulletproof slowed it down.
- Collisions in dicts are resolved via a new approach, which can help
dramatically in bad cases. For example, looking up every key in a dict
d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
faster now. Thanks to Christian Tismer for pointing out the cause and
the nature of an effective cure (last December! better late than never).
- repr() is much faster for large containers (dict, list, tuple).
Library
-------
- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
were added to the string module. These a locale-independent
constants, unlike letters, lowercase, and uppercase. These are now
use in appropriate locations in the standard library.
- The flags used in dlopen calls can now be configured using
sys.setdlopenflags and queried using sys.getdlopenflags.
- Fredrik Lundh's xmlrpclib is now a standard library module. This
provides full client-side XML-RPC support. In addition,
Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
one asyncore-based). Thanks to Eric Raymond for the documentation.
- The xrange() object is simplified: it no longer supports slicing,
repetition, comparisons, efficient 'in' checking, the tolist()
method, or the start, stop and step attributes. See PEP 260.
- A new function fnmatch.filter to filter lists of file names was added.
- calendar.py uses month and day names based on the current locale.
- strop is now *really* obsolete (this was announced before with 1.6),
and issues DeprecationWarning when used (except for the four items
that are still imported into string.py).
- Cookie.py now sorts key+value pairs by key in output strings.
- pprint.isrecursive(object) didn't correctly identify recursive objects.
Now it does.
- pprint functions now much faster for large containers (tuple, list, dict).
- New 'q' and 'Q' format codes in the struct module, corresponding to C
types "long long" and "unsigned long long" (on Windows, __int64). In
native mode, these can be used only when the platform C compiler supports
these types (when HAVE_LONG_LONG is #define'd by the Python config
process), and then they inherit the sizes and alignments of the C types.
In standard mode, 'q' and 'Q' are supported on all platforms, and are
8-byte integral types.
- The site module installs a new built-in function 'help' that invokes
pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
it displays a message reminding the user to use 'help()' or
'help(object)'.
Tests
-----
- New test_mutants.py runs dict comparisons where the key and value
comparison operators mutate the dicts randomly during comparison. This
rapidly causes Python to crash under earlier releases (not for the faint
of heart: it can also cause Win9x to freeze or reboot!).
- New test_pprint.py verifies that pprint.isrecursive() and
pprint.isreadable() return sensible results. Also verifies that simple
cases produce correct output.
C API
-----
- Removed the unused last_is_sticky argument from the internal
_PyTuple_Resize(). If this affects you, you were cheating.
What's New in Python 2.1 (final)?
=================================
We only changed a few things since the last release candidate, all in
Python library code:
- A bug in the locale module was fixed that affected locales which
define no grouping for numeric formatting.
- A few bugs in the weakref module's implementations of weak
dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
and the test suite was updated to check for these bugs.
- An old bug in the os.path.walk() function (introduced in Python
2.0!) was fixed: a non-existent file would cause an exception
instead of being ignored.
- Fixed a few bugs in the new symtable module found by Neil Norwitz's
PyChecker.
What's New in Python 2.1c2?
===========================
A flurry of small changes, and one showstopper fixed in the nick of
time made it necessary to release another release candidate. The list
here is the *complete* list of patches (except version updates):
Core
- Tim discovered a nasty bug in the dictionary code, caused by
PyDict_Next() calling dict_resize(), and the GC code's use of
PyDict_Next() violating an assumption in dict_items(). This was
fixed with considerable amounts of band-aid, but the net effect is a
saner and more robust implementation.
- Made a bunch of symbols static that were accidentally global.
Build and Ports
- The setup.py script didn't check for a new enough version of zlib
(1.1.3 is needed). Now it does.
- Changed "make clean" target to also remove shared libraries.
- Added a more general warning about the SGI Irix optimizer to README.
Library
- Fix a bug in urllib.basejoin("http://host", "../file.html") which
omitted the slash between host and file.html.
- The mailbox module's _Mailbox class contained a completely broken
and undocumented seek() method. Ripped it out.
- Fixed a bunch of typos in various library modules (urllib2, smtpd,
sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
- Fixed a few last-minute bugs in unittest.
Extensions
- Reverted the patch to the OpenSSL code in socketmodule.c to support
RAND_status() and the EGD, and the subsequent patch that tried to
fix it for pre-0.9.5 versions; the problem with the patch is that on
some systems it issues a warning whenever socket is imported, and
that's unacceptable.
Tests
- Fixed the pickle tests to work with "import test.test_pickle".
- Tweaked test_locale.py to actually run the test Windows.
- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
not "wb" (which is not a valid mode at all).
- Fix pstats browser crashes. Import readline if it exists to make
the user interface nicer.
- Add "import thread" to the top of test modules that import the
threading module (test_asynchat and test_threadedtempfile). This
prevents test failures caused by a broken threading module resulting
from a previously caught failed import.
- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
needed on some platforms (e.g. Solaris 8) when the tests are run
twice in succession.
- Skip rather than fail test_sunaudiodev if no audio device is found.
What's New in Python 2.1c1?
===========================
This list was significantly updated when 2.1c2 was released; the 2.1c1
release didn't mention most changes that were actually part of 2.1c1:
Legal
- Copyright was assigned to the Python Software Foundation (PSF) and a
PSF license (very similar to the CNRI license) was added.
- The CNRI copyright notice was updated to include 2001.
Core
- After a public outcry, assignment to __debug__ is no longer illegal;
instead, a warning is issued. It will become illegal in 2.2.
- Fixed a core dump with "%#x" % 0, and changed the semantics so that
"%#x" now always prepends "0x", even if the value is zero.
- Fixed some nits in the bytecode compiler.
- Fixed core dumps when calling certain kinds of non-functions.
- Fixed various core dumps caused by reference count bugs.
Build and Ports
- Use INSTALL_SCRIPT to install script files.
- New port: SCO Unixware 7, by Billy G. Allie.
- Updated RISCOS port.
- Updated BeOS port and notes.
- Various other porting problems resolved.
Library
- The TERMIOS and SOCKET modules are now truly obsolete and
unnecessary. Their symbols are incorporated in the termios and
socket modules.
- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
better tests for pickling.
- threading: make Condition.wait() robust against KeyboardInterrupt.
- zipfile: add support to zipfile to support opening an archive
represented by an open file rather than a file name. Fix bug where
the archive was not properly closed. Fixed a bug in this bugfix
where flush() was called for a read-only file.
- imputil: added an uninstall() method to the ImportManager.
- Canvas: fixed bugs in lower() and tkraise() methods.
- SocketServer: API change (added overridable close_request() method)
so that the TCP server can explicitly close the request.
- pstats: Eric Raymond added a simple interactive statistics browser,
invoked when the module is run as a script.
- locale: fixed a problem in format().
- webbrowser: made it work when the BROWSER environment variable has a
value like "/usr/bin/netscape". Made it auto-detect Konqueror for
KDE 2. Fixed some other nits.
- unittest: changes to allow using a different exception than
AssertionError, and added a few more function aliases. Some other
small changes.
- urllib, urllib2: fixed redirect problems and a coupleof other nits.
- asynchat: fixed a critical bug in asynchat that slipped through the
2.1b2 release. Fixed another rare bug.
- Fix some unqualified except: clauses (always a bad code example).
XML
- pyexpat: new API get_version_string().
- Fixed some minidom bugs.
Extensions
- Fixed a core dump in _weakref. Removed the weakref.mapping()
function (it adds nothing to the API).
- Rationalized the use of header files in the readline module, to make
it compile (albeit with some warnings) with the very recent readline
4.2, without breaking for earlier versions.
- Hopefully fixed a buffering problem in linuxaudiodev.
- Attempted a fix to make the OpenSSL support in the socket module
work again with pre-0.9.5 versions of OpenSSL.
Tests
- Added a test case for asynchat and asyncore.
- Removed coupling between tests where one test failing could break
another.
Tools
- Ping added an interactive help browser to pydoc, fixed some nits
in the rest of the pydoc code, and added some features to his
inspect module.
- An updated python-mode.el version 4.1 which integrates Ken
Manheimer's pdbtrack.el. This makes debugging Python code via pdb
much nicer in XEmacs and Emacs. When stepping through your program
with pdb, in either the shell window or the *Python* window, the
source file and line will be tracked by an arrow. Very cool!
- IDLE: syntax warnings in interactive mode are changed into errors.
- Some improvements to Tools/webchecker (ignore some more URL types,
follow some more links).
- Brought the Tools/compiler package up to date.
What's New in Python 2.1 beta 2?
================================
(Unlisted are many fixed bugs, more documentation, etc.)
Core language, builtins, and interpreter
- The nested scopes work (enabled by "from __future__ import
nested_scopes") is completed; in particular, the future now extends
into code executed through exec, eval() and execfile(), and into the
interactive interpreter.
- When calling a base class method (e.g. BaseClass.__init__(self)),
this is now allowed even if self is not strictly spoken a class
instance (e.g. when using metaclasses or the Don Beaudry hook).
- Slice objects are now comparable but not hashable; this prevents
dict[:] from being accepted but meaningless.
- Complex division is now calculated using less braindead algorithms.
This doesn't change semantics except it's more likely to give useful
results in extreme cases. Complex repr() now uses full precision
like float repr().
- sgmllib.py now calls handle_decl() for simple <!...> declarations.
- It is illegal to assign to the name __debug__, which is set when the
interpreter starts. It is effectively a compile-time constant.
- A warning will be issued if a global statement for a variable
follows a use or assignment of that variable.
Standard library
- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
inspired by JUnit), is now part of the standard library. You now
have a choice of two testing frameworks: unittest requires you to
write testcases as separate code, doctest gathers them from
docstrings. Both approaches have their advantages and
disadvantages.
- A new module Tix was added, which wraps the Tix extension library
for Tk. With that module, it is not necessary to statically link
Tix with _tkinter, since Tix will be loaded with Tcl's "package
require" command. See Demo/tix/.
- tzparse.py is now obsolete.
- In gzip.py, the seek() and tell() methods are removed -- they were
non-functional anyway, and it's better if callers can test for their
existence with hasattr().
Python/C API
- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
that's already in the dictionary during a PyDict_Next() iteration.
This used to fail occasionally when a dictionary resize operation
could be triggered that would rehash all the keys. All other
modifications to the dictionary are still off-limits during a
PyDict_Next() iteration!
- New extended APIs related to passing compiler variables around.
- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
implement isinstance() and issubclass().
- Py_BuildValue() now has a "D" conversion to create a Python complex
number from a Py_complex C value.
- Extensions types which support weak references must now set the
field allocated for the weak reference machinery to NULL themselves;
this is done to avoid the cost of checking each object for having a
weakly referencable type in PyObject_INIT(), since most types are
not weakly referencable.
- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
free variables and cell variables to and from the frame's f_locals.
- Variants of several functions defined in pythonrun.h have been added
to support the nested_scopes future statement. The variants all end
in Flags and take an extra argument, a PyCompilerFlags *; examples:
PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
variants may be removed in Python 2.2, when nested scopes are
mandatory.
Distutils
- the sdist command now writes a PKG-INFO file, as described in PEP 241,
into the release tree.
- several enhancements to the bdist_wininst command from Thomas Heller
(an uninstaller, more customization of the installer's display)
- from Jack Jansen: added Mac-specific code to generate a dialog for
users to specify the command-line (because providing a command-line with
MacPython is awkward). Jack also made various fixes for the Mac
and the Metrowerks compiler.
- added 'platforms' and 'keywords' to the set of metadata that can be
specified for a distribution.
- applied patches from Jason Tishler to make the compiler class work with
Cygwin.
What's New in Python 2.1 beta 1?
================================
Core language, builtins, and interpreter
- Following an outcry from the community about the amount of code
broken by the nested scopes feature introduced in 2.1a2, we decided
to make this feature optional, and to wait until Python 2.2 (or at
least 6 months) to make it standard. The option can be enabled on a
per-module basis by adding "from __future__ import nested_scopes" at
the beginning of a module (before any other statements, but after
comments and an optional docstring). See PEP 236 (Back to the
__future__) for a description of the __future__ statement. PEP 227
(Statically Nested Scopes) has been updated to reflect this change,
and to clarify the semantics in a number of endcases.
- The nested scopes code, when enabled, has been hardened, and most
bugs and memory leaks in it have been fixed.
- Compile-time warnings are now generated for a number of conditions
that will break or change in meaning when nested scopes are enabled:
- Using "from...import *" or "exec" without in-clause in a function
scope that also defines a lambda or nested function with one or
more free (non-local) variables. The presence of the import* or
bare exec makes it impossible for the compiler to determine the
exact set of local variables in the outer scope, which makes it
impossible to determine the bindings for free variables in the
inner scope. To avoid the warning about import *, change it into
an import of explicitly name object, or move the import* statement
to the global scope; to avoid the warning about bare exec, use
exec...in... (a good idea anyway -- there's a possibility that
bare exec will be deprecated in the future).
- Use of a global variable in a nested scope with the same name as a
local variable in a surrounding scope. This will change in
meaning with nested scopes: the name in the inner scope will
reference the variable in the outer scope rather than the global
of the same name. To avoid the warning, either rename the outer
variable, or use a global statement in the inner function.
- An optional object allocator has been included. This allocator is
optimized for Python objects and should be faster and use less memory
than the standard system allocator. It is not enabled by default
because of possible thread safety problems. The allocator is only
protected by the Python interpreter lock and it is possible that some
extension modules require a thread safe allocator. The object
allocator can be enabled by providing the "--with-pymalloc" option to
configure.
Standard library
- pyexpat now detects the expat version if expat.h defines it. A
number of additional handlers are provided, which are only available
since expat 1.95. In addition, the methods SetParamEntityParsing and
GetInputContext of Parser objects are available with 1.95.x
only. Parser objects now provide the ordered_attributes and
specified_attributes attributes. A new module expat.model was added,
which offers a number of additional constants if 1.95.x is used.
- xml.dom offers the new functions registerDOMImplementation and
getDOMImplementation.
- xml.dom.minidom offers a toprettyxml method. A number of DOM
conformance issues have been resolved. In particular, Element now
has a hasAttributes method, and the handling of namespaces was
improved.
- Ka-Ping Yee contributed two new modules: inspect.py, a module for
getting information about live Python code, and pydoc.py, a module
for interactively converting docstrings to HTML or text.
Tools/scripts/pydoc, which is now automatically installed into
<prefix>/bin, uses pydoc.py to display documentation; try running
"pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
lets you browse the module docstrings using a web browser.
- New library module difflib.py, primarily packaging the SequenceMatcher
class at the heart of the popular ndiff.py file-comparison tool.
- doctest.py (a framework for verifying Python code examples in docstrings)
is now part of the std library.
Windows changes
- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
small GUI that lets you browse the module docstrings using your
default web browser.
- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
Platforms) is implemented. See
http://python.sourceforge.net/peps/pep-0235.html
for full details, especially the "Current Lower-Left Semantics" section.
The new Windows import rules are simpler than before:
A. If the PYTHONCASEOK environment variable exists, same as
before: silently accept the first case-insensitive match of any
kind; raise ImportError if none found.
B. Else search sys.path for the first case-sensitive match; raise
ImportError if none found.
The same rules have been implemented on other platforms with case-
insensitive but case-preserving filesystems too (including Cygwin, and
several flavors of Macintosh operating systems).
- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
what it's supposed to do (and does do under NT and 2000) via direct
port manipulation. It's unknown whether this will work on all systems,
but it does work on my Win98SE systems now and was known to be useless on
all Win9x systems before.
- Build: Subproject _test (effectively) renamed to _testcapi.
New platforms
- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
Thanks to Steven Majewski!
- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
Tishler!
- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
Schwertberger! See RISCOS/README for more information -- it seems
that because of the bizarre filename conventions on RISCOS, no port
to that platform is easy.
What's New in Python 2.1 alpha 2?
=================================
Core language, builtins, and interpreter
- Scopes nest. If a name is used in a function or class, but is not
local, the definition in the nearest enclosing function scope will
be used. One consequence of this change is that lambda statements
could reference variables in the namespaces where the lambda is
defined. In some unusual cases, this change will break code.
In all previous version of Python, names were resolved in exactly
three namespaces -- the local namespace, the global namespace, and
the builtins namespace. According to this old definition, if a
function A is defined within a function B, the names bound in B are
not visible in A. The new rules make names bound in B visible in A,
unless A contains a name binding that hides the binding in B.
Section 4.1 of the reference manual describes the new scoping rules
in detail. The test script in Lib/test/test_scope.py demonstrates
some of the effects of the change.
The new rules will cause existing code to break if it defines nested
functions where an outer function has local variables with the same
name as globals or builtins used by the inner function. Example:
def munge(str):
def helper(x):
return str(x)
if type(str) != type(''):
str = helper(str)
return str.strip()
Under the old rules, the name str in helper() is bound to the
built-in function str(). Under the new rules, it will be bound to
the argument named str and an error will occur when helper() is
called.
- The compiler will report a SyntaxError if "from ... import *" occurs
in a function or class scope. The language reference has documented
that this case is illegal, but the compiler never checked for it.
The recent introduction of nested scope makes the meaning of this
form of name binding ambiguous. In a future release, the compiler
may allow this form when there is no possibility of ambiguity.
- repr(string) is easier to read, now using hex escapes instead of octal,
and using \t, \n and \r instead of \011, \012 and \015 (respectively):
>>> "\texample \r\n" + chr(0) + chr(255)
'\texample \r\n\x00\xff' # in 2.1
'\011example \015\012\000\377' # in 2.0
- Functions are now compared and hashed by identity, not by value, since
the func_code attribute is writable.
- Weak references (PEP 205) have been added. This involves a few
changes in the core, an extension module (_weakref), and a Python
module (weakref). The weakref module is the public interface. It
includes support for "explicit" weak references, proxy objects, and
mappings with weakly held values.
- A 'continue' statement can now appear in a try block within the body
of a loop. It is still not possible to use continue in a finally
clause.
Standard library
- mailbox.py now has a new class, PortableUnixMailbox which is
identical to UnixMailbox but uses a more portable scheme for
determining From_ separators. Also, the constructors for all the
classes in this module have a new optional `factory' argument, which
is a callable used when new message classes must be instantiated by
the next() method.
- random.py is now self-contained, and offers all the functionality of
the now-deprecated whrandom.py. See the docs for details. random.py
also supports new functions getstate() and setstate(), for saving
and restoring the internal state of the generator; and jumpahead(n),
for quickly forcing the internal state to be the same as if n calls to
random() had been made. The latter is particularly useful for multi-
threaded programs, creating one instance of the random.Random() class for
each thread, then using .jumpahead() to force each instance to use a
non-overlapping segment of the full period.
- random.py's seed() function is new. For bit-for-bit compatibility with
prior releases, use the whseed function instead. The new seed function
addresses two problems: (1) The old function couldn't produce more than
about 2**24 distinct internal states; the new one about 2**45 (the best
that can be done in the Wichmann-Hill generator). (2) The old function
sometimes produced identical internal states when passed distinct
integers, and there was no simple way to predict when that would happen;
the new one guarantees to produce distinct internal states for all
arguments in [0, 27814431486576L).
- The socket module now supports raw packets on Linux. The socket
family is AF_PACKET.
- test_capi.py is a start at running tests of the Python C API. The tests
are implemented by the new Modules/_testmodule.c.
- A new extension module, _symtable, provides provisional access to the
internal symbol table used by the Python compiler. A higher-level
interface will be added on top of _symtable in a future release.
- Removed the obsolete soundex module.
- xml.dom.minidom now uses the standard DOM exceptions. Node supports
the isSameNode method; NamedNodeMap the get method.
- xml.sax.expatreader supports the lexical handler property; it
generates comment, startCDATA, and endCDATA events.
Windows changes
- Build procedure: the zlib project is built in a different way that
ensures the zlib header files used can no longer get out of synch with
the zlib binary used. See PCbuild\readme.txt for details. Your old
zlib-related directories can be deleted; you'll need to download fresh
source for zlib and unpack it into a new directory.
- Build: New subproject _test for the benefit of test_capi.py (see above).
- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
interface to some Python compiler internals).
- Build: Subproject ucnhash is gone, since the code was folded into the
unicodedata subproject.
What's New in Python 2.1 alpha 1?
=================================
Core language, builtins, and interpreter
- There is a new Unicode companion to the PyObject_Str() API
called PyObject_Unicode(). It behaves in the same way as the
former, but assures that the returned value is a Unicode object
(applying the usual coercion if necessary).
- The comparison operators support "rich comparison overloading" (PEP
207). C extension types can provide a rich comparison function in
the new tp_richcompare slot in the type object. The cmp() function
and the C function PyObject_Compare() first try the new rich
comparison operators before trying the old 3-way comparison. There
is also a new C API PyObject_RichCompare() (which also falls back on
the old 3-way comparison, but does not constrain the outcome of the
rich comparison to a Boolean result).
The rich comparison function takes two objects (at least one of
which is guaranteed to have the type that provided the function) and
an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
object, which may be NotImplemented (in which case the tp_compare
slot function is used as a fallback, if defined).
Classes can overload individual comparison operators by defining one
or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
__ge__. There are no explicit "reflected argument" versions of
these; instead, __lt__ and __gt__ are each other's reflection,
likewise for__le__ and __ge__; __eq__ and __ne__ are their own
reflection (similar at the C level). No other implications are
made; in particular, Python does not assume that == is the Boolean
inverse of !=, or that < is the Boolean inverse of >=. This makes
it possible to define types with partial orderings.
Classes or types that want to implement (in)equality tests but not
the ordering operators (i.e. unordered types) should implement ==
and !=, and raise an error for the ordering operators.
It is possible to define types whose rich comparison results are not
Boolean; e.g. a matrix type might want to return a matrix of bits
for A < B, giving elementwise comparisons. Such types should ensure
that any interpretation of their value in a Boolean context raises
an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
at the C level) to always raise an exception.
- Complex numbers use rich comparisons to define == and != but raise
an exception for <, <=, > and >=. Unfortunately, this also means
that cmp() of two complex numbers raises an exception when the two
numbers differ. Since it is not mathematically meaningful to compare
complex numbers except for equality, I hope that this doesn't break
too much code.
- The outcome of comparing non-numeric objects of different types is
not defined by the language, other than that it's arbitrary but
consistent (see the Reference Manual). An implementation detail changed
in 2.1a1 such that None now compares less than any other object. Code
relying on this new behavior (like code that relied on the previous
behavior) does so at its own risk.
- Functions and methods now support getting and setting arbitrarily
named attributes (PEP 232). Functions have a new __dict__
(a.k.a. func_dict) which hold the function attributes. Methods get
and set attributes on their underlying im_func. It is a TypeError
to set an attribute on a bound method.
- The xrange() object implementation has been improved so that
xrange(sys.maxint) can be used on 64-bit platforms. There's still a
limitation that in this case len(xrange(sys.maxint)) can't be
calculated, but the common idiom "for i in xrange(sys.maxint)" will
work fine as long as the index i doesn't actually reach 2**31.
(Python uses regular ints for sequence and string indices; fixing
that is much more work.)
- Two changes to from...import:
1) "from M import X" now works even if (after loading module M)
sys.modules['M'] is not a real module; it's basically a getattr()
operation with AttributeError exceptions changed into ImportError.
2) "from M import *" now looks for M.__all__ to decide which names to
import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
filters out names starting with '_' as before. Whether or not
__all__ exists, there's no restriction on the type of M.
- File objects have a new method, xreadlines(). This is the fastest
way to iterate over all lines in a file:
for line in file.xreadlines():
...do something to line...
See the xreadlines module (mentioned below) for how to do this for
other file-like objects.
- Even if you don't use file.xreadlines(), you may expect a speedup on
line-by-line input. The file.readline() method has been optimized
quite a bit in platform-specific ways: on systems (like Linux) that
support flockfile(), getc_unlocked(), and funlockfile(), those are
used by default. On systems (like Windows) without getc_unlocked(),
a complicated (but still thread-safe) method using fgets() is used by
default.
You can force use of the fgets() method by #define'ing
USE_FGETS_IN_GETLINE at build time (it may be faster than
getc_unlocked()).
You can force fgets() not to be used by #define'ing
DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
test_bufio.py fails -- and let us know if it does!).
- In addition, the fileinput module, while still slower than the other
methods on most platforms, has been sped up too, by using
file.readlines(sizehint).
- Support for run-time warnings has been added, including a new
command line option (-W) to specify the disposition of warnings.
See the description of the warnings module below.
- Extensive changes have been made to the coercion code. This mostly
affects extension modules (which can now implement mixed-type
numerical operators without having to use coercion), but
occasionally, in boundary cases the coercion semantics have changed
subtly. Since this was a terrible gray area of the language, this
is considered an improvement. Also note that __rcmp__ is no longer
supported -- instead of calling __rcmp__, __cmp__ is called with
reflected arguments.
- In connection with the coercion changes, a new built-in singleton
object, NotImplemented is defined. This can be returned for
operations that wish to indicate they are not implemented for a
particular combination of arguments. From C, this is
Py_NotImplemented.
- The interpreter accepts now bytecode files on the command line even
if they do not have a .pyc or .pyo extension. On Linux, after executing
import imp,sys,string
magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
any byte code file can be used as an executable (i.e. as an argument
to execve(2)).
- %[xXo] formats of negative Python longs now produce a sign
character. In 1.6 and earlier, they never produced a sign,
and raised an error if the value of the long was too large
to fit in a Python int. In 2.0, they produced a sign if and
only if too large to fit in an int. This was inconsistent
across platforms (because the size of an int varies across
platforms), and inconsistent with hex() and oct(). Example:
>>> "%x" % -0x42L
'-42' # in 2.1
'ffffffbe' # in 2.0 and before, on 32-bit machines
>>> hex(-0x42L)
'-0x42L' # in all versions of Python
The behavior of %d formats for negative Python longs remains
the same as in 2.0 (although in 1.6 and before, they raised
an error if the long didn't fit in a Python int).
%u formats don't make sense for Python longs, but are allowed
and treated the same as %d in 2.1. In 2.0, a negative long
formatted via %u produced a sign if and only if too large to
fit in an int. In 1.6 and earlier, a negative long formatted
via %u raised an error if it was too big to fit in an int.
- Dictionary objects have an odd new method, popitem(). This removes
an arbitrary item from the dictionary and returns it (in the form of
a (key, value) pair). This can be useful for algorithms that use a
dictionary as a bag of "to do" items and repeatedly need to pick one
item. Such algorithms normally end up running in quadratic time;
using popitem() they can usually be made to run in linear time.
Standard library
- In the time module, the time argument to the functions strftime,
localtime, gmtime, asctime and ctime is now optional, defaulting to
the current time (in the local timezone).
- The ftplib module now defaults to passive mode, which is deemed a
more useful default given that clients are often inside firewalls
these days. Note that this could break if ftplib is used to connect
to a *server* that is inside a firewall, from outside; this is
expected to be a very rare situation. To fix that, you can call
ftp.set_pasv(0).
- The module site now treats .pth files not only for path configuration,
but also supports extensions to the initialization code: Lines starting
with import are executed.
- There's a new module, warnings, which implements a mechanism for
issuing and filtering warnings. There are some new built-in
exceptions that serve as warning categories, and a new command line
option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
turns warnings into errors). warnings.warn(message[, category])
issues a warning message; this can also be called from C as
PyErr_Warn(category, message).
- A new module xreadlines was added. This exports a single factory
function, xreadlines(). The intention is that this code is the
absolutely fastest way to iterate over all lines in an open
file(-like) object:
import xreadlines
for line in xreadlines.xreadlines(file):
...do something to line...
This is equivalent to the previous the speed record holder using
file.readlines(sizehint). Note that if file is a real file object
(as opposed to a file-like object), this is equivalent:
for line in file.xreadlines():
...do something to line...
- The bisect module has new functions bisect_left, insort_left,
bisect_right and insort_right. The old names bisect and insort
are now aliases for bisect_right and insort_right. XXX_right
and XXX_left methods differ in what happens when the new element
compares equal to one or more elements already in the list: the
XXX_left methods insert to the left, the XXX_right methods to the
right. Code that doesn't care where equal elements end up should
continue to use the old, short names ("bisect" and "insort").
- The new curses.panel module wraps the panel library that forms part
of SYSV curses and ncurses. Contributed by Thomas Gellekum.
- The SocketServer module now sets the allow_reuse_address flag by
default in the TCPServer class.
- A new function, sys._getframe(), returns the stack frame pointer of
the caller. This is intended only as a building block for
higher-level mechanisms such as string interpolation.
- The pyexpat module supports a number of new handlers, which are
available only in expat 1.2. If invocation of a callback fails, it
will report an additional frame in the traceback. Parser objects
participate now in garbage collection. If expat reports an unknown
encoding, pyexpat will try to use a Python codec; that works only
for single-byte charsets. The parser type objects is exposed as
XMLParserObject.
- xml.dom now offers standard definitions for symbolic node type and
exception code constants, and a hierarchy of DOM exceptions. minidom
was adjusted to use them.
- The conformance of xml.dom.minidom to the DOM specification was
improved. It detects a number of additional error cases; the
previous/next relationship works even when the tree is modified;
Node supports the normalize() method; NamedNodeMap, DocumentType and
DOMImplementation classes were added; Element supports the
hasAttribute and hasAttributeNS methods; and Text supports the splitText
method.
Build issues
- For Unix (and Unix-compatible) builds, configuration and building of
extension modules is now greatly automated. Rather than having to
edit the Modules/Setup file to indicate which modules should be
built and where their include files and libraries are, a
distutils-based setup.py script now takes care of building most
extension modules. All extension modules built this way are built
as shared libraries. Only a few modules that must be linked
statically are still listed in the Setup file; you won't need to
edit their configuration.
- Python should now build out of the box on Cygwin. If it doesn't,
mail to Jason Tishler (jlt63 at users.sourceforge.net).
- Python now always uses its own (renamed) implementation of getopt()
-- there's too much variation among C library getopt()
implementations.
- C++ compilers are better supported; the CXX macro is always set to a
C++ compiler if one is found.
Windows changes
- select module: By default under Windows, a select() call
can specify no more than 64 sockets. Python now boosts
this Microsoft default to 512. If you need even more than
that, see the MS docs (you'll need to #define FD_SETSIZE
and recompile Python from source).
- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
subdirectory is no more!
What's New in Python 2.0?
=========================
Below is a list of all relevant changes since release 1.6. Older
changes are in the file HISTORY. If you are making the jump directly
from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
HISTORY file! Many important changes listed there.
Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
http://www.amk.ca/python/2.0/.
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
======================================================================
What's new in 2.0 (since release candidate 1)?
==============================================
Standard library
- The copy_reg module was modified to clarify its intended use: to
register pickle support for extension types, not for classes.
pickle() will raise a TypeError if it is passed a class.
- Fixed a bug in gettext's "normalize and expand" code that prevented
it from finding an existing .mo file.
- Restored support for HTTP/0.9 servers in httplib.
- The math module was changed to stop raising OverflowError in case of
underflow, and return 0 instead in underflow cases. Whether Python
used to raise OverflowError in case of underflow was platform-
dependent (it did when the platform math library set errno to ERANGE
on underflow).
- Fixed a bug in StringIO that occurred when the file position was not
at the end of the file and write() was called with enough data to
extend past the end of the file.
- Fixed a bug that caused Tkinter error messages to get lost on
Windows. The bug was fixed by replacing direct use of
interp->result with Tcl_GetStringResult(interp).
- Fixed bug in urllib2 that caused it to fail when it received an HTTP
redirect response.
- Several changes were made to distutils: Some debugging code was
removed from util. Fixed the installer used when an external zip
program (like WinZip) is not found; the source code for this
installer is in Misc/distutils. check_lib() was modified to behave
more like AC_CHECK_LIB by add other_libraries() as a parameter. The
test for whether installed modules are on sys.path was changed to
use both normcase() and normpath().
- Several minor bugs were fixed in the xml package (the minidom,
pulldom, expatreader, and saxutils modules).
- The regression test driver (regrtest.py) behavior when invoked with
-l changed: It now reports a count of objects that are recognized as
garbage but not freed by the garbage collector.
- The regression test for the math module was changed to test
exceptional behavior when the test is run in verbose mode. Python
cannot yet guarantee consistent exception behavior across platforms,
so the exception part of test_math is run only in verbose mode, and
may fail on your platform.
Internals
- PyOS_CheckStack() has been disabled on Win64, where it caused
test_sre to fail.
Build issues
- Changed compiler flags, so that gcc is always invoked with -Wall and
-Wstrict-prototypes. Users compiling Python with GCC should see
exactly one warning, except if they have passed configure the
--with-pydebug flag. The expected warning is for getopt() in
Modules/main.c. This warning will be fixed for Python 2.1.
- Fixed configure to add -threads argument during linking on OSF1.
Tools and other miscellany
- The compiler in Tools/compiler was updated to support the new
language features introduced in 2.0: extended print statement, list
comprehensions, and augmented assignments. The new compiler should
also be backwards compatible with Python 1.5.2; the compiler will
always generate code for the version of the interpreter it runs
under.
What's new in 2.0 release candidate 1 (since beta 2)?
=====================================================
What is release candidate 1?
We believe that release candidate 1 will fix all known bugs that we
intend to fix for the 2.0 final release. This release should be a bit
more stable than the previous betas. We would like to see even more
widespread testing before the final release, so we are producing this
release candidate. The final release will be exactly the same unless
any show-stopping (or brown bag) bugs are found by testers of the
release candidate.
All the changes since the last beta release are bug fixes or changes
to support building Python for specific platforms.
Core language, builtins, and interpreter
- A bug that caused crashes when __coerce__ was used with augmented
assignment, e.g. +=, was fixed.
- Raise ZeroDivisionError when raising zero to a negative number,
e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the built-in
power operator and the result of math.pow(0.0, -2.0) will vary by
platform. On Linux, it raises a ValueError.
- A bug in Unicode string interpolation was fixed that occasionally
caused errors with formats including "%%". For example, the
following expression "%% %s" % u"abc" no longer raises a TypeError.
- Compilation of deeply nested expressions raises MemoryError instead
of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
rendering them useless. They are now written in binary mode again.
Standard library
- Keyword arguments are now accepted for most pattern and match object
methods in SRE, the standard regular expression engine.
- In SRE, fixed error with negative lookahead and lookbehind that
manifested itself as a runtime error in patterns like "(?<!abc)(def)".
- Several bugs in the Unicode handling and error handling in _tkinter
were fixed.
- Fix memory management errors in Merge() and Tkapp_Call() routines.
- Several changes were made to cStringIO to make it compatible with
the file-like object interface and with StringIO. If operations are
performed on a closed object, an exception is raised. The truncate
method now accepts a position argument and readline accepts a size
argument.
- There were many changes made to the linuxaudiodev module and its
test suite; as a result, a short, unexpected audio sample should now
play when the regression test is run.
Note that this module is named poorly, because it should work
correctly on any platform that supports the Open Sound System
(OSS).
The module now raises exceptions when errors occur instead of
crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
audio) and defines a getptr() method that calls the
SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
- The library_version attribute, introduced in an earlier beta, was
removed because it can not be supported with early versions of the C
readline library, which provides no way to determine the version at
compile-time.
- The binascii module is now enabled on Win64.
- tokenize.py no longer suffers "recursion depth" errors when parsing
programs with very long string literals.
Internals
- Fixed several buffer overflow vulnerabilities in calculate_path(),
which is called when the interpreter starts up to determine where
the standard library is installed. These vulnerabilities affect all
previous versions of Python and can be exploited by setting very
long values for PYTHONHOME or argv[0]. The risk is greatest for a
setuid Python script, although use of the wrapper in
Misc/setuid-prog.c will eliminate the vulnerability.
- Fixed garbage collection bugs in instance creation that were
triggered when errors occurred during initialization. The solution,
applied in cPickle and in PyInstance_New(), is to call
PyObject_GC_Init() after the initialization of the object's
container attributes is complete.
- pyexpat adds definitions of PyModule_AddStringConstant and
PyModule_AddObject if the Python version is less than 2.0, which
provides compatibility with PyXML on Python 1.5.2.
- If the platform has a bogus definition for LONG_BIT (the number of
bits in a long), an error will be reported at compile time.
- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
collection crashes and possibly other, unreported crashes.
- Fixed a memory leak in _PyUnicode_Fini().
Build issues
- configure now accepts a --with-suffix option that specifies the
executable suffix. This is useful for builds on Cygwin and Mac OS
X, for example.
- The mmap.PAGESIZE constant is now initialized using sysconf when
possible, which eliminates a dependency on -lucb for Reliant UNIX.
- The md5 file should now compile on all platforms.
- The select module now compiles on platforms that do not define
POLLRDNORM and related constants.
- Darwin (Mac OS X): Initial support for static builds on this
platform.
- BeOS: A number of changes were made to the build and installation
process. ar-fake now operates on a directory of object files.
dl_export.h is gone, and its macros now appear on the mwcc command
line during build on PPC BeOS.
- Platform directory in lib/python2.0 is "plat-beos5" (or
"plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
- Cygwin: Support for shared libraries, Tkinter, and sockets.
- SunOS 4.1.4_JL: Fix test for directory existence in configure.
Tools and other miscellany
- Removed debugging prints from main used with freeze.
- IDLE auto-indent no longer crashes when it encounters Unicode
characters.
What's new in 2.0 beta 2 (since beta 1)?
========================================
Core language, builtins, and interpreter
- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
"%d" % 2L**64 == "18446744073709551616".
- Add -h and -V command line options to print the usage message and
Python version number and exit immediately.
- eval() and exec accept Unicode objects as code parameters.
- getattr() and setattr() now also accept Unicode objects for the
attribute name, which are converted to strings using the default
encoding before lookup.
- Multiplication on string and Unicode now does proper bounds
checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
string is too long."
- Better error message when continue is found in try statement in a
loop.
Standard library and extensions
- socket module: the OpenSSL code now adds support for RAND_status()
and EGD (Entropy Gathering Device).
- array: reverse() method of array now works. buffer_info() now does
argument checking; it still takes no arguments.
- asyncore/asynchat: Included most recent version from Sam Rushing.
- cgi: Accept '&' or ';' as separator characters when parsing form data.
- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
- ConfigParser: When reading the file, options spelled in upper case
letters are now correctly converted to lowercase.
- copy: Copy Unicode objects atomically.
- cPickle: Fail gracefully when copy_reg can't be imported.
- cStringIO: Implemented readlines() method.
- dbm: Add get() and setdefault() methods to dbm object. Add constant
`library' to module that names the library used. Added doc strings
and method names to error messages. Uses configure to determine
which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
now available options.
- distutils: Update to version 0.9.3.
- dl: Add several dl.RTLD_ constants.
- fpectl: Now supported on FreeBSD.
- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
found by the collector will be saved in gc.garbage. This is useful
for debugging a program that creates reference cycles.
- httplib: Three changes: Restore support for set_debuglevel feature
of HTTP class. Do not close socket on zero-length response. Do not
crash when server sends invalid content-length header.
- mailbox: Mailbox class conforms better to qmail specifications.
- marshal: When reading a short, sign-extend on platforms where shorts
are bigger than 16 bits. When reading a long, repair the unportable
sign extension that was being done for 64-bit machines. (It assumed
that signed right shift sign-extends.)
- operator: Add contains(), invert(), __invert__() as aliases for
__contains__(), inv(), and __inv__() respectively.
- os: Add support for popen2() and popen3() on all platforms where
fork() exists. (popen4() is still in the works.)
- os: (Windows only:) Add startfile() function that acts like double-
clicking on a file in Explorer (or passing the file name to the
DOS "start" command).
- os.path: (Windows, DOS:) Treat trailing colon correctly in
os.path.join. os.path.join("a:", "b") yields "a:b".
- pickle: Now raises ValueError when an invalid pickle that contains
a non-string repr where a string repr was expected. This behavior
matches cPickle.
- posixfile: Remove broken __del__() method.
- py_compile: support CR+LF line terminators in source file.
- readline: Does not immediately exit when ^C is hit when readline and
threads are configured. Adds definition of rl_library_version. (The
latter addition requires GNU readline 2.2 or later.)
- rfc822: Domain literals returned by AddrlistClass method
getdomainliteral() are now properly wrapped in brackets.
- site: sys.setdefaultencoding() should only be called in case the
standard default encoding ("ascii") is changed. This saves quite a
few cycles during startup since the first call to
setdefaultencoding() will initialize the codec registry and the
encodings package.
- socket: Support for size hint in readlines() method of object returned
by makefile().
- sre: Added experimental expand() method to match objects. Does not
use buffer interface on Unicode strings. Does not hang if group id
is followed by whitespace.
- StringIO: Size hint in readlines() is now supported as documented.
- struct: Check ranges for bytes and shorts.
- urllib: Improved handling of win32 proxy settings. Fixed quote and
quote_plus functions so that the always encode a comma.
- Tkinter: Image objects are now guaranteed to have unique ids. Set
event.delta to zero if Tk version doesn't support mousewheel.
Removed some debugging prints.
- UserList: now implements __contains__().
- webbrowser: On Windows, use os.startfile() instead of os.popen(),
which works around a bug in Norton AntiVirus 2000 that leads directly
to a Blue Screen freeze.
- xml: New version detection code allows PyXML to override standard
XML package if PyXML version is greater than 0.6.1.
- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
(conventional DOM), and xml.dom.pulldom, which allows building the DOM
tree only for nodes which are sufficiently interesting to a specific
application. Does not provide the HTML-specific extensions. Still
undocumented.
- xml.sax: SAX 2 support for Python, including all the handler
interfaces needed to process XML 1.0 compliant XML. Some
documentation is already available.
- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
packagized XML support.
C API
- Add three new convenience functions for module initialization --
PyModule_AddObject(), PyModule_AddIntConstant(), and
PyModule_AddStringConstant().
- Cleaned up definition of NULL in C source code; all definitions were
removed and add #error to Python.h if NULL isn't defined after
#include of stdio.h.
- Py_PROTO() macros that were removed in 2.0b1 have been restored for
backwards compatibility (at the source level) with old extensions.
- A wrapper API was added for signal() and sigaction(). Instead of
either function, always use PyOS_getsig() to get a signal handler
and PyOS_setsig() to set one. A new convenience typedef
PyOS_sighandler_t is defined for the type of signal handlers.
- Add PyString_AsStringAndSize() function that provides access to the
internal data buffer and size of a string object -- or the default
encoded version of a Unicode object.
- PyString_Size() and PyString_AsString() accept Unicode objects.
- The standard header <limits.h> is now included by Python.h (if it
exists). INT_MAX and LONG_MAX will always be defined, even if
<limits.h> is not available.
- PyFloat_FromString takes a second argument, pend, that was
effectively useless. It is now officially useless but preserved for
backwards compatibility. If the pend argument is not NULL, *pend is
set to NULL.
- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
for the attribute name. See note on getattr() above.
- A few bug fixes to argument processing for Unicode.
PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
PyArg_Parse() special cases "s#" for Unicode objects; it returns a
pointer to the default encoded string data instead of to the raw
UTF-16.
- Py_BuildValue accepts B format (for bgen-generated code).
Internals
- On Unix, fix code for finding Python installation directory so that
it works when argv[0] is a relative path.
- Added a true unicode_internal_encode() function and fixed the
unicode_internal_decode function() to support Unicode objects directly
rather than by generating a copy of the object.
- Several of the internal Unicode tables are much smaller now, and
the source code should be much friendlier to weaker compilers.
- In the garbage collector: Fixed bug in collection of tuples. Fixed
bug that caused some instances to be removed from the container set
while they were still live. Fixed parsing in gc.set_debug() for
platforms where sizeof(long) > sizeof(int).
- Fixed refcount problem in instance deallocation that only occurred
when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
- On Windows, getpythonregpath is now protected against null data in
registry key.
- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
condition.
Build and platform-specific issues
- Better support of GNU Pth via --with-pth configure option.
- Python/C API now properly exposed to dynamically-loaded extension
modules on Reliant UNIX.
- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
Don't define MS_SYNC to be zero when it is undefined. Added missing
prototypes in posixmodule.c.
- Improved support for HP-UX build. Threads should now be correctly
configured (on HP-UX 10.20 and 11.00).
- Fix largefile support on older NetBSD systems and OpenBSD by adding
define for TELL64.
Tools and other miscellany
- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
- freeze: The modulefinder now works with 2.0 opcodes.
- IDLE:
Move hackery of sys.argv until after the Tk instance has been
created, which allows the application-specific Tkinter
initialization to be executed if present; also pass an explicit
className parameter to the Tk() constructor.
What's new in 2.0 beta 1?
=========================
Source Incompatibilities
------------------------
None. Note that 1.6 introduced several incompatibilities with 1.5.2,
such as single-argument append(), connect() and bind(), and changes to
str(long) and repr(float).
Binary Incompatibilities
------------------------
- Third party extensions built for Python 1.5.x or 1.6 cannot be used
with Python 2.0; these extensions will have to be rebuilt for Python
2.0.
- On Windows, attempting to import a third party extension built for
Python 1.5.x or 1.6 results in an immediate crash; there's not much we
can do about this. Check your PYTHONPATH environment variable!
- Python bytecode files (*.pyc and *.pyo) are not compatible between
releases.
Overview of Changes Since 1.6
-----------------------------
There are many new modules (including brand new XML support through
the xml package, and i18n support through the gettext module); a list
of all new modules is included below. Lots of bugs have been fixed.
The process for making major new changes to the language has changed
since Python 1.6. Enhancements must now be documented by a Python
Enhancement Proposal (PEP) before they can be accepted.
There are several important syntax enhancements, described in more
detail below:
- Augmented assignment, e.g. x += 1
- List comprehensions, e.g. [x**2 for x in range(10)]
- Extended import statement, e.g. import Module as Name
- Extended print statement, e.g. print >> file, "Hello"
Other important changes:
- Optional collection of cyclical garbage
Python Enhancement Proposal (PEP)
---------------------------------
PEP stands for Python Enhancement Proposal. A PEP is a design
document providing information to the Python community, or describing
a new feature for Python. The PEP should provide a concise technical
specification of the feature and a rationale for the feature.
We intend PEPs to be the primary mechanisms for proposing new
features, for collecting community input on an issue, and for
documenting the design decisions that have gone into Python. The PEP
author is responsible for building consensus within the community and
documenting dissenting opinions.
The PEPs are available at http://python.sourceforge.net/peps/.
Augmented Assignment
--------------------
This must have been the most-requested feature of the past years!
Eleven new assignment operators were added:
+= -= *= /= %= **= <<= >>= &= ^= |=
For example,
A += B
is similar to
A = A + B
except that A is evaluated only once (relevant when A is something
like dict[index].attr).
However, if A is a mutable object, A may be modified in place. Thus,
if A is a number or a string, A += B has the same effect as A = A+B
(except A is only evaluated once); but if a is a list, A += B has the
same effect as A.extend(B)!
Classes and built-in object types can override the new operators in
order to implement the in-place behavior; the not-in-place behavior is
used automatically as a fallback when an object doesn't implement the
in-place behavior. For classes, the method name is derived from the
method name for the corresponding not-in-place operator by inserting
an 'i' in front of the name, e.g. __iadd__ implements in-place
__add__.
Augmented assignment was implemented by Thomas Wouters.
List Comprehensions
-------------------
This is a flexible new notation for lists whose elements are computed
from another list (or lists). The simplest form is:
[<expression> for <variable> in <sequence>]
For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
This is more efficient than a for loop with a list.append() call.
You can also add a condition:
[<expression> for <variable> in <sequence> if <condition>]
For example, [w for w in words if w == w.lower()] would yield the list
of words that contain no uppercase characters. This is more efficient
than a for loop with an if statement and a list.append() call.
You can also have nested for loops and more than one 'if' clause. For
example, here's a function that flattens a sequence of sequences::
def flatten(seq):
return [x for subseq in seq for x in subseq]
flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
This prints
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
List comprehensions originated as a patch set from Greg Ewing; Skip
Montanaro and Thomas Wouters also contributed. Described by PEP 202.
Extended Import Statement
-------------------------
Many people have asked for a way to import a module under a different
name. This can be accomplished like this:
import foo
bar = foo
del foo
but this common idiom gets old quickly. A simple extension of the
import statement now allows this to be written as follows:
import foo as bar
There's also a variant for 'from ... import':
from foo import bar as spam
This also works with packages; e.g. you can write this:
import test.regrtest as regrtest
Note that 'as' is not a new keyword -- it is recognized only in this
context (this is only possible because the syntax for the import
statement doesn't involve expressions).
Implemented by Thomas Wouters. Described by PEP 221.
Extended Print Statement
------------------------
Easily the most controversial new feature, this extension to the print
statement adds an option to make the output go to a different file
than the default sys.stdout.
For example, to write an error message to sys.stderr, you can now
write:
print >> sys.stderr, "Error: bad dog!"
As a special feature, if the expression used to indicate the file
evaluates to None, the current value of sys.stdout is used. Thus:
print >> None, "Hello world"
is equivalent to
print "Hello world"
Design and implementation by Barry Warsaw. Described by PEP 214.
Optional Collection of Cyclical Garbage
---------------------------------------
Python is now equipped with a garbage collector that can hunt down
cyclical references between Python objects. It's no replacement for
reference counting; in fact, it depends on the reference counts being
correct, and decides that a set of objects belong to a cycle if all
their reference counts can be accounted for from their references to
each other. This devious scheme was first proposed by Eric Tiedemann,
and brought to implementation by Neil Schemenauer.
There's a module "gc" that lets you control some parameters of the
garbage collection. There's also an option to the configure script
that lets you enable or disable the garbage collection. In 2.0b1,
it's on by default, so that we (hopefully) can collect decent user
experience with this new feature. There are some questions about its
performance. If it proves to be too much of a problem, we'll turn it
off by default in the final 2.0 release.
Smaller Changes
---------------
A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
map(None, seq1, seq2, ...) when the sequences have the same length;
i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
the lists are not all the same length, the shortest list wins:
zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
sys.version_info is a tuple (major, minor, micro, level, serial).
Dictionaries have an odd new method, setdefault(key, default).
dict.setdefault(key, default) returns dict[key] if it exists; if not,
it sets dict[key] to default and returns that value. Thus:
dict.setdefault(key, []).append(item)
does the same work as this common idiom:
if not dict.has_key(key):
dict[key] = []
dict[key].append(item)
There are two new variants of SyntaxError that are raised for
indentation-related errors: IndentationError and TabError.
Changed \x to consume exactly two hex digits; see PEP 223. Added \U
escape that consumes exactly eight hex digits.
The limits on the size of expressions and file in Python source code
have been raised from 2**16 to 2**32. Previous versions of Python
were limited because the maximum argument size the Python VM accepted
was 2**16. This limited the size of object constructor expressions,
e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
limit was raised thanks to a patch by Charles Waldman that effectively
fixes the problem. It is now much more likely that you will be
limited by available memory than by an arbitrary limit in Python.
The interpreter's maximum recursion depth can be modified by Python
programs using sys.getrecursionlimit and sys.setrecursionlimit. This
limit is the maximum number of recursive calls that can be made by
Python code. The limit exists to prevent infinite recursion from
overflowing the C stack and causing a core dump. The default value is
1000. The maximum safe value for a particular platform can be found
by running Tools/scripts/find_recursionlimit.py.
New Modules and Packages
------------------------
atexit - for registering functions to be called when Python exits.
imputil - Greg Stein's alternative API for writing custom import
hooks.
pyexpat - an interface to the Expat XML parser, contributed by Paul
Prescod.
xml - a new package with XML support code organized (so far) in three
subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
would fill a volume. There's a special feature whereby a
user-installed package named _xmlplus overrides the standard
xmlpackage; this is intended to give the XML SIG a hook to distribute
backwards-compatible updates to the standard xml package.
webbrowser - a platform-independent API to launch a web browser.
Changed Modules
---------------
array -- new methods for array objects: count, extend, index, pop, and
remove
binascii -- new functions b2a_hex and a2b_hex that convert between
binary data and its hex representation
calendar -- Many new functions that support features including control
over which day of the week is the first day, returning strings instead
of printing them. Also new symbolic constants for days of week,
e.g. MONDAY, ..., SUNDAY.
cgi -- FieldStorage objects have a getvalue method that works like a
dictionary's get method and returns the value attribute of the object.
ConfigParser -- The parser object has new methods has_option,
remove_section, remove_option, set, and write. They allow the module
to be used for writing config files as well as reading them.
ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
optionally support the RFC 959 REST command.
gzip -- readline and readlines now accept optional size arguments
httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
the module doc strings for details.
locale -- implement getdefaultlocale for Win32 and Macintosh
marshal -- no longer dumps core when marshaling deeply nested or
recursive data structures
os -- new functions isatty, seteuid, setegid, setreuid, setregid
os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
support under Unix.
os/pty -- support for openpty and forkpty
os.path -- fix semantics of os.path.commonprefix
smtplib -- support for sending very long messages
socket -- new function getfqdn()
readline -- new functions to read, write and truncate history files.
The readline section of the library reference manual contains an
example.
select -- add interface to poll system call
shutil -- new copyfileobj function
SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
HTTP server.
Tkinter -- optimization of function flatten
urllib -- scans environment variables for proxy configuration,
e.g. http_proxy.
whichdb -- recognizes dumbdbm format
Obsolete Modules
----------------
None. However note that 1.6 made a whole slew of modules obsolete:
stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
poly, zmod, strop, util, whatsound.
Changed, New, Obsolete Tools
----------------------------
None.
C-level Changes
---------------
Several cleanup jobs were carried out throughout the source code.
All C code was converted to ANSI C; we got rid of all uses of the
Py_PROTO() macro, which makes the header files a lot more readable.
Most of the portability hacks were moved to a new header file,
pyport.h; several other new header files were added and some old
header files were removed, in an attempt to create a more rational set
of header files. (Few of these ever need to be included explicitly;
they are all included by Python.h.)
Trent Mick ensured portability to 64-bit platforms, under both Linux
and Win64, especially for the new Intel Itanium processor. Mick also
added large file support for Linux64 and Win64.
The C APIs to return an object's size have been update to consistently
use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
previous versions, the abstract interfaces used PyXXX_Length and the
concrete interfaces used PyXXX_Size. The old names,
e.g. PyObject_Length, are still available for backwards compatibility
at the API level, but are deprecated.
The PyOS_CheckStack function has been implemented on Windows by
Fredrik Lundh. It prevents Python from failing with a stack overflow
on Windows.
The GC changes resulted in creation of two new slots on object,
tp_traverse and tp_clear. The augmented assignment changes result in
the creation of a new slot for each in-place operator.
The GC API creates new requirements for container types implemented in
C extension modules. See Include/objimpl.h for details.
PyErr_Format has been updated to automatically calculate the size of
the buffer needed to hold the formatted result string. This change
prevents crashes caused by programmer error.
New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
that are the same as their non-Ex counterparts except they take an
extra flag argument that tells them to close the file when done.
XXX There were other API changes that should be fleshed out here.
Windows Changes
---------------
New popen2/popen3/peopen4 in os module (see Changed Modules above).
os.popen is much more usable on Windows 95 and 98. See Microsoft
Knowledge Base article Q150956. The Win9x workaround described there
is implemented by the new w9xpopen.exe helper in the root of your
Python installation. Note that Python uses this internally; it is not
a standalone program.
Administrator privileges are no longer required to install Python
on Windows NT or Windows 2000. If you have administrator privileges,
Python's registry info will be written under HKEY_LOCAL_MACHINE.
Otherwise the installer backs off to writing Python's registry info
under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
uses of Python, but will prevent some advanced uses from working
(for example, running a Python script as an NT service, or possibly
from CGI).
[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
installer; instead, it installs the needed Tcl/Tk files directly in the
Python directory. If you already have a Tcl/Tk installation, this
wastes some disk space (about 4 Megs) but avoids problems with
conflicting Tcl/Tk installations, and makes it much easier for Python
to ensure that Tcl/Tk can find all its files.
[This was new in 1.6] The Windows installer now installs by default in
\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
Updates to the changes between 1.5.2 and 1.6
--------------------------------------------
The 1.6 NEWS file can't be changed after the release is done, so here
is some late-breaking news:
New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
and changes to getlocale() and setlocale().
The new module is now enabled per default.
It is not true that the encodings codecs cannot be used for normal
strings: the string.encode() (which is also present on 8-bit strings
!) allows using them for 8-bit strings too, e.g. to convert files from
cp1252 (Windows) to latin-1 or vice-versa.
Japanese codecs are available from Tamito KAJIYAMA:
http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
======================================================================
=======================================
==> Release 1.6 (September 5, 2000) <==
=======================================
What's new in release 1.6?
==========================
Below is a list of all relevant changes since release 1.5.2.
Source Incompatibilities
------------------------
Several small incompatible library changes may trip you up:
- The append() method for lists can no longer be invoked with more
than one argument. This used to append a single tuple made out of
all arguments, but was undocumented. To append a tuple, use
e.g. l.append((a, b, c)).
- The connect(), connect_ex() and bind() methods for sockets require
exactly one argument. Previously, you could call s.connect(host,
port), but this was undocumented. You must now write
s.connect((host, port)).
- The str() and repr() functions are now different more often. For
long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
For floats, repr() now gives 17 digits of precision, to ensure no
precision is lost (on all current hardware).
- The -X option is gone. Built-in exceptions are now always
classes. Many more library modules also have been converted to
class-based exceptions.
Binary Incompatibilities
------------------------
- Third party extensions built for Python 1.5.x cannot be used with
Python 1.6; these extensions will have to be rebuilt for Python 1.6.
- On Windows, attempting to import a third party extension built for
Python 1.5.x results in an immediate crash; there's not much we can do
about this. Check your PYTHONPATH environment variable!
Overview of Changes since 1.5.2
-------------------------------
For this overview, I have borrowed from the document "What's New in
Python 2.0" by Andrew Kuchling and Moshe Zadka:
http://www.amk.ca/python/2.0/ .
There are lots of new modules and lots of bugs have been fixed. A
list of all new modules is included below.
Probably the most pervasive change is the addition of Unicode support.
We've added a new fundamental datatype, the Unicode string, a new
built-in function unicode(), and numerous C APIs to deal with Unicode
and encodings. See the file Misc/unicode.txt for details, or
http://starship.python.net/crew/lemburg/unicode-proposal.txt.
Two other big changes, related to the Unicode support, are the
addition of string methods and (yet another) new regular expression
engine.
- String methods mean that you can now say s.lower() etc. instead of
importing the string module and saying string.lower(s) etc. One
peculiarity is that the equivalent of string.join(sequence,
delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
the effect of string.join(sequence); to make this more readable, try
space=" " first. Note that the maxsplit argument defaults in
split() and replace() have changed from 0 to -1.
- The new regular expression engine, SRE by Fredrik Lundh, is fully
backwards compatible with the old engine, and is in fact invoked
using the same interface (the "re" module). You can explicitly
invoke the old engine by import pre, or the SRE engine by importing
sre. SRE is faster than pre, and supports Unicode (which was the
main reason to put effort in yet another new regular expression
engine -- this is at least the fourth!).
Other Changes
-------------
Other changes that won't break code but are nice to know about:
Deleting objects is now safe even for deeply nested data structures.
Long/int unifications: long integers can be used in seek() calls, as
slice indexes.
String formatting (s % args) has a new formatting option, '%r', which
acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
alpha 1.)
Greg Ward's "distutils" package is included: this will make
installing, building and distributing third party packages much
simpler.
There's now special syntax that you can use instead of the apply()
function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
You can also use variations f(a1, a2, *args, **kwds) and you can leave
one or the other out: f(*args), f(**kwds).
The built-ins int() and long() take an optional second argument to
indicate the conversion base -- of course only if the first argument
is a string. This makes string.atoi() and string.atol() obsolete.
(string.atof() was already obsolete).
When a local variable is known to the compiler but undefined when
used, a new exception UnboundLocalError is raised. This is a class
derived from NameError so code catching NameError should still work.
The purpose is to provide better diagnostics in the following example:
x = 1
def f():
print x
x = x+1
This used to raise a NameError on the print statement, which confused
even experienced Python programmers (especially if there are several
hundreds of lines of code between the reference and the assignment to
x :-).
You can now override the 'in' operator by defining a __contains__
method. Note that it has its arguments backwards: x in a causes
a.__contains__(x) to be called. That's why the name isn't __in__.
The exception AttributeError will have a more friendly error message,
e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
<b>break code</b> that expects the message to be exactly the attribute
name.
New Modules in 1.6
------------------
UserString - base class for deriving from the string type.
distutils - tools for distributing Python modules.
robotparser - parse a robots.txt file, for writing web spiders.
(Moved from Tools/webchecker/.)
linuxaudiodev - audio for Linux.
mmap - treat a file as a memory buffer. (Windows and Unix.)
sre - regular expressions (fast, supports unicode). Currently, this
code is very rough. Eventually, the re module will be reimplemented
using sre (without changes to the re API).
filecmp - supersedes the old cmp.py and dircmp.py modules.
tabnanny - check Python sources for tab-width dependence. (Moved from
Tools/scripts/.)
urllib2 - new and improved but incompatible version of urllib (still
experimental).
zipfile - read and write zip archives.
codecs - support for Unicode encoders/decoders.
unicodedata - provides access to the Unicode 3.0 database.
_winreg - Windows registry access.
encodings - package which provides a large set of standard codecs --
currently only for the new Unicode support. It has a drop-in extension
mechanism which allows you to add new codecs by simply copying them
into the encodings package directory. Asian codec support will
probably be made available as separate distribution package built upon
this technique and the new distutils package.
Changed Modules
---------------
readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
chunk, wave, random, shelve, nntplib - minor enhancements.
socket, httplib, urllib - optional OpenSSL support (Unix only).
_tkinter - support for 8.0 up to 8.3. Support for versions older than
8.0 has been dropped.
string - most of this module is deprecated now that strings have
methods. This no longer uses the built-in strop module, but takes
advantage of the new string methods to provide transparent support for
both Unicode and ordinary strings.
Changes on Windows
------------------
The installer no longer runs a separate Tcl/Tk installer; instead, it
installs the needed Tcl/Tk files directly in the Python directory. If
you already have a Tcl/Tk installation, this wastes some disk space
(about 4 Megs) but avoids problems with conflincting Tcl/Tk
installations, and makes it much easier for Python to ensure that
Tcl/Tk can find all its files. Note: the alpha installers don't
include the documentation.
The Windows installer now installs by default in \Python16\ on the
default volume, instead of \Program Files\Python-1.6\.
Changed Tools
-------------
IDLE - complete overhaul. See the <a href="../idle/">IDLE home
page</a> for more information. (Python 1.6 alpha 1 will come with
IDLE 0.6.)
Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
text extraction tool used for internationalizing applications written
in Python.
Obsolete Modules
----------------
stdwin and everything that uses it. (Get Python 1.5.2 if you need
it. :-)
soundex. (Skip Montanaro has a version in Python but it won't be
included in the Python release.)
cmp, cmpcache, dircmp. (Replaced by filecmp.)
dump. (Use pickle.)
find. (Easily coded using os.walk().)
grep. (Not very useful as a library module.)
packmail. (No longer has any use.)
poly, zmod. (These were poor examples at best.)
strop. (No longer needed by the string module.)
util. (This functionality was long ago built in elsewhere).
whatsound. (Use sndhdr.)
Detailed Changes from 1.6b1 to 1.6
----------------------------------
- Slight changes to the CNRI license. A copyright notice has been
added; the requirement to indicate the nature of modifications now
applies when making a derivative work available "to others" instead of
just "to the public"; the version and date are updated. The new
license has a new handle.
- Added the Tools/compiler package. This is a project led by Jeremy
Hylton to write the Python bytecode generator in Python.
- The function math.rint() is removed.
- In Python.h, "#define _GNU_SOURCE 1" was added.
- Version 0.9.1 of Greg Ward's distutils is included (instead of
version 0.9).
- A new version of SRE is included. It is more stable, and more
compatible with the old RE module. Non-matching ranges are indicated
by -1, not None. (The documentation said None, but the PRE
implementation used -1; changing to None would break existing code.)
- The winreg module has been renamed to _winreg. (There are plans for
a higher-level API called winreg, but this has not yet materialized in
a form that is acceptable to the experts.)
- The _locale module is enabled by default.
- Fixed the configuration line for the _curses module.
- A few crashes have been fixed, notably <file>.writelines() with a
list containing non-string objects would crash, and there were
situations where a lost SyntaxError could dump core.
- The <list>.extend() method now accepts an arbitrary sequence
argument.
- If __str__() or __repr__() returns a Unicode object, this is
converted to an 8-bit string.
- Unicode string comparisons is no longer aware of UTF-16
encoding peculiarities; it's a straight 16-bit compare.
- The Windows installer now installs the LICENSE file and no longer
registers the Python DLL version in the registry (this is no longer
needed). It now uses Tcl/Tk 8.3.2.
- A few portability problems have been fixed, in particular a
compilation error involving socklen_t.
- The PC configuration is slightly friendlier to non-Microsoft
compilers.
======================================================================
======================================
==> Release 1.5.2 (April 13, 1999) <==
======================================
From 1.5.2c1 to 1.5.2 (final)
=============================
Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PCbuild/python15.wse: Bump version to 1.5.2 (final)
* PCbuild/python15.dsp: Added shamodule.c
* PC/config.c: Added sha module!
* README, Include/patchlevel.h: Prepare for final release.
* Misc/ACKS:
More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
* Python/thread_solaris.h:
While I can't really test this thoroughly, Pat Knight and the Solaris
man pages suggest that the proper thing to do is to add THR_NEW_LWP to
the flags on thr_create(), and that there really isn't a downside, so
I'll do that.
* Misc/ACKS:
Bunch of new names who helped iron out the last wrinkles of 1.5.2.
* PC/python_nt.rc:
Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
(I can't even display this on NT, maybe Win/98 can?)
* Lib/pstats.py:
Fix mysterious references to jprofile that were in the source since
its creation. I'm assuming these were once valid references to "Jim
Roskind's profile"...
* Lib/Attic/threading_api.py:
Removed; since long subsumed in Doc/lib/libthreading.tex
* Modules/socketmodule.c:
Put back __osf__ support for gethostbyname_r(); the real bug was that
it was being used even without threads. This of course might be an
all-platform problem so now we only use the _r variant when we are
using threads.
Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/cPickle.c:
Fix accidentally reversed NULL test in load_mark(). Suggested by
Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
returns NULL.)
* README:
Add note about popen2 problem on Linux noticed by Pablo Bleyer.
* README: Add note about -D_REENTRANT for HP-UX 10.20.
* Modules/Makefile.pre.in: 'clean' target should remove hassignal.
* PC/Attic/vc40.mak, PC/readme.txt:
Remove all VC++ info (except VC 1.5) from readme.txt;
remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
* README: Clarify PC build instructions (point to PCbuild).
* Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
* Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
Forgot to add this file. CDROM device parameters.
* Lib/gzip.py: Two different changes.
1. Jack Jansen reports that on the Mac, the time may be negative, and
solves this by adding a write32u() function that writes an unsigned
long.
2. On 64-bit platforms the CRC comparison fails; I've fixed this by
casting both values to be compared to "unsigned long" i.e. modulo
0x100000000L.
Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PC/Attic/_tkinter.def: No longer needed.
* Misc/ACKS: Correct missed character in Andrew Dalke's name.
* README: Add DEC Ultrix notes (from Donn Cave's email).
* configure: The usual
* configure.in:
Quote a bunch of shell variables used in test, related to long-long.
* Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
casts for picky compilers.
* Modules/socketmodule.c:
3-arg gethostbyname_r doesn't really work on OSF/1.
* PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
Avoid totally empty files.
Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/fixps.py: Use re instead of regex.
Don't rewrite the file in place.
(Reported by Andy Dustman.)
* Lib/netrc.py, Lib/shlex.py: Get rid of #! line
Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
Add a variable %_TCL_% that makes it easier to switch to a different version.
======================================================================
From 1.5.2b2 to 1.5.2c1
=======================
Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PCbuild/python15.wse:
Release 1.5.2c1. Add IDLE and Uninstall to program group.
Don't distribute zlib.dll. Tweak some comments.
* PCbuild/zlib.dsp: Now using static zlib 1.1.3
* Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
The usual
* Include/patchlevel.h: Release 1.5.2c1
* README: Release 1.5.2c1.
* Misc/NEWS: News for the 1.5.2c1 release.
* Lib/test/test_strftime.py:
On Windows, we suddenly find, strftime() may return "" for an
unsupported format string. (I guess this is because the logic for
deciding whether to reallocate the buffer or not has been improved.)
This caused the test code to crash on result[0]. Fix this by assuming
an empty result also means the format is not supported.
* Demo/tkinter/matt/window-creation-w-location.py:
This demo imported some private code from Matt. Make it cripple along.
* Lib/lib-tk/Tkinter.py:
Delete an accidentally checked-in feature that actually broke more
than was worth it: when deleting a canvas item, it would try to
automatically delete the bindings for that item. Since there's
nothing that says you can't reuse the tag and still have the bindings,
this is not correct. Also, it broke at least one demo
(Demo/tkinter/matt/rubber-band-box-demo-1.py).
* Python/thread_wince.h: Win/CE thread support by Mark Hammond.
Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/zlibmodule.c:
Patch by Andrew Kuchling to unflush() (flush() for deflating).
Without this, if inflate() returned Z_BUF_ERROR asking for more output
space, we would report the error; now, we increase the buffer size and
try again, just as for Z_OK.
* Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
* Tools/idle/ChangeLog: New change log.
* Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
* Python/pythonrun.c:
Alas, get rid of the Win specific hack to ask the user to press Return
before exiting when an error happened. This didn't work right when
Python is invoked from a daemon.
* Tools/idle/idlever.py: Version bump awaiting impending new release.
(Not much has changed :-( )
* Lib/lib-tk/Tkinter.py:
lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
so the preferred name for them is tag_lower, tag_raise
(similar to tag_bind, and similar to the Text widget);
unfortunately can't delete the old ones yet (maybe in 1.6)
* Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
Changes by Mark Hammond for Windows CE. Mostly of the form
#ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
* Python/bltinmodule.c:
Remove unused variable from complex_from_string() code.
* Include/patchlevel.h:
Add the possibility of a gamma release (release candidate).
Add '+' to string version number to indicate we're beyond b2 now.
* Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
* Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
Per writes:
"""
The application where Signum Support uses smtplib needs to be able to
report good error messages to the user when sending email fails. To
help in diagnosing problems it is useful to be able to report the
entire message sent by the server, not only the SMTP error code of the
offending command.
A lot of the functions in sendmail.py unfortunately discards the
message, leaving only the code. The enclosed patch fixes that
problem.
The enclosed patch also introduces a base class for exceptions that
include an SMTP error code and error message, and make the code and
message available on separate attributes, so that surrounding code can
deal with them in whatever way it sees fit. I've also added some
documentation to the exception classes.
The constructor will now raise an exception if it cannot connect to
the SMTP server.
The data() method will raise an SMTPDataError if it doesn't receive
the expected 354 code in the middle of the exchange.
According to section 5.2.10 of RFC 1123 a smtp client must accept "any
text, including no text at all" after the error code. If the response
of a HELO command contains no text self.helo_resp will be set to the
empty string (""). The patch fixes the test in the sendmail() method
so that helo_resp is tested against None; if it has the empty string
as value the sendmail() method would invoke the helo() method again.
The code no longer accepts a -1 reply from the ehlo() method in
sendmail().
[Text about removing SMTPRecipientsRefused deleted --GvR]
"""
and also:
"""
smtplib.py appends an extra blank line to the outgoing mail if the
`msg' argument to the sendmail method already contains a trailing
newline. This patch should fix the problem.
"""
The Dragon writes:
"""
Mostly I just re-added the SMTPRecipientsRefused exception
(the exception object now has the appropriate info in it ) [Per had
removed this in his patch --GvR] and tweaked the behavior of the
sendmail method whence it throws the newly added SMTPHeloException (it
was closing the connection, which it shouldn't. whatever catches the
exception should do that. )
I pondered the change of the return values to tuples all around,
and after some thinking I decided that regularizing the return values was
too much of the Right Thing (tm) to not do.
My one concern is that code expecting an integer & getting a tuple
may fail silently.
(i.e. if it's doing :
x.somemethod() >= 400:
expecting an integer, the expression will always be true if it gets a
tuple instead. )
However, most smtplib code I've seen only really uses the
sendmail() method, so this wouldn't bother it. Usually code I've seen
that calls the other methods usually only calls helo() and ehlo() for
doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
and thus I would think not much code uses it yet.
"""
Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/test_ntpath.py:
Fix the tests now that splitdrive() no longer treats UNC paths special.
(Some tests converted to splitunc() tests.)
* Lib/ntpath.py:
Withdraw the UNC support from splitdrive(). Instead, a new function
splitunc() parses UNC paths. The contributor of the UNC parsing in
splitdrive() doesn't like it, but I haven't heard a good reason to
keep it, and it causes some problems. (I think there's a
philosophical problem -- to me, the split*() functions are purely
syntactical, and the fact that \\foo is not a valid path doesn't mean
that it shouldn't be considered an absolute path.)
Also (quite separately, but strangely related to the philosophical
issue above) fix abspath() so that if win32api exists, it doesn't fail
when the path doesn't actually exist -- if GetFullPathName() fails,
fall back on the old strategy (join with getcwd() if necessary, and
then use normpath()).
* configure.in, configure, config.h.in, acconfig.h:
For BeOS PowerPC. Chris Herborth.
Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/timemodule.c:
Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
#else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
* Misc/ACKS:
Bunch of new contributors, including 9 who contributed to the Docs,
reported by Fred.
Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/gzip.py:
Oops, missed mode parameter to open().
* Lib/gzip.py:
Made the default mode 'rb' instead of 'r', for better cross-platform
support. (Based on comment on the documentation by Bernhard Reiter
<bernhard@csd.uwm.edu>).
Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/dutree.py:
For reasons I dare not explain, this script should always execute
main() when imported (in other words, it is not usable as a module).
Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/test_cpickle.py: Jonathan Giddy write:
In test_cpickle.py, the module os got imported, but the line to remove
the temp file has gone missing.
Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/BaseHTTPServer.py: Per Cederqvist writes:
If you send something like "PUT / HTTP/1.0" to something derived from
BaseHTTPServer that doesn't define do_PUT, you will get a response
that begins like this:
HTTP/1.0 501 Unsupported method ('do_PUT')
Server: SimpleHTTP/0.3 Python/1.5
Date: Tue, 30 Mar 1999 18:53:53 GMT
The server should complain about 'PUT' instead of 'do_PUT'. This
patch should fix the problem.
Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/smtplib.py: Patch by Per Cederqvist, who writes:
"""
- It needlessly used the makefile() method for each response that is
read from the SMTP server.
- If the remote SMTP server closes the connection unexpectedly the
code raised an IndexError. It now raises an SMTPServerDisconnected
exception instead.
- The code now checks that all lines in a multiline response actually
contains an error code.
"""
The Dragon approves.
Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/compileall.py:
When run as a script, report failures in the exit code as well.
Patch largely based on changes by Andrew Dalke, as discussed in the
distutils-sig.
Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urllib.py:
Hack so that if a 302 or 301 redirect contains a relative URL, the
right thing "just happens" (basejoin() with old URL).
* Modules/cPickle.c:
Protection against picling to/from closed (real) file.
The problem was reported by Moshe Zadka.
* Lib/test/test_cpickle.py:
Test protection against picling to/from closed (real) file.
* Modules/timemodule.c: Chris Lawrence writes:
"""
The GNU folks, in their infinite wisdom, have decided not to implement
altzone in libc6; this would not be horrible, except that timezone
(which is implemented) includes the current DST setting (i.e. timezone
for Central is 18000 in summer and 21600 in winter). So Python's
timezone and altzone variables aren't set correctly during DST.
Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
show the "right" thing on Linux (by using the tm_gmtoff stuff
available in BSD, which is how the GLIBC manual claims things should
be done) and (b) should cope with the southern hemisphere. In pursuit
of (b), I also took the liberty of renaming the "summer" and "winter"
variables to "july" and "jan". This patch should also make certain
time calculations on Linux actually work right (like the tz-aware
functions in the rfc822 module).
(It's hard to find DST that's currently being used in the southern
hemisphere; I tested using Africa/Windhoek.)
"""
* Lib/test/output/test_gzip:
Jonathan Giddy discovered this file was missing.
* Modules/shamodule.c:
Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
middlename) Marangozov, patch coded by Greg Stein.
* Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/ndiff.py: Tim Peters writes:
I should have waited overnight <wink/sigh>. Nothing wrong with the one I
sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
for recreating the original files from ndiff's output. That's attached, if
you're game! Us Windows guys don't usually have a sed sitting around
<wink>.
Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/ndiff.py: Tim Peters writes:
Attached is a cleaned-up version of ndiff (added useful module
docstring, now echo'ed in case of cmd line mistake); added -q option
to suppress initial file identification lines; + other minor cleanups,
& a slightly faster match engine.
Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Tools/scripts/dutree.py:
During display, if EPIPE is raised, it's probably because a pager was
killed. Discard the error in that case, but propagate it otherwise.
Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_userlist, Lib/test/test_userlist.py:
Test suite for UserList.
* Lib/UserList.py: Use isinstance() where appropriate.
Reformatted with 4-space indent.
Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
* Tools/pynche/PyncheWidget.py:
Helpwin.__init__(): The text widget should get focus.
* Tools/pynche/pyColorChooser.py:
Removed unnecessary import `from PyncheWidget import PyncheWidget'
Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_userdict, Lib/test/test_userdict.py:
Test suite for UserDict
* Lib/UserDict.py: Improved a bunch of things.
The constructor now takes an optional dictionary.
Use isinstance() where appropriate.
Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
Basic regr tests for pickle/cPickle
* Lib/pickle.py:
Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
points out) it doesn't work in JPython Applets.
Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
* Lib/test/test_gzip.py:
Added a simple test suite for gzip. It simply opens a temp file,
writes a chunk of compressed data, closes it, writes another chunk, and
reads the contents back to verify that they are the same.
* Lib/gzip.py:
Based on a suggestion from bruce@hams.com, make a trivial change to
allow using the 'a' flag as a mode for opening a GzipFile. gzip
files, surprisingly enough, can be concatenated and then decompressed;
the effect is to concatenate the two chunks of data.
If we support it on writing, it should also be supported on reading.
This *wasn't* trivial, and required rearranging the code in the
reading path, particularly the _read() method.
Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
and 'Unknown compression method'
Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/test_b1.py:
Add tests for float() and complex() with string args (Nick/Stephanie
Lockwood).
Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
* Modules/zlibmodule.c:
Add an .unused_data attribute to decompressor objects. If .unused_data
is not an empty string, this means that you have arrived at the
end of the stream of compressed data, and the contents of .unused_data are
whatever follows the compressed stream.
Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Python/bltinmodule.c:
Patch by Nick and Stephanie Lockwood to implement complex() with a string
argument. This closes TODO item 2.19.
Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
Unfortunately his code breaks wcgui.py in a way that's not easy
to fix. I expect that this is a temporary situation --
eventually Sam's changes will be merged back in.
(The changes add a -t option to specify exceptions to the -x
option, and explicit checking for #foo style fragment ids.)
* Objects/dictobject.c:
Vladimir Marangozov contributed updated comments.
* Objects/bufferobject.c: Folded long lines.
* Lib/test/output/test_sha, Lib/test/test_sha.py:
Added Jeremy's test code for the sha module.
* Modules/shamodule.c, Modules/Setup.in:
Added Greg Stein and Andrew Kuchling's sha module.
Fix comments about zlib version and URL.
* Lib/test/test_bsddb.py: Remove the temp file when we're done.
* Include/pythread.h: Conform to standard boilerplate.
* configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
Chris Herborth: the new compiler in R4.1 needs some new options to work...
* Modules/socketmodule.c:
Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
data struct before calling gethostby{name,addr}_r(); (2) ignore the
3/5/6 args determinations made by the configure script and switch on
platform identifiers instead:
AIX, OSF have 3 args
Sun, SGI have 5 args
Linux has 6 args
On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
* Modules/socketmodule.c:
Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
* Lib/mailbox.py:
Add readlines() to _Subfile class. Not clear who would need it, but
Chris Lawrence sent me a broken version; this one is a tad simpler and
more conforming to the standard.
Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
* Lib/gzip.py: use struct instead of bit-manipulate in Python
Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/Makefile.pre.in:
Add $(EXE) to various occurrences of python so it will work on Cygwin
with egcs (after setting EXE=.exe). Patch by Norman Vine.
* configure, configure.in:
Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Include/thread.h:
Adding thread.h -- unused but for b/w compatibility.
As requested by Bill Janssen.
* configure.in, configure:
Add code to test for all sorts of gethostbyname_r variants,
donated by David Arnold.
* config.h.in, acconfig.h:
Add symbols for gethostbyname_r variants (sigh).
* Modules/socketmodule.c: Clean up pass for the previous patches.
- Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
glibc2.
- If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
don't know what code should be used.
- New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
- Modify the gethostbyaddr() code to also hold on to the lock until
after it is safe to release, overlapping with the Python lock.
(Note: I think that it could in theory be possible that Python code
executed while gethostbyname_lock is held could attempt to reacquire
the lock -- e.g. in a signal handler or destructor. I will simply say
"don't do that then.")
* Modules/socketmodule.c: Jonathan Giddy writes:
Here's a patch to fix the race condition, which wasn't fixed by Rob's
patch. It holds the gethostbyname lock until the results are copied out,
which means that this lock and the Python global lock are held at the same
time. This shouldn't be a problem as long as the gethostbyname lock is
always acquired when the global lock is not held.
Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
* Modules/zlibmodule.c:
Fixed the flush() method of compression objects; the test for
the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
Logic cleaned up and commented.
* Lib/test/test_zlib.py:
Added simple test for the flush() method of compression objects, trying the
different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/shlex.py:
Bug reported by Tobias Thelen: missing "self." in assignment target.
Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/arraymodule.c:
Use an unsigned cast to avoid a warning in VC++.
* Lib/dospath.py, Lib/ntpath.py:
New code for split() by Tim Peters, behaves more like posixpath.split().
* Objects/floatobject.c:
Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
a block cannot be freed, add its free items back to the free list.
This is necessary to avoid leaking when Python is reinitialized later.
* Objects/intobject.c:
Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
a block cannot be freed, add its free items back to the free list, and
add its valid ints back to the small_ints array if they are in range.
This is necessary to avoid leaking when Python is reinitialized later.
* Lib/types.py:
Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
* Python/bltinmodule.c:
New builtin buffer() creates a derived read-only buffer from any
object that supports the buffer interface (e.g. strings, arrays).
* Objects/bufferobject.c:
Added check for negative offset for PyBuffer_FromObject and check for
negative size for PyBuffer_FromMemory. Greg Stein.
Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urlparse.py: Sjoerd Mullender writes:
If a filename on Windows starts with \\, it is converted to a URL
which starts with ////. If this URL is passed to urlparse.urlparse
you get a path that starts with // (and an empty netloc). If you pass
the result back to urlparse.urlunparse, you get a URL that starts with
//, which is parsed differently by urlparse.urlparse. The fix is to
add the (empty) netloc with accompanying slashes if the path in
urlunparse starts with //. Do this for all schemes that use a netloc.
* Lib/nturl2path.py: Sjoerd Mullender writes:
Pathnames of files on other hosts in the same domain
(\\host\path\to\file) are not translated correctly to URLs and back.
The URL should be something like file:////host/path/to/file.
Note that a combination of drive letter and remote host is not
possible.
Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urlparse.py:
Delete non-standard-conforming code in urljoin() that would use the
netloc from the base url as the default netloc for the resulting url
even if the schemes differ.
Once upon a time, when the web was wild, this was a valuable hack
because some people had a URL referencing an ftp server colocated with
an http server without having the host in the ftp URL (so they could
replicate it or change the hostname easily).
More recently, after the file: scheme got added back to the list of
schemes that accept a netloc, it turns out that this caused weirdness
when joining an http: URL with a file: URL -- the resulting file: URL
would always inherit the host from the http: URL because the file:
scheme supports a netloc but in practice never has one.
There are two reasons to get rid of the old, once-valuable hack,
instead of removing the file: scheme from the uses_netloc list. One,
the RFC says that file: uses the netloc syntax, and does not endorse
the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
hack.
* Include/ceval.h, Include/abstract.h:
Add DLL level b/w compat for PySequence_In and PyEval_CallObject
Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
An attempt to execute grid_slaves with arguments (0,0) results in
*all* of the slaves being returned, not just the slave associated with
row 0, column 0. This is because the test for arguments in the method
does not test to see if row (and column) does not equal None, but
rather just whether is evaluates to non-false. A value of 0 fails
this test.
Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Modules/cmathmodule.c:
Docstring fix: acosh() returns the hyperbolic arccosine, not the
hyperbolic cosine. Problem report via David Ascher by one of his
students.
Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* configure.in:
Should test for gethost*by*name_r, not for gethostname_r (which
doesn't exist and doesn't make sense).
* Modules/socketmodule.c:
Patch by Rob Riggs for Linux -- glibc2 has a different argument
converntion for gethostbyname_r() etc. than Solaris!
* Python/thread_pthread.h: Rob Riggs wrote:
"""
Spec says that on success pthread_create returns 0. It does not say
that an error code will be < 0. Linux glibc2 pthread_create() returns
ENOMEM (12) when one exceed process limits. (It looks like it should
return EAGAIN, but that's another story.)
For reference, see:
http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
"""
[I have a feeling that similar bugs were fixed before; perhaps someone
could check that all error checks no check for != 0?]
* Tools/bgen/bgen/bgenObjectDefinition.py:
New mixin class that defines cmp and hash that use
the ob_itself pointer. This allows (when using the mixin)
different Python objects pointing to the same C object and
behaving well as dictionary keys.
Or so sez Jack Jansen...
* Lib/urllib.py: Yet another patch by Sjoerd Mullender:
Don't convert URLs to URLs using pathname2url.
Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/cmd.py: Patch by Michael Scharf. He writes:
The module cmd requires for each do_xxx command a help_xxx
function. I think this is a little old fashioned.
Here is a patch: use the docstring as help if no help_xxx
function can be found.
[I'm tempted to rip out all the help_* functions from pdb, but I'll
resist it. Any takers? --Guido]
* Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
Under Windows, python freeze.py -o hello hello.py
creates all the correct files in the hello subdirectory, but the
Makefile has the directory prefix in it for frozen_extensions.c
nmake fails because it tries to locate hello/frozen_extensions.c
(His fix adds a call to os.path.basename() in the appropriate place.)
* Objects/floatobject.c, Objects/intobject.c:
Vladimir has restructured his code somewhat so that the blocks are now
represented by an explicit structure. (There are still too many casts
in the code, but that may be unavoidable.)
Also added code so that with -vv it is very chatty about what it does.
* Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
Change #! line to modern usage; also chmod +x
* Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
Change #! line to modern usage
* Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
The filename to URL conversion didn't properly quote special
characters.
The URL to filename didn't properly unquote special chatacters.
* Objects/floatobject.c:
OK, try again. Vladimir gave me a fix for the alignment bus error,
so here's his patch again. This time it works (at least on Solaris,
Linux and Irix).
Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/idle/PathBrowser.py:
Don't crash when sys.path contains an empty string.
* Tools/idle/PathBrowser.py:
- Don't crash in the case where a superclass is a string instead of a
pyclbr.Class object; this can happen when the superclass is
unrecognizable (to pyclbr), e.g. when module renaming is used.
- Show a watch cursor when calling pyclbr (since it may take a while
recursively parsing imported modules!).
Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/mimetypes.py:
Added .rdf and .xsl as application/xml types. (.rdf is for the
Resource Description Framework, a metadata encoding, and .xsl is for
the Extensible Stylesheet Language.)
Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_popen2, Lib/test/test_popen2.py:
Test for popen2 module, by Chris Tismer.
* Objects/floatobject.c:
Alas, Vladimir's patch caused a bus error (probably double
alignment?), and I didn't test it. Withdrawing it for now.
Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Objects/floatobject.c:
Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
floats on finalization.
* Objects/intobject.c:
Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
integers on finalization.
* Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
Add PathBrowser to File module
* Tools/idle/PathBrowser.py:
"Path browser" - 4 scrolled lists displaying:
directories on sys.path
modules in selected directory
classes in selected module
methods of selected class
Sinlge clicking in a directory, module or class item updates the next
column with info about the selected item. Double clicking in a
module, class or method item opens the file (and selects the clicked
item if it is a class or method).
I guess eventually I should be using a tree widget for this, but the
ones I've seen don't work well enough, so for now I use the old
Smalltalk or NeXT style multi-column hierarchical browser.
* Tools/idle/MultiScrolledLists.py:
New utility: multiple scrolled lists in parallel
* Tools/idle/ScrolledList.py: - White background.
- Display "(None)" (or text of your choosing) when empty.
- Don't set the focus.
Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urllib.py:
open_http also had the 'data is None' test backwards. don't call with the
extra argument if data is None.
* Demo/embed/demo.c:
Call Py_SetProgramName() instead of redefining getprogramname(),
reflecting changes in the runtime around 1.5 or earlier.
* Python/ceval.c:
Always test for an error return (usually NULL or -1) without setting
an exception.
* Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
He writes:
I had an off-by-1000 error in floatsleep(),
and the problem with time.clock() is that it's not implemented properly
on QNX... ANSI says it's supposed to return _CPU_ time used by the
process, but on QNX it returns the amount of real time used... so I was
confused.
* Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
Test for self.returntype behaving like OSErr rather than being it.
Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
* Lib/urllib.py:
http_error had the 'data is None' test backwards. don't call with the
extra argument if data is None.
* Lib/urllib.py: change indentation from 8 spaces to 4 spaces
* Lib/urllib.py: pleasing the tabnanny
Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/colorsys.py:
Oops, one more "x, y, z" to convert...
* Lib/colorsys.py:
Adjusted comment at the top to be less confusing, following Fredrik
Lundh's example.
Converted comment to docstring.
Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/toaiff.py:
Use sndhdr instead of the obsolete whatsound module.
Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
* Lib/urllib.py:
When performing a POST request, i.e. when the second argument to
urlopen is used to specify form data, make sure the second argument is
threaded through all of the http_error_NNN calls. This allows error
handlers like the redirect and authorization handlers to properly
re-start the connection.
Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/mhlib.py: Patch by Lars Wirzenius:
o the initial comment is wrong: creating messages is already
implemented
o Message.getbodytext: if the mail or it's part contains an
empty content-transfer-encoding header, the code used to
break; the change below treats an empty encoding value the same
as the other types that do not need decoding
o SubMessage.getbodytext was missing the decode argument; the
change below adds it; I also made it unconditionally return
the raw text if decoding was not desired, because my own
routines needed that (and it was easier than rewriting my
own routines ;-)
Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
* Python/bltinmodule.c (initerrors):
Make sure that the exception tuples ("base-classes" when
string-based exceptions are used) reflect the real class hierarchy,
i.e. that SystemExit derives from Exception not StandardError.
* Lib/exceptions.py:
Document the correct class hierarchy for SystemExit. It is not an
error and so it derives from Exception and not SystemError. The
docstring was incorrect but the implementation was fine.
Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/shutil.py:
Add import sys, needed by reference to sys.exc_info() in rmtree().
Discovered by Mitch Chapman.
* config.h.in:
Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
disappears. It wasn't used anywhere anyway...
* Modules/arraymodule.c:
Carefully check for overflow when allocating the memory for fromfile
-- someone tried to pass in sys.maxint and got bitten by the bogus
calculations.
* configure.in:
Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
LIBM (from --with-libm=...); this actually broke the customizability
offered by the latter option. Thanks go to Clay Spence for reporting
this.
* Lib/test/test_dl.py:
1. Print the error message (carefully) when a dl.open() fails in verbose mode.
2. When no test case worked, raise ImportError instead of failing.
* Python/bltinmodule.c:
Patch by Tim Peters to improve the range checks for range() and
xrange(), especially for platforms where int and long are different
sizes (so sys.maxint isn't actually the theoretical limit for the
length of a list, but the largest C int is -- sys.maxint is the
largest Python int, which is actually a C long).
* Makefile.in:
1. Augment the DG/UX rule so it doesn't break the BeOS build.
2. Add $(EXE) to various occurrences of python so it will work on
Cygwin with egcs (after setting EXE=.exe). These patches by
Norman Vine.
* Lib/posixfile.py:
According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
list (of bsd variants that have a different lock structure).
* Lib/test/test_fcntl.py:
According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
* Modules/timemodule.c:
Patch by Tadayoshi Funaba (with some changes) to be smarter about
guessing what happened when strftime() returns 0. Is it buffer
overflow or was the result simply 0 bytes long? (This happens for an
empty format string, or when the format string is a single %Z and the
timezone is unknown.) if the buffer is at least 256 times as long as
the format, assume the latter.
Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urllib.py:
As Des Barry points out, we need to call pathname2url(file) in two
calls to addinfourl() in open_file().
* Modules/Setup.in: Document *static* -- in two places!
* Modules/timemodule.c:
We don't support leap seconds, so the seconds field of a time 9-tuple
should be in the range [0-59]. Noted by Tadayoshi Funaba.
* Modules/stropmodule.c:
In atoi(), don't use isxdigit() to test whether the last character
converted was a "digit" -- use isalnum(). This test is there only to
guard against "+" or "-" being interpreted as a valid int literal.
Reported by Takahiro Nakayama.
* Lib/os.py:
As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
so they don't need to be treated specially here.
Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Misc/NEWS:
Typo: "apparentlt" --> "apparently"
Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
* Modules/posixmodule.c:
The docstring for ttyname(..) claims a second "mode" argument. The
actual code does not allow such an argument. (Finn Bock.)
* Lib/lib-old/poly.py:
Dang. Even though this is obsolete code, somebody found a bug, and I
fix it. Oh well.
Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/pyclbr.py:
Bow to font-lock at the end of the docstring, since it throws stuff
off.
Make sure the path parameter to readmodule() is a list before adding it
with sys.path, or the addition could fail.
======================================================================
From 1.5.2b1 to 1.5.2b2
=======================
General
-------
- Many memory leaks fixed.
- Many small bugs fixed.
- Command line option -OO (or -O -O) suppresses inclusion of doc
strings in resulting bytecode.
Windows-specific changes
------------------------
- New built-in module winsound provides an interface to the Win32
PlaySound() call.
- Re-enable the audioop module in the config.c file.
- On Windows, support spawnv() and associated P_* symbols.
- Fixed the conversion of times() return values on Windows.
- Removed freeze from the installer -- it doesn't work without the
source tree. (See FAQ 8.11.)
- On Windows 95/98, the Tkinter module now is smart enough to find
Tcl/Tk even when the PATH environment variable hasn't been set -- when
the import of _tkinter fails, it searches in a standard locations,
patches os.environ["PATH"], and tries again. When it still fails, a
clearer error message is produced. This should avoid most
installation problems with Tkinter use (e.g. in IDLE).
- The -i option doesn't make any calls to set[v]buf() for stdin --
this apparently screwed up _kbhit() and the _tkinter main loop.
- The ntpath module (and hence, os.path on Windows) now parses out UNC
paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
splitdrive() will \\host\mountpoint as the drive and \dir\file as the
path. ** EXPERIMENTAL **
- Added a hack to the exit code so that if (1) the exit status is
nonzero and (2) we think we have our own DOS box (i.e. we're not
started from a command line shell), we print a message and wait for
the user to hit a key before the DOS box is closed.
- Updated the installer to WISE 5.0g. Added a dialog warning about
the imminent Tcl installation. Added a dialog to specify the program
group name in the start menu. Upgraded the Tcl installer to Tcl
8.0.4.
Changes to intrinsics
---------------------
- The repr() or str() of a module object now shows the __file__
attribute (i.e., the file which it was loaded), or the string
"(built-in)" if there is no __file__ attribute.
- The range() function now avoids overflow during its calculations (if
at all possible).
- New info string sys.hexversion, which is an integer encoding the
version in hexadecimal. In other words, hex(sys.hexversion) ==
0x010502b2 for Python 1.5.2b2.
New or improved ports
---------------------
- Support for Nextstep descendants (future Mac systems).
- Improved BeOS support.
- Support dynamic loading of shared libraries on NetBSD platforms that
use ELF (i.e., MIPS and Alpha systems).
Configuration/build changes
---------------------------
- The Lib/test directory is no longer included in the default module
search path (sys.path) -- "test" has been a package ever since 1.5.
- Now using autoconf 2.13.
New library modules
-------------------
- New library modules asyncore and asynchat: these form Sam Rushing's
famous asynchronous socket library. Sam has gracefully allowed me to
incorporate these in the standard Python library.
- New module statvfs contains indexing constants for [f]statvfs()
return tuple.
Changes to the library
----------------------
- The wave module (platform-independent support for Windows sound
files) has been fixed to actually make it work.
- The sunau module (platform-independent support for Sun/NeXT sound
files) has been fixed to work across platforms. Also, a weird
encoding bug in the header of the audio test data file has been
corrected.
- Fix a bug in the urllib module that occasionally tripped up
webchecker and other ftp retrieves.
- ConfigParser's get() method now accepts an optional keyword argument
(vars) that is substituted on top of the defaults that were setup in
__init__. You can now also have recusive references in your
configuration file.
- Some improvements to the Queue module, including a put_nowait()
module and an optional "block" second argument, to get() and put(),
defaulting to 1.
- The updated xmllib module is once again compatible with the version
present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
- The bdb module (base class for the debugger) now supports
canonicalizing pathnames used in breakpoints. The derived class must
override the new canonical() method for this to work. Also changed
clear_break() to the backwards compatible old signature, and added
clear_bpbynumber() for the new functionality.
- In sgmllib (and hence htmllib), recognize attributes even if they
don't have space in front of them. I.e. '<a
name="foo"href="bar.html">' will now have two attributes recognized.
- In the debugger (pdb), change clear syntax to support three
alternatives: clear; clear file:line; clear bpno bpno ...
- The os.path module now pretends to be a submodule within the os
"package", so you can do things like "from os.path import exists".
- The standard exceptions now have doc strings.
- In the smtplib module, exceptions are now classes. Also avoid
inserting a non-standard space after "TO" in rcpt() command.
- The rfc822 module's getaddrlist() method now uses all occurrences of
the specified header instead of just the first. Some other bugfixes
too (to handle more weird addresses found in a very large test set,
and to avoid crashes on certain invalid dates), and a small test
module has been added.
- Fixed bug in urlparse in the common-case code for HTTP URLs; it
would lose the query, fragment, and/or parameter information.
- The sndhdr module no longer supports whatraw() -- it depended on a
rare extenral program.
- The UserList module/class now supports the extend() method, like
real list objects.
- The uu module now deals better with trailing garbage generated by
some broke uuencoders.
- The telnet module now has a my_interact() method which uses threads
instead of select. The interact() method uses this by default on
Windows (where the single-threaded version doesn't work).
- Add a class to mailbox.py for dealing with qmail directory
mailboxes. The test code was extended to notice these being used as
well.
Changes to extension modules
----------------------------
- Support for the [f]statvfs() system call, where it exists.
- Fixed some bugs in cPickle where bad input could cause it to dump
core.
- Fixed cStringIO to make the writelines() function actually work.
- Added strop.expandtabs() so string.expandtabs() is now much faster.
- Added fsync() and fdatasync(), if they appear to exist.
- Support for "long files" (64-bit seek pointers).
- Fixed a bug in the zlib module's flush() function.
- Added access() system call. It returns 1 if access granted, 0 if
not.
- The curses module implements an optional nlines argument to
w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
Changes to tools
----------------
- Some changes to IDLE; see Tools/idle/NEWS.txt.
- Latest version of Misc/python-mode.el included.
Changes to Tkinter
------------------
- Avoid tracebacks when an image is deleted after its root has been
destroyed.
Changes to the Python/C API
---------------------------
- When parentheses are used in a PyArg_Parse[Tuple]() call, any
sequence is now accepted, instead of requiring a tuple. This is in
line with the general trend towards accepting arbitrary sequences.
- Added PyModule_GetFilename().
- In PyNumber_Power(), remove unneeded and even harmful test for float
to the negative power (which is already and better done in
floatobject.c).
- New version identification symbols; read patchlevel.h for info. The
version numbers are now exported by Python.h.
- Rolled back the API version change -- it's back to 1007!
- The frozenmain.c function calls PyInitFrozenExtensions().
- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
INCREF.
======================================================================
From 1.5.2a2 to 1.5.2b1
=======================
Changes to intrinsics
---------------------
- New extension NotImplementedError, derived from RuntimeError. Not
used, but recommended use is for "abstract" methods to raise this.
- The parser will now spit out a warning or error when -t or -tt is
used for parser input coming from a string, too.
- The code generator now inserts extra SET_LINENO opcodes when
compiling multi-line argument lists.
- When comparing bound methods, use identity test on the objects, not
equality test.
New or improved ports
---------------------
- Chris Herborth has redone his BeOS port; it now works on PowerPC
(R3/R4) and x86 (R4 only). Threads work too in this port.
Renaming
--------
- Thanks to Chris Herborth, the thread primitives now have proper Py*
names in the source code (they already had those for the linker,
through some smart macros; but the source still had the old, un-Py
names).
Configuration/build changes
---------------------------
- Improved support for FreeBSD/3.
- Check for pthread_detach instead of pthread_create in libc.
- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
Otherwise modules such as thread didn't get incorporated in extensions.
New library modules
-------------------
- shlex.py by Eric Raymond provides a lexical analyzer class for
simple shell-like syntaxes.
- netrc.py by Eric Raymond provides a parser for .netrc files. (The
undocumented Netrc class in ftplib.py is now obsolete.)
- codeop.py is a new module that contains the compile_command()
function that was previously in code.py. This is so that JPython can
provide its own version of this function, while still sharing the
higher-level classes in code.py.
- turtle.py is a new module for simple turtle graphics. I'm still
working on it; let me know if you use this to teach Python to children
or other novices without prior programming experience.
Obsoleted library modules
-------------------------
- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
their status of obsoleteness. They don't do a particularly good job
and don't seem particularly relevant to the Python core.
New tools
---------
- I've added IDLE: my Integrated DeveLopment Environment for Python.
Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
work on Macintosh, but I haven't been able to test it there; it does
depend on new features in 1.5.2 and perhaps even new features in
1.5.2b1, especially the new code module). This is very much a work in
progress. I'd like to hear how people like it compared to PTUI (or
any other IDE they are familiar with).
- New tools by Barry Warsaw:
= audiopy: controls the Solaris Audio device
= pynche: The PYthonically Natural Color and Hue Editor
= world: Print mappings between country names and DNS country codes
New demos
---------
- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
song.
- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
Tkinter. (By Fredrik Lundh -- not by me!)
Changes to the library
----------------------
- compileall.py now avoids recompiling .py files that haven't changed;
it adds a -f option to force recompilation.
- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
patches).
- nntplib.py: statparse() no longer lowercases the message-id.
- types.py: use type(__stdin__) for FileType.
- urllib.py: fix translations for filenames with "funny" characters.
Patch by Sjoerd Mullender. Note that if you subclass one of the
URLopener classes, and you have copied code from the old urllib.py,
your subclass may stop working. A long-term solution is to provide
more methods so that you don't have to copy code.
- cgi.py: In read_multi, allow a subclass to override the class we
instantiate when we create a recursive instance, by setting the class
variable 'FieldStorageClass' to the desired class. By default, this
is set to None, in which case we use self.__class__ (as before).
Also, a patch by Jim Fulton to pass additional arguments to recursive
calls to the FieldStorage constructor from its read_multi method.
- UserList.py: In __getslice__, use self.__class__ instead of
UserList.
- In SimpleHTTPServer.py, the server specified in test() should be
BaseHTTPServer.HTTPServer, in case the request handler should want to
reference the two attributes added by BaseHTTPServer.server_bind. (By
Jeff Rush, for Bobo). Also open the file in binary mode, so serving
images from a Windows box might actually work.
- In CGIHTTPServer.py, the list of acceptable formats is -split-
on spaces but -joined- on commas, resulting in double commas
in the joined text. (By Jeff Rush.)
- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
new threaded versions of Unix Server classes, using the ThreadingMixIn
class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
method do_delete(); do_clear() was meant. By Greg Ward.
- getopt.py: accept a non-list sequence for the long options (request
by Jack Jansen). Because it might be a common mistake to pass a
single string, this situation is treated separately. Also added
docstrings (copied from the library manual) and removed the (now
redundant) module comments.
- tempfile.py: improvements to avoid security leaks.
- code.py: moved compile_command() to new module codeop.py.
- pickle.py: support pickle format 1.3 (binary float added). By Jim
Fulton. Also get rid of the undocumented obsolete Pickler dump_special
method.
- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
- imaplib.py: fix problem with some versions of IMAP4 servers that
choose to mix the case in their CAPABILITIES response.
- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
by Fredrik Lundh.
Changes to extension modules
----------------------------
- More doc strings for several modules were contributed by Chris
Petrilli: math, cmath, fcntl.
- Fixed a bug in zlibmodule.c that could cause core dumps on
decompression of rarely occurring input.
- cPickle.c: new version from Jim Fulton, with Open Source copyright
notice. Also, initialize self->safe_constructors early on to prevent
crash in early dealloc.
- cStringIO.c: new version from Jim Fulton, with Open Source copyright
notice. Also fixed a core dump in cStringIO.c when doing seeks.
- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
modifies its argument string (bad function!), so we make a temporary
copy.
- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
control pseudo-device, per audio(7I).
Changes to tools
----------------
- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
support for Emacs).
- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
only the names of offending files to be printed.
- freeze: when printing missing modules, also print the module they
were imported from.
- untabify.py: patch by Detlef Lannert to implement -t option
(set tab size).
Changes to Tkinter
------------------
- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
row2?
- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
doesn't work when running in a non-threaded environment. He added
some #ifdefs that fix this.
Changes to the Python/C API
---------------------------
- Bumped API version number to 1008 -- enough things have changed!
- There's a new macro, PyThreadState_GET(), which does the same work
as PyThreadState_Get() without the overhead of a function call (it
also avoids the error check). The two top calling locations of
PyThreadState_Get() have been changed to use this macro.
- All symbols intended for export from a DLL or shared library are now
marked as such (with the DL_IMPORT() macro) in the header file that
declares them. This was needed for the BeOS port, and should also
make some other ports easier. The PC port no longer needs the file
with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
macro which is only used for init methods in extension modules, and
for Py_Main().
Invisible changes to internals
------------------------------
- Fixed a bug in new_buffersize() in fileobject.c which could
return a buffer size that was way too large.
- Use PySys_WriteStderr instead of fprintf in most places.
- dictobject.c: remove dead code discovered by Vladimir Marangozov.
- tupleobject.c: make tuples less hungry -- an extra item was
allocated but never used. Tip by Vladimir Marangozov.
- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
Jansen)
- import.c: Jim Fulton fixes a reference count bug in
PyEval_GetGlobals.
- glmodule.c: check in the changed version after running the stubber
again -- this solves the conflict with curses over the 'clear' entry
point much nicer. (Jack Jansen had checked in the changes to cstubs
eons ago, but I never regenrated glmodule.c :-( )
- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
Marangozov.
- stropmodule.c: add a missing DECREF in an error exit. Submitted by
Jonathan Giddy.
======================================================================
From 1.5.2a1 to 1.5.2a2
=======================
General
-------
- It is now a syntax error to have a function argument without a
default following one with a default.
- __file__ is now set to the .py file if it was parsed (it used to
always be the .pyc/.pyo file).
- Don't exit with a fatal error during initialization when there's a
problem with the exceptions.py module.
- New environment variable PYTHONOPTIMIZE can be used to set -O.
- New version of python-mode.el for Emacs.
Miscellaneous fixed bugs
------------------------
- No longer print the (confusing) error message about stack underflow
while compiling.
- Some threading and locking bugs fixed.
- When errno is zero, report "Error", not "Success".
Documentation
-------------
- Documentation will be released separately.
- Doc strings added to array and md5 modules by Chris Petrilli.
Ports and build procedure
-------------------------
- Stop installing when a move or copy fails.
- New version of the OS/2 port code by Jeff Rush.
- The makesetup script handles absolute filenames better.
- The 'new' module is now enabled by default in the Setup file.
- I *think* I've solved the problem with the Linux build blowing up
sometimes due to a conflict between sigcheck/intrcheck and
signalmodule.
Built-in functions
------------------
- The second argument to apply() can now be any sequence, not just a
tuple.
Built-in types
--------------
- Lists have a new method: L1.extend(L2) is equivalent to the common
idiom L1[len(L1):] = L2.
- Better error messages when a sequence is indexed with a non-integer.
- Bettter error message when calling a non-callable object (include
the type in the message).
Python services
---------------
- New version of cPickle.c fixes some bugs.
- pickle.py: improved instantiation error handling.
- code.py: reworked quite a bit. New base class
InteractiveInterpreter and derived class InteractiveConsole. Fixed
several problems in compile_command().
- py_compile.py: print error message and continue on syntax errors.
Also fixed an old bug with the fstat code (it was never used).
- pyclbr.py: support submodules of packages.
String Services
---------------
- StringIO.py: raise the right exception (ValueError) for attempted
I/O on closed StringIO objects.
- re.py: fixed a bug in subn(), which caused .groups() to fail inside
the replacement function called by sub().
- The struct module has a new format 'P': void * in native mode.
Generic OS Services
-------------------
- Module time: Y2K robustness. 2-digit year acceptance depends on
value of time.accept2dyear, initialized from env var PYTHONY2K,
default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
(POSIX or X/Open recommendation).
- os.path: normpath(".//x") should return "x", not "/x".
- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
doesn't work.
- tempfile.py: regenerate the template after a fork() call.
Optional OS Services
--------------------
- In the signal module, disable restarting interrupted system calls
when we have siginterrupt().
Debugger
--------
- No longer set __args__; this feature is no longer supported and can
affect the debugged code.
- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
added aliases and some other useful new features, e.g. much better
breakpoint support: temporary breakpoint, disabled breakpoints,
breakpoints with ignore counts, and conditions; breakpoints can be set
on a file before it is loaded.
Profiler
--------
- Changes so that JPython can use it. Also fix the calibration code
so it actually works again
.
Internet Protocols and Support
------------------------------
- imaplib.py: new version from Piers Lauder.
- smtplib.py: change sendmail() method to accept a single string or a
list or strings as the destination (commom newbie mistake).
- poplib.py: LIST with a msg argument fixed.
- urlparse.py: some optimizations for common case (http).
- urllib.py: support content-length in info() for ftp protocol;
support for a progress meter through a third argument to
urlretrieve(); commented out gopher test (the test site is dead).
Internet Data handling
----------------------
- sgmllib.py: support tags with - or . in their name.
- mimetypes.py: guess_type() understands 'data' URLs.
Restricted Execution
--------------------
- The classes rexec.RModuleLoader and rexec.RModuleImporter no
longer exist.
Tkinter
-------
- When reporting an exception, store its info in sys.last_*. Also,
write all of it to stderr.
- Added NS, EW, and NSEW constants, for grid's sticky option.
- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
- Make bind variants without a sequence return a tuple of sequences
(formerly it returned a string, which wasn't very convenient).
- Add image commands to the Text widget (these are new in Tk 8.0).
- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
- Improved the thread code (but you still can't call update() from
another thread on Windows).
- Fixed unnecessary references to _default_root in the new dialog
modules.
- Miscellaneous problems fixed.
Windows General
---------------
- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
search for dependent dlls in the directory containing the .pyd.
- In debugging mode, call DebugBreak() in Py_FatalError().
Windows Installer
-----------------
- Install zlib.dll in the DLLs directory instead of in the win32
system directory, to avoid conflicts with other applications that have
their own zlib.dll.
Test Suite
----------
- test_long.py: new test for long integers, by Tim Peters.
- regrtest.py: improved so it can be used for other test suites as
well.
- test_strftime.py: use re to compare test results, to support legal
variants (e.g. on Linux).
Tools and Demos
---------------
- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
remove/add Windows style '\r\n' line endings), untabify.py (to remove
tabs), and rgrep.yp (reverse grep).
- Improvements to Tools/freeze/. Each Python module is now written to
its own C file. This prevents some compilers or assemblers from
blowing up on large frozen programs, and saves recompilation time if
only a few modules are changed. Other changes too, e.g. new command
line options -x and -i.
- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
Python/C API
------------
- New mechanism to support extensions of the type object while
remaining backward compatible with extensions compiled for previous
versions of Python 1.5. A flags field indicates presence of certain
fields.
- Addition to the buffer API to differentiate access to bytes and
8-bit characters (in anticipation of Unicode characters).
- New argument parsing format t# ("text") to indicate 8-bit
characters; s# simply means 8-bit bytes, for backwards compatibility.
- New object type, bufferobject.c is an example and can be used to
create buffers from memory.
- Some support for 64-bit longs, including some MS platforms.
- Many calls to fprintf(stderr, ...) have been replaced with calls to
PySys_WriteStderr(...).
- The calling context for PyOS_Readline() has changed: it must now be
called with the interpreter lock held! It releases the lock around
the call to the function pointed to by PyOS_ReadlineFunctionPointer
(default PyOS_StdioReadline()).
- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
- Renamed header file "thread.h" to "pythread.h".
- The code string of code objects may now be anything that supports the
buffer API.
======================================================================
From 1.5.1 to 1.5.2a1
=====================
General
-------
- When searching for the library, a landmark that is a compiled module
(string.pyc or string.pyo) is also accepted.
- When following symbolic links to the python executable, use a loop
so that a symlink to a symlink can work.
- Added a hack so that when you type 'quit' or 'exit' at the
interpreter, you get a friendly explanation of how to press Ctrl-D (or
Ctrl-Z) to exit.
- New and improved Misc/python-mode.el (Python mode for Emacs).
- Revert a new feature in Unix dynamic loading: for one or two
revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
out to be a bad idea.
Miscellaneous fixed bugs
------------------------
- All patches on the patch page have been integrated. (But much more
has been done!)
- Several memory leaks plugged (e.g. the one for classes with a
__getattr__ method).
- Removed the only use of calloc(). This triggered an obscure bug on
multiprocessor Sparc Solaris 2.6.
- Fix a peculiar bug that would allow "import sys.time" to succeed
(believing the built-in time module to be a part of the sys package).
- Fix a bug in the overflow checking when converting a Python long to
a C long (failed to convert -2147483648L, and some other cases).
Documentation
-------------
- Doc strings have been added to many extension modules: __builtin__,
errno, select, signal, socket, sys, thread, time. Also to methods of
list objects (try [].append.__doc__). A doc string on a type will now
automatically be propagated to an instance if the instance has methods
that are accessed in the usual way.
- The documentation has been expanded and the formatting improved.
(Remember that the documentation is now unbundled and has its own
release cycle though; see http://www.python.org/doc/.)
- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
Ports and build procedure
-------------------------
- The BeOS port is now integrated. Courtesy Chris Herborth.
- Symbol files for FreeBSD 2.x and 3.x have been contributed
(Lib/plat-freebsd[23]/*).
- Support HPUX 10.20 DCE threads.
- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
works, it won't also use -Olimit 1500 (which gives a warning for every
file). Also support the SGI_ABI environment variable better.
- The makesetup script now understands absolute pathnames ending in .o
in the module -- it assumes it's a file for which we have no source.
- Other miscellaneous improvements to the configure script and
Makefiles.
- The test suite now uses a different sound sample.
Built-in functions
------------------
- Better checks for invalid input to int(), long(), string.atoi(),
string.atol(). (Formerly, a sign without digits would be accepted as
a legal ways to spell zero.)
- Changes to map() and filter() to use the length of a sequence only
as a hint -- if an IndexError happens earlier, take that. (Formerly,
this was considered an error.)
- Experimental feature in getattr(): a third argument can specify a
default (instead of raising AttributeError).
- Implement round() slightly different, so that for negative ndigits
no additional errors happen in the last step.
- The open() function now adds the filename to the exception when it
fails.
Built-in exceptions
-------------------
- New standard exceptions EnvironmentError and PosixError.
EnvironmentError is the base class for IOError and PosixError;
PosixError is the same as os.error. All this so that either exception
class can be instantiated with a third argument indicating a filename.
The built-in function open() and most os/posix functions that take a
filename argument now use this.
Built-in types
--------------
- List objects now have an experimental pop() method; l.pop() returns
and removes the last item; l.pop(i) returns and removes the item at
i. Also, the sort() method is faster again. Sorting is now also
safer: it is impossible for the sorting function to modify the list
while the sort is going on (which could cause core dumps).
- Changes to comparisons: numbers are now smaller than any other type.
This is done to prevent the circularity where [] < 0L < 1 < [] is
true. As a side effect, cmp(None, 0) is now positive instead of
negative. This *shouldn't* affect any working code, but I've found
that the change caused several "sleeping" bugs to become active, so
beware!
- Instance methods may now have other callable objects than just
Python functions as their im_func. Use new.instancemethod() or write
your own C code to create them; new.instancemethod() may be called
with None for the instance to create an unbound method.
- Assignment to __name__, __dict__ or __bases__ of a class object is
now allowed (with stringent type checks); also allow assignment to
__getattr__ etc. The cached values for __getattr__ etc. are
recomputed after such assignments (but not for derived classes :-( ).
- Allow assignment to some attributes of function objects: func_code,
func_defaults and func_doc / __doc__. (With type checks except for
__doc__ / func_doc .)
Python services
---------------
- New tests (in Lib/test): reperf.py (regular expression benchmark),
sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
for the MimeWriter module).
- Generalized test/regrtest.py so that it is useful for testing other
packages.
- The ihooks.py module now understands package imports.
- In code.py, add a class that subsumes Fredrik Lundh's
PythonInterpreter class. The interact() function now uses this.
- In rlcompleter.py, in completer(), return None instead of raising an
IndexError when there are no more completions left.
- Fixed the marshal module to test for certain common kinds of invalid
input. (It's still not foolproof!)
- In the operator module, add an alias (now the preferred name)
"contains" for "sequenceincludes".
String Services
---------------
- In the string and strop modules, in the replace() function, treat an
empty pattern as an error (since it's not clear what was meant!).
- Some speedups to re.py, especially the string substitution and split
functions. Also added new function/method findall(), to find all
occurrences of a given substring.
- In cStringIO, add better argument type checking and support the
readonly 'closed' attribute (like regular files).
- In the struct module, unsigned 1-2 byte sized formats no longer
result in long integer values.
Miscellaneous services
----------------------
- In whrandom.py, added new method and function randrange(), same as
choice(range(start, stop, step)) but faster. This addresses the
problem that randint() was accidentally defined as taking an inclusive
range. Also, randint(a, b) is now redefined as randrange(a, b+1),
adding extra range and type checking to its arguments!
- Add some semi-thread-safety to random.gauss() (it used to be able to
crash when invoked from separate threads; now the worst it can do is
give a duplicate result occasionally).
- Some restructuring and generalization done to cmd.py.
- Major upgrade to ConfigParser.py; converted to using 're', added new
exceptions, support underscore in section header and option name. No
longer add 'name' option to every section; instead, add '__name__'.
- In getpass.py, don't use raw_input() to ask for the password -- we
don't want it to show up in the readline history! Also don't catch
interrupts (the try-finally already does all necessary cleanup).
Generic OS Services
-------------------
- New functions in os.py: makedirs(), removedirs(), renames(). New
variable: linesep (the line separator as found in binary files,
i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
this with files opened in (default) text mode; the line separator used
will always be '\n'!
- Changes to the 'os.path' submodule of os.py: added getsize(),
getmtime(), getatime() -- these fetch the most popular items from the
stat return tuple.
- In the time module, add strptime(), if it exists. (This parses a
time according to a format -- the inverse of strftime().) Also,
remove the call to mktime() from strftime() -- it messed up the
formatting of some non-local times.
- In the socket module, added a new function gethostbyname_ex().
Also, don't use #ifdef to test for some symbols that are enums on some
platforms (and should exist everywhere).
Optional OS Services
--------------------
- Some fixes to gzip.py. In particular, the readlines() method now
returns the lines *with* trailing newline characters, like readlines()
of regular file objects. Also, it didn't work together with cPickle;
fixed that.
- In whichdb.py, support byte-swapped dbhash (bsddb) files.
- In anydbm.py, look at the type of an existing database to determine
which module to use to open it. (The anydbm.error exception is now a
tuple.)
Unix Services
-------------
- In the termios module, in tcsetattr(), initialize the structure vy
calling tcgetattr().
- Added some of the "wait status inspection" macros as functions to
the posix module (and thus to the os module): WEXITSTATUS(),
WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
- In the syslog module, make the default facility more intuitive
(matching the docs).
Debugger
--------
- In pdb.py, support for setting breaks on files/modules that haven't
been loaded yet.
Internet Protocols and Support
------------------------------
- Changes in urllib.py; sped up unquote() and quote(). Fixed an
obscure bug in quote_plus(). Added urlencode(dict) -- convenience
function for sending a POST request with urlopen(). Use the getpass
module to ask for a password. Rewrote the (test) main program so that
when used as a script, it can retrieve one or more URLs to stdout.
Use -t to run the self-test. Made the proxy code work again.
- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
fail when someone asks for their HEAD. Also, for POST, set the
default content-type to application/x-www-form-urlencoded. Also, in
FieldStorage.__init__(), when method='GET', always get the query
string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
explicitly passed in fp.
- The smtplib.py module now supports ESMTP and has improved standard
compliance, for picky servers.
- Improved imaplib.py.
- Fixed UDP support in SocketServer.py (it never worked).
- Fixed a small bug in CGIHTTPServer.py.
Internet Data handling
----------------------
- In rfc822.py, add a new class AddressList. Also support a new
overridable method, isheader(). Also add a get() method similar to
dictionaries (and make getheader() an alias for it). Also, be smarter
about seekable (test whether fp.tell() works) and test for presence of
unread() method before trying seeks.
- In sgmllib.py, restore the call to report_unbalanced() that was lost
long ago. Also some other improvements: handle <? processing
instructions >, allow . and - in entity names, and allow \r\n as line
separator.
- Some restructuring and generalization done to multifile.py; support
a 'seekable' flag.
Restricted Execution
--------------------
- Improvements to rexec.py: package support; support a (minimal)
sys.exc_info(). Also made the (test) main program a bit fancier (you
can now use it to run arbitrary Python scripts in restricted mode).
Tkinter
-------
- On Unix, Tkinter can now safely be used from a multi-threaded
application. (Formerly, no threads would make progress while
Tkinter's mainloop() was active, because it didn't release the Python
interpreter lock.) Unfortunately, on Windows, threads other than the
main thread should not call update() or update_idletasks() because
this will deadlock the application.
- An interactive interpreter that uses readline and Tkinter no longer
uses up all available CPU time.
- Even if readline is not used, Tk windows created in an interactive
interpreter now get continuously updated. (This even works in Windows
as long as you don't hit a key.)
- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
- No longer register Tcl_finalize() as a low-level exit handler. It
may call back into Python, and that's a bad idea.
- Allow binding of Tcl commands (given as a string).
- Some minor speedups; replace explicitly coded getint() with int() in
most places.
- In FileDialog.py, remember the directory of the selected file, if
given.
- Change the names of all methods in the Wm class: they are now
wm_title(), etc. The old names (title() etc.) are still defined as
aliases.
- Add a new method of interpreter objects, interpaddr(). This returns
the address of the Tcl interpreter object, as an integer. Not very
useful for the Python programmer, but this can be called by another C
extension that needs to make calls into the Tcl/Tk C API and needs to
get the address of the Tcl interpreter object. A simple cast of the
return value to (Tcl_Interp *) will do the trick.
Windows General
---------------
- Don't insist on proper case for module source files if the filename
is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
doesn't). This should address problems with this feature on
oldfashioned filesystems (Novell servers?).
Windows Library
---------------
- os.environ is now all uppercase, but accesses are case insensitive,
and the putenv() calls made as a side effect of changing os.environ
are case preserving.
- Removed samefile(), sameopenfile(), samestat() from os.path (aka
ntpath.py) -- these cannot be made to work reliably (at least I
wouldn't know how).
- Fixed os.pipe() so that it returns file descriptors acceptable to
os.read() and os.write() (like it does on Unix), rather than Windows
file handles.
- Added a table of WSA error codes to socket.py.
- In the select module, put the (huge) file descriptor arrays on the
heap.
- The getpass module now raises KeyboardInterrupt when it sees ^C.
- In mailbox.py, fix tell/seek when using files opened in text mode.
- In rfc822.py, fix tell/seek when using files opened in text mode.
- In the msvcrt extension module, release the interpreter lock for
calls that may block: _locking(), _getch(), _getche(). Also fix a
bogus error return when open_osfhandle() doesn't have the right
argument list.
Windows Installer
-----------------
- The registry key used is now "1.5" instead of "1.5.x" -- so future
versions of 1.5 and Mark Hammond's win32all installer don't need to be
resynchronized.
Windows Tools
-------------
- Several improvements to freeze specifically for Windows.
Windows Build Procedure
-----------------------
- The VC++ project files and the WISE installer have been moved to the
PCbuild subdirectory, so they are distributed in the same subdirectory
where they must be used. This avoids confusion.
- New project files for Windows 3.1 port by Jim Ahlstrom.
- Got rid of the obsolete subdirectory PC/setup_nt/.
- The projects now use distinct filenames for the .exe, .dll, .lib and
.pyd files built in debug mode (by appending "_d" to the base name,
before the extension). This makes it easier to switch between the two
and get the right versions. There's a pragma in config.h that directs
the linker to include the appropriate .lib file (so python15.lib no
longer needs to be explicit in your project).
- The installer now installs more files (e.g. config.h). The idea is
that you shouldn't need the source distribution if you want build your
own extensions in C or C++.
Tools and Demos
---------------
- New script nm2def.py by Marc-Andre Lemburg, to construct
PC/python_nt.def automatically (some hand editing still required).
- New tool ndiff.py: Tim Peters' text diffing tool.
- Various and sundry improvements to the freeze script.
- The script texi2html.py (which was part of the Doc tree but is no
longer used there) has been moved to the Tools/scripts subdirectory.
- Some generalizations in the webchecker code. There's now a
primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
- The ftpmirror.py script now handles symbolic links properly, and
also files with multiple spaces in their names.
- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
last line is both indented and lacks a newline. This is now fixed.
Python/C API
------------
- Added missing prototypes for PyEval_CallFunction() and
PyEval_CallMethod().
- New macro PyList_SET_ITEM().
- New macros to access object members for PyFunction, PyCFunction
objects.
- New APIs PyImport_AppendInittab() and PyImport_ExtendInittab() to
dynamically add one or many entries to the table of built-in modules.
- New macro Py_InitModule3(name, methods, doc) which calls
Py_InitModule4() with appropriate arguments. (The -4 variant requires
you to pass an obscure version number constant which is always the same.)
- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
sys.stdout or sys.stderr using a printf-like interface. (Used in
_tkinter.c, for example.)
- New APIs for conversion between Python longs and C 'long long' if
your compiler supports it.
- PySequence_In() is now called PySequence_Contains().
(PySequence_In() is still supported for b/w compatibility; it is
declared obsolete because its argument order is confusing.)
- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
*never* raise an exception -- (even if the hash() fails, simply clear
the error). This was necessary because there is lots of code out
there that already assumes this.
- Changes to PySequence_Tuple() and PySequence_List() to use the
length of a sequence only as a hint -- if an IndexError happens
earlier, take that. (Formerly, this was considered an error.)
- Reformatted abstract.c to give it a more familiar "look" and fixed
many error checking bugs.
- Add NULL pointer checks to all calls of a C function through a type
object and extensions (e.g. nb_add).
- The code that initializes sys.path now calls Py_GetPythonHome()
instead of getenv("PYTHONHOME"). This, together with the new API
Py_SetPythonHome(), makes it easier for embedding applications to
change the notion of Python's "home" directory (where the libraries
etc. are sought).
- Fixed a very old bug in the parsing of "O?" format specifiers.
======================================================================
========================================
==> Release 1.5.1 (October 31, 1998) <==
========================================
From 1.5 to 1.5.1
=================
General
-------
- The documentation is now unbundled. It has also been extensively
modified (mostly to implement a new and more uniform formatting
style). We figure that most people will prefer to download one of the
preformatted documentation sets (HTML, PostScript or PDF) and that
only a minority have a need for the LaTeX or FrameMaker sources. Of
course, the unbundled documentation sources still released -- just not
in the same archive file, and perhaps not on the same date.
- All bugs noted on the errors page (and many unnoted) are fixed. All
new bugs take their places.
- No longer a core dump when attempting to print (or repr(), or str())
a list or dictionary that contains an instance of itself; instead, the
recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
Py_ReprLeave() below. Comparisons of such objects still go beserk,
since this requires a different kind of fix; fortunately, this is a
less common scenario in practice.
Syntax change
-------------
- The raise statement can now be used without arguments, to re-raise
a previously set exception. This should be used after catching an
exception with an except clause only, either in the except clause or
later in the same function.
Import and module handling
--------------------------
- The implementation of import has changed to use a mutex (when
threading is supported). This means that when two threads
simultaneously import the same module, the import statements are
serialized. Recursive imports are not affected.
- Rewrote the finalization code almost completely, to be much more
careful with the order in which modules are destroyed. Destructors
will now generally be able to reference built-in names such as None
without trouble.
- Case-insensitive platforms such as Mac and Windows require the case
of a module's filename to match the case of the module name as
specified in the import statement (see below).
- The code for figuring out the default path now distinguishes between
files, modules, executable files, and directories. When expecting a
module, we also look for the .pyc or .pyo file.
Parser/tokenizer changes
------------------------
- The tokenizer can now warn you when your source code mixes tabs and
spaces for indentation in a manner that depends on how much a tab is
worth in spaces. Use "python -t" or "python -v" to enable this
option. Use "python -tt" to turn the warnings into errors. (See also
tabnanny.py and tabpolice.py below.)
- Return unsigned characters from tok_nextc(), so '\377' isn't
mistaken for an EOF character.
- Fixed two pernicious bugs in the tokenizer that only affected AIX.
One was actually a general bug that was triggered by AIX's smaller I/O
buffer size. The other was a bug in the AIX optimizer's loop
unrolling code; swapping two statements made the problem go away.
Tools, demos and miscellaneous files
------------------------------------
- There's a new version of Misc/python-mode.el (the Emacs mode for
Python) which is much smarter about guessing the indentation style
used in a particular file. Lots of other cool features too!
- There are two new tools in Tools/scripts: tabnanny.py and
tabpolice.py, implementing two different ways of checking whether a
file uses indentation in a way that is sensitive to the interpretation
of a tab. The preferred module is tabnanny.py (by Tim Peters).
- Some new demo programs:
Demo/tkinter/guido/paint.py -- Dave Mitchell
Demo/sockets/unixserver.py -- Piet van Oostrum
- Much better freeze support. The freeze script can now freeze
hierarchical module names (with a corresponding change to import.c),
and has a few extra options (e.g. to suppress freezing specific
modules). It also does much more on Windows NT.
- Version 1.0 of the faq wizard is included (only very small changes
since version 0.9.0).
- New feature for the ftpmirror script: when removing local files
(i.e., only when -r is used), do a recursive delete.
Configuring and building Python
-------------------------------
- Get rid of the check for -linet -- recent Sequent Dynix systems don't
need this any more and apparently it screws up their configuration.
- Some changes because gcc on SGI doesn't support '-all'.
- Changed the build rules to use $(LIBRARY) instead of
-L.. -lpython$(VERSION)
since the latter trips up the SunOS 4.1.x linker (sigh).
- Fix the bug where the '# dgux is broken' comment in the Makefile
tripped over Make on some platforms.
- Changes for AIX: install the python.exp file; properly use
$(srcdir); the makexp_aix script now removes C++ entries of the form
Class::method.
- Deleted some Makefile targets only used by the (long obsolete)
gMakefile hacks.
Extension modules
-----------------
- Performance and threading improvements to the socket and bsddb
modules, by Christopher Lindblad of Infoseek.
- Added operator.__not__ and operator.not_.
- In the thread module, when a thread exits due to an unhandled
exception, don't store the exception information in sys.last_*; it
prevents proper calling of destructors of local variables.
- Fixed a number of small bugs in the cPickle module.
- Changed find() and rfind() in the strop module so that
find("x","",2) returns -1, matching the implementation in string.py.
- In the time module, be more careful with the result of ctime(), and
test for HAVE_MKTIME before usinmg mktime().
- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
modules.
- Added the LOG_SYSLOG constant to the syslog module, if defined.
Standard library modules
------------------------
- All standard library modules have been converted to an indentation
style using either only tabs or only spaces -- never a mixture -- if
they weren't already consistent according to tabnanny. This means
that the new -t option (see above) won't complain about standard
library modules.
- New standard library modules:
threading -- GvR and the thread-sig
Java style thread objects -- USE THIS!!!
getpass -- Piers Lauder
simple utilities to prompt for a password and to
retrieve the current username
imaplib -- Piers Lauder
interface for the IMAP4 protocol
poplib -- David Ascher, Piers Lauder
interface for the POP3 protocol
smtplib -- Dragon De Monsyne
interface for the SMTP protocol
- Some obsolete modules moved to a separate directory (Lib/lib-old)
which is *not* in the default module search path:
Para
addpack
codehack
fmt
lockfile
newdir
ni
rand
tb
- New version of the PCRE code (Perl Compatible Regular Expressions --
the re module and the supporting pcre extension) by Andrew Kuchling.
Incompatible new feature in re.sub(): the handling of escapes in the
replacement string has changed.
- Interface change in the copy module: a __deepcopy__ method is now
called with the memo dictionary as an argument.
- Feature change in the tokenize module: differentiate between NEWLINE
token (an official newline) and NL token (a newline that the grammar
ignores).
- Several bugfixes to the urllib module. It is now truly thread-safe,
and several bugs and a portability problem have been fixed. New
features, all due to Sjoerd Mullender: When creating a temporary file,
it gives it an appropriate suffix. Support the "data:" URL scheme.
The open() method uses the tempcache.
- New version of the xmllib module (this time with a test suite!) by
Sjoerd Mullender.
- Added debugging code to the telnetlib module, to be able to trace
the actual traffic.
- In the rfc822 module, added support for deleting a header (still no
support for adding headers, though). Also fixed a bug where an
illegal address would cause a crash in getrouteaddr(), fixed a
sign reversal in mktime_tz(), and use the local timezone by default
(the latter two due to Bill van Melle).
- The normpath() function in the dospath and ntpath modules no longer
does case normalization -- for that, use the separate function
normcase() (which always existed); normcase() has been sped up and
fixed (it was the cause of a crash in Mark Hammond's installer in
certain locales).
- New command supported by the ftplib module: rmd(); also fixed some
minor bugs.
- The profile module now uses a different timer function by default --
time.clock() is generally better than os.times(). This makes it work
better on Windows NT, too.
- The tempfile module now recovers when os.getcwd() raises an
exception.
- Fixed some bugs in the random module; gauss() was subtly wrong, and
vonmisesvariate() should return a full circle. Courtesy Mike Miller,
Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
- Better default seed in the whrandom module, courtesy Andrew Kuchling.
- Fix slow close() in shelve module.
- The Unix mailbox class in the mailbox module is now more robust when
a line begins with the string "From " but is definitely not the start
of a new message. The pattern used can be changed by overriding a
method or class variable.
- Added a rmtree() function to the copy module.
- Fixed several typos in the pickle module. Also fixed problems when
unpickling in restricted execution environments.
- Added docstrings and fixed a typo in the py_compile and compileall
modules. At Mark Hammond's repeated request, py_compile now append a
newline to the source if it needs one. Both modules support an extra
parameter to specify the purported source filename (to be used in
error messages).
- Some performance tweaks by Jeremy Hylton to the gzip module.
- Fixed a bug in the merge order of dictionaries in the ConfigParser
module. Courtesy Barry Warsaw.
- In the multifile module, support the optional second parameter to
seek() when possible.
- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
urlparse now correctly handles Gopher URLs with query strings.
- Fixed a tiny bug in format_exception() in the traceback module.
Also rewrite tb_lineno() to be compatible with JPython (and not
disturb the current exception!); by Jim Hugunin.
- The httplib module is more robust when servers send a short response
-- courtesy Tim O'Malley.
Tkinter and friends
-------------------
- Various typos and bugs fixed.
- New module Tkdnd implements a drag-and-drop protocol (within one
application only).
- The event_*() widget methods have been restructured slightly -- they
no longer use the default root.
- The interfaces for the bind*() and unbind() widget methods have been
redesigned; the bind*() methods now return the name of the Tcl command
created for the callback, and this can be passed as an optional
argument to unbind() in order to delete the command (normally, such
commands are automatically unbound when the widget is destroyed, but
for some applications this isn't enough).
- Variable objects now have trace methods to interface to Tcl's
variable tracing facilities.
- Image objects now have an optional keyword argument, 'master', to
specify a widget (tree) to which they belong. The image_names() and
image_types() calls are now also widget methods.
- There's a new global call, Tkinter.NoDefaultRoot(), which disables
all use of the default root by the Tkinter library. This is useful to
debug applications that are in the process of being converted from
relying on the default root to explicit specification of the root
widget.
- The 'exit' command is deleted from the Tcl interpreter, since it
provided a loophole by which one could (accidentally) exit the Python
interpreter without invoking any cleanup code.
- Tcl_Finalize() is now registered as a Python low-level exit handle,
so Tcl will be finalized when Python exits.
The Python/C API
----------------
- New function PyThreadState_GetDict() returns a per-thread dictionary
intended for storing thread-local global variables.
- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
dictionary to allow recursive container types to detect recursion in
their repr(), str() and print implementations.
- New function PyObject_Not(x) calculates (not x) according to Python's
standard rules (basically, it negates the outcome PyObject_IsTrue(x).
- New function _PyModule_Clear(), which clears a module's dictionary
carefully without removing the __builtins__ entry. This is implied
when a module object is deallocated (this used to clear the dictionary
completely).
- New function PyImport_ExecCodeModuleEx(), which extends
PyImport_ExecCodeModule() by adding an extra parameter to pass it the
true file.
- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
allow embedded applications to force a different value for PYTHONHOME.
- New global flag Py_FrozenFlag is set when this is a "frozen" Python
binary; it suppresses warnings about not being able to find the
standard library directories.
- New global flag Py_TabcheckFlag is incremented by the -t option and
causes the tokenizer to issue warnings or errors about inconsistent
mixing of tabs and spaces for indentation.
Miscellaneous minor changes and bug fixes
-----------------------------------------
- Improved the error message when an attribute of an attribute-less
object is requested -- include the name of the attribute and the type
of the object in the message.
- Sped up int(), long(), float() a bit.
- Fixed a bug in list.sort() that would occasionally dump core.
- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
when taken to the real power.
- Fixed a number of bugs in the file reading code, at least one of
which could cause a core dump on NT, and one of which would
occasionally cause file.read() to return less than the full contents
of the file.
- Performance hack by Vladimir Marangozov for stack frame creation.
- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
Windows 95/NT
-------------
- The .lib files are now part of the distribution; they are collected
in the subdirectory "libs" of the installation directory.
- The extension modules (.pyd files) are now collected in a separate
subdirectory of the installation directory named "DLLs".
- The case of a module's filename must now match the case of the
module name as specified in the import statement. This is an
experimental feature -- if it turns out to break in too many
situations, it will be removed (or disabled by default) in the future.
It can be disabled on a per-case basis by setting the environment
variable PYTHONCASEOK (to any value).
======================================================================
=====================================
==> Release 1.5 (January 3, 1998) <==
=====================================
From 1.5b2 to 1.5
=================
- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
- Added doc strings to string.py, stropmodule.c, structmodule.c,
thanks to Charles Waldman.
- Many nits fixed in the manuals, thanks to Fred Drake and many others
(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
HTML markup instead of inline GIF images for tables; only two images
are left (for obscure bits of math). The index of the HTML version has
also been much improved. Finally, it is once again possible to
generate an Emacs info file from the library manual (but I don't
commit to supporting this in future versions).
- New module: telnetlib.py (a simple telnet client library).
- New tool: Tools/versioncheck/, by Jack Jansen.
- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
extension modules.
- Many small changes again to Tkinter.py -- mostly bugfixes and adding
missing routines. Thanks to Greg McFarlane for reporting a bunch of
problems and proofreading my fixes.
- The re module and its documentation are up to date with the latest
version released to the string-sig (Dec. 22).
- Stop test_grp.py from failing when the /etc/group file is empty
(yes, this happens!).
- Fix bug in integer conversion (mystrtoul.c) that caused
4294967296==0 to be true!
- The VC++ 4.2 project file should be complete again.
- In tempfile.py, use a better template on NT, and add a new optional
argument "suffix" with default "" to specify a specific extension for
the temporary filename (needed sometimes on NT but perhaps also handy
elsewhere).
- Fixed some bugs in the FAQ wizard, and converted it to use re
instead of regex.
- Fixed a mysteriously undetected error in dlmodule.c (it was using a
totally bogus routine name to raise an exception).
- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
- Hopefully harmless changes to the build process to support shared
libraries on DG/UX. This adds a target to create
libpython$(VERSION).so; however this target is *only* for DG/UX.
- Fixed a bug in the new format string error checking in getargs.c.
- A simple fix for infinite recursion when printing __builtins__:
reset '_' to None before printing and set it to the printed variable
*after* printing (and only when printing is successful).
- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
parent window is not (Skip Montanaro).
- Fixed the two most annoying problems with ftp URLs in
urllib.urlopen(); an empty file now correctly raises an error, and it
is no longer required to explicitly close the returned "file" object
before opening another ftp URL to the same host and directory.
======================================================================
From 1.5b1 to 1.5b2
===================
- Fixed a bug in cPickle.c that caused it to crash right away because
the version string had a different format.
- Changes in pickle.py and cPickle.c: when unpickling an instance of a
class that doesn't define the __getinitargs__() method, the __init__()
constructor is no longer called. This makes a much larger group of
classes picklable by default, but may occasionally change semantics.
To force calling __init__() on unpickling, define a __getinitargs__()
method. Other changes too, in particular cPickle now handles classes
defined in packages correctly. The same change applies to copying
instances with copy.py. The cPickle.c changes and some pickle.py
changes are courtesy Jim Fulton.
- Locale support in he "re" (Perl regular expressions) module. Use
the flag re.L (or re.LOCALE) to enable locale-specific matching
rules for \w and \b. The in-line syntax for this flag is (?L).
- The built-in function isinstance(x, y) now also succeeds when y is
a type object and type(x) is y.
- repr() and str() of class and instance objects now reflect the
package/module in which the class is defined.
- Module "ni" has been removed. (If you really need it, it's been
renamed to "ni1". Let me know if this causes any problems for you.
Package authors are encouraged to write __init__.py files that
support both ni and 1.5 package support, so the same version can be
used with Python 1.4 as well as 1.5.)
- The thread module is now automatically included when threads are
configured. (You must remove it from your existing Setup file,
since it is now in its own Setup.thread file.)
- New command line option "-x" to skip the first line of the script;
handy to make executable scripts on non-Unix platforms.
- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
haven't checked how this affects things, but it should make symbols
in one shared library available to the next one.
- The Windows installer now installs in the "Program Files" folder on
the proper volume by default.
- The Windows configuration adds a new main program, "pythonw", and
registers a new extension, ".pyw" that invokes this. This is a
pstandard Python interpreter that does not pop up a console window;
handy for pure Tkinter applications. All output to the original
stdout and stderr is lost; reading from the original stdin yields
EOF. Also, both python.exe and pythonw.exe now have a pretty icon
(a green snake in a box, courtesy Mark Hammond).
- Lots of improvements to emacs-mode.el again. See Barry's web page:
http://www.python.org/ftp/emacs/pmdetails.html.
- Lots of improvements and additions to the library reference manual;
many by Fred Drake.
- Doc strings for the following modules: rfc822.py, posixpath.py,
ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
- Some more regression testing.
- An optional 4th (maxsplit) argument to strop.replace().
- Fixed handling of maxsplit in string.splitfields().
- Tweaked os.environ so it can be pickled and copied.
- The portability problems caused by indented preprocessor commands
and C++ style comments should be gone now.
- In random.py, added Pareto and Weibull distributions.
- The crypt module is now disabled in Modules/Setup.in by default; it
is rarely needed and causes errors on some systems where users often
don't know how to deal with those.
- Some improvements to the _tkinter build line suggested by Case Roole.
- A full suite of platform specific files for NetBSD 1.x, submitted by
Anders Andersen.
- New Solaris specific header STROPTS.py.
- Moved a confusing occurrence of *shared* from the comments in
Modules/Setup.in (people would enable this one instead of the real
one, and get disappointing results).
- Changed the default mode for directories to be group-writable when
the installation process creates them.
- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
shared libraries for both.
- Support FreeBSD and NetBSD in posixfile.py.
- Support for the "event" command, new in Tk 4.2. By Case Roole.
- Add Tix_SafeInit() support to tkappinit.c.
- Various bugs fixed in "re.py" and "pcre.c".
- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
is set.
- Provide default blocksize for retrbinary in ftplib.py (Skip
Montanaro).
- In NT, pick the username up from different places in user.py (Jeff
Bauer).
- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
- Many small improvements to Jeff Rush' OS/2 support.
- ospath.py is gone; it's been obsolete for so many years now...
- The reference manual is now set up to prepare better HTML (still
using webmaker, alas).
- Add special handling to /Tools/freeze for Python modules that are
imported implicitly by the Python runtime: 'site' and 'exceptions'.
- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
inside <PRE>, by "Scott".
- Added ConfigParser.py, a generic parser for sectioned configuration
files.
- In _localemodule.c, LC_MESSAGES is not always defined; put it
between #ifdefs.
- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
- Demo/scripts/newslist.py: Fix the way the version number is gotten
out of the RCS revision.
- PyArg_Parse[Tuple] now explicitly check for bad characters at the
end of the format string.
- Revamped PC/example_nt to support VC++ 5.x.
- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
after studying the GNU libg++ quicksort. This should be much faster
if there are lots of duplicates, and otherwise at least as good.
- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
uudecode bug where it complaints about trailing garbage is still there
:-( ).
- pickle.py requires integers in text mode to be in decimal notation
(it used to accept octal and hex, even though it would only generate
decimal numbers).
- In string.atof(), don't fail when the "re" module is unavailable.
Plug the ensuing security leak by supplying an empty __builtins__
directory to eval().
- A bunch of small fixes and improvements to Tkinter.py.
- Fixed a buffer overrun in PC/getpathp.c.
======================================================================
From 1.5a4 to 1.5b1
===================
- The Windows NT/95 installer now includes full HTML of all manuals.
It also has a checkbox that lets you decide whether to install the
interpreter and library. The WISE installer script for the installer
is included in the source tree as PC/python15.wse, and so are the
icons used for Python files. The config.c file for the Windows build
is now complete with the pcre module.
- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
evaluated for the prompt.
- The reference manual is brought up to date (more or less -- it still
needs work, e.g. in the area of package import).
- The icons used by latex2html are now included in the Doc
subdirectory (mostly so that tarring up the HTML files can be fully
automated). A simple index.html is also added to Doc (it only works
after you have successfully run latex2html).
- For all you would-be proselytizers out there: a new version of
Misc/BLURB describes Python more concisely, and Misc/comparisons
compares Python to several other languages. Misc/BLURB.WINDOWS
contains a blurb specifically aimed at Windows programmers (by Mark
Hammond).
- A new version of the Python mode for Emacs is included as
Misc/python-mode.el. There are too many new features to list here.
See http://www.python.org/ftp/emacs/pmdetails.html for more info.
- New module fileinput makes iterating over the lines of a list of
files easier. (This still needs some more thinking to make it more
extensible.)
- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
Age C++ compiler. I expect that Jeff will also provide a binary
release for this platform.
- On Linux, the configure script now uses '-Xlinker -export-dynamic'
instead of '-rdynamic' to link the main program so that it exports its
symbols to shared libraries it loads dynamically. I hope this doesn't
break on older Linux versions; it is needed for mklinux and appears to
work on Linux 2.0.30.
- Some Tkinter resstructuring: the geometry methods that apply to a
master are now properly usable on toplevel master widgets. There's a
new (internal) widget class, BaseWidget. New, longer "official" names
for the geometry manager methods have been added,
e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
shorter names still work, and where there's ambiguity, pack wins over
place wins over grid. Also, the bind_class method now returns its
value.
- New, RFC-822 conformant parsing of email addresses and address lists
in the rfc822 module, courtesy Ben Escoto.
- New, revamped tkappinit.c with support for popular packages (PIL,
TIX, BLT, TOGL). For the last three, you need to execute the Tcl
command "load {} Tix" (or Blt, or Togl) to gain access to them.
The Modules/Setup line for the _tkinter module has been rewritten
using the cool line-breaking feature of most Bourne shells.
- New socket method connect_ex() returns the error code from connect()
instead of raising an exception on errors; this makes the logic
required for asynchronous connects simpler and more efficient.
- New "locale" module with (still experimental) interface to the
standard C library locale interface, courtesy Martin von Löwis. This
does not repeat my mistake in 1.5a4 of always calling
setlocale(LC_ALL, ""). In fact, we've pretty much decided that
Python's standard numerical formatting operations should always use
the conventions for the C locale; the locale module contains utility
functions to format numbers according to the user specified locale.
(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
"C") after locale-changing calls.) See the library manual. (Alas, the
promised changes to the "re" module for locale support have not been
materialized yet. If you care, volunteer!)
- Memory leak plugged in Py_BuildValue when building a dictionary.
- Shared modules can now live inside packages (hierarchical module
namespaces). No changes to the shared module itself are needed.
- Improved policy for __builtins__: this is a module in __main__ and a
dictionary everywhere else.
- Python no longer catches SIGHUP and SIGTERM by default. This was
impossible to get right in the light of thread contexts. If you want
your program to clean up when a signal happens, use the signal module
to set up your own signal handler.
- New Python/C API PyNumber_CoerceEx() does not return an exception
when no coercion is possible. This is used to fix a problem where
comparing incompatible numbers for equality would raise an exception
rather than return false as in Python 1.4 -- it once again will return
false.
- The errno module is changed again -- the table of error messages
(errorstr) is removed. Instead, you can use os.strerror(). This
removes redundance and a potential locale dependency.
- New module xmllib, to parse XML files. By Sjoerd Mullender.
- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
It resets the signal module's notion of what the current process ID
and thread are, so that signal handlers will work after (and across)
calls to os.fork().
- Fixed most occurrences of fatal errors due to missing thread state.
- For vgrind (a flexible source pretty printer) fans, there's a simple
Python definition in Misc/vgrindefs, courtesy Neale Pickett.
- Fixed memory leak in exec statement.
- The test.pystone module has a new function, pystones(loops=LOOPS),
which returns a (benchtime, stones) tuple. The main() function now
calls this and prints the report.
- Package directories now *require* the presence of an __init__.py (or
__init__.pyc) file before they are considered as packages. This is
done to prevent accidental subdirectories with common names from
overriding modules with the same name.
- Fixed some strange exceptions in __del__ methods in library modules
(e.g. urllib). This happens because the built-in names are already
deleted by the time __del__ is called. The solution (a hack, but it
works) is to set some instance variables to 0 instead of None.
- The table of built-in module initializers is replaced by a pointer
variable. This makes it possible to switch to a different table at
run time, e.g. when a collection of modules is loaded from a shared
library. (No example code of how to do this is given, but it is
possible.) The table is still there of course, its name prefixed with
an underscore and used to initialize the pointer.
- The warning about a thread still having a frame now only happens in
verbose mode.
- Change the signal finalization so that it also resets the signal
handlers. After this has been called, our signal handlers are no
longer active!
- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
literals. There's now also a test fort this module.
- The copy module now also uses __dict__.update(state) instead of
going through individual attribute assignments, for class instances
without a __setstate__ method.
- New module reconvert translates old-style (regex module) regular
expressions to new-style (re module, Perl-style) regular expressions.
- Most modules that used to use the regex module now use the re
module. The grep module has a new pgrep() function which uses
Perl-style regular expressions.
- The (very old, backwards compatibility) regexp.py module has been
deleted.
- Restricted execution (rexec): added the pcre module (support for the
re module) to the list of trusted extension modules.
- New version of Jim Fulton's CObject object type, adds
PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
- Some patches to Lee Busby's fpectl mods that accidentally didn't
make it into 1.5a4.
- In the string module, add an optional 4th argument to count(),
matching find() etc.
- Patch for the nntplib module by Charles Waldman to add optional user
and password arguments to NNTP.__init__(), for nntp servers that need
them.
- The str() function for class objects now returns
"modulename.classname" instead of returning the same as repr().
- The parsing of \xXX escapes no longer relies on sscanf().
- The "sharedmodules" subdirectory of the installation is renamed to
"lib-dynload". (You may have to edit your Modules/Setup file to fix
this in an existing installation!)
- Fixed Don Beaudry's mess-up with the OPT test in the configure
script. Certain SGI platforms will still issue a warning for each
compile; there's not much I can do about this since the compiler's
exit status doesn't indicate that I was using an obsolete option.
- Fixed Barry's mess-up with {}.get(), and added test cases for it.
- Shared libraries didn't quite work under AIX because of the change
in status of the GNU readline interface. Fix due to by Vladimir
Marangozov.
======================================================================
From 1.5a3 to 1.5a4
===================
- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
feature; better install instructions; removed faqmain.py (which was an
older version).
- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
about the treatment of lines starting with '.'. Added a minimal test
function.
- struct module: ignore most whitespace in format strings.
- urllib.py: close the socket and temp file in URLopener.retrieve() so
that multiple retrievals using the same connection work.
- All standard exceptions are now classes by default; use -X to make
them strings (for backward compatibility only).
- There's a new standard exception hierarchy, defined in the standard
library module exceptions.py (which you never need to import
explicitly). See
http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
more info.
- Three new C API functions:
- int PyErr_GivenExceptionMatches(obj1, obj2)
Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
instance of type obj2, or of a class derived from obj2
- int PyErr_ExceptionMatches(obj)
Higher level wrapper around PyErr_GivenExceptionMatches() which uses
PyErr_Occurred() as obj1. This will be the more commonly called
function.
- void PyErr_NormalizeException(typeptr, valptr, tbptr)
Normalizes exceptions, and places the normalized values in the
arguments. If type is not a class, this does nothing. If type is a
class, then it makes sure that value is an instance of the class by:
1. if instance is of the type, or a class derived from type, it does
nothing.
2. otherwise it instantiates the class, using the value as an
argument. If value is None, it uses an empty arg tuple, and if
the value is a tuple, it uses just that.
- Another new C API function: PyErr_NewException() creates a new
exception class derived from Exception; when -X is given, it creates a
new string exception.
- core interpreter: remove the distinction between tuple and list
unpacking; allow an arbitrary sequence on the right hand side of any
unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
thing, which should really be called UNPACK_SEQUENCE.)
- classes: Allow assignments to an instance's __dict__ or __class__,
so you can change ivars (including shared ivars -- shock horror) and
change classes dynamically. Also make the check on read-only
attributes of classes less draconic -- only the specials names
__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
assigned.
- Two new built-in functions: issubclass() and isinstance(). Both
take classes as their second arguments. The former takes a class as
the first argument and returns true iff first is second, or is a
subclass of second. The latter takes any object as the first argument
and returns true iff first is an instance of the second, or any
subclass of second.
- configure: Added configuration tests for presence of alarm(),
pause(), and getpwent().
- Doc/Makefile: changed latex2html targets.
- classes: Reverse the search order for the Don Beaudry hook so that
the first class with an applicable hook wins. Makes more sense.
- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
now legal to call these more than once. The first call to
Py_Initialize() initializes, the first call to Py_Finalize()
finalizes. There's also a new API, Py_IsInitialized() which checks
whether we are already initialized (in case you want to leave things
as they were).
- Completely disable the declarations for malloc(), realloc() and
free(). Any 90's C compiler has these in header files, and the tests
to decide whether to suppress the declarations kept failing on some
platforms.
- *Before* (instead of after) signalmodule.o is added, remove both
intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
ld on various systems.
- Added reop to PC/config.c
- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
Removed outdated HP-UX comments from README. Added Cray T3E comments.
- Various renames of statically defined functions that had name
conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
roundup (sys/types.h).
- urllib.py: Interpret three slashes in file: URL as local file (for
Netscape on Windows/Mac).
- copy.py: Make sure the objects returned by __getinitargs__() are
kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
easily reproducible because it requires a later call to
__getinitargs__() to return a tuple that happens to be allocated at
the same address.)
- Added definition of AR to toplevel Makefile. Renamed @buildno temp
file to buildno1.
- Moved Include/assert.h to Parser/assert.h, which seems to be the
only place where it's needed.
- Tweaked the dictionary lookup code again for some more speed
(Vladimir Marangozov).
- NT build: Changed the way python15.lib is included in the other
projects. Per Mark Hammond's suggestion, add it to the extra libs in
Settings instead of to the project's source files.
- regrtest.py: Change default verbosity so that there are only three
levels left: -q, default and -v. In default mode, the name of each
test is now printed. -v is the same as the old -vv. -q is more quiet
than the old default mode.
- Removed the old FAQ from the distribution. You now have to get it
from the web!
- Removed the PC/make_nt.in file from the distribution; it is no
longer needed.
- Changed the build sequence so that shared modules are built last.
This fixes things for AIX and doesn't hurt elsewhere.
- Improved test for GNU MP v1 in mpzmodule.c
- fileobject.c: ftell() on Linux discards all buffered data; changed
read() code to use lseek() instead to get the same effect
- configure.in, configure, importdl.c: NeXT sharedlib fixes
- tupleobject.c: PyTuple_SetItem asserts refcnt==1
- resource.c: Different strategy regarding whether to declare
getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
conflicting decls in its headers. Choice: only declare the return
type, not the argument prototype, and not on Linux.
- importdl.c, configure*: set sharedlib extensions properly for NeXT
- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
fixed; moved addition of PURIFY to LINKCC to configure
- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
added to shup up various compilers.
- _tkinter.c: removed buggy mac #ifndef
- Doc: various Mac documentation changes, added docs for 'ic' module
- PC/make_nt.in: deleted
- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
"")
- test_rotor.py: print b -> print `b`
- Tkinter.py: (tagOrId) -> (tagOrId,)
- Tkinter.py: the Tk class now also has a configure() method and
friends (they have been moved to the Misc class to accomplish this).
- dict.get(key[, default]) returns dict[key] if it exists, or default
if it doesn't. The default defaults to None. This is quicker for
some applications than using either has_key() or try:...except
KeyError:....
- Tools/webchecker/: some small changes to webchecker.py; added
websucker.py (a simple web site mirroring script).
- Dictionary objects now have a get() method (also in UserDict.py).
dict.get(key, default) returns dict[key] if it exists and default
otherwise; default defaults to None.
- Tools/scripts/logmerge.py: print the author, too.
- Changes to import: support for "import a.b.c" is now built in. See
http://grail.cnri.reston.va.us/python/essays/packages.html
for more info. Most important deviations from "ni.py": __init__.py is
executed in the package's namespace instead of as a submodule; and
there's no support for "__" or "__domain__". Note that "ni.py" is not
changed to match this -- it is simply declared obsolete (while at the
same time, it is documented...:-( ).
Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
for an example implementation of hierarchical module import written in
Python).
- More changes to import: the site.py module is now imported by
default when Python is initialized; use -S to disable it. The site.py
module extends the path with several more directories: site-packages
inside the lib/python1.5/ directory, site-python in the lib/
directory, and pathnames mentioned in *.pth files found in either of
those directories. See
http://grail.cnri.reston.va.us/python/essays/packages.html
for more info.
- Changes to standard library subdirectory names: those subdirectories
that are not packages have been renamed with a hyphen in their name,
e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
The test suite is now a package -- to run a test, you must now use
"import test.test_foo".
- A completely new re.py module is provided (thanks to Andrew
Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
"pcre" re compiler and engine. For a while, the "old" re.py (which
was new in 1.5a3!) will be kept around as re1.py. The "old" regex
module and underlying parser and engine are still present -- while
regex is now officially obsolete, it will probably take several major
release cycles before it can be removed.
- The posix module now has a strerror() function which translates an
error code to a string.
- The emacs.py module (which was long obsolete) has been removed.
- The universal makefile Misc/Makefile.pre.in now features an
"install" target. By default, installed shared libraries go into
$exec_prefix/lib/python$VERSION/site-packages/.
- The install-sh script is installed with the other configuration
specific files (in the config/ subdirectory).
- It turns out whatsound.py and sndhdr.py were identical modules.
Since there's also an imghdr.py file, I propose to make sndhdr.py the
official one. For compatibility, whatsound.py imports * from
sndhdr.py.
- Class objects have a new attribute, __module__, giving the name of
the module in which they were declared. This is useful for pickle and
for printing the full name of a class exception.
- Many extension modules no longer issue a fatal error when their
initialization fails; the importing code now checks whether an error
occurred during module initialization, and correctly propagates the
exception to the import statement.
- Most extension modules now raise class-based exceptions (except when
-X is used).
- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
thread state -- just don't manipulate the lock if it isn't there.
- Fixed a bug in Python/getopt.c that made it do the wrong thing when
an option was a single '-'. Thanks to Andrew Kuchling.
- New module mimetypes.py will guess a MIME type from a filename's
extension.
- Windows: the DLL version is now settable via a resource rather than
being hardcoded. This can be used for "branding" a binary Python
distribution.
- urllib.py is now threadsafe -- it now uses re instead of regex, and
sys.exc_info() instead of sys.exc_{type,value}.
- Many other library modules that used to use
sys.exc_{type,value,traceback} are now more thread-safe by virtue of
using sys.exc_info().
- The functions in popen2 have an optional buffer size parameter.
Also, the command argument can now be either a string (passed to the
shell) or a list of arguments (passed directly to execv).
- Alas, the thread support for _tkinter released with 1.5a3 didn't
work. It's been rewritten. The bad news is that it now requires a
modified version of a file in the standard Tcl distribution, which you
must compile with a -I option pointing to the standard Tcl source
tree. For this reason, the thread support is disabled by default.
- The errno extension module adds two tables: errorcode maps errno
numbers to errno names (e.g. EINTR), and errorstr maps them to
message strings. (The latter is redundant because the new call
posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
- The readline extension module now provides some interfaces to
internal readline routines that make it possible to write a completer
in Python. An example completer, rlcompleter.py, is provided.
When completing a simple identifier, it completes keywords,
built-ins and globals in __main__; when completing
NAME.NAME..., it evaluates (!) the expression up to the last
dot and completes its attributes.
It's very cool to do "import string" type "string.", hit the
completion key (twice), and see the list of names defined by
the string module!
Tip: to use the tab key as the completion key, call
readline.parse_and_bind("tab: complete")
- The traceback.py module has a new function tb_lineno() by Marc-Andre
Lemburg which extracts the line number from the linenumber table in
the code object. Apparently the traceback object doesn't contain the
right linenumber when -O is used. Rather than guessing whether -O is
on or off, the module itself uses tb_lineno() unconditionally.
- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
to tag_bind() so it works again.
- The pystone script is now a standard library module. Example use:
"import test.pystone; test.pystone.main()".
- The import of the readline module in interactive mode is now also
attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
Lemburg, who asked for this. :-)
- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
Mullender, to be closer to the standard. This fixes the getaddr()
method. Unfortunately, getaddrlist() is as broken as ever, since it
splits on commas without regard for RFC 822 quoting conventions.
- pprint.py: correctly emit trailing "," in singleton tuples.
- _tkinter.c: export names for its type objects, TkappType and
TkttType.
- pickle.py: use __module__ when defined; fix a particularly hard to
reproduce bug that confuses the memo when temporary objects are
returned by custom pickling interfaces; and a semantic change: when
unpickling the instance variables of an instance, use
inst.__dict__.update(value) instead of a for loop with setattr() over
the value.keys(). This is more consistent (the pickling doesn't use
getattr() either but pickles inst.__dict__) and avoids problems with
instances that have a __setattr__ hook. But it *is* a semantic change
(because the setattr hook is no longer used). So beware!
- config.h is now installed (at last) in
$exec_prefix/include/python1.5/. For most sites, this means that it
is actually in $prefix/include/python1.5/, with all the other Python
include files, since $prefix and $exec_prefix are the same by
default.
- The imp module now supports parts of the functionality to implement
import of hierarchical module names. It now supports find_module()
and load_module() for all types of modules. Docstrings have been
added for those functions in the built-in imp module that are still
relevant (some old interfaces are obsolete). For a sample
implementation of hierarchical module import in Python, see the new
library module knee.py.
- The % operator on string objects now allows arbitrary nested parens
in a %(...)X style format. (Brad Howes)
- Reverse the order in which Setup and Setup.local are passed to the
makesetup script. This allows variable definitions in Setup.local to
override definitions in Setup. (But you'll still have to edit Setup
if you want to disable modules that are enabled by default, or if such
modules need non-standard options.)
- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
is like PyImport_ImporModule(name) but receives the globals and locals
dict and the fromlist arguments as well. (The name is a char*; the
others are PyObject*s).
- The 'p' format in the struct extension module alloded to above is
new in 1.5a4.
- The types.py module now uses try-except in a few places to make it
more likely that it can be imported in restricted mode. Some type
names are undefined in that case, e.g. CodeType (inaccessible),
FileType (not always accessible), and TracebackType and FrameType
(inaccessible).
- In urllib.py: added separate administration of temporary files
created y URLopener.retrieve() so cleanup() can properly remove them.
The old code removed everything in tempcache which was a bad idea if
the user had passed a non-temp file into it. Also, in basejoin(),
interpret relative paths starting in "../". This is necessary if the
server uses symbolic links.
- The Windows build procedure and project files are now based on
Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
directory. It is much more robust, and properly builds separate Debug
and Release versions. (The installer will be added shortly.)
- Added casts and changed some return types in regexpr.c to avoid
compiler warnings or errors on some platforms.
- The AIX build tools for shared libraries now supports VPATH. (Donn
Cave)
- By default, disable the "portable" multimedia modules audioop,
imageop, and rgbimg, since they don't work on 64-bit platforms.
- Fixed a nasty bug in cStringIO.c when code was actually using the
close() method (the destructors would try to free certain fields a
second time).
- For those who think they need it, there's a "user.py" module. This
is *not* imported by default, but can be imported to run user-specific
setup commands, ~/.pythonrc.py.
- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
Vladimir Marangozov, and others.
- Added os.altsep; this is '/' on DOS/Windows, and None on systems
with a sane filename syntax.
- os.py: Write out the dynamic OS choice, to avoid exec statements.
Adding support for a new OS is now a bit more work, but I bet that
'dos' or 'nt' will cover most situations...
- The obsolete exception AccessError is now really gone.
- Tools/faqwiz/: New installation instructions show how to maintain
multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
Added instructions to bootstrap script, too. Version bumped to 0.8.1.
Added <html>...</html> feature suggested by Skip Montanaro. Added
leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
default SRCDIR.
- Documentation for the relatively new modules "keyword" and "symbol"
has been added (to the end of the section on the parser extension
module).
- In module bisect.py, but functions have two optional argument 'lo'
and 'hi' which allow you to specify a subsequence of the array to
operate on.
- In ftplib.py, changed most methods to return their status (even when
it is always "200 OK") rather than swallowing it.
- main() now calls setlocale(LC_ALL, ""), if setlocale() and
<locale.h> are defined.
- Changes to configure.in, the configure script, and both
Makefile.pre.in files, to support SGI's SGI_ABI platform selection
environment variable.
======================================================================
From 1.4 to 1.5a3
=================
Security
--------
- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
please use the new version. The old version has a huge security leak.
Miscellaneous
-------------
- Because of various (small) incompatible changes in the Python
bytecode interpreter, the magic number for .pyc files has changed
again.
- The default module search path is now much saner. Both on Unix and
Windows, it is essentially derived from the path to the executable
(which can be overridden by setting the environment variable
$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
front of the default path, like in Unix (instead of overriding the
default path). On Windows, the directory containing the executable is
added to the end of the path.
- A new version of python-mode.el for Emacs has been included. Also,
a new file ccpy-style.el has been added to configure Emacs cc-mode for
the preferred style in Python C sources.
- On Unix, when using sys.argv[0] to insert the script directory in
front of sys.path, expand a symbolic link. You can now install a
program in a private directory and have a symbolic link to it in a
public bin directory, and it will put the private directory in the
module search path. Note that the symlink is expanded in sys.path[0]
but not in sys.argv[0], so you can still tell the name by which you
were invoked.
- It is now recommended to use ``#!/usr/bin/env python'' instead of
``#!/usr/local/bin/python'' at the start of executable scripts, except
for CGI scripts. It has been determined that the use of /usr/bin/env
is more portable than that of /usr/local/bin/python -- scripts almost
never have to be edited when the Python interpreter lives in a
non-standard place. Note that this doesn't work for CGI scripts since
the python executable often doesn't live in the HTTP server's default
search path.
- The silly -s command line option and the corresponding
PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
flag in the Python/C API) are gone.
- Most problems on 64-bit platforms should now be fixed. Andrew
Kuchling helped. Some uncommon extension modules are still not
clean (image and audio ops?).
- Fixed a bug where multiple anonymous tuple arguments would be mixed up
when using the debugger or profiler (reported by Just van Rossum).
The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
would print the wrong value when run under the debugger or profiler.
- The hacks that the dictionary implementation used to speed up
repeated lookups of the same C string were removed; these were a
source of subtle problems and don't seem to serve much of a purpose
any longer.
- All traces of support for the long dead access statement have been
removed from the sources.
- Plugged the two-byte memory leak in the tokenizer when reading an
interactive EOF.
- There's a -O option to the interpreter that removes SET_LINENO
instructions and assert statements (see below); it uses and produces
.pyo files instead of .pyc files. The speedup is only a few percent
in most cases. The line numbers are still available in the .pyo file,
as a separate table (which is also available in .pyc files). However,
the removal of the SET_LINENO instructions means that the debugger
(pdb) can't set breakpoints on lines in -O mode. The traceback module
contains a function to extract a line number from the code object
referenced in a traceback object. In the future it should be possible
to write external bytecode optimizers that create better optimized
.pyo files, and there should be more control over optimization;
consider the -O option a "teaser". Without -O, the assert statement
actually generates code that first checks __debug__; if this variable
is false, the assertion is not checked. __debug__ is a built-in
variable whose value is initialized to track the -O flag (it's true
iff -O is not specified). With -O, no code is generated for assert
statements, nor for code of the form ``if __debug__: <something>''.
Sorry, no further constant folding happens.
Performance
-----------
- It's much faster (almost twice for pystone.py -- see
Tools/scripts). See the entry on string interning below.
- Some speedup by using separate free lists for method objects (both
the C and the Python variety) and for floating point numbers.
- Big speedup by allocating frame objects with a single malloc() call.
The Python/C API for frames is changed (you shouldn't be using this
anyway).
- Significant speedup by inlining some common opcodes for common operand
types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
- Small speedup by reordering the method tables of some common
objects (e.g. list.append is now first).
- Big optimization to the read() method of file objects. A read()
without arguments now attempts to use fstat to allocate a buffer of
the right size; for pipes and sockets, it will fall back to doubling
the buffer size. While that the improvement is real on all systems,
it is most dramatic on Windows.
Documentation
-------------
- Many new pieces of library documentation were contributed, mostly by
Andrew Kuchling. Even cmath is now documented! There's also a
chapter of the library manual, "libundoc.tex", which provides a
listing of all undocumented modules, plus their status (e.g. internal,
obsolete, or in need of documentation). Also contributions by Sue
Williams, Skip Montanaro, and some module authors who succumbed to
pressure to document their own contributed modules :-). Note that
printing the documentation now kills fewer trees -- the margins have
been reduced.
- I have started documenting the Python/C API. Unfortunately this project
hasn't been completed yet. It will be complete before the final release of
Python 1.5, though. At the moment, it's better to read the LaTeX source
than to attempt to run it through LaTeX and print the resulting dvi file.
- The posix module (and hence os.py) now has doc strings! Thanks to Neil
Schemenauer. I received a few other contributions of doc strings. In most
other places, doc strings are still wishful thinking...
Language changes
----------------
- Private variables with leading double underscore are now a permanent
feature of the language. (These were experimental in release 1.4. I have
favorable experience using them; I can't label them "experimental"
forever.)
- There's new string literal syntax for "raw strings". Prefixing a string
literal with the letter r (or R) disables all escape processing in the
string; for example, r'\n' is a two-character string consisting of a
backslash followed by the letter n. This combines with all forms of string
quotes; it is actually useful for triple quoted doc strings which might
contain references to \n or \t. An embedded quote prefixed with a
backslash does not terminate the string, but the backslash is still
included in the string; for example, r'\'' is a two-character string
consisting of a backslash and a quote. (Raw strings are also
affectionately known as Robin strings, after their inventor, Robin
Friedrich.)
- There's a simple assert statement, and a new exception
AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
not foo > 0: raise AssertionError''. Sorry, the text of the asserted
condition is not available; it would be too complicated to generate
code for this (since the code is generated from a parse tree).
However, the text is displayed as part of the traceback!
- The raise statement has a new feature: when using "raise SomeClass,
somevalue" where somevalue is not an instance of SomeClass, it
instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
instance of a *derived* class of SomeClass, the exception class raised
is set to somevalue.__class__, and SomeClass is ignored after that.
- Duplicate keyword arguments are now detected at compile time;
f(a=1,a=2) is now a syntax error.
Changes to built-in features
----------------------------
- There's a new exception FloatingPointError (used only by Lee Busby's
patches to catch floating point exceptions, at the moment).
- The obsolete exception ConflictError (presumably used by the long
obsolete access statement) has been deleted.
- There's a new function sys.exc_info() which returns the tuple
(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
- There's a new variable sys.executable, pointing to the executable file
for the Python interpreter.
- The sort() methods for lists no longer uses the C library qsort(); I
wrote my own quicksort implementation, with lots of help (in the form
of a kind of competition) from Tim Peters. This solves a bug in
dictionary comparisons on some Solaris versions when Python is built
with threads, and makes sorting lists even faster.
- The semantics of comparing two dictionaries have changed, to make
comparison of unequal dictionaries faster. A shorter dictionary is
always considered smaller than a larger dictionary. For dictionaries
of the same size, the smallest differing element determines the
outcome (which yields the same results as before in this case, without
explicit sorting). Thanks to Aaron Watters for suggesting something
like this.
- The semantics of try-except have changed subtly so that calling a
function in an exception handler that itself raises and catches an
exception no longer overwrites the sys.exc_* variables. This also
alleviates the problem that objects referenced in a stack frame that
caught an exception are kept alive until another exception is caught
-- the sys.exc_* variables are restored to their previous value when
returning from a function that caught an exception.
- There's a new "buffer" interface. Certain objects (e.g. strings and
arrays) now support the "buffer" protocol. Buffer objects are acceptable
whenever formerly a string was required for a write operation; mutable
buffer objects can be the target of a read operation using the call
f.readinto(buffer). A cool feature is that regular expression matching now
also work on array objects. Contribution by Jack Jansen. (Needs
documentation.)
- String interning: dictionary lookups are faster when the lookup
string object is the same object as the key in the dictionary, not
just a string with the same value. This is done by having a pool of
"interned" strings. Most names generated by the interpreter are now
automatically interned, and there's a new built-in function intern(s)
that returns the interned version of a string. Interned strings are
not a different object type, and interning is totally optional, but by
interning most keys a speedup of about 15% was obtained for the
pystone benchmark.
- Dictionary objects have several new methods; clear() and copy() have
the obvious semantics, while update(d) merges the contents of another
dictionary d into this one, overriding existing keys. The dictionary
implementation file is now called dictobject.c rather than the
confusing mappingobject.c.
- The intrinsic function dir() is much smarter; it looks in __dict__,
__members__ and __methods__.
- The intrinsic functions int(), long() and float() can now take a
string argument and then do the same thing as string.atoi(),
string.atol(), and string.atof(). No second 'base' argument is
allowed, and complex() does not take a string (nobody cared enough).
- When a module is deleted, its globals are now deleted in two phases.
In the first phase, all variables whose name begins with exactly one
underscore are replaced by None; in the second phase, all variables
are deleted. This makes it possible to have global objects whose
destructors depend on other globals. The deletion order within each
phase is still random.
- It is no longer an error for a function to be called without a
global variable __builtins__ -- an empty directory will be provided
by default.
- Guido's corollary to the "Don Beaudry hook": it is now possible to
do metaprogramming by using an instance as a base class. Not for the
faint of heart; and undocumented as yet, but basically if a base class
is an instance, its class will be instantiated to create the new
class. Jim Fulton will love it -- it also works with instances of his
"extension classes", since it is triggered by the presence of a
__class__ attribute on the purported base class. See
Demo/metaclasses/index.html for an explanation and see that directory
for examples.
- Another change is that the Don Beaudry hook is now invoked when
*any* base class is special. (Up to 1.5a3, the *last* special base
class is used; in 1.5a4, the more rational choice of the *first*
special base class is used.)
- New optional parameter to the readlines() method of file objects.
This indicates the number of bytes to read (the actual number of bytes
read will be somewhat larger due to buffering reading until the end of
the line). Some optimizations have also been made to speed it up (but
not as much as read()).
- Complex numbers no longer have the ".conj" pseudo attribute; use
z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
now *do* support the __members__ and __methods__ special attributes.
- The complex() function now looks for a __complex__() method on class
instances before giving up.
- Long integers now support arbitrary shift counts, so you can now
write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
shift count for this.)
- The hex() and oct() functions have been changed so that for regular
integers, they never emit a minus sign. For example, on a 32-bit
machine, oct(-1) now returns '037777777777' and hex(-1) returns
'0xffffffff'. While this may seem inconsistent, it is much more
useful. (For long integers, a minus sign is used as before, to fit
the result in memory :-)
- The hash() function computes better hashes for several data types,
including strings, floating point numbers, and complex numbers.
New extension modules
---------------------
- New extension modules cStringIO.c and cPickle.c, written by Jim
Fulton and other folks at Digital Creations. These are much more
efficient than their Python counterparts StringIO.py and pickle.py,
but don't support subclassing. cPickle.c clocks up to 1000 times
faster than pickle.py; cStringIO.c's improvement is less dramatic but
still significant.
- New extension module zlibmodule.c, interfacing to the free zlib
library (gzip compatible compression). There's also a module gzip.py
which provides a higher level interface. Written by Andrew Kuchling
and Jeremy Hylton.
- New module readline; see the "miscellaneous" section above.
- New Unix extension module resource.c, by Jeremy Hylton, provides
access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
related symbolic constants.
- New extension puremodule.c, by Barry Warsaw, which interfaces to the
Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
possible to enable Purify by simply setting the PURIFY Makefile
variable in the Modules/Setup file.
Changes in extension modules
----------------------------
- The struct extension module has several new features to control byte
order and word size. It supports reading and writing IEEE floats even
on platforms where this is not the native format. It uses uppercase
format codes for unsigned integers of various sizes (always using
Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
and 'p' for "Pascal strings" (with a leading length byte, included in
the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
big-endian data and '<' forces little-endian data; these also select
standard data sizes and disable automatic alignment (use pad bytes as
needed).
- The array module supports uppercase format codes for unsigned data
formats (like the struct module).
- The fcntl extension module now exports the needed symbolic
constants. (Formerly these were in FCNTL.py which was not available
or correct for all platforms.)
- The extension modules dbm, gdbm and bsddb now check that the
database is still open before making any new calls.
- The dbhash module is no more. Use bsddb instead. (There's a third
party interface for the BSD 2.x code somewhere on the web; support for
bsddb will be deprecated.)
- The gdbm module now supports a sync() method.
- The socket module now has some new functions: getprotobyname(), and
the set {ntoh,hton}{s,l}().
- Various modules now export their type object: socket.SocketType,
array.ArrayType.
- The socket module's accept() method now returns unknown addresses as
a tuple rather than raising an exception. (This can happen in
promiscuous mode.) Theres' also a new function getprotobyname().
- The pthread support for the thread module now works on most platforms.
- STDWIN is now officially obsolete. Support for it will eventually
be removed from the distribution.
- The binascii extension module is now hopefully fully debugged.
(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
received.)
- audioop.c: added a ratecv() function; better handling of overflow in
add().
- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
Windows, also O_TEXT and O_BINARY. The 'error' variable (the
exception is raises) is renamed -- its string value is now "os.error",
so newbies don't believe they have to import posix (or nt) to catch
it when they see os.error reported as posix.error. The execve()
function now accepts any mapping object for the environment.
- A new version of the al (audio library) module for SGI was
contributed by Sjoerd Mullender.
- The regex module has a new function get_syntax() which retrieves the
syntax setting set by set_syntax(). The code was also sanitized,
removing worries about unclean error handling. See also below for its
successor, re.py.
- The "new" module (which creates new objects of various types) once
again has a fully functioning new.function() method. Dangerous as
ever! Also, new.code() has several new arguments.
- A problem has been fixed in the rotor module: on systems with signed
characters, rotor-encoded data was not portable when the key contained
8-bit characters. Also, setkey() now requires its argument rather
than having broken code to default it.
- The sys.builtin_module_names variable is now a tuple. Another new
variables in sys is sys.executable (the full path to the Python
binary, if known).
- The specs for time.strftime() have undergone some revisions. It
appears that not all format characters are supported in the same way
on all platforms. Rather than reimplement it, we note these
differences in the documentation, and emphasize the shared set of
features. There's also a thorough test set (that occasionally finds
problems in the C library implementation, e.g. on some Linuxes),
thanks to Skip Montanaro.
- The nis module seems broken when used with NIS+; unfortunately
nobody knows how to fix it. It should still work with old NIS.
New library modules
-------------------
- New (still experimental) Perl-style regular expression module,
re.py, which uses a new interface for matching as well as a new
syntax; the new interface avoids the thread-unsafety of the regex
interface. This comes with a helper extension reopmodule.c and vastly
rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
Peters, and Andrew Kuchling. See the documentation libre.tex. In
1.5, the old regex module is still fully supported; in the future, it
will become obsolete.
- New module gzip.py; see zlib above.
- New module keyword.py exports knowledge about Python's built-in
keywords. (New version by Ka-Ping Yee.)
- New module pprint.py (with documentation) which supports
pretty-printing of lists, tuples, & dictionaries recursively. By Fred
Drake.
- New module code.py. The function code.compile_command() can
determine whether an interactively entered command is complete or not,
distinguishing incomplete from invalid input. (XXX Unfortunately,
this seems broken at this moment, and I don't have the time to fix
it. It's probably better to add an explicit interface to the parser
for this.)
- There is now a library module xdrlib.py which can read and write the
XDR data format as used by Sun RPC, for example. It uses the struct
module.
Changes in library modules
--------------------------
- Module codehack.py is now completely obsolete.
- The pickle.py module has been updated to make it compatible with the
new binary format that cPickle.c produces. By default it produces the
old all-ASCII format compatible with the old pickle.py, still much
faster than pickle.py; it will read both formats automatically. A few
other updates have been made.
- A new helper module, copy_reg.py, is provided to register extensions
to the pickling code.
- Revamped module tokenize.py is much more accurate and has an
interface that makes it a breeze to write code to colorize Python
source code. Contributed by Ka-Ping Yee.
- In ihooks.py, ModuleLoader.load_module() now closes the file under
all circumstances.
- The tempfile.py module has a new class, TemporaryFile, which creates
an open temporary file that will be deleted automatically when
closed. This works on Windows and MacOS as well as on Unix. (Jim
Fulton.)
- Changes to the cgi.py module: Most imports are now done at the
top of the module, which provides a speedup when using ni (Jim
Fulton). The problem with file upload to a Windows platform is solved
by using the new tempfile.TemporaryFile class; temporary files are now
always opened in binary mode (Jim Fulton). The cgi.escape() function
now takes an optional flag argument that quotes '"' to '"'. It
is now possible to invoke cgi.py from a command line script, to test
cgi scripts more easily outside an http server. There's an optional
limit to the size of uploads to POST (Skip Montanaro). Added a
'strict_parsing' option to all parsing functions (Jim Fulton). The
function parse_qs() now uses urllib.unquote() on the name as well as
the value of fields (Clarence Gardner). The FieldStorage class now
has a __len__() method.
- httplib.py: the socket object is no longer closed; all HTTP/1.*
responses are now accepted; and it is now thread-safe (by not using
the regex module).
- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
- The popen2.py module is now rewritten using a class, which makes
access to the standard error stream and the process id of the
subprocess possible.
- Added timezone support to the rfc822.py module, in the form of a
getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
Also added recognition of some non-standard date formats, by Lars
Wirzenius, and RFC 850 dates (Chris Lawrence).
- mhlib.py: various enhancements, including almost compatible parsing
of message sequence specifiers without invoking a subprocess. Also
added a createmessage() method by Lars Wirzenius.
- The StringIO.StringIO class now supports readline(nbytes). (Lars
Wirzenius.) (Of course, you should be using cStringIO for performance.)
- UserDict.py supports the new dictionary methods as well.
- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
speed it up, and replace 0 seed values by 1 to avoid degeneration.
A bug was fixed in the test for invalid arguments.
- Module ftplib.py: added support for parsing a .netrc file (Fred
Drake). Also added an ntransfercmd() method to the FTP class, which
allows access to the expected size of a transfer when available, and a
parse150() function to the module which parses the corresponding 150
response.
- urllib.py: the ftp cache is now limited to 10 entries. Added
quote_plus() and unquote_plus() functions which are like quote() and
unquote() but also replace spaces with '+' or vice versa, for
encoding/decoding CGI form arguments. Catch all errors from the ftp
module. HTTP requests now add the Host: header line. The proxy
variable names are now mapped to lower case, for Windows. The
spliturl() function no longer erroneously throws away all data past
the first newline. The basejoin() function now intereprets "../"
correctly. I *believe* that the problems with "exception raised in
__del__" under certain circumstances have been fixed (mostly by
changes elsewher in the interpreter).
- In urlparse.py, there is a cache for results in urlparse.urlparse();
its size limit is set to 20. Also, new URL schemes shttp, https, and
snews are "supported".
- shelve.py: use cPickle and cStringIO when available. Also added
a sync() method, which calls the database's sync() method if there is
one.
- The mimetools.py module now uses the available Python modules for
decoding quoted-printable, uuencode and base64 formats, rather than
creating a subprocess.
- The python debugger (pdb.py, and its base class bdb.py) now support
conditional breakpoints. See the docs.
- The modules base64.py, uu.py and quopri.py can now be used as simple
command line utilities.
- Various small fixes to the nntplib.py module that I can't bother to
document in detail.
- Sjoerd Mullender's mimify.py module now supports base64 encoding and
includes functions to handle the funny encoding you sometimes see in mail
headers. It is now documented.
- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
gotten from the environment.
- Many more modules now correctly open files in binary mode when this
is necessary on non-Unix platforms.
- The copying functions in the undocumented module shutil.py are
smarter.
- The Writer classes in the formatter.py module now have a flush()
method.
- The sgmllib.py module accepts hyphens and periods in the middle of
attribute names. While this is against the SGML standard, there is
some HTML out there that uses this...
- The interface for the Python bytecode disassembler module, dis.py,
has been enhanced quite a bit. There's now one main function,
dis.dis(), which takes almost any kind of object (function, module,
class, instance, method, code object) and disassembles it; without
arguments it disassembles the last frame of the last traceback. The
other functions have changed slightly, too.
- The imghdr.py module recognizes new image types: BMP, PNG.
- The string.py module has a new function replace(str, old, new,
[maxsplit]) which does substring replacements. It is actually
implemented in C in the strop module. The functions [r]find() an
[r]index() have an optional 4th argument indicating the end of the
substring to search, alsoo implemented by their strop counterparts.
(Remember, never import strop -- import string uses strop when
available with zero overhead.)
- The string.join() function now accepts any sequence argument, not
just lists and tuples.
- The string.maketrans() requires its first two arguments to be
present. The old version didn't require them, but there's not much
point without them, and the documentation suggests that they are
required, so we fixed the code to match the documentation.
- The regsub.py module has a function clear_cache(), which clears its
internal cache of compiled regular expressions. Also, the cache now
takes the current syntax setting into account. (However, this module
is now obsolete -- use the sub() or subn() functions or methods in the
re module.)
- The undocumented module Complex.py has been removed, now that Python
has built-in complex numbers. A similar module remains as
Demo/classes/Complex.py, as an example.
Changes to the build process
----------------------------
- The way GNU readline is configured is totally different. The
--with-readline configure option is gone. It is now an extension
module, which may be loaded dynamically. You must enable it (and
specify the correct libraries to link with) in the Modules/Setup file.
Importing the module installs some hooks which enable command line
editing. When the interpreter shell is invoked interactively, it
attempts to import the readline module; when this fails, the default
input mechanism is used. The hook variables are PyOS_InputHook and
PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
ideas from William Magro.)
- New build procedure: a single library, libpython1.5.a, is now built,
which contains absolutely everything except for a one-line main()
program (which calls Py_Main(argc, argv) to start the interpreter
shell). This makes life much simpler for applications that need to
embed Python. The serial number of the build is now included in the
version string (sys.version).
- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
emits a single warning any more when compiling Python.
- A number of new Makefile variables have been added for special
situations, e.g. LDLAST is appended to the link command. These are
used by editing the Makefile or passing them on the make command
line.
- A set of patches from Lee Busby has been integrated that make it
possible to catch floating point exceptions. Use the configure option
--with-fpectl to enable the patches; the extension modules fpectl and
fpetest provide control to enable/disable and test the feature,
respectively.
- The support for shared libraries under AIX is now simpler and more
robust. Thanks to Vladimir Marangozov for revamping his own patches!
- The Modules/makesetup script now reads a file Setup.local as well as
a file Setup. Most changes to the Setup script can be done by editing
Setup.local instead, which makes it easier to carry a particular setup
over from one release to the next.
- The Modules/makesetup script now copies any "include" lines it
encounters verbatim into the output Makefile. It also recognizes .cxx
and .cpp as C++ source files.
- The configure script is smarter about C compiler options; e.g. with
gcc it uses -O2 and -g when possible, and on some other platforms it
uses -Olimit 1500 to avoid a warning from the optimizer about the main
loop in ceval.c (which has more than 1000 basic blocks).
- The configure script now detects whether malloc(0) returns a NULL
pointer or a valid block (of length zero). This avoids the nonsense
of always adding one byte to all malloc() arguments on most platforms.
- The configure script has a new option, --with-dec-threads, to enable
DEC threads on DEC Alpha platforms. Also, --with-threads is now an
alias for --with-thread (this was the Most Common Typo in configure
arguments).
- Many changes in Doc/Makefile; amongst others, latex2html is now used
to generate HTML from all latex documents.
Change to the Python/C API
--------------------------
- Because some interfaces have changed, the PYTHON_API macro has been
bumped. Most extensions built for the old API version will still run,
but I can't guarantee this. Python prints a warning message on
version mismatches; it dumps core when the version mismatch causes a
serious problem :-)
- I've completed the Grand Renaming, with the help of Roger Masse and
Barry Warsaw. This makes reading or debugging the code much easier.
Many other unrelated code reorganizations have also been carried out.
The allobjects.h header file is gone; instead, you would have to
include Python.h followed by rename2.h. But you're better off running
Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
the rename2.h; it will disappear in the next release.
- Various and sundry small bugs in the "abstract" interfaces have been
fixed. Thanks to all the (involuntary) testers of the Python 1.4
version! Some new functions have been added, e.g. PySequence_List(o),
equivalent to list(o) in Python.
- New API functions PyLong_FromUnsignedLong() and
PyLong_AsUnsignedLong().
- The API functions in the file cgensupport.c are no longer
supported. This file has been moved to Modules and is only ever
compiled when the SGI specific 'gl' module is built.
- PyObject_Compare() can now raise an exception. Check with
PyErr_Occurred(). The comparison function in an object type may also
raise an exception.
- The slice interface uses an upper bound of INT_MAX when no explicit
upper bound is given (e.x. for a[1:]). It used to ask the object for
its length and do the calculations.
- Support for multiple independent interpreters. See Doc/api.tex,
functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
documentation is incomplete, also see the new Demo/pysvr example
(which shows how to use these in a threaded application) and the
source code.
- There is now a Py_Finalize() function which "de-initializes"
Python. It is possible to completely restart the interpreter
repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
change of functionality in Py_Initialize() means that it is now a
fatal error to call it while the interpreter is already initialized.
The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
is deprecated (it is nothing more than Py_Finalize() followed by
exit()).
- There are no known memory leaks left. While Py_Finalize() doesn't
free *all* allocated memory (some of it is hard to track down),
repeated calls to Py_Finalize() and Py_Initialize() do not create
unaccessible heap blocks.
- There is now explicit per-thread state. (Inspired by, but not the
same as, Greg Stein's free threading patches.)
- There is now better support for threading C applications. There are
now explicit APIs to manipulate the interpreter lock. Read the source
or the Demo/pysvr example; the new functions are
PyEval_{Acquire,Release}{Lock,Thread}().
- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
with other libraries' DEBUG macros. Likewise for any other test
macros that didn't yet start with Py_.
- New wrappers around malloc() and friends: Py_Malloc() etc. call
malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
just malloc(). Use of these wrappers could be essential if multiple
memory allocators exist (e.g. when using certain DLL setups under
Windows). (Idea by Jim Fulton.)
- New C API PyImport_Import() which uses whatever __import__() hook
that is installed for the current execution environment. By Jim
Fulton.
- It is now possible for an extension module's init function to fail
non-fatally, by calling one of the PyErr_* functions and returning.
- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
argument to the proper type, like the similar PyString macros already
did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
and PyList_GET_ITEM.
- Some of the Py_Get* function, like Py_GetVersion() (but not yet
Py_GetPath()) are now declared as returning a const char *. (More
should follow.)
- Changed the run-time library to check for exceptions after object
comparisons. PyObject_Compare() can now return an exception; use
PyErr_Occurred() to check (there is *no* special return value).
- PyFile_WriteString() and Py_Flushline() now return error indicators
instead of clearing exceptions. This fixes an obscure bug where using
these would clear a pending exception, discovered by Just van Rossum.
- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
an argument list including keyword arguments. Contributed by Geoff
Philbrick.
- PyArg_GetInt() is gone.
- It's no longer necessary to include graminit.h when calling one of
the extended parser API functions. The three public grammar start
symbols are now in Python.h as Py_single_input, Py_file_input, and
Py_eval_input.
- The CObject interface has a new function,
PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
on the object referenced by "module.name".
Tkinter
-------
- On popular demand, _tkinter once again installs a hook for readline
that processes certain Tk events while waiting for the user to type
(using PyOS_InputHook).
- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
caused by command definitions referencing widget objects beyond their
lifetime.
- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
with the new Tk dialog scripts, and provide more "native platform"
style file selection dialog boxes on some platforms. Contributed by
Fredrik Lundh.
- Tkinter.py: when the first Tk object is destroyed, it sets the
hiddel global _default_root to None, so that when another Tk object is
created it becomes the new default root. Other miscellaneous
changes and fixes.
- The Image class now has a configure method.
- Added a bunch of new winfo options to Tkinter.py; we should now be
up to date with Tk 4.2. The new winfo options supported are:
mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
visualsavailable.
- The broken bind() method on Canvas objects defined in the Canvas.py
module has been fixed. The CanvasItem and Group classes now also have
an unbind() method.
- The problem with Tkinter.py falling back to trying to import
"tkinter" when "_tkinter" is not found has been fixed -- it no longer
tries "tkinter", ever. This makes diagnosing the problem "_tkinter
not configured" much easier and will hopefully reduce the newsgroup
traffic on this topic.
- The ScrolledText module once again supports the 'cnf' parameter, to
be compatible with the examples in Mark Lutz' book (I know, I know,
too late...)
- The _tkinter.c extension module has been revamped. It now support
Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
works well under Windows and Mac (with the latest Tk ports to those
platforms). It also supports threading -- it is safe for one
(Python-created) thread to be blocked in _tkinter.mainloop() while
other threads modify widgets. To make the changes visible, those
threads must use update_idletasks()method. (The patch for threading
in 1.5a3 was broken; in 1.5a4, it is back in a different version,
which requires access to the Tcl sources to get it to work -- hence it
is disabled by default.)
- A bug in _tkinter.c has been fixed, where Split() with a string
containing an unmatched '"' could cause an exception or core dump.
- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
CreateFileHandler, so _tkinter.createfilehandler is not available on
those platforms when using Tk 8.0 or later. I will have to rethink
how to interface with Tcl's lower-level event mechanism, or with its
channels (which are like Python's file-like objects). Jack Jansen has
provided a fix for the Mac, so createfilehandler *is* actually
supported there; maybe I can adapt his fix for Windows.
Tools and Demos
---------------
- A new regression test suite is provided, which tests most of the
standard and built-in modules. The regression test is run by invoking
the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
he and Roger Masse contributed most of the new tests.
- New tool: faqwiz -- the CGI script that is used to maintain the
Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
Tools/faqwiz.
- New tool: webchecker -- a simple extensible web robot that, when
aimed at a web server, checks that server for dead links. Available
are a command line utility as well as a Tkinter based GUI version. In
Tools/webchecker. A simplified version of this program is dissected
in my article in O'Reilly's WWW Journal, the issue on Scripting
Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
Includes a parser for robots.txt files by Skip Montanaro.
- New small tools: cvsfiles.py (prints a list of all files under CVS
n a particular directory tree), treesync.py (a rather Guido-specific
script to synchronize two source trees, one on Windows NT, the other
one on Unix under CVS but accessible from the NT box), and logmerge.py
(sort a collection of RCS or CVS logs by date). In Tools/scripts.
- The freeze script now also works under Windows (NT). Another
feature allows the -p option to be pointed at the Python source tree
instead of the installation prefix. This was loosely based on part of
xfreeze by Sam Rushing and Bill Tutt.
- New examples (Demo/extend) that show how to use the generic
extension makefile (Misc/Makefile.pre.in).
- Tools/scripts/h2py.py now supports C++ comments.
- Tools/scripts/pystone.py script is upgraded to version 1.1; there
was a bug in version 1.0 (distributed with Python 1.4) that leaked
memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Windows (NT and 95)
-------------------
- New project files for Developer Studio (Visual C++) 5.0 for Windows
NT (the old VC++ 4.2 Makefile is also still supported, but will
eventually be withdrawn due to its bulkiness).
- See the note on the new module search path in the "Miscellaneous" section
above.
- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
basically withdrawn. If it still works for you, you're lucky.
- There's a new extension module, msvcrt.c, which provides various
low-level operations defined in the Microsoft Visual C++ Runtime Library.
These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
console I/O functions like kbhit(), getch() and putch().
- The -u option not only sets the standard I/O streams to unbuffered
status, but also sets them in binary mode. (This can also be done
using msvcrt.setmode(), by the way.)
- The, sys.prefix and sys.exec_prefix variables point to the directory
where Python is installed, or to the top of the source tree, if it was run
from there.
- The various os.path modules (posixpath, ntpath, macpath) now support
passing more than two arguments to the join() function, so
os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
c)).
- The ntpath module (normally used as os.path) supports ~ to $HOME
expansion in expanduser().
- The freeze tool now works on Windows.
- See also the Tkinter category for a sad note on
_tkinter.createfilehandler().
- The truncate() method for file objects now works on Windows.
- Py_Initialize() is no longer called when the DLL is loaded. You
must call it yourself.
- The time module's clock() function now has good precision through
the use of the Win32 API QueryPerformanceCounter().
- Mark Hammond will release Python 1.5 versions of PythonWin and his
other Windows specific code: the win32api extensions, COM/ActiveX
support, and the MFC interface.
Mac
---
- As always, the Macintosh port will be done by Jack Jansen. He will
make a separate announcement for the Mac specific source code and the
binary distribution(s) when these are ready.
======================================================================
=====================================
==> Release 1.4 (October 25 1996) <==
=====================================
(Starting in reverse chronological order:)
- Changed disclaimer notice.
- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
default to the user's login shell.
- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
widget, and bogus bspace() function.
- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
paragraph.
- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
subprojects, and to remove the (broken) experimental NumPy
subprojects.
- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
(where os.stat() returns mtimes as floats.)
- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
fix POST in CGIHTTPServer.py.
- Version 2.83 of Misc/python-mode.el for Emacs is included.
- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
group starting immediately after a group tag.
- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
- In Objects/stringobject.c, fixed the compare function to do the
first char comparison in unsigned mode, for consistency with the way
other characters are compared by memcmp().
- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
- In Lib/urllib.py, fix another case where openedurl wasn't set.
(XXX Sorry, the rest is in totally random order. No time to fix it.)
- SyntaxError exceptions detected during code generation
(e.g. assignment to an expression) now include a line number.
- Don't leave trailing / or \ in script directory inserted in front of
sys.path.
- Added a note to Tools/scripts/classfix.py abouts its historical
importance.
- Added Misc/Makefile.pre.in, a universal Makefile for extensions
built outside the distribution.
- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
- Install shared modules with mode 555 (needed for performance on some
platforms).
- Some changes to standard library modules to avoid calling append()
with more than one argument -- while supported, this should be
outlawed, and I don't want to set a bad example.
- bdb.py (and hence pdb.py) supports calling run() with a code object
instead of a code string.
- Fixed an embarrassing bug cgi.py which prevented correct uploading
of binary files from Netscape (which doesn't distinguish between
binary and text files). Also added dormant logging support, which
makes it easier to debug the cgi module itself.
- Added default writer to constructor of NullFormatter class.
- Use binary mode for socket.makefile() calls in ftplib.py.
- The ihooks module no longer "installs" itself upon import -- this
was an experimental feature that helped ironing out some bugs but that
slowed down code that imported it without the need to install it
(e.g. the rexec module). Also close the file in some cases and add
the __file__ attribute to loaded modules.
- The test program for mailbox.py is now more useful.
- Added getparamnames() to Message class in mimetools.py -- it returns
the names of parameters to the content-type header.
- Fixed a typo in ni that broke the loop stripping "__." from names.
- Fix sys.path[0] for scripts run via pdb.py's new main program.
- profile.py can now also run a script, like pdb.
- Fix a small bug in pyclbr -- don't add names starting with _ when
emulating from ... import *.
- Fixed a series of embarrassing typos in rexec's handling of standard
I/O redirection. Added some more "safe" built-in modules: cmath,
errno, operator.
- Fixed embarrassing typo in shelve.py.
- Added SliceType and EllipsisType to types.py.
- In urllib.py, added handling for error 301 (same as 302); added
geturl() method to get the URL after redirection.
- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
- Fixed bsddbmodule.c to add binary mode indicator on platforms that
have it. This should make it working on Windows NT.
- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
whatever applies. Also rationalized some other tests for various MS
platforms.
- Added the sources for the NT installer script used for Python
1.4beta3. Not tested with this release, but better than nothing.
- A compromise in pickle's defenses against Trojan horses: a
user-defined function is now okay where a class is expected. A
built-in function is not okay, to prevent pickling something that
will execute os.system("rm -f *") when unpickling.
- dis.py will print the name of local variables referenced by local
load/store/delete instructions.
- Improved portability of SimpleHTTPServer module to non-Unix
platform.
- The thread.h interface adds an extra argument to down_sema(). This
only affects other C code that uses thread.c; the Python thread module
doesn't use semaphores (which aren't provided on all platforms where
Python threads are supported). Note: on NT, this change is not
implemented.
- Fixed some typos in abstract.h; corrected signature of
PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
abstract.c's PyObject_CallMethod().
- apply(classname, (), {}) now works even if the class has no
__init__() method.
- Implemented complex remainder and divmod() (these would dump core!).
Conversion of complex numbers to int, long int or float now raises an
exception, since there is no meaningful way to do it without losing
information.
- Fixed bug in built-in complex() function which gave the wrong result
for two real arguments.
- Change the hash algorithm for strings -- the multiplier is now
1000003 instead of 3, which gives better spread for short strings.
- New default path for Windows NT, the registry structure now supports
default paths for different install packages. (Mark Hammond -- the
next PythonWin release will use this.)
- Added more symbols to the python_nt.def file.
- When using GNU readline, set rl_readline_name to "python".
- The Ellipses built-in name has been renamed to Ellipsis -- this is
the correct singular form. Thanks to Ka-Ping Yee, who saved us from
eternal embarrassment.
- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
Ellipsis name change.
- Updated the library reference manual. Added documentation of
restricted mode (rexec, Bastion) and the formatter module (for use
with the htmllib module). Fixed the documentation of htmllib
(finally).
- The reference manual is now maintained in FrameMaker.
- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
- Slight improvements to Doc/Makefile.
- Added fcntl.lockf(). This should be used for Unix file locking
instead of the posixfile module; lockf() is more portable.
- The getopt module now supports long option names, thanks to Lars
Wizenius.
- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
and Nils Fischbeck.
- Use more bits of time.time() in whrandom's default seed().
- Performance hack for regex module's regs attribute.
- Don't close already closed socket in socket module.
- Correctly handle separators containing embedded nulls in
strop.split, strop.find and strop.rfind. Also added more detail to
error message for strop.atoi and friends.
- Moved fallback definition for hypot() to Python/hypot.c.
- Added fallback definition for strdup, in Python/strdup.c.
- Fixed some bugs where a function would return 0 to indicate an error
where it should return -1.
- Test for error returned by time.localtime(), and rationalized its MS
tests.
- Added Modules/Setup.local file, which is processed after Setup.
- Corrected bug in toplevel Makefile.in -- execution of regen script
would not use the right PATH and PYTHONPATH.
- Various and sundry NeXT configuration changes (sigh).
- Support systems where libreadline needs neither termcap nor curses.
- Improved ld_so_aix script and python.exp file (for AIX).
- More stringent test for working <stdarg.h> in configure script.
- Removed Demo/www subdirectory -- it was totally out of date.
- Improved demos and docs for Fred Drake's parser module; fixed one
typo in the module itself.
=========================================
==> Release 1.4beta3 (August 26 1996) <==
=========================================
(XXX This is less readable that it should. I promise to restructure
it for the final 1.4 release.)
What's new in 1.4beta3 (since beta2)?
-------------------------------------
- Name mangling to implement a simple form of class-private variables.
A name of the form "__spam" can't easily be used outside the class.
(This was added in 1.4beta3, but left out of the 1.4beta3 release
message.)
- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
handled correctly when using a proxy server.
- In ntpath.normpath(): don't truncate to 8+3 format.
- In mimetools.choose_boundary(): don't die when getuid() or getpid()
aren't defined.
- Module urllib: some optimizations to (un)quoting.
- New module MimeWriter for writing MIME documents.
- More changes to formatter module.
- The freeze script works once again and is much more robust (using
sys.prefix etc.). It also supports a -o option to specify an
output directory.
- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
- The Doc/Makefile targets have been reorganized somewhat to remove the
insistence on always generating PostScript.
- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
name conflict on the Mac.
- Linking a module compiled with a different setting for Py_TRACE_REFS now
generates a linker error rather than a core dump.
- The cgi module has a new convenience function print_exception(), which
formats a python exception using HTML. It also fixes a bug in the
compatibility code and adds a dubious feature which makes it possible to
have two query strings, one in the URL and one in the POST data.
- A subtle change in the unpickling of class instances makes it possible
to unpickle in restricted execution mode, where the __dict__ attribute is
not available (but setattr() is).
- Documentation for os.path.splitext() (== posixpath.splitext()) has been
cleared up. It splits at the *last* dot.
- posixfile locking is now also correctly supported on AIX.
- The tempfile module once again honors an initial setting of tmpdir. It
now works on Windows, too.
- The traceback module has some new functions to extract, format and print
the active stack.
- Some translation functions in the urllib module have been made a little
less sluggish.
- The addtag_* methods for Canvas widgets in Tkinter as well as in the
separate Canvas class have been fixed so they actually do something
meaningful.
- A tiny _test() function has been added to Tkinter.py.
- A generic Makefile for dynamically loaded modules is provided in the Misc
subdirectory (Misc/gMakefile).
- A new version of python-mode.el for Emacs is provided. See
http://www.python.org/ftp/emacs/pmdetails.html for details. The
separate file pyimenu.el is no longer needed, imenu support is folded
into python-mode.el.
- The configure script can finally correctly find the readline library in a
non-standard location. The LDFLAGS variable is passed on the Makefiles
from the configure script.
- Shared libraries are now installed as programs (i.e. with executable
permission). This is required on HP-UX and won't hurt on other systems.
- The objc.c module is no longer part of the distribution. Objective-C
support may become available as contributed software on the ftp site.
- The sybase module is no longer part of the distribution. A much
improved sybase module is available as contributed software from the
ftp site.
- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
can use *.so and *.sl as shared libraries.
- Some more fidgeting for AIX shared libraries.
- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
available from the contrib directory on the ftp site.)
- A warning is written to sys.stderr when a __del__ method raises an
exception (formerly, such exceptions were completely ignored).
- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
incapable of ANSI style token concatenation and stringification.
- All source files (except a few platform specific modules) are once again
compatible with K&R C compilers as well as ANSI compilers. In particular,
ANSI-isms have been removed or made conditional in complexobject.c,
getargs.c and operator.c.
- The abstract object API has three new functions, PyObject_DelItem,
PySequence_DelItem, and PySequence_DelSlice.
- The operator module has new functions delitem and delslice, and the
functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
"and" are reserved words). ("__or__" and "__and__" are unchanged.)
- The environment module is no longer supported; putenv() is now a function
in posixmodule (also under NT).
- Error in filter(<function>, "") has been fixed.
- Unrecognized keyword arguments raise TypeError, not KeyError.
- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
some more documentation.
- Bug in float power boundary case (0.0 to the negative integer power)
fixed.
- The test of negative number to the float power has been moved from the
built-in pow() function to floatobject.c (so complex numbers can yield the
correct result).
- The bug introduced in beta2 where shared libraries loaded (using
dlopen()) from the current directory would fail, has been fixed.
- Modules imported as shared libraries now also have a __file__ attribute,
giving the filename from which they were loaded. The only modules without
a __file__ attribute now are built-in modules.
- On the Mac, dynamically loaded modules can end in either ".slb" or
".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
extension should only be used for "fat" binaries.
- C API addition: marshal.c now supports
PyMarshal_WriteObjectToString(object).
- C API addition: getargs.c now supports
PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
to parse keyword arguments.
- The PC versioning scheme (sys.winver) has changed once again. the
version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
"1.4.1" for Python 1.4.1 -- the beta level is not included) and
<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
- h2py.py accepts whitespace before the # in CPP directives
- On Solaris 2.5, it should now be possible to use either Posix threads or
Solaris threads (XXX: how do you select which is used???). (Note: the
Python pthreads interface doesn't fully support semaphores yet -- anyone
care to fix this?)
- Thread support should now work on AIX, using either DCE threads or
pthreads.
- New file Demo/sockets/unicast.py
- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
both) (XXX)
- New project setup for PC port, now compatible with PythonWin, with
_tkinter and NumPy support (XXX)
- New module site.py (XXX)
- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
- regen script fixed (XXX)
- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
- testall now also tests math module (XXX)
- string.atoi c.s. now raise an exception for an empty input string.
- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
have config.h included at various places.
- Unrecognized keyword arguments now raise TypeError rather than KeyError.
- The makesetup script recognizes files with extension .so or .sl as
(shared) libraries.
- 'access' is no longer a reserved word, and all code related to its
implementation is gone (or at least #ifdef'ed out). This should make
Python a little speedier too!
- Performance enhancements suggested by Sjoerd Mullender. This includes
the introduction of two new optional function pointers in type object,
getattro and setattro, which are like getattr and setattr but take a
string object instead of a C string pointer.
- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
only on the left or only on the right, A new optional third argument to
split() specifies the maximum number of separators honored (so
splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
1.3, splitfields(s, None) is totally equivalent to split(s).)
string.capwords() has an optional second argument specifying the
separator (which is passed to split()).
- regsub.split() has the same addition as string.split(). regsub.splitx(s,
sep, maxsep) implements the functionality that was regsub.split(s, 1) in
1.4beta2 (return a list containing the delimiters as well as the words).
- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
argument to _tkinter.create() to set Tcl's argv0 variable, so X
resources use the right resource class again.
- Add #undef fabs to Modules/mathmodule.c for macintosh.
- Added some macro renames for AIX in Modules/operator.c.
- Removed spurious 'E' from Doc/liberrno.tex.
- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
Misc/gMakefile and new version of Misc/python-mode.el.
- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
NameError).
- Added missing "from types import *" to Lib/tkinter/Canvas.py.
- Added hint about using default args for __init__ to pickle docs.
- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
PySequence_Length.
- Some improvements to Doc/texi2html.py.
- In Python/import.c, Cast unsigned char * in struct _frozen to char *
in calls to rds_object().
- In doc/ref4.tex, added note about scope of lambda bodies.
What's new in 1.4beta2 (since beta1)?
-------------------------------------
- Portability bug in the md5.h header solved.
- The PC build procedure now really works, and sets sys.platform to a
meaningful value (a few things were botched in beta 1). Lib/dos_8x3
is now a standard part of the distribution (alas).
- More improvements to the installation procedure. Typing "make install"
now inserts the version number in the pathnames of almost everything
installed, and creates the machine dependent modules (FCNTL.py etc.) if not
supplied by the distribution. (XXX There's still a problem with the latter
because the "regen" script requires that Python is installed. Some manual
intervention may still be required.) (This has been fixed in 1.4beta3.)
- New modules: errno, operator (XXX).
- Changes for use with Numerical Python: built-in function slice() and
Ellipses object, and corresponding syntax:
x[lo:hi:stride] == x[slice(lo, hi, stride)]
x[a, ..., z] == x[(a, Ellipses, z)]
- New documentation for errno and cgi modules.
- The directory containing the script passed to the interpreter is
inserted in from of sys.path; "." is no longer a default path
component.
- Optional third string argument to string.translate() specifies
characters to delete. New function string.maketrans() creates a
translation table for translate() or for regex.compile().
- Module posix (and hence module os under Unix) now supports putenv().
Moreover, module os is enhanced so that if putenv() is supported,
assignments to os.environ entries make the appropriate putenv() call.
(XXX the putenv() implementation can leak a small amount of memory per
call.)
- pdb.py can now be invoked from the command line to debug a script:
python pdb.py <script> <arg> ...
- Much improved parseaddr() in rfc822.
- In cgi.py, you can now pass an alternative value for environ to
nearly all functions.
- You can now assign to instance variables whose name begins and ends
with '__'.
- New version of Fred Drake's parser module and associates (token,
symbol, AST).
- New PYTHON_API_VERSION value and .pyc file magic number (again!).
- The "complex" internal structure type is now called "Py_complex" to
avoid name conflicts.
- Numerous small bugs fixed.
- Slight pickle speedups.
- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
- NeXT portability mods by Bill Bumgarner integrated.
- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
converted to new naming style.
What's new in 1.4beta1 (since 1.3)?
-----------------------------------
- Added sys.platform and sys.exec_platform for Bill Janssen.
- Installation has been completely overhauled. "make install" now installs
everything, not just the python binary. Installation uses the install-sh
script (borrowed from X11) to install each file.
- New functions in the posix module: mkfifo, plock, remove (== unlink),
and ftruncate. More functions are also available under NT.
- New function in the fcntl module: flock.
- Shared library support for FreeBSD.
- The --with-readline option can now be used without a DIRECTORY argument,
for systems where libreadline.* is in one of the standard places. It is
also possible for it to be a shared library.
- The extension tkinter has been renamed to _tkinter, to avoid confusion
with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
well as 4.0.
- Author's change of address from CWI in Amsterdam, The Netherlands, to
CNRI in Reston, VA, USA.
- The math.hypot() function is now always available (if it isn't found in
the C math library, Python provides its own implementation).
- The latex documentation is now compatible with latex2e, thanks to David
Ascher.
- The expression x**y is now equivalent to pow(x, y).
- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
- Complex numbers are now supported. Imaginary constants are written with
a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
part to an imaginary part, like 3+4j. Complex numbers are always stored in
floating point form, so this is equivalent to 3.0+4.0j. It is also
possible to create complex numbers with the new built-in function
complex(re, [im]). For the footprint-conscious, complex number support can
be disabled by defining the symbol WITHOUT_COMPLEX.
- New built-in function list() is the long-awaited counterpart of tuple().
- There's a new "cmath" module which provides the same functions as the
"math" library but with complex arguments and results. (There are very
good reasons why math.sqrt(-1) still raises an exception -- you have to use
cmath.sqrt(-1) to get 1j for an answer.)
- The Python.h header file (which is really the same as allobjects.h except
it disables support for old style names) now includes several more files,
so you have to have fewer #include statements in the average extension.
- The NDEBUG symbol is no longer used. Code that used to be dependent on
the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
respectively. At long last, the source actually compiles and links without
errors when this symbol is defined.
- Several symbols that didn't follow the new naming scheme have been
renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
are no external symbols left without a Py or _Py prefix, not even those
defined by sources that were incorporated from elsewhere (regexpr.c,
md5c.c). (Macros are a different story...)
- There are now typedefs for the structures defined in config.c and
frozen.c.
- New PYTHON_API_VERSION value and .pyc file magic number.
- New module Bastion. (XXX)
- Improved performance of StringIO module.
- UserList module now supports + and * operators.
- The binhex and binascii modules now actually work.
- The cgi module has been almost totally rewritten and documented.
It now supports file upload and a new data type to handle forms more
flexibly.
- The formatter module (for use with htmllib) has been overhauled (again).
- The ftplib module now supports passive mode and has doc strings.
- In (ideally) all places where binary files are read or written, the file
is now correctly opened in binary mode ('rb' or 'wb') so the code will work
on Mac or PC.
- Dummy versions of os.path.expandvars() and expanduser() are now provided
on non-Unix platforms.
- Module urllib now has two new functions url2pathname and pathname2url
which turn local filenames into "file:..." URLs using the same rules as
Netscape (why be different). it also supports urlretrieve() with a
pathname parameter, and honors the proxy environment variables (http_proxy
etc.). The URL parsing has been improved somewhat, too.
- Micro improvements to urlparse. Added urlparse.urldefrag() which
removes a trailing ``#fragment'' if any.
- The mailbox module now supports MH style message delimiters as well.
- The mhlib module contains some new functionality: setcontext() to set the
current folder and parsesequence() to parse a sequence as commonly passed
to MH commands (e.g. 1-10 or last:5).
- New module mimify for conversion to and from MIME format of email
messages.
- Module ni now automatically installs itself when first imported -- this
is against the normal rule that modules should define classes and functions
but not invoke them, but appears more useful in the case that two
different, independent modules want to use ni's features.
- Some small performance enhancements in module pickle.
- Small interface change to the profile.run*() family of functions -- more
sensible handling of return values.
- The officially registered Mac creator for Python files is 'Pyth'. This
replaces 'PYTH' which was used before but never registered.
- Added regsub.capwords(). (XXX)
- Added string.capwords(), string.capitalize() and string.translate().
(XXX)
- Fixed an interface bug in the rexec module: it was impossible to pass a
hooks instance to the RExec class. rexec now also supports the dynamic
loading of modules from shared libraries. Some other interfaces have been
added too.
- Module rfc822 now caches the headers in a dictionary for more efficient
lookup.
- The sgmllib module now understands a limited number of SGML "shorthands"
like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
- The tempfile module actually tries a number of different places to find a
usable temporary directory. (This was prompted by certain Linux
installations that appear to be missing a /usr/tmp directory.) [A bug in
the implementation that would ignore a pre-existing tmpdir global has been
fixed in beta3.]
- Much improved and enhanved FileDialog module for Tkinter.
- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
well as Tk 4.1).
- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
extension is called _socket and a wrapper module win/socket.py provides
"makefile()" and "dup()" functionality. On Windows, the select module
works only with socket objects.
- Bugs in bsddb module fixed (e.g. missing default argument values).
- The curses extension now includes <ncurses.h> when available.
- The gdbm module now supports opening databases in "fast" mode by
specifying 'f' as the second character or the mode string.
- new variables sys.prefix and sys.exec_prefix pass corresponding
configuration options / Makefile variables to the Python programmer.
- The ``new'' module now supports creating new user-defined classes as well
as instances thereof.
- The soundex module now sports get_soundex() to get the soundex value for an
arbitrary string (formerly it would only do soundex-based string
comparison) as well as doc strings.
- New object type "cobject" to safely wrap void pointers for passing them
between various extension modules.
- More efficient computation of float**smallint.
- The mysterious bug whereby "x.x" (two occurrences of the same
one-character name) typed from the commandline would sometimes fail
mysteriously.
- The initialization of the readline function can now be invoked by a C
extension through PyOS_ReadlineInit().
- There's now an externally visible pointer PyImport_FrozenModules which
can be changed by an embedding application.
- The argument parsing functions now support a new format character 'D' to
specify complex numbers.
- Various memory leaks plugged and bugs fixed.
- Improved support for posix threads (now that real implementations are
beginning to apepar). Still no fully functioning semaphores.
- Some various and sundry improvements and new entries in the Tools
directory.
=====================================
==> Release 1.3 (13 October 1995) <==
=====================================
Major change
============
Two words: Keyword Arguments. See the first section of Chapter 12 of
the Tutorial.
(The rest of this file is textually the same as the remaining sections
of that chapter.)
Changes to the WWW and internet tools
=====================================
The "htmllib" module has been rewritten in an incompatible fashion.
The new version is considerably more complete (HTML 2.0 except forms,
but including all ISO-8859-1 entity definitions), and easy to use.
Small changes to "sgmllib" have also been made, to better match the
tokenization of HTML as recognized by other web tools.
A new module "formatter" has been added, for use with the new
"htmllib" module.
The "urllib"and "httplib" modules have been changed somewhat to allow
overriding unknown URL types and to support authentication. They now
use "mimetools.Message" instead of "rfc822.Message" to parse headers.
The "endrequest()" method has been removed from the HTTP class since
it breaks the interaction with some servers.
The "rfc822.Message" class has been changed to allow a flag to be
passed in that says that the file is unseekable.
The "ftplib" module has been fixed to be (hopefully) more robust on
Linux.
Several new operations that are optionally supported by servers have
been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
Other Language Changes
======================
The "raise" statement now takes an optional argument which specifies
the traceback to be used when printing the exception's stack trace.
This must be a traceback object, such as found in "sys.exc_traceback".
When omitted or given as "None", the old behavior (to generate a stack
trace entry for the current stack frame) is used.
The tokenizer is now more tolerant of alien whitespace. Control-L in
the leading whitespace of a line resets the column number to zero,
while Control-R just before the end of the line is ignored.
Changes to Built-in Operations
==============================
For file objects, "f.read(0)" and "f.readline(0)" now return an empty
string rather than reading an unlimited number of bytes. For the
latter, omit the argument altogether or pass a negative value.
A new system variable, "sys.platform", has been added. It specifies
the current platform, e.g. "sunos5" or "linux1".
The built-in functions "input()" and "raw_input()" now use the GNU
readline library when it has been configured (formerly, only
interactive input to the interpreter itself was read using GNU
readline). The GNU readline library provides elaborate line editing
and history. The Python debugger ("pdb") is the first beneficiary of
this change.
Two new built-in functions, "globals()" and "locals()", provide access
to dictionaries containming current global and local variables,
respectively. (These augment rather than replace "vars()", which
returns the current local variables when called without an argument,
and a module's global variables when called with an argument of type
module.)
The built-in function "compile()" now takes a third possible value for
the kind of code to be compiled: specifying "'single'" generates code
for a single interactive statement, which prints the output of
expression statements that evaluate to something else than "None".
Library Changes
===============
There are new module "ni" and "ihooks" that support importing modules
with hierarchical names such as "A.B.C". This is enabled by writing
"import ni; ni.ni()" at the very top of the main program. These
modules are amply documented in the Python source.
The module "rexec" has been rewritten (incompatibly) to define a class
and to use "ihooks".
The "string.split()" and "string.splitfields()" functions are now the
same function (the presence or absence of the second argument
determines which operation is invoked); similar for "string.join()"
and "string.joinfields()".
The "Tkinter" module and its helper "Dialog" have been revamped to use
keyword arguments. Tk 4.0 is now the standard. A new module
"FileDialog" has been added which implements standard file selection
dialogs.
The optional built-in modules "dbm" and "gdbm" are more coordinated
--- their "open()" functions now take the same values for their "flag"
argument, and the "flag" and "mode" argument have default values (to
open the database for reading only, and to create the database with
mode "0666" minuse the umask, respectively). The memory leaks have
finally been fixed.
A new dbm-like module, "bsddb", has been added, which uses the BSD DB
package's hash method.
A portable (though slow) dbm-clone, implemented in Python, has been
added for systems where none of the above is provided. It is aptly
dubbed "dumbdbm".
The module "anydbm" provides a unified interface to "bsddb", "gdbm",
"dbm", and "dumbdbm", choosing the first one available.
A new extension module, "binascii", provides a variety of operations
for conversion of text-encoded binary data.
There are three new or rewritten companion modules implemented in
Python that can encode and decode the most common such formats: "uu"
(uuencode), "base64" and "binhex".
A module to handle the MIME encoding quoted-printable has also been
added: "quopri".
The parser module (which provides an interface to the Python parser's
abstract syntax trees) has been rewritten (incompatibly) by Fred
Drake. It now lets you change the parse tree and compile the result!
The \code{syslog} module has been upgraded and documented.
Other Changes
=============
The dynamic module loader recognizes the fact that different filenames
point to the same shared library and loads the library only once, so
you can have a single shared library that defines multiple modules.
(SunOS / SVR4 style shared libraries only.)
Jim Fulton's ``abstract object interface'' has been incorporated into
the run-time API. For more detailes, read the files
"Include/abstract.h" and "Objects/abstract.c".
The Macintosh version is much more robust now.
Numerous things I have forgotten or that are so obscure no-one will
notice them anyway :-)
===================================
==> Release 1.2 (13 April 1995) <==
===================================
- Changes to Misc/python-mode.el:
- Wrapping and indentation within triple quote strings should work
properly now.
- `Standard' bug reporting mechanism (use C-c C-b)
- py-mark-block was moved to C-c C-m
- C-c C-v shows you the python-mode version
- a basic python-font-lock-keywords has been added for Emacs 19
font-lock colorizations.
- proper interaction with pending-del and del-sel modes.
- New py-electric-colon (:) command for improved outdenting. Also
py-indent-line (TAB) should handle outdented lines better.
- New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
- The Library Reference has been restructured, and many new and
existing modules are now documented, in particular the debugger and
the profiler, as well as the persistency and the WWW/internet support
modules.
- All known bugs have been fixed. For example the pow(2,2,3L) bug on
Linux has been fixed. Also the re-entrancy problems with __del__ have
been fixed.
- All known memory leaks have been fixed.
- Phase 2 of the Great Renaming has been executed. The header files
now use the new names (PyObject instead of object, etc.). The linker
also sees the new names. Most source files still use the old names,
by virtue of the rename2.h header file. If you include Python.h, you
only see the new names. Dynamically linked modules have to be
recompiled. (Phase 3, fixing the rest of the sources, will be
executed gradually with the release later versions.)
- The hooks for implementing "safe-python" (better called "restricted
execution") are in place. Specifically, the import statement is
implemented by calling the built-in function __import__, and the
built-in names used in a particular scope are taken from the
dictionary __builtins__ in that scope's global dictionary. See also
the new (unsupported, undocumented) module rexec.py.
- The import statement now supports the syntax "import a.b.c" and
"from a.b.c import name". No officially supported implementation
exists, but one can be prototyped by replacing the built-in __import__
function. A proposal by Ken Manheimer is provided as newimp.py.
- All machinery used by the import statement (or the built-in
__import__ function) is now exposed through the new built-in module
"imp" (see the library reference manual). All dynamic loading
machinery is moved to the new file importdl.c.
- Persistent storage is supported through the use of the modules
"pickle" and "shelve" (implemented in Python). There's also a "copy"
module implementing deepcopy and normal (shallow) copy operations.
See the library reference manual.
- Documentation strings for many object types are accessible through
the __doc__ attribute. Modules, classes and functions support special
syntax to initialize the __doc__ attribute: if the first statement
consists of just a string literal, that string literal becomes the
value of the __doc__ attribute. The default __doc__ attribute is
None. Documentation strings are also supported for built-in
functions, types and modules; however this feature hasn't been widely
used yet. See the 'new' module for an example. (Basically, the type
object's tp_doc field contains the doc string for the type, and the
4th member of the methodlist structure contains the doc string for the
method.)
- The __coerce__ and __cmp__ methods for user-defined classes once
again work as expected. As an example, there's a new standard class
Complex in the library.
- The functions posix.popen() and posix.fdopen() now have an optional
third argument to specify the buffer size, and default their second
(mode) argument to 'r' -- in analogy to the built-in open() function.
The same applies to posixfile.open() and the socket method makefile().
- The thread.exit_thread() function now raises SystemExit so that
'finally' clauses are honored and a memory leak is plugged.
- Improved X11 and Motif support, by Sjoerd Mullender. This extension
is being maintained and distributed separately.
- Improved support for the Apple Macintosh, in part by Jack Jansen,
e.g. interfaces to (a few) resource mananger functions, get/set file
type and creator, gestalt, sound manager, speech manager, MacTCP, comm
toolbox, and the think C console library. This is being maintained
and distributed separately.
- Improved version for Windows NT, by Mark Hammond. This is being
maintained and distributed separately.
- Used autoconf 2.0 to generate the configure script. Adapted
configure.in to use the new features in autoconf 2.0.
- It now builds on the NeXT without intervention, even on the 3.3
Sparc pre-release.
- Characters passed to isspace() and friends are masked to nonnegative
values.
- Correctly compute pow(-3.0, 3).
- Fix portability problems with getopt (configure now checks for a
non-GNU getopt).
- Don't add frozenmain.o to libPython.a.
- Exceptions can now be classes. ALl built-in exceptions are still
string objects, but this will change in the future.
- The socket module exports a long list of socket related symbols.
(More built-in modules will export their symbolic constants instead of
relying on a separately generated Python module.)
- When a module object is deleted, it clears out its own dictionary.
This fixes a circularity in the references between functions and
their global dictionary.
- Changed the error handling by [new]getargs() e.g. for "O&".
- Dynamic loading of modules using shared libraries is supported for
several new platforms.
- Support "O&", "[...]" and "{...}" in mkvalue().
- Extension to findmethod(): findmethodinchain() (where a chain is a
linked list of methodlist arrays). The calling interface for
findmethod() has changed: it now gets a pointer to the (static!)
methodlist structure rather than just to the function name -- this
saves copying flags etc. into the (short-lived) method object.
- The callable() function is now public.
- Object types can define a few new operations by setting function
pointers in the type object structure: tp_call defines how an object
is called, and tp_str defines how an object's str() is computed.
===================================
==> Release 1.1.1 (10 Nov 1994) <==
===================================
This is a pure bugfix release again. See the ChangeLog file for details.
One exception: a few new features were added to tkinter.
=================================
==> Release 1.1 (11 Oct 1994) <==
=================================
This release adds several new features, improved configuration and
portability, and fixes more bugs than I can list here (including some
memory leaks).
The source compiles and runs out of the box on more platforms than
ever -- including Windows NT. Makefiles or projects for a variety of
non-UNIX platforms are provided.
APOLOGY: some new features are badly documented or not at all. I had
the choice -- postpone the new release indefinitely, or release it
now, with working code but some undocumented areas. The problem with
postponing the release is that people continue to suffer from existing
bugs, and send me patches based on the previous release -- which I
can't apply directly because my own source has changed. Also, some
new modules (like signal) have been ready for release for quite some
time, and people are anxiously waiting for them. In the case of
signal, the interface is simple enough to figure out without
documentation (if you're anxious enough :-). In this case it was not
simple to release the module on its own, since it relies on many small
patches elsewhere in the source.
For most new Python modules, the source code contains comments that
explain how to use them. Documentation for the Tk interface, written
by Matt Conway, is available as tkinter-doc.tar.gz from the Python
home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
new operator overloading facilities, have a look at Demo/classes:
Complex.py and Rat.py show how to implement a numeric type without and
with __coerce__ method. Also have a look at the end of the Tutorial
document (Doc/tut.tex). If you're still confused: use the newsgroup
or mailing list.
New language features:
- More flexible operator overloading for user-defined classes
(INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
- Classes can define methods named __getattr__, __setattr__ and
__delattr__ to trap attribute accesses. See end of tutorial.
- Classes can define method __call__ so instances can be called
directly. See end of tutorial.
New support facilities:
- The Makefiles (for the base interpreter as well as for extensions)
now support creating dynamically loadable modules if the platform
supports shared libraries.
- Passing the interpreter a .pyc file as script argument will execute
the code in that file. (On the Mac such files can be double-clicked!)
- New Freeze script, to create independently distributable "binaries"
of Python programs -- look in Demo/freeze
- Improved h2py script (in Demo/scripts) follows #includes and
supports macros with one argument
- New module compileall generates .pyc files for all modules in a
directory (tree) without also executing them
- Threads should work on more platforms
New built-in modules:
- tkinter (support for Tcl's Tk widget set) is now part of the base
distribution
- signal allows catching or ignoring UNIX signals (unfortunately still
undocumented -- any taker?)
- termios provides portable access to POSIX tty settings
- curses provides an interface to the System V curses library
- syslog provides an interface to the (BSD?) syslog daemon
- 'new' provides interfaces to create new built-in object types
(e.g. modules and functions)
- sybase provides an interface to SYBASE database
New/obsolete built-in methods:
- callable(x) tests whether x can be called
- sockets now have a setblocking() method
- sockets no longer have an allowbroadcast() method
- socket methods send() and sendto() return byte count
New standard library modules:
- types.py defines standard names for built-in types, e.g. StringType
- urlparse.py parses URLs according to the latest internet draft
- uu.py does uuencode/uudecode (not the fastest in the world, but
quicker than installing uuencode on a non-UNIX machine :-)
- New, faster and more powerful profile module.py
- mhlib.py provides interface to MH folders and messages
New facilities for extension writers (unfortunately still
undocumented):
- newgetargs() supports optional arguments and improved error messages
- O!, O& O? formats for getargs allow more versatile type checking of
non-standard types
- can register pending asynchronous callback, to be called the next
time the Python VM begins a new instruction (Py_AddPendingCall)
- can register cleanup routines to be called when Python exits
(Py_AtExit)
- makesetup script understands C++ files in Setup file (use file.C
or file.cc)
- Make variable OPT is passed on to sub-Makefiles
- An init<module>() routine may signal an error by not entering
the module in the module table and raising an exception instead
- For long module names, instead of foobarbletchmodule.c you can
use foobarbletch.c
- getintvalue() and getfloatvalue() try to convert any object
instead of requiring an "intobject" or "floatobject"
- All the [new]getargs() formats that retrieve an integer value
will now also work if a float is passed
- C function listtuple() converts list to tuple, fast
- You should now call sigcheck() instead of intrcheck();
sigcheck() also sets an exception when it returns nonzero
====================================
==> Release 1.0.3 (14 July 1994) <==
====================================
This release consists entirely of bug fixes to the C sources; see the
head of ../ChangeLog for a complete list. Most important bugs fixed:
- Sometimes the format operator (string%expr) would drop the last
character of the format string
- Tokenizer looped when last line did not end in \n
- Bug when triple-quoted string ended in quote plus newline
- Typo in socketmodule (listen) (== instead of =)
- typing vars() at the >>> prompt would cause recursive output
==================================
==> Release 1.0.2 (4 May 1994) <==
==================================
Overview of the most visible changes. Bug fixes are not listed. See
also ChangeLog.
Tokens
------
* String literals follow Standard C rules: they may be continued on
the next line using a backslash; adjacent literals are concatenated
at compile time.
* A new kind of string literals, surrounded by triple quotes (""" or
'''), can be continued on the next line without a backslash.
Syntax
------
* Function arguments may have a default value, e.g. def f(a, b=1);
defaults are evaluated at function definition time. This also applies
to lambda.
* The try-except statement has an optional else clause, which is
executed when no exception occurs in the try clause.
Interpreter
-----------
* The result of a statement-level expression is no longer printed,
except_ for expressions entered interactively. Consequently, the -k
command line option is gone.
* The result of the last printed interactive expression is assigned to
the variable '_'.
* Access to implicit global variables has been speeded up by removing
an always-failing dictionary lookup in the dictionary of local
variables (mod suggested by Steve Makewski and Tim Peters).
* There is a new command line option, -u, to force stdout and stderr
to be unbuffered.
* Incorporated Steve Majewski's mods to import.c for dynamic loading
under AIX.
* Fewer chances of dumping core when trying to reload or re-import
static built-in, dynamically loaded built-in, or frozen modules.
* Loops over sequences now don't ask for the sequence's length when
they start, but try to access items 0, 1, 2, and so on until they hit
an IndexError. This makes it possible to create classes that generate
infinite or indefinite sequences a la Steve Majewski. This affects
for loops, the (not) in operator, and the built-in functions filter(),
map(), max(), min(), reduce().
Changed Built-in operations
---------------------------
* The '%' operator on strings (printf-style formatting) supports a new
feature (adapted from a patch by Donald Beaudry) to allow
'%(<key>)<format>' % {...} to take values from a dictionary by name
instead of from a tuple by position (see also the new function
vars()).
* The '%s' formatting operator is changed to accept any type and
convert it to a string using str().
* Dictionaries with more than 20,000 entries can now be created
(thanks to Steve Kirsch).
New Built-in Functions
----------------------
* vars() returns a dictionary containing the local variables; vars(m)
returns a dictionary containing the variables of module m. Note:
dir(x) is now equivalent to vars(x).keys().
Changed Built-in Functions
--------------------------
* open() has an optional third argument to specify the buffer size: 0
for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
for default.
* open()'s second argument is now optional; it defaults to "r".
* apply() now checks that its second argument is indeed a tuple.
New Built-in Modules
--------------------
Changed Built-in Modules
------------------------
The thread module no longer supports exit_prog().
New Python Modules
------------------
* Module addpack contains a standard interface to modify sys.path to
find optional packages (groups of related modules).
* Module urllib contains a number of functions to access
World-Wide-Web files specified by their URL.
* Module httplib implements the client side of the HTTP protocol used
by World-Wide-Web servers.
* Module gopherlib implements the client side of the Gopher protocol.
* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
style mailbox files.
* Module random contains various random distributions, e.g. gauss().
* Module lockfile locks and unlocks open files using fcntl (inspired
by a similar module by Andy Bensky).
* Module ntpath (by Jaap Vermeulen) implements path operations for
Windows/NT.
* Module test_thread (in Lib/test) contains a small test set for the
thread module.
Changed Python Modules
----------------------
* The string module's expandvars() function is now documented and is
implemented in Python (using regular expressions) instead of forking
off a shell process.
* Module rfc822 now supports accessing the header fields using the
mapping/dictionary interface, e.g. h['subject'].
* Module pdb now makes it possible to set a break on a function
(syntax: break <expression>, where <expression> yields a function
object).
Changed Demos
-------------
* The Demo/scripts/freeze.py script is working again (thanks to Jaap
Vermeulen).
New Demos
---------
* Demo/threads/Generator.py is a proposed interface for restartable
functions a la Tim Peters.
* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
directory full of HTML pages which between them contain links to all
the newsgroups available on your server.
* Demo/dns contains a DNS (Domain Name Server) client.
* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
nice enhanced Python shell!!!).
* Demo/turing contains a Turing machine by Amrit Prem.
Documentation
-------------
* Documented new language features mentioned above (but not all new
modules).
* Added a chapter to the Tutorial describing recent additions to
Python.
* Clarified some sentences in the reference manual,
e.g. break/continue, local/global scope, slice assignment.
Source Structure
----------------
* Moved Include/tokenizer.h to Parser/tokenizer.h.
* Added Python/getopt.c for systems that don't have it.
Emacs mode
----------
* Indentation of continuated lines is done more intelligently;
consequently the variable py-continuation-offset is gone.
========================================
==> Release 1.0.1 (15 February 1994) <==
========================================
* Many portability fixes should make it painless to build Python on
several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
* Fixed test for <stdarg.h> -- this broke on some platforms.
* Fixed test for shared library dynalic loading -- this broke on SunOS
4.x using the GNU loader.
* Changed order and number of SVR4 networking libraries (it is now
-lsocket -linet -lnsl, if these libraries exist).
* Installing the build intermediate stages with "make libainstall" now
also installs config.c.in, Setup and makesetup, which are used by the
new Extensions mechanism.
* Improved README file contains more hints and new troubleshooting
section.
* The built-in module strop now defines fast versions of three more
functions of the standard string module: atoi(), atol() and atof().
The strop versions of atoi() and atol() support an optional second
argument to specify the base (default 10). NOTE: you don't have to
explicitly import strop to use the faster versions -- the string
module contains code to let versions from stop override the default
versions.
* There is now a working Lib/dospath.py for those who use Python under
DOS (or Windows). Thanks, Jaap!
* There is now a working Modules/dosmodule.c for DOS (or Windows)
system calls.
* Lib.os.py has been reorganized (making it ready for more operating
systems).
* Lib/ospath.py is now obsolete (use os.path instead).
* Many fixes to the tutorial to make it match Python 1.0. Thanks,
Tim!
* Fixed Doc/Makefile, Doc/README and various scripts there.
* Added missing description of fdopen to Doc/libposix.tex.
* Made cleanup() global, for the benefit of embedded applications.
* Added parsing of addresses and dates to Lib/rfc822.py.
* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
them usable at all.
* New module Lib/wave.py reads RIFF (*.wav) audio files.
* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
belongs.
* New options and comments for Modules/makesetup (used by new
Extension mechanism).
* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
and elsewhere.
* Fixed coredump in filter(None, 'abcdefg').
=======================================
==> Release 1.0.0 (26 January 1994) <==
=======================================
As is traditional, so many things have changed that I can't pretend to
be complete in these release notes, but I'll try anyway :-)
Note that the very last section is labeled "remaining bugs".
Source organization and build process
-------------------------------------
* The sources have finally been split: instead of a single src
subdirectory there are now separate directories Include, Parser,
Grammar, Objects, Python and Modules. Other directories also start
with a capital letter: Misc, Doc, Lib, Demo.
* A few extensions (notably Amoeba and X support) have been moved to a
separate subtree Extensions, which is no longer in the core
distribution, but separately ftp'able as extensions.tar.Z. (The
distribution contains a placeholder Ext-dummy with a description of
the Extensions subtree as well as the most recent versions of the
scripts used there.)
* A few large specialized demos (SGI video and www) have been
moved to a separate subdirectory Demo2, which is no longer in the core
distribution, but separately ftp'able as demo2.tar.Z.
* Parts of the standard library have been moved to subdirectories:
there are now standard subdirectories stdwin, test, sgi and sun4.
* The configuration process has radically changed: I now use GNU
autoconf. This makes it much easier to build on new Unix flavors, as
well as fully supporting VPATH (if your Make has it). The scripts
Configure.py and Addmodule.sh are no longer needed. Many source files
have been adapted in order to work with the symbols that the configure
script generated by autoconf defines (or not); the resulting source is
much more portable to different C compilers and operating systems,
even non Unix systems (a Mac port was done in an afternoon). See the
toplevel README file for a description of the new build process.
* GNU readline (a slightly newer version) is now a subdirectory of the
Python toplevel. It is still not automatically configured (being
totally autoconf-unaware :-). One problem has been solved: typing
Control-C to a readline prompt will now work. The distribution no
longer contains a "super-level" directory (above the python toplevel
directory), and dl, dl-dld and GNU dld are no longer part of the
Python distribution (you can still ftp them from
ftp.cwi.nl:/pub/dynload).
* The DOS functions have been taken out of posixmodule.c and moved
into a separate file dosmodule.c.
* There's now a separate file version.c which contains nothing but
the version number.
* The actual main program is now contained in config.c (unless NO_MAIN
is defined); pythonmain.c now contains a function realmain() which is
called from config.c's main().
* All files needed to use the built-in module md5 are now contained in
the distribution. The module has been cleaned up considerably.
Documentation
-------------
* The library manual has been split into many more small latex files,
so it is easier to edit Doc/lib.tex file to create a custom library
manual, describing only those modules supported on your system. (This
is not automated though.)
* A fourth manual has been added, titled "Extending and Embedding the
Python Interpreter" (Doc/ext.tex), which collects information about
the interpreter which was previously spread over several files in the
misc subdirectory.
* The entire documentation is now also available on-line for those who
have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
"http://www.cwi.nl/~guido/Python.html".
Syntax
------
* Strings may now be enclosed in double quotes as well as in single
quotes. There is no difference in interpretation. The repr() of
string objects will use double quotes if the string contains a single
quote and no double quotes. Thanks to Amrit Prem for these changes!
* There is a new keyword 'exec'. This replaces the exec() built-in
function. If a function contains an exec statement, local variable
optimization is not performed for that particular function, thus
making assignment to local variables in exec statements less
confusing. (As a consequence, os.exec and python.exec have been
renamed to execv.)
* There is a new keyword 'lambda'. An expression of the form
lambda <parameters> : <expression>
yields an anonymous function. This is really only syntactic sugar;
you can just as well define a local function using
def some_temporary_name(<parameters>): return <expression>
Lambda expressions are particularly useful in combination with map(),
filter() and reduce(), described below. Thanks to Amrit Prem for
submitting this code (as well as map(), filter(), reduce() and
xrange())!
Built-in functions
------------------
* The built-in module containing the built-in functions is called
__builtin__ instead of builtin.
* New built-in functions map(), filter() and reduce() perform standard
functional programming operations (though not lazily):
- map(f, seq) returns a new sequence whose items are the items from
seq with f() applied to them.
- filter(f, seq) returns a subsequence of seq consisting of those
items for which f() is true.
- reduce(f, seq, initial) returns a value computed as follows:
acc = initial
for item in seq: acc = f(acc, item)
return acc
* New function xrange() creates a "range object". Its arguments are
the same as those of range(), and when used in a for loop a range
objects also behaves identical. The advantage of xrange() over
range() is that its representation (if the range contains many
elements) is much more compact than that of range(). The disadvantage
is that the result cannot be used to initialize a list object or for
the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
architectures, benchmarks have shown that "for i in range(...): ..."
actually executes *faster* than "for i in xrange(...): ...", but on
memory starved machines like PCs running DOS range(100000) may be just
too big to be represented at all...
* Built-in function exec() has been replaced by the exec statement --
see above.
The interpreter
---------------
* Syntax errors are now not printed to stderr by the parser, but
rather the offending line and other relevant information are packed up
in the SyntaxError exception argument. When the main loop catches a
SyntaxError exception it will print the error in the same format as
previously, but at the proper position in the stack traceback.
* You can now set a maximum to the number of traceback entries
printed by assigning to sys.tracebacklimit. The default is 1000.
* The version number in .pyc files has changed yet again.
* It is now possible to have a .pyc file without a corresponding .py
file. (Warning: this may break existing installations if you have an
old .pyc file lingering around somewhere on your module search path
without a corresponding .py file, when there is a .py file for a
module of the same name further down the path -- the new interpreter
will find the first .pyc file and complain about it, while the old
interpreter would ignore it and use the .py file further down.)
* The list sys.builtin_module_names is now sorted and also contains
the names of a few hardwired built-in modules (sys, __main__ and
__builtin__).
* A module can now find its own name by accessing the global variable
__name__. Assigning to this variable essentially renames the module
(it should also be stored under a different key in sys.modules).
A neat hack follows from this: a module that wants to execute a main
program when called as a script no longer needs to compare
sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
* When an object is printed by the print statement, its implementation
of str() is used. This means that classes can define __str__(self) to
direct how their instances are printed. This is different from
__repr__(self), which should define an unambigous string
representation of the instance. (If __str__() is not defined, it
defaults to __repr__().)
* Functions and code objects can now be compared meaningfully.
* On systems supporting SunOS or SVR4 style shared libraries, dynamic
loading of modules using shared libraries is automatically configured.
Thanks to Bill Jansen and Denis Severson for contributing this change!
Built-in objects
----------------
* File objects have acquired a new method writelines() which is the
reverse of readlines(). (It does not actually write lines, just a
list of strings, but the symmetry makes the choice of name OK.)
Built-in modules
----------------
* Socket objects no longer support the avail() method. Use the select
module instead, or use this function to replace it:
def avail(f):
import select
return f in select.select([f], [], [], 0)[0]
* Initialization of stdwin is done differently. It actually modifies
sys.argv (taking out the options the X version of stdwin recognizes)
the first time it is imported.
* A new built-in module parser provides a rudimentary interface to the
python parser. Corresponding standard library modules token and symbol
defines the numeric values of tokens and non-terminal symbols.
* The posix module has acquired new functions setuid(), setgid(),
execve(), and exec() has been renamed to execv().
* The array module is extended with 8-byte object swaps, the 'i'
format character, and a reverse() method. The read() and write()
methods are renamed to fromfile() and tofile().
* The rotor module has freed of portability bugs. This introduces a
backward compatibility problem: strings encoded with the old rotor
module can't be decoded by the new version.
* For select.select(), a timeout (4th) argument of None means the same
as leaving the timeout argument out.
* Module strop (and hence standard library module string) has acquired
a new function: rindex(). Thanks to Amrit Prem!
* Module regex defines a new function symcomp() which uses an extended
regular expression syntax: parenthesized subexpressions may be labeled
using the form "\(<labelname>...\)", and the group() method can return
sub-expressions by name. Thanks to Tracy Tims for these changes!
* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
Mullender!
Standard library modules
------------------------
* The library is now split in several subdirectories: all stuff using
stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
test modules are in Lib/test. The default module search path will
include all relevant subdirectories by default.
* Module os now knows about trying to import dos. It defines
functions execl(), execle(), execlp() and execvp().
* New module dospath (should be attacked by a DOS hacker though).
* All modules defining classes now define __init__() constructors
instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
* Some minor changes and bugfixes module ftplib (mostly Steve
Majewski's suggestions); the debug() method is renamed to
set_debuglevel().
* Some new test modules (not run automatically by testall though):
test_audioop, test_md5, test_rgbimg, test_select.
* Module string now defines rindex() and rfind() in analogy of index()
and find(). It also defines atof() and atol() (and corresponding
exceptions) in analogy to atoi().
* Added help() functions to modules profile and pdb.
* The wdb debugger (now in Lib/stdwin) now shows class or instance
variables on a double click. Thanks to Sjoerd Mullender!
* The (undocumented) module lambda has gone -- you couldn't import it
any more, and it was basically more a demo than a library module...
Multimedia extensions
---------------------
* The optional built-in modules audioop and imageop are now standard
parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
for contributing this code!
* There's a new operation in audioop: minmax().
* There's a new built-in module called rgbimg which supports portable
efficient reading of SGI RCG image files. Thanks also to Paul
Haeberli for the original code! (Who will contribute a GIF reader?)
* The module aifc is gone -- you should now always use aifc, which has
received a facelift.
* There's a new module sunau., for reading Sun (and NeXT) audio files.
* There's a new module audiodev which provides a uniform interface to
(SGI Indigo and Sun Sparc) audio hardware.
* There's a new module sndhdr which recognizes various sound files by
looking in their header and checking for various magic words.
Optimizations
-------------
* Most optimizations below can be configured by compile-time flags.
Thanks to Sjoerd Mullender for submitting these optimizations!
* Small integers (default -1..99) are shared -- i.e. if two different
functions compute the same value it is possible (but not
guaranteed!!!) that they return the same *object*. Python programs
can detect this but should *never* rely on it.
* Empty tuples (which all compare equal) are shared in the same
manner.
* Tuples of size up to 20 (default) are put in separate free lists
when deallocated.
* There is a compile-time option to cache a string's hash function,
but this appeared to have a negligeable effect, and as it costs 4
bytes per string it is disabled by default.
Embedding Python
----------------
* The initialization interface has been simplified somewhat. You now
only call "initall()" to initialize the interpreter.
* The previously announced renaming of externally visible identifiers
has not been carried out. It will happen in a later release. Sorry.
Miscellaneous bugs that have been fixed
---------------------------------------
* All known portability bugs.
* Version 0.9.9 dumped core in <listobject>.sort() which has been
fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
on the mailing list while I was away!
* Core dump on a format string ending in '%', e.g. in the expression
'%' % None.
* The array module yielded a bogus result for concatenation (a+b would
yield a+a).
* Some serious memory leaks in strop.split() and strop.splitfields().
* Several problems with the nis module.
* Subtle problem when copying a class method from another class
through assignment (the method could not be called).
Remaining bugs
--------------
* One problem with 64-bit machines remains -- since .pyc files are
portable and use only 4 bytes to represent an integer object, 64-bit
integer literals are silently truncated when written into a .pyc file.
Work-around: use eval('123456789101112').
* The freeze script doesn't work any more. A new and more portable
one can probably be cooked up using tricks from Extensions/mkext.py.
* The dos support hasn't been tested yet. (Really Soon Now we should
have a PC with a working C compiler!)
===================================
==> Release 0.9.9 (29 Jul 1993) <==
===================================
I *believe* these are the main user-visible changes in this release,
but there may be others. SGI users may scan the {src,lib}/ChangeLog
files for improvements of some SGI specific modules, e.g. aifc and
cl. Developers of extension modules should also read src/ChangeLog.
Naming of C symbols used by the Python interpreter
--------------------------------------------------
* This is the last release using the current naming conventions. New
naming conventions are explained in the file misc/NAMING.
Summarizing, all externally visible symbols get (at least) a "Py"
prefix, and most functions are renamed to the standard form
PyModule_FunctionName.
* Writers of extensions are urged to start using the new naming
conventions. The next release will use the new naming conventions
throughout (it will also have a different source directory
structure).
* As a result of the preliminary work for the great renaming, many
functions that were accidentally global have been made static.
BETA X11 support
----------------
* There are now modules interfacing to the X11 Toolkit Intrinsics, the
Athena widgets, and the Motif 1.1 widget set. These are not yet
documented except through the examples and README file in the demo/x11
directory. It is expected that this interface will be replaced by a
more powerful and correct one in the future, which may or may not be
backward compatible. In other words, this part of the code is at most
BETA level software! (Note: the rest of Python is rock solid as ever!)
* I understand that the above may be a bit of a disappointment,
however my current schedule does not allow me to change this situation
before putting the release out of the door. By releasing it
undocumented and buggy, at least some of the (working!) demo programs,
like itr (my Internet Talk Radio browser) become available to a larger
audience.
* There are also modules interfacing to SGI's "Glx" widget (a GL
window wrapped in a widget) and to NCSA's "HTML" widget (which can
format HyperText Markup Language, the document format used by the
World Wide Web).
* I've experienced some problems when building the X11 support. In
particular, the Xm and Xaw widget sets don't go together, and it
appears that using X11R5 is better than using X11R4. Also the threads
module and its link time options may spoil things. My own strategy is
to build two Python binaries: one for use with X11 and one without
it, which can contain a richer set of built-in modules. Don't even
*think* of loading the X11 modules dynamically...
Environmental changes
---------------------
* Compiled files (*.pyc files) created by this Python version are
incompatible with those created by the previous version. Both
versions detect this and silently create a correct version, but it
means that it is not a good idea to use the same library directory for
an old and a new interpreter, since they will start to "fight" over
the *.pyc files...
* When a stack trace is printed, the exception is printed last instead
of first. This means that if the beginning of the stack trace
scrolled out of your window you can still see what exception caused
it.
* Sometimes interrupting a Python operation does not work because it
hangs in a blocking system call. You can now kill the interpreter by
interrupting it three times. The second time you interrupt it, a
message will be printed telling you that the third interrupt will kill
the interpreter. The "sys.exitfunc" feature still makes limited
clean-up possible in this case.
Changes to the command line interface
-------------------------------------
* The python usage message is now much more informative.
* New option -i enters interactive mode after executing a script --
useful for debugging.
* New option -k raises an exception when an expression statement
yields a value other than None.
* For each option there is now also a corresponding environment
variable.
Using Python as an embedded language
------------------------------------
* The distribution now contains (some) documentation on the use of
Python as an "embedded language" in other applications, as well as a
simple example. See the file misc/EMBEDDING and the directory embed/.
Speed improvements
------------------
* Function local variables are now generally stored in an array and
accessed using an integer indexing operation, instead of through a
dictionary lookup. (This compensates the somewhat slower dictionary
lookup caused by the generalization of the dictionary module.)
Changes to the syntax
---------------------
* Continuation lines can now *sometimes* be written without a
backslash: if the continuation is contained within nesting (), [] or
{} brackets the \ may be omitted. There's a much improved
python-mode.el in the misc directory which knows about this as well.
* You can no longer use an empty set of parentheses to define a class
without base classes. That is, you no longer write this:
class Foo(): # syntax error
...
You must write this instead:
class Foo:
...
This was already the preferred syntax in release 0.9.8 but many
people seemed not to have picked it up. There's a Python script that
fixes old code: demo/scripts/classfix.py.
* There's a new reserved word: "access". The syntax and semantics are
still subject of research and debate (as well as undocumented), but
the parser knows about the keyword so you must not use it as a
variable, function, or attribute name.
Changes to the semantics of the language proper
-----------------------------------------------
* The following compatibility hack is removed: if a function was
defined with two or more arguments, and called with a single argument
that was a tuple with just as many arguments, the items of this tuple
would be used as the arguments. This is no longer supported.
Changes to the semantics of classes and instances
-------------------------------------------------
* Class variables are now also accessible as instance variables for
reading (assignment creates an instance variable which overrides the
class variable of the same name though).
* If a class attribute is a user-defined function, a new kind of
object is returned: an "unbound method". This contains a pointer to
the class and can only be called with a first argument which is a
member of that class (or a derived class).
* If a class defines a method __init__(self, arg1, ...) then this
method is called when a class instance is created by the classname()
construct. Arguments passed to classname() are passed to the
__init__() method. The __init__() methods of base classes are not
automatically called; the derived __init__() method must call these if
necessary (this was done so the derived __init__() method can choose
the call order and arguments for the base __init__() methods).
* If a class defines a method __del__(self) then this method is called
when an instance of the class is about to be destroyed. This makes it
possible to implement clean-up of external resources attached to the
instance. As with __init__(), the __del__() methods of base classes
are not automatically called. If __del__ manages to store a reference
to the object somewhere, its destruction is postponed; when the object
is again about to be destroyed its __del__() method will be called
again.
* Classes may define a method __hash__(self) to allow their instances
to be used as dictionary keys. This must return a 32-bit integer.
Minor improvements
------------------
* Function and class objects now know their name (the name given in
the 'def' or 'class' statement that created them).
* Class instances now know their class name.
Additions to built-in operations
--------------------------------
* The % operator with a string left argument implements formatting
similar to sprintf() in C. The right argument is either a single
value or a tuple of values. All features of Standard C sprintf() are
supported except %p.
* Dictionaries now support almost any key type, instead of just
strings. (The key type must be an immutable type or must be a class
instance where the class defines a method __hash__(), in order to
avoid losing track of keys whose value may change.)
* Built-in methods are now compared properly: when comparing x.meth1
and y.meth2, if x is equal to y and the methods are defined by the
same function, x.meth1 compares equal to y.meth2.
Additions to built-in functions
-------------------------------
* str(x) returns a string version of its argument. If the argument is
a string it is returned unchanged, otherwise it returns `x`.
* repr(x) returns the same as `x`. (Some users found it easier to
have this as a function.)
* round(x) returns the floating point number x rounded to a whole
number, represented as a floating point number. round(x, n) returns x
rounded to n digits.
* hasattr(x, name) returns true when x has an attribute with the given
name.
* hash(x) returns a hash code (32-bit integer) of an arbitrary
immutable object's value.
* id(x) returns a unique identifier (32-bit integer) of an arbitrary
object.
* compile() compiles a string to a Python code object.
* exec() and eval() now support execution of code objects.
Changes to the documented part of the library (standard modules)
----------------------------------------------------------------
* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
the border case '/foo/..' returns '/' instead of ''.
* A new function string.find() is added with similar semantics to
string.index(); however when it does not find the given substring it
returns -1 instead of raising string.index_error.
Changes to built-in modules
---------------------------
* New optional module 'array' implements operations on sequences of
integers or floating point numbers of a particular size. This is
useful to manipulate large numerical arrays or to read and write
binary files consisting of numerical data.
* Regular expression objects created by module regex now support a new
method named group(), which returns one or more \(...\) groups by number.
The number of groups is increased from 10 to 100.
* Function compile() in module regex now supports an optional mapping
argument; a variable casefold is added to the module which can be used
as a standard uppercase to lowercase mapping.
* Module time now supports many routines that are defined in the
Standard C time interface (<time.h>): gmtime(), localtime(),
asctime(), ctime(), mktime(), as well as these variables (taken from
System V): timezone, altzone, daylight and tzname. (The corresponding
functions in the undocumented module calendar have been removed; the
undocumented and unfinished module tzparse is now obsolete and will
disappear in a future release.)
* Module strop (the fast built-in version of standard module string)
now uses C's definition of whitespace instead of fixing it to space,
tab and newline; in practice this usually means that vertical tab,
form feed and return are now also considered whitespace. It exports
the string of characters that are considered whitespace as well as the
characters that are considered lowercase or uppercase.
* Module sys now defines the variable builtin_module_names, a list of
names of modules built into the current interpreter (including not
yet imported, but excluding two special modules that always have to be
defined -- sys and builtin).
* Objects created by module sunaudiodev now also support flush() and
close() methods.
* Socket objects created by module socket now support an optional
flags argument for their methods sendto() and recvfrom().
* Module marshal now supports dumping to and loading from strings,
through the functions dumps() and loads().
* Module stdwin now supports some new functionality. You may have to
ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
Bugs fixed
----------
* Fixed comparison of negative long integers.
* The tokenizer no longer botches input lines longer than BUFSIZ.
* Fixed several severe memory leaks in module select.
* Fixed memory leaks in modules socket and sv.
* Fixed memory leak in divmod() for long integers.
* Problems with definition of floatsleep() on Suns fixed.
* Many portability bugs fixed (and undoubtedly new ones added :-).
Changes to the build procedure
------------------------------
* The Makefile supports some new targets: "make default" and "make
all". Both are by normally equivalent to "make python".
* The Makefile no longer uses $> since it's not supported by all
versions of Make.
* The header files now all contain #ifdef constructs designed to make
it safe to include the same header file twice, as well as support for
inclusion from C++ programs (automatic extern "C" { ... } added).
Freezing Python scripts
-----------------------
* There is now some support for "freezing" a Python script as a
stand-alone executable binary file. See the script
demo/scripts/freeze.py. It will require some site-specific tailoring
of the script to get this working, but is quite worthwhile if you write
Python code for other who may not have built and installed Python.
MS-DOS
------
* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
Marcel van der Peijl! This requires fewer compatibility hacks in
posixmodule.c. The executable is not yet available but will be soon
(check the mailing list).
* The default PYTHONPATH has changed.
Changes for developers of extension modules
-------------------------------------------
* Read src/ChangeLog for full details.
SGI specific changes
--------------------
* Read src/ChangeLog for full details.
==================================
==> Release 0.9.8 (9 Jan 1993) <==
==================================
I claim no completeness here, but I've tried my best to scan the log
files throughout my source tree for interesting bits of news. A more
complete account of the changes is to be found in the various
ChangeLog files. See also "News for release 0.9.7beta" below if you're
still using release 0.9.6, and the file HISTORY if you have an even
older release.
--Guido
Changes to the language proper
------------------------------
There's only one big change: the conformance checking for function
argument lists (of user-defined functions only) is stricter. Earlier,
you could get away with the following:
(a) define a function of one argument and call it with any
number of arguments; if the actual argument count wasn't
one, the function would receive a tuple containing the
arguments (an empty tuple if there were none).
(b) define a function of two arguments, and call it with more
than two arguments; if there were more than two arguments,
the second argument would be passed as a tuple containing
the second and further actual arguments.
(Note that an argument (formal or actual) that is a tuple is counted as
one; these rules don't apply inside such tuples, only at the top level
of the argument list.)
Case (a) was needed to accommodate variable-length argument lists;
there is now an explicit "varargs" feature (precede the last argument
with a '*'). Case (b) was needed for compatibility with old class
definitions: up to release 0.9.4 a method with more than one argument
had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
Version 0.9.6 provide better ways to handle both casees, bot provided
backward compatibility; version 0.9.8 retracts the compatibility hacks
since they also cause confusing behavior if a function is called with
the wrong number of arguments.
There's a script that helps converting classes that still rely on (b),
provided their methods' first argument is called "self":
demo/scripts/methfix.py.
If this change breaks lots of code you have developed locally, try
#defining COMPAT_HACKS in ceval.c.
(There's a third compatibility hack, which is the reverse of (a): if a
function is defined with two or more arguments, and called with a
single argument that is a tuple with just as many arguments, the items
of this tuple will be used as the arguments. Although this can (and
should!) be done using the built-in function apply() instead, it isn't
withdrawn yet.)
One minor change: comparing instance methods works like expected, so
that if x is an instance of a user-defined class and has a method m,
then (x.m==x.m) yields 1.
The following was already present in 0.9.7beta, but not explicitly
mentioned in the NEWS file: user-defined classes can now define types
that behave in almost allrespects like numbers. See
demo/classes/Rat.py for a simple example.
Changes to the build process
----------------------------
The Configure.py script and the Makefile has been made somewhat more
bullet-proof, after reports of (minor) trouble on certain platforms.
There is now a script to patch Makefile and config.c to add a new
optional built-in module: Addmodule.sh. Read the script before using!
Using Addmodule.sh, all optional modules can now be configured at
compile time using Configure.py, so there are no modules left that
require dynamic loading.
The Makefile has been fixed to make it easier to use with the VPATH
feature of some Make versions (e.g. SunOS).
Changes affecting portability
-----------------------------
Several minor portability problems have been solved, e.g. "malloc.h"
has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
the system now tolerates malloc(0) returning 0.
For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
distributed with Python. This solves several minor problems, in
particular scripts invoked using #! can now use dynamic loading.
Changes to the interpreter interface
------------------------------------
On popular demand, there's finally a "profile" feature for interactive
use of the interpreter. If the environment variable $PYTHONSTARTUP is
set to the name of an existing file, Python statements in this file
are executed when the interpreter is started in interactive mode.
There is a new clean-up mechanism, complementing try...finally: if you
assign a function object to sys.exitfunc, it will be called when
Python exits or receives a SIGTERM or SIGHUP signal.
The interpreter is now generally assumed to live in
/usr/local/bin/python (as opposed to /usr/local/python). The script
demo/scripts/fixps.py will update old scripts in place (you can easily
modify it to do other similar changes).
Most I/O that uses sys.stdin/stdout/stderr will now use any object
assigned to those names as long as the object supports readline() or
write() methods.
The parser stack has been increased to 500 to accommodate more
complicated expressions (7 levels used to be the practical maximum,
it's now about 38).
The limit on the size of the *run-time* stack has completely been
removed -- this means that tuple or list displays can contain any
number of elements (formerly more than 50 would crash the
interpreter).
Changes to existing built-in functions and methods
--------------------------------------------------
The built-in functions int(), long(), float(), oct() and hex() now
also apply to class instalces that define corresponding methods
(__int__ etc.).
New built-in functions
----------------------
The new functions str() and repr() convert any object to a string.
The function repr(x) is in all respects equivalent to `x` -- some
people prefer a function for this. The function str(x) does the same
except if x is already a string -- then it returns x unchanged
(repr(x) adds quotes and escapes "funny" characters as octal escapes).
The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
Changes to general built-in modules
-----------------------------------
The time module's functions are more general: time() returns a
floating point number and sleep() accepts one. Their accuracies
depends on the precision of the system clock. Millisleep is no longer
needed (although it still exists for now), but millitimer is still
needed since on some systems wall clock time is only available with
seconds precision, while a source of more precise time exists that
isn't synchronized with the wall clock. (On UNIX systems that support
the BSD gettimeofday() function, time.time() is as time.millitimer().)
The string representation of a file object now includes an address:
'<file 'filename', mode 'r' at #######>' where ###### is a hex number
(the object's address) to make it unique.
New functions added to posix: nice(), setpgrp(), and if your system
supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
Improvements to the socket module: socket objects have new methods
getpeername() and getsockname(), and the {get,set}sockopt methods can
now get/set any kind of option using strings built with the new struct
module. And there's a new function fromfd() which creates a socket
object given a file descriptor (useful for servers started by inetd,
which have a socket connected to stdin and stdout).
Changes to SGI-specific built-in modules
----------------------------------------
The FORMS library interface (fl) now requires FORMS 2.1a. Some new
functions have been added and some bugs have been fixed.
Additions to al (audio library interface): added getname(),
getdefault() and getminmax().
The gl modules doesn't call "foreground()" when initialized (this
caused some problems) like it dit in 0.9.7beta (but not before).
There's a new gl function 'gversion() which returns a version string.
The interface to sv (Indigo video interface) has totally changed.
(Sorry, still no documentation, but see the examples in
demo/sgi/{sv,video}.)
Changes to standard library modules
-----------------------------------
Most functions in module string are now much faster: they're actually
implemented in C. The module containing the C versions is called
"strop" but you should still import "string" since strop doesn't
provide all the interfaces defined in string (and strop may be renamed
to string when it is complete in a future release).
string.index() now accepts an optional third argument giving an index
where to start searching in the first argument, so you can find second
and further occurrences (this is similar to the regular expression
functions in regex).
The definition of what string.splitfields(anything, '') should return
is changed for the last time: it returns a singleton list containing
its whole first argument unchanged. This is compatible with
regsub.split() which also ignores empty delimiter matches.
posixpath, macpath: added dirname() and normpath() (and basename() to
macpath).
The mainloop module (for use with stdwin) can now demultiplex input
from other sources, as long as they can be polled with select().
New built-in modules
--------------------
Module struct defines functions to pack/unpack values to/from strings
representing binary values in native byte order.
Module strop implements C versions of many functions from string (see
above).
Optional module fcntl defines interfaces to fcntl() and ioctl() --
UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
Optional module mpz defines an interface to an altaernative long
integer implementation, the GNU MPZ library.
Optional module md5 uses the GNU MPZ library to calculate MD5
signatures of strings.
There are also optional new modules specific to SGI machines: imageop
defines some simple operations to images represented as strings; sv
interfaces to the Indigo video board; cl interfaces to the (yet
unreleased) compression library.
New standard library modules
----------------------------
(Unfortunately the following modules are not all documented; read the
sources to find out more about them!)
autotest: run testall without showing any output unless it differs
from the expected output
bisect: use bisection to insert or find an item in a sorted list
colorsys: defines conversions between various color systems (e.g. RGB
<-> YUV)
nntplib: a client interface to NNTP servers
pipes: utility to construct pipeline from templates, e.g. for
conversion from one file format to another using several utilities.
regsub: contains three functions that are more or less compatible with
awk functions of the same name: sub() and gsub() do string
substitution, split() splits a string using a regular expression to
define how separators are define.
test_types: test operations on the built-in types of Python
toaiff: convert various audio file formats to AIFF format
tzparse: parse the TZ environment parameter (this may be less general
than it could be, let me know if you fix it).
(Note that the obsolete module "path" no longer exists.)
New SGI-specific library modules
--------------------------------
CL: constants for use with the built-in compression library interface (cl)
Queue: a multi-producer, multi-consumer queue class implemented for
use with the built-in thread module
SOCKET: constants for use with built-in module socket, e.g. to set/get
socket options. This is SGI-specific because the constants to be
passed are system-dependent. You can generate a version for your own
system by running the script demo/scripts/h2py.py with
/usr/include/sys/socket.h as input.
cddb: interface to the database used by the CD player
torgb: convert various image file types to rgb format (requires pbmplus)
New demos
---------
There's an experimental interface to define Sun RPC clients and
servers in demo/rpc.
There's a collection of interfaces to WWW, WAIS and Gopher (both
Python classes and program providing a user interface) in demo/www.
This includes a program texi2html.py which converts texinfo files to
HTML files (the format used hy WWW).
The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
For SGI systems, there's a whole collection of programs and classes
that make use of the Indigo video board in demo/sgi/{sv,video}. This
represents a significant amount of work that we're giving away!
There are demos "rsa" and "md5test" that exercise the mpz and md5
modules, respectively. The rsa demo is a complete implementation of
the RSA public-key cryptosystem!
A bunch of games and examples submitted by Stoffel Erasmus have been
included in demo/stoffel.
There are miscellaneous new files in some existing demo
subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
There are also many minor changes to existing files, but I'm too lazy
to run a diff and note the differences -- you can do this yourself if
you save the old distribution's demos. One highlight: the
stdwin/python.py demo is much improved!
Changes to the documentation
----------------------------
The LaTeX source for the library uses different macros to enable it to
be converted to texinfo, and from there to INFO or HTML format so it
can be browsed as a hypertext. The net result is that you can now
read the Python library documentation in Emacs info mode!
Changes to the source code that affect C extension writers
----------------------------------------------------------
The function strdup() no longer exists (it was used only in one places
and is somewhat of a portability problem since some systems have the
same function in their C library.
The functions NEW() and RENEW() allocate one spare byte to guard
against a NULL return from malloc(0) being taken for an error, but
this should not be relied upon.
=========================
==> Release 0.9.7beta <==
=========================
Changes to the language proper
------------------------------
User-defined classes can now implement operations invoked through
special syntax, such as x[i] or `x` by defining methods named
__getitem__(self, i) or __repr__(self), etc.
Changes to the build process
----------------------------
Instead of extensive manual editing of the Makefile to select
compile-time options, you can now run a Configure.py script.
The Makefile as distributed builds a minimal interpreter sufficient to
run Configure.py. See also misc/BUILD
The Makefile now includes more "utility" targets, e.g. install and
tags/TAGS
Using the provided strtod.c and strtol.c are now separate options, as
on the Sun the provided strtod.c dumps core :-(
The regex module is now an option chosen by the Makefile, since some
(old) C compilers choke on regexpr.c
Changes affecting portability
-----------------------------
You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
interface
Dynamic loading is now supported for Sun (and other non-COFF systems)
through dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
DL is out, 1.4)
The system-dependent code for the use of the select() system call is
moved to one file: myselect.h
Thanks to Jaap Vermeulen, the code should now port cleanly to the
SEQUENT
Changes to the interpreter interface
------------------------------------
The interpretation of $PYTHONPATH in the environment is different: it
is inserted in front of the default path instead of overriding it
Changes to existing built-in functions and methods
--------------------------------------------------
List objects now support an optional argument to their sort() method,
which is a comparison function similar to qsort(3) in C
File objects now have a method fileno(), used by the new select module
(see below)
New built-in function
---------------------
coerce(x, y): take two numbers and return a tuple containing them
both converted to a common type
Changes to built-in modules
---------------------------
sys: fixed core dumps in settrace() and setprofile()
socket: added socket methods setsockopt() and getsockopt(); and
fileno(), used by the new select module (see below)
stdwin: added fileno() == connectionnumber(), in support of new module
select (see below)
posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
gl: added qgetfd()
fl: added several new functions, fixed several obscure bugs, adapted
to FORMS 2.1
Changes to standard modules
---------------------------
posixpath: changed implementation of ismount()
string: atoi() no longer mistakes leading zero for octal number
...
New built-in modules
--------------------
Modules marked "dynamic only" are not configured at compile time but
can be loaded dynamically. You need to turn on the DL or DLD option in
the Makefile for support dynamic loading of modules (this requires
external code).
select: interfaces to the BSD select() system call
dbm: interfaces to the (new) dbm library (dynamic only)
nis: interfaces to some NIS functions (aka yellow pages)
thread: limited form of multiple threads (sgi only)
audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
coding (dynamic only)
cd: interface to Indigo SCSI CDROM player audio library (sgi only)
jpeg: read files in JPEG format (dynamic only, sgi only; needs
external code)
imgfile: read SGI image files (dynamic only, sgi only)
sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
sv: interface to Indigo video library (sgi only)
pc: a minimal set of MS-DOS interfaces (MS-DOS only)
rotor: encryption, by Lance Ellinghouse (dynamic only)
New standard modules
--------------------
Not all these modules are documented. Read the source:
lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
additional documentation.
imghdr: recognizes image file headers
sndhdr: recognizes sound file headers
profile: print run-time statistics of Python code
readcd, cdplayer: companion modules for built-in module cd (sgi only)
emacs: interface to Emacs using py-connect.el (see below).
SOCKET: symbolic constant definitions for socket options
SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
SV: symbolic constant definitions for sv (sgi only)
CD: symbolic constant definitions for cd (sgi only)
New demos
---------
scripts/pp.py: execute Python as a filter with a Perl-like command
line interface
classes/: examples using the new class features
threads/: examples using the new thread module
sgi/cd/: examples using the new cd module
Changes to the documentation
----------------------------
The last-minute syntax changes of release 0.9.6 are now reflected
everywhere in the manuals
The reference manual has a new section (3.2) on implementing new kinds
of numbers, sequences or mappings with user classes
Classes are now treated extensively in the tutorial (chapter 9)
Slightly restructured the system-dependent chapters of the library
manual
The file misc/EXTENDING incorporates documentation for mkvalue() and
a new section on error handling
The files misc/CLASSES and misc/ERRORS are no longer necessary
The doc/Makefile now creates PostScript files automatically
Miscellaneous changes
---------------------
Incorporated Tim Peters' changes to python-mode.el, it's now version
1.06
A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
program running in an Emacs buffer execute Emacs lisp code. The
necessary Python code is in lib/emacs.py. The Emacs code is
misc/py-connect.el (it needs some external Emacs lisp code)
Changes to the source code that affect C extension writers
----------------------------------------------------------
New service function mkvalue() to construct a Python object from C
values according to a "format" string a la getargs()
Most functions from pythonmain.c moved to new pythonrun.c which is
in libpython.a. This should make embedded versions of Python easier
ceval.h is split in eval.h (which needs compile.h and only declares
eval_code) and ceval.h (which doesn't need compile.hand declares the
rest)
ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
improve the parallellism of multi-threaded programs by letting other
Python code run when a blocking system call or something similar is
made)
In structmember.[ch], new member types BYTE, CHAR and unsigned
variants have been added
New file xxmodule.c is a template for new extension modules.
==================================
==> Release 0.9.6 (6 Apr 1992) <==
==================================
Misc news in 0.9.6:
- Restructured the misc subdirectory
- Reference manual completed, library manual much extended (with indexes!)
- the GNU Readline library is now distributed standard with Python
- the script "../demo/scripts/classfix.py" fixes Python modules using old
class syntax
- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
- Because of the GNU copyleft business I am not using the GNU regular
expression implementation but a free re-implementation by Tatu Ylonen
that recently appeared in comp.sources.misc (Bravo, Tatu!)
New features in 0.9.6:
- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
- New module 'os' supplants modules 'mac' and 'posix' for most cases;
module 'path' is replaced by 'os.path'
- os.path.split() return value differs from that of old path.split()
- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
currently being handled
- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
exception
- New function string.expandtabs() expands tabs in a string
- Added times() interface to posix (user & sys time of process & children)
- Added uname() interface to posix (returns OS type, hostname, etc.)
- New built-in function execfile() is like exec() but from a file
- Functions exec() and eval() are less picky about whitespace/newlines
- New built-in functions getattr() and setattr() access arbitrary attributes
- More generic argument handling in built-in functions (see "./EXTENDING")
- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
- Division and modulo for long and plain integers with negative operands
have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
(a/b, a%b) for integers. For floats, % is also changed, but of course
/ is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
- A function with explicit variable-length argument list can be declared
like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
- Code tracing and profiling features have been added, and two source
code debuggers are provided in the library (pdb.py, tty-oriented,
and wdb, window-oriented); you can now step through Python programs!
See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
a script that fixes old Python modules
- Plain integer right shift now uses sign extension
- Long integer shift/mask operations now simulate 2's complement
to give more useful results for negative operands
- Changed/added range checks for long/plain integer shifts
- Options found after "-c command" are now passed to the command in sys.argv
(note subtle incompatibility with "python -c command -- -options"!)
- Module stdwin is better protected against touching objects after they've
been closed; menus can now also be closed explicitly
- Stdwin now uses its own exception (stdwin.error)
New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
- dictionary objects can now be compared properly; e.g., {}=={} is true
- new exception SystemExit causes termination if not caught;
it is raised by sys.exit() so that 'finally' clauses can clean up,
and it may even be caught. It does work interactively!
- new module "regex" implements GNU Emacs style regular expressions;
module "regexp" is rewritten in Python for backward compatibility
- formal parameter lists may contain trailing commas
Bugs fixed in 0.9.6:
- assigning to or deleting a list item with a negative index dumped core
- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
Bugs fixed in 0.9.5:
- masking operations involving negative long integers gave wrong results
===================================
==> Release 0.9.4 (24 Dec 1991) <==
===================================
- new function argument handling (see below)
- built-in apply(func, args) means func(args[0], args[1], ...)
- new, more refined exceptions
- new exception string values (NameError = 'NameError' etc.)
- better checking for math exceptions
- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
- fixed list assignment bug: "a[1:1] = a" now works correctly
- new class syntax, without extraneous parentheses
- new 'global' statement to assign global variables from within a function
New class syntax
----------------
You can now declare a base class as follows:
class B: # Was: class B():
def some_method(self): ...
...
and a derived class thusly:
class D(B): # Was: class D() = B():
def another_method(self, arg): ...
Multiple inheritance looks like this:
class M(B, D): # Was: class M() = B(), D():
def this_or_that_method(self, arg): ...
The old syntax is still accepted by Python 0.9.4, but will disappear
in Python 1.0 (to be posted to comp.sources).
New 'global' statement
----------------------
Every now and then you have a global variable in a module that you
want to change from within a function in that module -- say, a count
of calls to a function, or an option flag, etc. Until now this was
not directly possible. While several kludges are known that
circumvent the problem, and often the need for a global variable can
be avoided by rewriting the module as a class, this does not always
lead to clearer code.
The 'global' statement solves this dilemma. Its occurrence in a
function body means that, for the duration of that function, the
names listed there refer to global variables. For instance:
total = 0.0
count = 0
def add_to_total(amount):
global total, count
total = total + amount
count = count + 1
'global' must be repeated in each function where it is needed. The
names listed in a 'global' statement must not be used in the function
before the statement is reached.
Remember that you don't need to use 'global' if you only want to *use*
a global variable in a function; nor do you need ot for assignments to
parts of global variables (e.g., list or dictionary items or
attributes of class instances). This has not changed; in fact
assignment to part of a global variable was the standard workaround.
New exceptions
--------------
Several new exceptions have been defined, to distinguish more clearly
between different types of errors.
name meaning was
AttributeError reference to non-existing attribute NameError
IOError unexpected I/O error RuntimeError
ImportError import of non-existing module or name NameError
IndexError invalid string, tuple or list index RuntimeError
KeyError key not in dictionary RuntimeError
OverflowError numeric overflow RuntimeError
SyntaxError invalid syntax RuntimeError
ValueError invalid argument value RuntimeError
ZeroDivisionError division by zero RuntimeError
The string value of each exception is now its name -- this makes it
easier to experimentally find out which operations raise which
exceptions; e.g.:
>>> KeyboardInterrupt
'KeyboardInterrupt'
>>>
New argument passing semantics
------------------------------
Off-line discussions with Steve Majewski and Daniel LaLiberte have
convinced me that Python's parameter mechanism could be changed in a
way that made both of them happy (I hope), kept me happy, fixed a
number of outstanding problems, and, given some backward compatibility
provisions, would only break a very small amount of existing code --
probably all mine anyway. In fact I suspect that most Python users
will hardly notice the difference. And yet it has cost me at least
one sleepless night to decide to make the change...
Philosophically, the change is quite radical (to me, anyway): a
function is no longer called with either zero or one argument, which
is a tuple if there appear to be more arguments. Every function now
has an argument list containing 0, 1 or more arguments. This list is
always implemented as a tuple, and it is a (run-time) error if a
function is called with a different number of arguments than expected.
What's the difference? you may ask. The answer is, very little unless
you want to write variadic functions -- functions that may be called
with a variable number of arguments. Formerly, you could write a
function that accepted one or more arguments with little trouble, but
writing a function that could be called with either 0 or 1 argument
(or more) was next to impossible. This is now a piece of cake: you
can simply declare an argument that receives the entire argument
tuple, and check its length -- it will be of size 0 if there are no
arguments.
Another anomaly of the old system was the way multi-argument methods
(in classes) had to be declared, e.g.:
class Point():
def init(self, (x, y, color)): ...
def setcolor(self, color): ...
dev moveto(self, (x, y)): ...
def draw(self): ...
Using the new scheme there is no need to enclose the method arguments
in an extra set of parentheses, so the above class could become:
class Point:
def init(self, x, y, color): ...
def setcolor(self, color): ...
dev moveto(self, x, y): ...
def draw(self): ...
That is, the equivalence rule between methods and functions has
changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
while formerly it was equivalent to Point.moveto(p,(x,y)).
A special backward compatibility rule makes that the old version also
still works: whenever a function with exactly two arguments (at the top
level) is called with more than two arguments, the second and further
arguments are packed into a tuple and passed as the second argument.
This rule is invoked independently of whether the function is actually a
method, so there is a slight chance that some erroneous calls of
functions expecting two arguments with more than that number of
arguments go undetected at first -- when the function tries to use the
second argument it may find it is a tuple instead of what was expected.
Note that this rule will be removed from future versions of the
language; it is a backward compatibility provision *only*.
Two other rules and a new built-in function handle conversion between
tuples and argument lists:
Rule (a): when a function with more than one argument is called with a
single argument that is a tuple of the right size, the tuple's items
are used as arguments.
Rule (b): when a function with exactly one argument receives no
arguments or more than one, that one argument will receive a tuple
containing the arguments (the tuple will be empty if there were no
arguments).
A new built-in function, apply(), was added to support functions that
need to call other functions with a constructed argument list. The call
apply(function, tuple)
is equivalent to
function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
While no new argument syntax was added in this phase, it would now be
quite sensible to add explicit syntax to Python for default argument
values (as in C++ or Modula-3), or a "rest" argument to receive the
remaining arguments of a variable-length argument list.
========================================================
==> Release 0.9.3 (never made available outside CWI) <==
========================================================
- string sys.version shows current version (also printed on interactive entry)
- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
- 'global' statement to declare module-global variables assigned in functions.
- new class declaration syntax: class C(Base1, Base2, ...): suite
(the old syntax is still accepted -- be sure to convert your classes now!)
- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
- C comparison operators: == != (the old = and <> remain valid).
- floating point numbers may now start with a period (e.g., .14).
- definition of integer division tightened (always truncates towards zero).
- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
- new list method l.count(x) returns the number of occurrences of x in l.
- new SGI module: al (Indigo and 4D/35 audio library).
- the FORMS interface (modules fl and FL) now uses FORMS 2.0
- module gl: added lrect{read,write}, rectzoom and pixmode;
added (non-GL) functions (un)packrect.
- new socket method: s.allowbroadcast(flag).
- many objects support __dict__, __methods__ or __members__.
- dir() lists anything that has __dict__.
- class attributes are no longer read-only.
- classes support __bases__, instances support __class__ (and __dict__).
- divmod() now also works for floats.
- fixed obscure bug in eval('1 ').
===================================
==> Release 0.9.2 (Autumn 1991) <==
===================================
Highlights
----------
- tutorial now (almost) complete; library reference reorganized
- new syntax: continue statement; semicolons; dictionary constructors;
restrictions on blank lines in source files removed
- dramatically improved module load time through precompiled modules
- arbitrary precision integers: compute 2 to the power 1000 and more...
- arithmetic operators now accept mixed type operands, e.g., 3.14/4
- more operations on list: remove, index, reverse; repetition
- improved/new file operations: readlines, seek, tell, flush, ...
- process management added to the posix module: fork/exec/wait/kill etc.
- BSD socket operations (with example servers and clients!)
- many new STDWIN features (color, fonts, polygons, ...)
- new SGI modules: font manager and FORMS library interface
Extended list of changes in 0.9.2
---------------------------------
Here is a summary of the most important user-visible changes in 0.9.2,
in somewhat arbitrary order. Changes in later versions are listed in
the "highlights" section above.
1. Changes to the interpreter proper
- Simple statements can now be separated by semicolons.
If you write "if t: s1; s2", both s1 and s2 are executed
conditionally.
- The 'continue' statement was added, with semantics as in C.
- Dictionary displays are now allowed on input: {key: value, ...}.
- Blank lines and lines bearing only a comment no longer need to
be indented properly. (A completely empty line still ends a multi-
line statement interactively.)
- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
- Option "-c command" to execute statements from the command line
- Compiled versions of modules are cached in ".pyc" files, giving a
dramatic improvement of start-up time
- Other, smaller speed improvements, e.g., extracting characters from
strings, looking up single-character keys, and looking up global
variables
- Interrupting a print operation raises KeyboardInterrupt instead of
only cancelling the print operation
- Fixed various portability problems (it now passes gcc with only
warnings -- more Standard C compatibility will be provided in later
versions)
- Source is prepared for porting to MS-DOS
- Numeric constants are now checked for overflow (this requires
standard-conforming strtol() and strtod() functions; a correct
strtol() implementation is provided, but the strtod() provided
relies on atof() for everything, including error checking
2. Changes to the built-in types, functions and modules
- New module socket: interface to BSD socket primitives
- New modules pwd and grp: access the UNIX password and group databases
- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
- New numeric type: long integer, for unlimited precision
- integer constants suffixed with 'L' or 'l' are long integers
- new built-in function long(x) converts int or float to long
- int() and float() now also convert from long integers
- New built-in function:
- pow(x, y) returns x to the power y
- New operation and methods for lists:
- l*n returns a new list consisting of n concatenated copies of l
- l.remove(x) removes the first occurrence of the value x from l
- l.index(x) returns the index of the first occurrence of x in l
- l.reverse() reverses l in place
- New operation for tuples:
- t*n returns a tuple consisting of n concatenated copies of t
- Improved file handling:
- f.readline() no longer restricts the line length, is faster,
and isn't confused by null bytes; same for raw_input()
- f.read() without arguments reads the entire (rest of the) file
- mixing of print and sys.stdout.write() has different effect
- New methods for files:
- f.readlines() returns a list containing the lines of the file,
as read with f.readline()
- f.flush(), f.tell(), f.seek() call their stdio counterparts
- f.isatty() tests for "tty-ness"
- New posix functions:
- _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
- popen() returns a file object connected to a pipe
- utime() replaces utimes() (the latter is not a POSIX name)
- New stdwin features, including:
- font handling
- color drawing
- scroll bars made optional
- polygons
- filled and xor shapes
- text editing objects now have a 'settext' method
3. Changes to the standard library
- Name change: the functions path.cat and macpath.cat are now called
path.join and macpath.join
- Added new modules: formatter, mutex, persist, sched, mainloop
- Added some modules and functionality to the "widget set" (which is
still under development, so please bear with me):
DirList, FormSplit, TextEdit, WindowSched
- Fixed module testall to work non-interactively
- Module string:
- added functions join() and joinfields()
- fixed center() to work correct and make it "transitive"
- Obsolete modules were removed: util, minmax
- Some modules were moved to the demo directory
4. Changes to the demonstration programs
- Added new useful scripts: byteyears, eptags, fact, from, lfact,
objgraph, pdeps, pi, primes, ptags, which
- Added a bunch of socket demos
- Doubled the speed of ptags
- Added new stdwin demos: microedit, miniedit
- Added a windowing interface to the Python interpreter: python (most
useful on the Mac)
- Added a browser for Emacs info files: demo/stdwin/ibrowse
(yes, I plan to put all STDWIN and Python documentation in texinfo
form in the future)
5. Other changes to the distribution
- An Emacs Lisp file "python.el" is provided to facilitate editing
Python programs in GNU Emacs (slightly improved since posted to
gnu.emacs.sources)
- Some info on writing an extension in C is provided
- Some info on building Python on non-UNIX platforms is provided
=====================================
==> Release 0.9.1 (February 1991) <==
=====================================
- Micro changes only
- Added file "patchlevel.h"
=====================================
==> Release 0.9.0 (February 1991) <==
=====================================
Original posting to alt.sources.
|