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
|
#! /bin/sh -e
# DP: CVS updates of the release22-maint branch (until 2005-02-04).
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p0 < $0
autoconf
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
rm -f configure
;;
*)
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
esac
exit 0
# cvs -z9 -q diff -uN -r r223 -r release22-maint
Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.288.6.19
retrieving revision 1.288.6.21
diff -u -r1.288.6.19 -r1.288.6.21
--- configure.in 29 Mar 2003 22:25:17 -0000 1.288.6.19
+++ configure.in 13 Jul 2003 09:48:31 -0000 1.288.6.21
@@ -1,5 +1,5 @@
dnl Process this file with autoconf 2.0 or later to make a configure script.
-AC_REVISION($Revision: 1.288.6.19 $)
+AC_REVISION($Revision: 1.288.6.21 $)
AC_PREREQ(2.0)
AC_INIT(Include/object.h)
AC_CONFIG_HEADER(pyconfig.h)
@@ -70,6 +70,7 @@
case $MACHDEP in
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
+ irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
fi
@@ -370,6 +371,21 @@
fi],
[AC_MSG_RESULT(no)])
+AC_MSG_CHECKING(whether gcc needs -fno-strict-aliasing)
+AC_TRY_CPP([
+#ifdef __GNUC__
+# if defined(__GNUC_MINOR__) && __GNUC__ >= 3 && (__GNUC_MINOR__ >= 3)
+# error -fno-strict-aliasing needed
+# endif
+#endif
+],[
+ GCC_EXTRA_OPT=
+ AC_MSG_RESULT(no)
+],[
+ GCC_EXTRA_OPT=-fno-strict-aliasing
+ AC_MSG_RESULT(yes)
+])
+
# Optimizer/debugger flags
AC_SUBST(OPT)
if test -z "$OPT"
@@ -383,10 +399,10 @@
# debug builds.
OPT="-g -Wall -Wstrict-prototypes"
else
- OPT="-g -O3 -Wall -Wstrict-prototypes"
+ OPT="-g -O3 $GCC_EXTRA_OPT -Wall -Wstrict-prototypes"
fi;;
*)
- OPT="-O3 -Wall -Wstrict-prototypes";;
+ OPT="-O3 $GCC_EXTRA_OPT -Wall -Wstrict-prototypes";;
esac
case $ac_sys_system in
SCO_SV*) OPT="$OPT -m486 -DSCO5";;
Index: install-sh
===================================================================
RCS file: /cvsroot/python/python/dist/src/install-sh,v
retrieving revision 2.4
retrieving revision 2.4.24.1
diff -u -r2.4 -r2.4.24.1
--- install-sh 10 Feb 2001 20:04:53 -0000 2.4
+++ install-sh 14 Jun 2003 06:59:02 -0000 2.4.24.1
@@ -1,19 +1,37 @@
#!/bin/sh
#
# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
#
-# Copyright 1991 by the Massachusetts Institute of Technology
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
@@ -56,7 +74,7 @@
while [ x"$1" != x ]; do
case $1 in
- -c) instcmd="$cpprog"
+ -c) instcmd=$cpprog
shift
continue;;
@@ -79,7 +97,7 @@
shift
continue;;
- -s) stripcmd="$stripprog"
+ -s) stripcmd=$stripprog
shift
continue;;
@@ -106,128 +124,132 @@
if [ x"$src" = x ]
then
- echo "install: no input file specified"
+ echo "$0: no input file specified" >&2
exit 1
else
- true
+ :
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
-
- if [ -d $dst ]; then
+
+ if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
- instcmd=mkdir
+ instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
+# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
- if [ -f $src -o -d $src ]
+ if [ -f "$src" ] || [ -d "$src" ]
then
- true
+ :
else
- echo "install: $src does not exist"
+ echo "$0: $src does not exist" >&2
exit 1
fi
-
+
if [ x"$dst" = x ]
then
- echo "install: no destination specified"
+ echo "$0: no destination specified" >&2
exit 1
else
- true
+ :
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
- if [ -d $dst ]
+ if [ -d "$dst" ]
then
- dst="$dst"/`basename $src`
+ dst=$dst/`basename "$src"`
else
- true
+ :
fi
fi
## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
-oIFS="${IFS}"
+oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
+ pathcomp=$pathcomp$1
shift
- if [ ! -d "${pathcomp}" ] ;
+ if [ ! -d "$pathcomp" ] ;
then
- $mkdirprog "${pathcomp}"
+ $mkdirprog "$pathcomp"
else
- true
+ :
fi
- pathcomp="${pathcomp}/"
+ pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
- $doit $instcmd $dst &&
+ $doit $instcmd "$dst" &&
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
- if [ x"$transformarg" = x ]
+ if [ x"$transformarg" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- dstfile=`basename $dst $transformbasename |
+ dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
- if [ x"$dstfile" = x ]
+ if [ x"$dstfile" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- true
+ :
fi
-# Make a temp file name in the proper directory.
+# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
+ rmtmp=$dstdir/#rm.$$#
-# Move or copy the file name to the temp name
+# Trap to clean up temp files at exit.
- $doit $instcmd $src $dsttmp &&
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+# Move or copy the file name to the temp name
- trap "rm -f ${dsttmp}" 0 &&
+ $doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
@@ -235,17 +257,38 @@
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+} &&
# Now rename the file to the real destination.
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
+# The final little trick to "correctly" pass the exit status to the exit trap.
-exit 0
+{
+ (exit 0); exit
+}
Index: Doc/ACKS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v
retrieving revision 1.33.6.2
retrieving revision 1.33.6.3
diff -u -r1.33.6.2 -r1.33.6.3
--- Doc/ACKS 3 Dec 2002 18:50:41 -0000 1.33.6.2
+++ Doc/ACKS 29 Jul 2003 17:44:23 -0000 1.33.6.3
@@ -4,7 +4,7 @@
This file lists people who have contributed in some way to the Python
documentation. It is probably not complete -- if you feel that you or
anyone else should be on this list, please let us know (send email to
-python-docs@python.org), and we'll be glad to correct the problem.
+docs@python.org), and we'll be glad to correct the problem.
It is only with the input and contributions of the Python community
that Python has such wonderful documentation -- Thank You!
Index: Doc/Makefile
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v
retrieving revision 1.235.2.1.2.20
retrieving revision 1.235.2.1.2.22
diff -u -r1.235.2.1.2.20 -r1.235.2.1.2.22
--- Doc/Makefile 29 May 2003 18:49:32 -0000 1.235.2.1.2.20
+++ Doc/Makefile 29 Jul 2003 17:44:23 -0000 1.235.2.1.2.22
@@ -49,7 +49,7 @@
# The formatted output is located in subdirectories. For PDF and
# PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in
# the html/ directory. If you want to fix the GNU info process, look
-# in the info/ directory; please send patches to python-docs@python.org.
+# in the info/ directory; please send patches to docs@python.org.
# This Makefile only includes information on how to perform builds; for
# dependency information, see Makefile.deps.
@@ -66,7 +66,7 @@
# This is the *documentation* release, and is used to construct the file
# names of the downloadable tarballs.
-RELEASE=2.2.3
+RELEASE=2.2.3+
PYTHON= python
DVIPS= dvips -N0 -t $(PAPER)
@@ -650,5 +650,6 @@
rm -rf isilo/ref/ isilo/tut/ isilo/inst/ isilo/dist/
rm -rf isilo/whatsnew/
rm -f isilo/python-*-$(RELEASE).pdb isilo-$(RELEASE).zip
+ rm -f pkglist.html paper-$(PAPER)/README
realclean distclean: clobber
Index: Doc/README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/README,v
retrieving revision 1.45.16.1
retrieving revision 1.45.16.2
diff -u -r1.45.16.1 -r1.45.16.2
--- Doc/README 27 Feb 2002 13:32:25 -0000 1.45.16.1
+++ Doc/README 29 Jul 2003 17:42:54 -0000 1.45.16.2
@@ -66,20 +66,11 @@
Other suggestions or questions should be sent to the Python
Documentation Team:
- python-docs@python.org
+ docs@python.org
Thanks!
-What happened to the Macintosh chapter of the Python Library Reference?
------------------------------------------------------------------------
-
-The directory mac/ contains the LaTeX sources for the "Macintosh
-Library Modules" manual; this is built using the standard build
-targets, so check the proper output directory for your chosen format
-and paper size.
-
-
What tools do I need?
---------------------
Index: Doc/api/concrete.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v
retrieving revision 1.6.6.6
retrieving revision 1.6.6.7
diff -u -r1.6.6.6 -r1.6.6.7
--- Doc/api/concrete.tex 22 Oct 2002 20:21:06 -0000 1.6.6.6
+++ Doc/api/concrete.tex 26 Dec 2003 00:00:29 -0000 1.6.6.7
@@ -1602,7 +1602,15 @@
\end{cvardesc}
\begin{cfuncdesc}{int}{PyList_Check}{PyObject *p}
- Returns true if its argument is a \ctype{PyListObject}.
+ Returns true if \var{p} is a list object or an instance of a
+ subtype of the list type.
+ \versionchanged[Allowed subtypes to be accepted]{2.2}
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{int}{PyList_CheckExact}{PyObject *p}
+ Return true if \var{p} is a list object, but not an instance of a
+ subtype of the list type.
+ \versionadded{2.2}
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyList_New}{int len}
@@ -1720,7 +1728,9 @@
\end{cvardesc}
\begin{cfuncdesc}{int}{PyDict_Check}{PyObject *p}
- Returns true if its argument is a \ctype{PyDictObject}.
+ Returns true if \var{p} is a dict object or an instance of a
+ subtype of the dict type.
+ \versionchanged[Allowed subtypes to be accepted]{2.2}
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyDict_New}{}
Index: Doc/dist/dist.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v
retrieving revision 1.36.16.3
retrieving revision 1.36.16.4
diff -u -r1.36.16.3 -r1.36.16.4
--- Doc/dist/dist.tex 31 Mar 2003 16:45:22 -0000 1.36.16.3
+++ Doc/dist/dist.tex 1 Jul 2003 21:37:38 -0000 1.36.16.4
@@ -1,7 +1,7 @@
\documentclass{howto}
\usepackage{distutils}
-% $Id: dist.tex,v 1.36.16.3 2003/03/31 16:45:22 fdrake Exp $
+% $Id: dist.tex,v 1.36.16.4 2003/07/01 21:37:38 nnorwitz Exp $
\title{Distributing Python Modules}
@@ -663,6 +663,27 @@
string should be given as the directory.
+\subsection{Debugging the setup script}
+\label{meta-data}
+
+Sometimes things go wrong, and the setup script doesn't do what the
+developer wants.
+
+Distutils catches any exceptions when running the setup script, and
+print a simple error message before the script is terminated. The
+motivation for this behaviour is to not confuse administrators who
+don't know much about Python and are trying to install a package. If
+they get a big long traceback from deep inside the guts of Distutils,
+they may think the package or the Python installation is broken
+because they don't read all the way down to the bottom and see that
+it's a permission problem.
+
+On the other hand, this doesn't help the developer to find the cause
+of the failure. For this purpose, the DISTUTILS_DEBUG environment
+variable can be set to anything except an empty string, and distutils
+will now print detailed information what it is doing, and prints the
+full traceback in case an exception occurrs.
+
\section{Writing the Setup Configuration File}
\label{setup-config}
Index: Doc/doc/doc.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v
retrieving revision 1.58
retrieving revision 1.58.4.1
diff -u -r1.58 -r1.58.4.1
--- Doc/doc/doc.tex 14 Dec 2001 22:50:05 -0000 1.58
+++ Doc/doc/doc.tex 29 Jul 2003 17:44:23 -0000 1.58.4.1
@@ -1805,7 +1805,7 @@
interested parties.
Comments and bug reports on the standard documents should be sent
- to \email{python-docs@python.org}. This may include comments
+ to \email{docs@python.org}. This may include comments
about formatting, content, grammatical and spelling errors, or
this document. You can also send comments on this document
directly to the author at \email{fdrake@acm.org}.
Index: Doc/ext/extending.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ext/extending.tex,v
retrieving revision 1.11.6.2
retrieving revision 1.11.6.3
diff -u -r1.11.6.2 -r1.11.6.3
--- Doc/ext/extending.tex 16 May 2002 13:47:00 -0000 1.11.6.2
+++ Doc/ext/extending.tex 7 Nov 2003 12:25:53 -0000 1.11.6.3
@@ -1174,14 +1174,12 @@
\section{Reference Counts
\label{refcounts}}
-In languages like C or \Cpp, the programmer is responsible for
-dynamic allocation and deallocation of memory on the heap. In C,
-this is done using the functions \cfunction{malloc()} and
-\cfunction{free()}. In \Cpp, the operators \keyword{new} and
-\keyword{delete} are used with essentially the same meaning; they are
-actually implemented using \cfunction{malloc()} and
-\cfunction{free()}, so we'll restrict the following discussion to the
-latter.
+In languages like C or \Cpp, the programmer is responsible for dynamic
+allocation and deallocation of memory on the heap. In C, this is done
+using the functions \cfunction{malloc()} and \cfunction{free()}. In
+\Cpp, the operators \keyword{new} and \keyword{delete} are used with
+essentially the same meaning so we'll restrict the following
+discussion to the C case.
Every block of memory allocated with \cfunction{malloc()} should
eventually be returned to the pool of available memory by exactly one
Index: Doc/html/about.html
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/html/about.html,v
retrieving revision 1.3.24.1
retrieving revision 1.3.24.2
diff -u -r1.3.24.1 -r1.3.24.2
--- Doc/html/about.html 17 Apr 2002 01:42:58 -0000 1.3.24.1
+++ Doc/html/about.html 29 Jul 2003 17:44:23 -0000 1.3.24.2
@@ -50,8 +50,8 @@
<h2>Comments and Questions</h2>
<p> General comments and questions regarding this document should
- be sent by email to <a href="mailto:python-docs@python.org"
- >python-docs@python.org</a>. If you find specific errors in
+ be sent by email to <a href="mailto:docs@python.org"
+ >docs@python.org</a>. If you find specific errors in
this document, please report the bug at the <a
href="http://sourceforge.net/bugs/?group_id=5470">Python Bug
Tracker</a> at <a href="http://sourceforge.net/">SourceForge</a>.
Index: Doc/html/stdabout.dat
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/html/stdabout.dat,v
retrieving revision 1.5.24.1
retrieving revision 1.5.24.2
diff -u -r1.5.24.1 -r1.5.24.2
--- Doc/html/stdabout.dat 22 May 2003 15:09:55 -0000 1.5.24.1
+++ Doc/html/stdabout.dat 29 Jul 2003 17:44:23 -0000 1.5.24.2
@@ -28,8 +28,8 @@
<h2>Comments and Questions</h2>
<p> General comments and questions regarding this document should
- be sent by email to <a href="mailto:python-docs@python.org"
- >python-docs@python.org</a>. If you find specific errors in
+ be sent by email to <a href="mailto:docs@python.org"
+ >docs@python.org</a>. If you find specific errors in
this document, either in the content or the presentation, please
report the bug at the <a
href="http://sourceforge.net/bugs/?group_id=5470">Python Bug
Index: Doc/info/README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/info/README,v
retrieving revision 1.3.28.1
retrieving revision 1.3.28.2
diff -u -r1.3.28.1 -r1.3.28.2
--- Doc/info/README 17 Jan 2002 21:06:19 -0000 1.3.28.1
+++ Doc/info/README 29 Jul 2003 17:44:23 -0000 1.3.28.2
@@ -18,4 +18,4 @@
conversion to the info format.
Questions and comments on these documents should be directed to
-python-docs@python.org.
+docs@python.org.
Index: Doc/lib/emailmessage.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v
retrieving revision 1.4.8.3
retrieving revision 1.4.8.4
diff -u -r1.4.8.3 -r1.4.8.4
--- Doc/lib/emailmessage.tex 21 Mar 2003 21:24:27 -0000 1.4.8.3
+++ Doc/lib/emailmessage.tex 19 Aug 2003 04:56:46 -0000 1.4.8.4
@@ -340,15 +340,18 @@
Parameter keys are always compared case insensitively. The return
value can either be a string, or a 3-tuple if the parameter was
\rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of
-the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may
-be the empty string. Your application should be prepared to deal with
-3-tuple return values, which it can convert to a Unicode string like
-so:
+the form \code{(CHARSET, LANGUAGE, VALUE)}. Note that both \code{CHARSET} and
+\code{LANGUAGE} can be \code{None}, in which case you should consider
+\code{VALUE} to be encoded in the \code{us-ascii} charset. You can
+usually ignore \code{LANGUAGE}.
+
+Your application should be prepared to deal with 3-tuple return
+values, and can convert the parameter to a Unicode string like so:
\begin{verbatim}
param = msg.get_param('foo')
if isinstance(param, tuple):
- param = unicode(param[2], param[0])
+ param = unicode(param[2], param[0] or 'us-ascii')
\end{verbatim}
In any case, the parameter value (either the returned string, or the
Index: Doc/lib/lib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v
retrieving revision 1.200
retrieving revision 1.200.4.1
diff -u -r1.200 -r1.200.4.1
--- Doc/lib/lib.tex 18 Dec 2001 16:32:30 -0000 1.200
+++ Doc/lib/lib.tex 25 Sep 2003 18:25:51 -0000 1.200.4.1
@@ -216,6 +216,7 @@
\input{libxmlrpclib}
\input{libsimplexmlrpc}
\input{libasyncore}
+\input{libasynchat}
\input{netdata} % Internet Data Handling
\input{libformatter}
Index: Doc/lib/libasynchat.tex
===================================================================
RCS file: Doc/lib/libasynchat.tex
diff -N Doc/lib/libasynchat.tex
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Doc/lib/libasynchat.tex 25 Sep 2003 18:26:06 -0000 1.3.18.1
@@ -0,0 +1,254 @@
+\section{\module{asynchat} ---
+ Asynchronous socket command/response handler}
+
+\declaremodule{standard}{asynchat}
+\modulesynopsis{Support for asynchronous command/response protocols.}
+\moduleauthor{Sam Rushing}{rushing@nightmare.com}
+\sectionauthor{Steve Holden}{sholden@holdenweb.com}
+
+This module builds on the \refmodule{asyncore} infrastructure,
+simplifying asynchronous clients and servers and making it easier to
+handle protocols whose elements are terminated by arbitrary strings, or
+are of variable length. \refmodule{asynchat} defines the abstract class
+\class{async_chat} that you subclass, providing implementations of the
+\method{collect_incoming_data()} and \method{found_terminator()}
+methods. It uses the same asynchronous loop as \refmodule{asyncore}, and
+the two types of channel, \class{asyncore.dispatcher} and
+\class{asynchat.async_chat}, can freely be mixed in the channel map.
+Typically an \class{asyncore.dispatcher} server channel generates new
+\class{asynchat.async_chat} channel objects as it receives incoming
+connection requests.
+
+\begin{classdesc}{async_chat}{}
+ This class is an abstract subclass of \class{asyncore.dispatcher}. To make
+ practical use of the code you must subclass \class{async_chat}, providing
+ meaningful \method{collect_incoming_data()} and \method{found_terminator()}
+ methods. The \class{asyncore.dispatcher} methods can be
+ used, although not all make sense in a message/response context.
+
+ Like \class{asyncore.dispatcher}, \class{async_chat} defines a set of events
+ that are generated by an analysis of socket conditions after a
+ \cfunction{select()} call. Once the polling loop has been started the
+ \class{async_chat} object's methods are called by the event-processing
+ framework with no action on the part of the programmer.
+
+ Unlike \class{asyncore.dispatcher}, \class{async_chat} allows you to define
+ a first-in-first-out queue (fifo) of \emph{producers}. A producer need have
+ only one method, \method{more()}, which should return data to be transmitted
+ on the channel. The producer indicates exhaustion (\emph{i.e.} that it contains
+ no more data) by having its \method{more()} method return the empty string. At
+ this point the \class{async_chat} object removes the producer from the fifo
+ and starts using the next producer, if any. When the producer fifo is empty
+ the \method{handle_write()} method does nothing. You use the channel object's
+ \method{set_terminator()} method to describe how to recognize the end
+ of, or an important breakpoint in, an incoming transmission from the
+ remote endpoint.
+
+ To build a functioning \class{async_chat} subclass your
+ input methods \method{collect_incoming_data()} and
+ \method{found_terminator()} must handle the data that the channel receives
+ asynchronously. The methods are described below.
+\end{classdesc}
+
+\begin{methoddesc}{close_when_done}{}
+ Pushes a \code{None} on to the producer fifo. When this producer is
+ popped off the fifo it causes the channel to be closed.
+\end{methoddesc}
+
+\begin{methoddesc}{collect_incoming_data}{data}
+ Called with \var{data} holding an arbitrary amount of received data.
+ The default method, which must be overridden, raises a \exception{NotImplementedError} exception.
+\end{methoddesc}
+
+\begin{methoddesc}{discard_buffers}{}
+ In emergencies this method will discard any data held in the input and/or
+ output buffers and the producer fifo.
+\end{methoddesc}
+
+\begin{methoddesc}{found_terminator}{}
+ Called when the incoming data stream matches the termination condition
+ set by \method{set_terminator}. The default method, which must be overridden,
+ raises a \exception{NotImplementedError} exception. The buffered input data should
+ be available via an instance attribute.
+\end{methoddesc}
+
+\begin{methoddesc}{get_terminator}{}
+ Returns the current terminator for the channel.
+\end{methoddesc}
+
+\begin{methoddesc}{handle_close}{}
+ Called when the channel is closed. The default method silently closes
+ the channel's socket.
+\end{methoddesc}
+
+\begin{methoddesc}{handle_read}{}
+ Called when a read event fires on the channel's socket in the
+ asynchronous loop. The default method checks for the termination
+ condition established by \method{set_terminator()}, which can be either
+ the appearance of a particular string in the input stream or the receipt
+ of a particular number of characters. When the terminator is found,
+ \method{handle_read} calls the \method{found_terminator()} method after
+ calling \method{collect_incoming_data()} with any data preceding the
+ terminating condition.
+\end{methoddesc}
+
+\begin{methoddesc}{handle_write}{}
+ Called when the application may write data to the channel.
+ The default method calls the \method{initiate_send()} method, which in turn
+ will call \method{refill_buffer()} to collect data from the producer
+ fifo associated with the channel.
+\end{methoddesc}
+
+\begin{methoddesc}{push}{data}
+ Creates a \class{simple_producer} object (\emph{see below}) containing the data and
+ pushes it on to the channel's \code{producer_fifo} to ensure its
+ transmission. This is all you need to do to have the channel write
+ the data out to the network, although it is possible to use your
+ own producers in more complex schemes to implement encryption and
+ chunking, for example.
+\end{methoddesc}
+
+\begin{methoddesc}{push_with_producer}{producer}
+ Takes a producer object and adds it to the producer fifo associated with
+ the channel. When all currently-pushed producers have been exhausted
+ the channel will consume this producer's data by calling its
+ \method{more()} method and send the data to the remote endpoint.
+\end{methoddesc}
+
+\begin{methoddesc}{readable}{}
+ Should return \code{True} for the channel to be included in the set of
+ channels tested by the \cfunction{select()} loop for readability.
+\end{methoddesc}
+
+\begin{methoddesc}{refill_buffer}{}
+ Refills the output buffer by calling the \method{more()} method of the
+ producer at the head of the fifo. If it is exhausted then the
+ producer is popped off the fifo and the next producer is activated.
+ If the current producer is, or becomes, \code{None} then the channel
+ is closed.
+\end{methoddesc}
+
+\begin{methoddesc}{set_terminator}{term}
+ Sets the terminating condition to be recognised on the channel. \code{term}
+ may be any of three types of value, corresponding to three different ways
+ to handle incoming protocol data.
+
+ \begin{tableii}{l|l}{}{term}{Description}
+ \lineii{\emph{string}}{Will call \method{found_terminator()} when the
+ string is found in the input stream}
+ \lineii{\emph{integer}}{Will call \method{found_terminator()} when the
+ indicated number of characters have been received}
+ \lineii{\code{None}}{The channel continues to collect data forever}
+ \end{tableii}
+
+ Note that any data following the terminator will be available for reading by
+ the channel after \method{found_terminator()} is called.
+\end{methoddesc}
+
+\begin{methoddesc}{writable}{}
+ Should return \code{True} as long as items remain on the producer fifo,
+ or the channel is connected and the channel's output buffer is non-empty.
+\end{methoddesc}
+
+\subsection{asynchat - Auxiliary Classes and Functions}
+
+\begin{classdesc}{simple_producer}{data\optional{, buffer_size=512}}
+ A \class{simple_producer} takes a chunk of data and an optional buffer size.
+ Repeated calls to its \method{more()} method yield successive chunks of the
+ data no larger than \var{buffer_size}.
+\end{classdesc}
+
+\begin{methoddesc}{more}{}
+ Produces the next chunk of information from the producer, or returns the empty string.
+\end{methoddesc}
+
+\begin{classdesc}{fifo}{\optional{list=None}}
+ Each channel maintains a \class{fifo} holding data which has been pushed by the
+ application but not yet popped for writing to the channel.
+ A \class{fifo} is a list used to hold data and/or producers until they are required.
+ If the \var{list} argument is provided then it should contain producers or
+ data items to be written to the channel.
+\end{classdesc}
+
+\begin{methoddesc}{is_empty}{}
+ Returns \code{True} iff the fifo is empty.
+\end{methoddesc}
+
+\begin{methoddesc}{first}{}
+ Returns the least-recently \method{push()}ed item from the fifo.
+\end{methoddesc}
+
+\begin{methoddesc}{push}{data}
+ Adds the given data (which may be a string or a producer object) to the
+ producer fifo.
+\end{methoddesc}
+
+\begin{methoddesc}{pop}{}
+ If the fifo is not empty, returns \code{True, first()}, deleting the popped
+ item. Returns \code{False, None} for an empty fifo.
+\end{methoddesc}
+
+The \module{asynchat} module also defines one utility function, which may be
+of use in network and textual analysis operations.
+
+\begin{funcdesc}{find_prefix_at_end}{haystack, needle}
+ Returns \code{True} if string \var{haystack} ends with any non-empty
+ prefix of string \var{needle}.
+\end{funcdesc}
+
+\subsection{asynchat Example \label{asynchat-example}}
+
+The following partial example shows how HTTP requests can be read with
+\class{async_chat}. A web server might create an \class{http_request_handler} object for
+each incoming client connection. Notice that initially the
+channel terminator is set to match the blank line at the end of the HTTP
+headers, and a flag indicates that the headers are being read.
+
+Once the headers have been read, if the request is of type POST
+(indicating that further data are present in the input stream) then the
+\code{Content-Length:} header is used to set a numeric terminator to
+read the right amount of data from the channel.
+
+The \method{handle_request()} method is called once all relevant input
+has been marshalled, after setting the channel terminator to \code{None}
+to ensure that any extraneous data sent by the web client are ignored.
+
+\begin{verbatim}
+class http_request_handler(asynchat.async_chat):
+
+ def __init__(self, conn, addr, sessions, log):
+ asynchat.async_chat.__init__(self, conn=conn)
+ self.addr = addr
+ self.sessions = sessions
+ self.ibuffer = []
+ self.obuffer = ""
+ self.set_terminator("\r\n\r\n")
+ self.reading_headers = True
+ self.handling = False
+ self.cgi_data = None
+ self.log = log
+
+ def collect_incoming_data(self, data):
+ """Buffer the data"""
+ self.ibuffer.append(data)
+
+ def found_terminator(self):
+ if self.reading_headers:
+ self.reading_headers = False
+ self.parse_headers("".join(self.ibuffer))
+ self.ibuffer = []
+ if self.op.upper() == "POST":
+ clen = self.headers.getheader("content-length")
+ self.set_terminator(int(clen))
+ else:
+ self.handling = True
+ self.set_terminator(None)
+ self.handle_request()
+ elif not self.handling:
+ self.set_terminator(None) # browsers sometimes over-send
+ self.cgi_data = parse(self.headers, "".join(self.ibuffer))
+ self.handling = True
+ self.ibuffer = []
+ self.handle_request()
+\end{verbatim}
+
Index: Doc/lib/libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.100.4.16
retrieving revision 1.100.4.17
diff -u -r1.100.4.16 -r1.100.4.17
--- Doc/lib/libfuncs.tex 16 May 2003 03:08:34 -0000 1.100.4.16
+++ Doc/lib/libfuncs.tex 5 Jul 2003 17:38:25 -0000 1.100.4.17
@@ -684,7 +684,7 @@
def getx(self): return self.__x
def setx(self, value): self.__x = value
def delx(self): del self.__x
- x = property(getx, setx, delx, "I'm the 'x' property.")
+ x = property(getx, setx, delx, "I'm the 'x' property.")
\end{verbatim}
\versionadded{2.2}
Index: Doc/lib/libinspect.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v
retrieving revision 1.10.6.1
retrieving revision 1.10.6.2
diff -u -r1.10.6.1 -r1.10.6.2
--- Doc/lib/libinspect.tex 23 Apr 2002 21:20:44 -0000 1.10.6.1
+++ Doc/lib/libinspect.tex 31 Oct 2003 15:27:55 -0000 1.10.6.2
@@ -25,7 +25,7 @@
The \function{getmembers()} function retrieves the members
of an object such as a class or module.
-The nine functions whose names begin with ``is'' are mainly
+The ten functions whose names begin with ``is'' are mainly
provided as convenient choices for the second argument to
\function{getmembers()}. They also help you determine when
you can expect to find the following special attributes:
Index: Doc/lib/librobotparser.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/librobotparser.tex,v
retrieving revision 1.4
retrieving revision 1.4.8.1
diff -u -r1.4 -r1.4.8.1
--- Doc/lib/librobotparser.tex 6 Nov 2001 22:14:35 -0000 1.4
+++ Doc/lib/librobotparser.tex 14 Jul 2003 17:05:19 -0000 1.4.8.1
@@ -15,7 +15,7 @@
questions about whether or not a particular user agent can fetch a URL on
the Web site that published the \file{robots.txt} file. For more details on
the structure of \file{robots.txt} files, see
-\url{http://info.webcrawler.com/mak/projects/robots/norobots.html}.
+\url{http://www.robotstxt.org/wc/norobots.html}.
\begin{classdesc}{RobotFileParser}{}
Index: Doc/lib/libstat.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstat.tex,v
retrieving revision 1.22
retrieving revision 1.22.6.1
diff -u -r1.22 -r1.22.6.1
--- Doc/lib/libstat.tex 28 Nov 2001 07:26:15 -0000 1.22
+++ Doc/lib/libstat.tex 19 Jun 2003 18:14:02 -0000 1.22.6.1
@@ -129,12 +129,12 @@
import os, sys
from stat import *
-def walktree(dir, callback):
- '''recursively descend the directory rooted at dir,
+def walktree(top, callback):
+ '''recursively descend the directory tree rooted at top,
calling the callback function for each regular file'''
- for f in os.listdir(dir):
- pathname = '%s/%s' % (dir, f)
+ for f in os.listdir(top):
+ pathname = os.path.join(top, f)
mode = os.stat(pathname)[ST_MODE]
if S_ISDIR(mode):
# It's a directory, recurse into it
Index: Doc/lib/libundoc.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libundoc.tex,v
retrieving revision 1.81
retrieving revision 1.81.6.1
diff -u -r1.81 -r1.81.6.1
--- Doc/lib/libundoc.tex 26 Nov 2001 21:38:50 -0000 1.81
+++ Doc/lib/libundoc.tex 29 Jul 2003 17:44:24 -0000 1.81.6.1
@@ -2,7 +2,8 @@
Here's a quick listing of modules that are currently undocumented, but
that should be documented. Feel free to contribute documentation for
-them! (Send via email to \email{python-docs@python.org}.)
+them! (Send via email to
+\ulink{\email{docs@python.org}}{mailto:docs@python.org}.)
The idea and original contents for this chapter were taken
from a posting by Fredrik Lundh; the specific contents of this chapter
Index: Doc/lib/liburllib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v
retrieving revision 1.40.8.4
retrieving revision 1.40.8.6
diff -u -r1.40.8.4 -r1.40.8.6
--- Doc/lib/liburllib.tex 25 Apr 2003 05:31:43 -0000 1.40.8.4
+++ Doc/lib/liburllib.tex 27 Aug 2003 15:10:20 -0000 1.40.8.6
@@ -118,7 +118,7 @@
\class{FancyURLopener} class and use it to perform their requested
actions. To override this functionality, programmers can create a
subclass of \class{URLopener} or \class{FancyURLopener}, then assign
-that an instance of that class to the
+an instance of that class to the
\code{urllib._urlopener} variable before calling the desired function.
For example, applications may want to specify a different
\mailheader{User-Agent} header than \class{URLopener} defines. This
@@ -223,12 +223,12 @@
\begin{classdesc}{FancyURLopener}{...}
\class{FancyURLopener} subclasses \class{URLopener} providing default
-handling for the following HTTP response codes: 301, 302, 303 and 401.
-For 301, 302 and 303 response codes, the \mailheader{Location} header
-is used to fetch the actual URL. For 401 response codes
-(authentication required), basic HTTP authentication is performed.
-For 301, 302 and 303 response codes, recursion is bounded by the value
-of the \var{maxtries} attribute, which defaults 10.
+handling for the following HTTP response codes: 301, 302, 303, 307 and
+401. For the 30x response codes listed above, the
+\mailheader{Location} header is used to fetch the actual URL. For 401
+response codes (authentication required), basic HTTP authentication is
+performed. For the 30x response codes, recursion is bounded by the
+value of the \var{maxtries} attribute, which defaults to 10.
\note{According to the letter of \rfc{2616}, 301 and 302 responses to
POST requests must not be automatically redirected without
Index: Doc/lib/liburllib2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib2.tex,v
retrieving revision 1.6.8.3
retrieving revision 1.6.8.5
diff -u -r1.6.8.3 -r1.6.8.5
--- Doc/lib/liburllib2.tex 16 May 2003 03:08:36 -0000 1.6.8.3
+++ Doc/lib/liburllib2.tex 24 Jul 2003 01:45:16 -0000 1.6.8.5
@@ -419,12 +419,13 @@
if you can't but another \class{Handler} might.
\note{The default implementation of this method does not strictly
- follow \rfc{2616}: it allows automatic 302 redirection of POST
- requests, because essentially all HTTP clients do this.}
-
+ follow \rfc{2616}, which says that 301 and 302 responses to POST
+ requests must not be automatically redirected without confirmation by
+ the user. In reality, browsers do allow automatic redirection of
+ these responses, changing the POST to a GET, and the default
+ implementation reproduces this behavior.}
\end{methoddesc}
-
\begin{methoddesc}[HTTPRedirectHandler]{http_error_301}{req,
fp, code, msg, hdrs}
Redirect to the \code{Location:} URL. This method is called by
@@ -441,9 +442,16 @@
\begin{methoddesc}[HTTPRedirectHandler]{http_error_303}{req,
fp, code, msg, hdrs}
The same as \method{http_error_301()}, but called for the
-`see other' redirect response.
+`see other' response.
\end{methoddesc}
+\begin{methoddesc}[HTTPRedirectHandler]{http_error_307}{req,
+ fp, code, msg, hdrs}
+The same as \method{http_error_301()}, but called for the
+`temporary redirect' response.
+\end{methoddesc}
+
+
\subsection{ProxyHandler Objects \label{proxy-handler}}
\begin{methoddescni}[ProxyHandler]{\var{protocol}_open}{request}
Index: Doc/lib/libwarnings.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libwarnings.tex,v
retrieving revision 1.6.16.1
retrieving revision 1.6.16.2
diff -u -r1.6.16.1 -r1.6.16.2
--- Doc/lib/libwarnings.tex 12 Mar 2002 19:51:16 -0000 1.6.16.1
+++ Doc/lib/libwarnings.tex 1 Jul 2003 21:48:57 -0000 1.6.16.2
@@ -174,7 +174,7 @@
\begin{funcdesc}{showwarning}{message, category, filename,
lineno\optional{, file}}
Write a warning to a file. The default implementation calls
-\code{showwarning(\var{message}, \var{category}, \var{filename},
+\code{formatwarning(\var{message}, \var{category}, \var{filename},
\var{lineno})} and writes the resulting string to \var{file}, which
defaults to \code{sys.stderr}. You may replace this function with an
alternative implementation by assigning to
Index: Doc/lib/tkinter.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v
retrieving revision 1.10.6.7
retrieving revision 1.10.6.9
diff -u -r1.10.6.7 -r1.10.6.9
--- Doc/lib/tkinter.tex 20 May 2003 15:20:33 -0000 1.10.6.7
+++ Doc/lib/tkinter.tex 28 Jul 2003 14:39:37 -0000 1.10.6.9
@@ -1763,13 +1763,15 @@
widgets that \code{[incr Widgets]} does, and is almost as complete as
Tix, lacking however Tix's fast \class{HList} widget for drawing trees.
}
-\seetitle[http://tkinter.effbot.org]{Tkinter3000}{
-is a Widget Construction Kit that allows you to write new Tkinter
-widgets in Python using Mixins. It is built on top of Tkinter,
-and does not offer the extended range of widgets that \refmodule{Tix} does,
-but does allow a form of building mega-widgets. The project is
-still in the early stages.
-}
+
+\seetitle[http://tkinter.effbot.org/]{Tkinter3000 Widget Construction
+ Kit (WCK)}{%
+is a library that allows you to write new Tkinter widgets in pure
+Python. The WCK framework gives you full control over widget
+creation, configuration, screen appearance, and event handling. WCK
+widgets can be very fast and light-weight, since they can operate
+directly on Python data structures, without having to transfer data
+through the Tk/Tcl layer.}
\end{seealso*}
@@ -1818,7 +1820,7 @@
and GUI elements, simply by taking existing controls, and creating a
derived class which simply adds or redefines the desired behavior.
}
-\seetitle[http://www.daa.com.au/\textasciitilde james/pygtk/]{PyGTK}{
+\seetitle[http://www.daa.com.au/\textasciitilde james/software/pygtk/]{PyGTK}{
is a set of bindings for the \ulink{GTK}{http://www.gtk.org/} widget set.
It provides an object oriented interface that is slightly higher
level than the C one. It automatically does all the type casting and
Index: Doc/mac/toolbox.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/mac/toolbox.tex,v
retrieving revision 1.4
retrieving revision 1.4.12.1
diff -u -r1.4 -r1.4.12.1
--- Doc/mac/toolbox.tex 11 Sep 2001 21:25:10 -0000 1.4
+++ Doc/mac/toolbox.tex 29 Jul 2003 17:44:24 -0000 1.4.12.1
@@ -23,7 +23,7 @@
\strong{Warning!} These modules are not yet documented. If you
wish to contribute documentation of any of these modules, please get
-in touch with \email{python-docs@python.org}.
+in touch with \email{docs@python.org}.
\localmoduletable
Index: Doc/mac/undoc.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/mac/undoc.tex,v
retrieving revision 1.7
retrieving revision 1.7.10.1
diff -u -r1.7 -r1.7.10.1
--- Doc/mac/undoc.tex 1 Oct 2001 17:04:10 -0000 1.7
+++ Doc/mac/undoc.tex 29 Jul 2003 17:44:24 -0000 1.7.10.1
@@ -4,7 +4,7 @@
The modules in this chapter are poorly documented (if at all). If you
wish to contribute documentation of any of these modules, please get in
touch with
-\ulink{\email{python-docs@python.org}}{mailto:python-docs@python.org}.
+\ulink{\email{docs@python.org}}{mailto:docs@python.org}.
\localmoduletable
Index: Doc/perl/l2hinit.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v
retrieving revision 1.58.6.1
retrieving revision 1.58.6.2
diff -u -r1.58.6.1 -r1.58.6.2
--- Doc/perl/l2hinit.perl 22 Mar 2002 17:23:03 -0000 1.58.6.1
+++ Doc/perl/l2hinit.perl 27 Jun 2003 18:27:21 -0000 1.58.6.2
@@ -385,12 +385,14 @@
# In addition to the standard stuff, add label to allow named node files and
# support suppression of the page complete (for HTML Help use).
+$MY_CONTENTS_PAGE = '';
sub do_cmd_tableofcontents {
local($_) = @_;
$TITLE = $toc_title;
$tocfile = $CURRENT_FILE;
my($closures,$reopens) = preserve_open_tags();
anchor_label('contents', $CURRENT_FILE, $_); # this is added
+ $MY_CONTENTS_PAGE = "$CURRENT_FILE";
join('', "<BR>\n\\tableofchildlinks[off]", $closures
, make_section_heading($toc_title, 'H2'), $toc_mark
, $reopens, $_);
@@ -619,8 +621,8 @@
"<link rel=\"STYLESHEET\" href=\"$STYLESHEET\">\n",
"<link rel=\"first\" href=\"$FILE.html\">\n",
($HAVE_TABLE_OF_CONTENTS
- ? ('<link rel="contents" href="contents.html" title="Contents">'
- . "\n")
+ ? ("<link rel='contents' href='$MY_CONTENTS_PAGE'"
+ . " title='Contents'>\n")
: ''),
($HAVE_GENERAL_INDEX
? '<link rel="index" href="genindex.html" title="Index">'
Index: Doc/ref/ref2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v
retrieving revision 1.34.6.7
retrieving revision 1.34.6.8
diff -u -r1.34.6.7 -r1.34.6.8
--- Doc/ref/ref2.tex 19 Jan 2003 14:54:08 -0000 1.34.6.7
+++ Doc/ref/ref2.tex 6 Sep 2003 03:48:52 -0000 1.34.6.8
@@ -284,25 +284,39 @@
\subsection{Reserved classes of identifiers\label{id-classes}}
Certain classes of identifiers (besides keywords) have special
-meanings. These are:
+meanings. These classes are identified by the patterns of leading and
+trailing underscore characters:
-\begin{tableiii}{l|l|l}{code}{Form}{Meaning}{Notes}
-\lineiii{_*}{Not imported by \samp{from \var{module} import *}}{(1)}
-\lineiii{__*__}{System-defined name}{}
-\lineiii{__*}{Class-private name mangling}{}
-\end{tableiii}
-
-See sections: \ref{import}, ``The \keyword{import} statement'';
-\ref{specialnames}, ``Special method names'';
-\ref{atom-identifiers}, ``Identifiers (Names)''.
+\begin{description}
-Note:
+\item[\code{_*}]
+ Not imported by \samp{from \var{module} import *}. The special
+ identifier \samp{_} is used in the interactive interpreter to store
+ the result of the last evaluation; it is stored in the
+ \module{__builtin__} module. When not in interactive mode, \samp{_}
+ has no special meaning and is not defined.
+ See section~\ref{import}, ``The \keyword{import} statement.''
+
+ \note{The name \samp{_} is often used in conjunction with
+ internationalization; refer to the documentation for the
+ \ulink{\module{gettext} module}{../lib/module-gettext.html} for more
+ information on this convention.}
+
+\item[\code{__*__}]
+ System-defined names. These names are defined by the interpreter
+ and it's implementation (including the standard library);
+ applications should not expect to define additional names using this
+ convention. The set of names of this class defined by Python may be
+ extended in future versions.
+ See section~\ref{specialnames}, ``Special method names.''
+
+\item[\code{__*}]
+ Class-private names. Names in this category, when used within the
+ context of a class definition, are re-written to use a mangled for
+ to help avoid name clashes between ``private'' attributes of base
+ and derived classes.
+ See section~\ref{atom-identifiers}, ``Identifiers (Names).''
-\begin{description}
-\item[(1)] The special identifier \samp{_} is used in the interactive
-interpreter to store the result of the last evaluation; it is stored
-in the \module{__builtin__} module. When not in interactive mode,
-\samp{_} has no special meaning and is not defined.
\end{description}
Index: Doc/ref/ref3.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.82.4.9
retrieving revision 1.82.4.10
diff -u -r1.82.4.9 -r1.82.4.10
--- Doc/ref/ref3.tex 12 May 2003 13:50:41 -0000 1.82.4.9
+++ Doc/ref/ref3.tex 24 Jul 2003 01:46:39 -0000 1.82.4.10
@@ -1486,7 +1486,7 @@
These methods are called to implement the augmented arithmetic
operations (\code{+=}, \code{-=}, \code{*=}, \code{/=}, \code{\%=},
\code{**=}, \code{<}\code{<=}, \code{>}\code{>=}, \code{\&=},
-\code{\^=}, \code{|=}). These methods should attempt to do the
+\code{\textasciicircum=}, \code{|=}). These methods should attempt to do the
operation in-place (modifying \var{self}) and return the result (which
could be, but does not have to be, \var{self}). If a specific method
is not defined, the augmented operation falls back to the normal
Index: Doc/ref/ref5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v
retrieving revision 1.53.4.11
retrieving revision 1.53.4.12
diff -u -r1.53.4.11 -r1.53.4.12
--- Doc/ref/ref5.tex 16 Dec 2002 23:19:19 -0000 1.53.4.11
+++ Doc/ref/ref5.tex 27 Jun 2003 17:13:17 -0000 1.53.4.12
@@ -169,6 +169,11 @@
square brackets:
\begin{productionlist}
+ \production{test}
+ {\token{and_test} ( "or" \token{and_test} )*
+ | \token{lambda_form}}
+ \production{testlist}
+ {\token{test} ( "," \token{test} )* [ "," ]}
\production{list_display}
{"[" [\token{listmaker}] "]"}
\production{listmaker}
Index: Doc/texinputs/boilerplate.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/Attic/boilerplate.tex,v
retrieving revision 1.70.2.1.2.11
retrieving revision 1.70.2.1.2.13
diff -u -r1.70.2.1.2.11 -r1.70.2.1.2.13
--- Doc/texinputs/boilerplate.tex 29 May 2003 18:49:32 -0000 1.70.2.1.2.11
+++ Doc/texinputs/boilerplate.tex 29 Jul 2003 17:44:24 -0000 1.70.2.1.2.13
@@ -2,10 +2,10 @@
Fred L. Drake, Jr., editor}
\authoraddress{
\strong{PythonLabs}\\
- Email: \email{python-docs@python.org}
+ Email: \email{docs@python.org}
}
-\date{30 May 2003} % XXX update before final release!
-\release{2.2.3} % software release, not documentation
+\date{\today} % XXX update before final release!
+\release{2.2.3+} % software release, not documentation
\setreleaseinfo{} % empty for final release
\setshortversion{2.2} % major.minor only for software
Index: Doc/tools/getpagecounts
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/getpagecounts,v
retrieving revision 1.7.26.1
retrieving revision 1.7.26.3
diff -u -r1.7.26.1 -r1.7.26.3
--- Doc/tools/getpagecounts 17 Apr 2002 03:29:26 -0000 1.7.26.1
+++ Doc/tools/getpagecounts 29 Jul 2003 17:44:24 -0000 1.7.26.3
@@ -2,7 +2,7 @@
"""Generate a page count report of the PostScript version of the manuals."""
-__version__ = '$Revision: 1.7.26.1 $'
+__version__ = '$Revision: 1.7.26.3 $'
import getopt
import sys
@@ -65,7 +65,7 @@
of it! To locate published copies of the larger manuals, or other
Python reference material, consult the Python Bookstore at:
- http://www.amk.ca/bookstore/
+ http://www.python.org/cgi-bin/moinmoin/PythonBooks
The following manuals are included in this package:
"""
@@ -73,7 +73,7 @@
If you have any questions, comments, or suggestions regarding these
-documents, please send them via email to python-docs@python.org.
+documents, please send them via email to docs@python.org.
"""
def count_pages(filename):
Index: Doc/tools/html2texi.pl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/html2texi.pl,v
retrieving revision 1.3
retrieving revision 1.3.30.1
diff -u -r1.3 -r1.3.30.1
--- Doc/tools/html2texi.pl 14 Jan 1999 18:17:07 -0000 1.3
+++ Doc/tools/html2texi.pl 29 Jul 2003 17:44:24 -0000 1.3.30.1
@@ -137,7 +137,7 @@
# Index:
# Perhaps double-check that every tag mentioned in the index is found
# in the text.
-# Python: email to python-docs@python.org, to get their feedback.
+# Python: email to docs@python.org, to get their feedback.
# Compare to existing lib/ Info manual
# Write the hooks into info-look; replace pyliblookup1-1.tar.gz.
# Postpass to remove extra quotation marks around typography already in
Index: Doc/tools/mkackshtml
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkackshtml,v
retrieving revision 1.2
retrieving revision 1.2.22.1
diff -u -r1.2 -r1.2.22.1
--- Doc/tools/mkackshtml 12 Feb 2001 19:12:55 -0000 1.2
+++ Doc/tools/mkackshtml 29 Jul 2003 17:44:24 -0000 1.2.22.1
@@ -52,7 +52,7 @@
documentation. This list is probably not complete -- if you feel that
you or anyone else should be on this list, please let us know (send
email to <a
-href="mailto:python-docs@python.org">python-docs@python.org</a>), and
+href="mailto:docs@python.org">docs@python.org</a>), and
we will be glad to correct the problem.</p>
<p>It is only with the input and contributions of the Python community
Index: Doc/tools/mkhowto
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v
retrieving revision 1.31
retrieving revision 1.31.6.1
diff -u -r1.31 -r1.31.6.1
--- Doc/tools/mkhowto 4 Dec 2001 16:32:04 -0000 1.31
+++ Doc/tools/mkhowto 24 Jul 2003 02:00:18 -0000 1.31.6.1
@@ -640,11 +640,9 @@
def new_index(filename, label="genindex"):
fp = open(filename, "w")
- fp.write(r"""\
-\begin{theindex}
-\label{%s}
-\end{theindex}
-""" % label)
+ fp.write("\\begin{theindex}\n"
+ "\\label{%s}\n"
+ "\\end{theindex}\n" % label)
fp.close()
Index: Doc/tools/sgmlconv/README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/README,v
retrieving revision 1.6
retrieving revision 1.6.22.1
diff -u -r1.6 -r1.6.22.1
--- Doc/tools/sgmlconv/README 22 Nov 2000 16:58:25 -0000 1.6
+++ Doc/tools/sgmlconv/README 29 Jul 2003 17:44:24 -0000 1.6.22.1
@@ -13,7 +13,7 @@
cd Doc/<document-dir>
make -f ../tools/sgmlconv/make.rules TOOLSDIR=../tools
-Please send comments and bug reports to python-docs@python.org.
+Please send comments and bug reports to docs@python.org.
What do the tools do?
Index: Doc/tut/tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.156.4.1.2.17
retrieving revision 1.156.4.1.2.20
diff -u -r1.156.4.1.2.17 -r1.156.4.1.2.20
--- Doc/tut/tut.tex 7 May 2003 16:02:06 -0000 1.156.4.1.2.17
+++ Doc/tut/tut.tex 7 Jul 2003 21:01:09 -0000 1.156.4.1.2.20
@@ -141,7 +141,7 @@
references to Monty Python skits in documentation is not only allowed,
it is encouraged!
-\section{Where From Here \label{where}}
+%\section{Where From Here \label{where}}
Now that you are all excited about Python, you'll want to examine it
in some more detail. Since the best way to learn a language is
@@ -299,10 +299,21 @@
(assuming that the interpreter is on the user's \envvar{PATH}) at the
beginning of the script and giving the file an executable mode. The
-\samp{\#!} must be the first two characters of the file. Note that
+\samp{\#!} must be the first two characters of the file. On some
+platforms, this first line must end with a \UNIX-style line ending
+(\character{\e n}), not a Mac OS (\character{\e r}) or Windows
+(\character{\e r\e n}) line ending. Note that
the hash, or pound, character, \character{\#}, is used to start a
comment in Python.
+The script can be given a executable mode, or permission, using the
+\program{chmod} command:
+
+\begin{verbatim}
+% chmod +x myscript.py
+\end{verbatim}
+
+
\subsection{The Interactive Startup File \label{startup}}
% XXX This should probably be dumped in an appendix, since most people
@@ -1388,8 +1399,9 @@
\strong{Important warning:} The default value is evaluated only once.
This makes a difference when the default is a mutable object such as a
-list or dictionary. For example, the following function accumulates
-the arguments passed to it on subsequent calls:
+list, dictionary, or instances of most classes. For example, the
+following function accumulates the arguments passed to it on
+subsequent calls:
\begin{verbatim}
def f(a, L=[]):
Index: Doc/whatsnew/whatsnew22.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew22.tex,v
retrieving revision 1.54.2.4
retrieving revision 1.54.2.5
diff -u -r1.54.2.4 -r1.54.2.5
--- Doc/whatsnew/whatsnew22.tex 20 May 2003 18:13:14 -0000 1.54.2.4
+++ Doc/whatsnew/whatsnew22.tex 10 Sep 2004 19:51:20 -0000 1.54.2.5
@@ -1,6 +1,6 @@
\documentclass{howto}
-% $Id: whatsnew22.tex,v 1.54.2.4 2003/05/20 18:13:14 akuchling Exp $
+% $Id: whatsnew22.tex,v 1.54.2.5 2004/09/10 19:51:20 akuchling Exp $
\title{What's New in Python 2.2}
\release{1.02}
@@ -344,7 +344,7 @@
example, \class{D}'s \method{save()} method would look like this:
\begin{verbatim}
-class D:
+class D (B,C):
def save (self):
# Call superclass .save()
super(D, self).save()
Index: Include/patchlevel.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v
retrieving revision 2.60.2.1.2.12
retrieving revision 2.60.2.1.2.13
diff -u -r2.60.2.1.2.12 -r2.60.2.1.2.13
--- Include/patchlevel.h 30 May 2003 13:41:07 -0000 2.60.2.1.2.12
+++ Include/patchlevel.h 31 May 2003 03:19:28 -0000 2.60.2.1.2.13
@@ -26,7 +26,7 @@
#define PY_RELEASE_SERIAL 0
/* Version as a string */
-#define PY_VERSION "2.2.3"
+#define PY_VERSION "2.2.3+"
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */
Index: Lib/SimpleXMLRPCServer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/SimpleXMLRPCServer.py,v
retrieving revision 1.2
retrieving revision 1.2.10.1
diff -u -r1.2 -r1.2.10.1
--- Lib/SimpleXMLRPCServer.py 29 Sep 2001 04:54:33 -0000 1.2
+++ Lib/SimpleXMLRPCServer.py 3 Feb 2005 14:58:26 -0000 1.2.10.1
@@ -161,7 +161,8 @@
try:
func = _resolve_dotted_attribute(
self.server.instance,
- method
+ method,
+ self.server.allow_dotted_names
)
except AttributeError:
pass
@@ -178,11 +179,20 @@
BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
-def _resolve_dotted_attribute(obj, attr):
+def _resolve_dotted_attribute(obj, attr, allow_dotted_names=True):
"""Resolves a dotted attribute name to an object. Raises
an AttributeError if any attribute in the chain starts with a '_'.
+
+ If the optional allow_dotted_names argument is false, dots are not
+ supported and this function operates similar to getattr(obj, attr).
"""
- for i in attr.split('.'):
+
+ if allow_dotted_names:
+ attrs = attr.split('.')
+ else:
+ attrs = [attr]
+
+ for i in attrs:
if i.startswith('_'):
raise AttributeError(
'attempt to access private attribute "%s"' % i
@@ -206,7 +216,7 @@
self.instance = None
SocketServer.TCPServer.__init__(self, addr, requestHandler)
- def register_instance(self, instance):
+ def register_instance(self, instance, allow_dotted_names=False):
"""Registers an instance to respond to XML-RPC requests.
Only one instance can be installed at a time.
@@ -225,9 +235,23 @@
If a registered function matches a XML-RPC request, then it
will be called instead of the registered instance.
+
+ If the optional allow_dotted_names argument is true and the
+ instance does not have a _dispatch method, method names
+ containing dots are supported and resolved, as long as none of
+ the name segments start with an '_'.
+
+ *** SECURITY WARNING: ***
+
+ Enabling the allow_dotted_names options allows intruders
+ to access your module's global variables and may allow
+ intruders to execute arbitrary code on your machine. Only
+ use this option on a secure, closed network.
+
"""
self.instance = instance
+ self.allow_dotted_names = allow_dotted_names
def register_function(self, function, name = None):
"""Registers a function to respond to XML-RPC requests.
Index: Lib/copy.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy.py,v
retrieving revision 1.22.10.5
retrieving revision 1.22.10.6
diff -u -r1.22.10.5 -r1.22.10.6
--- Lib/copy.py 12 Aug 2002 20:21:43 -0000 1.22.10.5
+++ Lib/copy.py 14 Jun 2003 07:20:04 -0000 1.22.10.6
@@ -112,6 +112,7 @@
d[types.TypeType] = _copy_atomic
d[types.XRangeType] = _copy_atomic
d[types.ClassType] = _copy_atomic
+d[types.BuiltinFunctionType] = _copy_atomic
def _copy_list(x):
return x[:]
@@ -211,6 +212,8 @@
pass
d[types.TypeType] = _deepcopy_atomic
d[types.XRangeType] = _deepcopy_atomic
+d[types.ClassType] = _deepcopy_atomic
+d[types.BuiltinFunctionType] = _deepcopy_atomic
def _deepcopy_list(x, memo):
y = []
Index: Lib/copy_reg.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy_reg.py,v
retrieving revision 1.9.6.1
retrieving revision 1.9.6.2
diff -u -r1.9.6.1 -r1.9.6.2
--- Lib/copy_reg.py 28 Dec 2001 15:48:09 -0000 1.9.6.1
+++ Lib/copy_reg.py 7 Jun 2003 20:09:43 -0000 1.9.6.2
@@ -29,10 +29,16 @@
# Example: provide pickling support for complex numbers.
-def pickle_complex(c):
- return complex, (c.real, c.imag)
+try:
+ complex
+except NameError:
+ pass
+else:
-pickle(type(1j), pickle_complex, complex)
+ def pickle_complex(c):
+ return complex, (c.real, c.imag)
+
+ pickle(complex, pickle_complex, complex)
# Support for picking new-style objects
Index: Lib/difflib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/difflib.py,v
retrieving revision 1.6.10.1
retrieving revision 1.6.10.2
diff -u -r1.6.10.1 -r1.6.10.2
--- Lib/difflib.py 30 Oct 2002 06:33:33 -0000 1.6.10.1
+++ Lib/difflib.py 1 Jul 2003 15:12:33 -0000 1.6.10.2
@@ -24,6 +24,11 @@
__all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher',
'Differ', 'IS_CHARACTER_JUNK', 'IS_LINE_JUNK']
+def _calculate_ratio(matches, length):
+ if length:
+ return 2.0 * matches / length
+ return 1.0
+
class SequenceMatcher:
"""
@@ -525,7 +530,7 @@
matches = reduce(lambda sum, triple: sum + triple[-1],
self.get_matching_blocks(), 0)
- return 2.0 * matches / (len(self.a) + len(self.b))
+ return _calculate_ratio(matches, len(self.a) + len(self.b))
def quick_ratio(self):
"""Return an upper bound on ratio() relatively quickly.
@@ -554,7 +559,7 @@
avail[elt] = numb - 1
if numb > 0:
matches = matches + 1
- return 2.0 * matches / (len(self.a) + len(self.b))
+ return _calculate_ratio(matches, len(self.a) + len(self.b))
def real_quick_ratio(self):
"""Return an upper bound on ratio() very quickly.
@@ -566,7 +571,7 @@
la, lb = len(self.a), len(self.b)
# can't have more matches than the number of elements in the
# shorter sequence
- return 2.0 * min(la, lb) / (la + lb)
+ return _calculate_ratio(min(la, lb), la + lb)
def get_close_matches(word, possibilities, n=3, cutoff=0.6):
"""Use SequenceMatcher to return list of the best "good enough" matches.
Index: Lib/httplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v
retrieving revision 1.42.10.10
retrieving revision 1.42.10.11
diff -u -r1.42.10.10 -r1.42.10.11
--- Lib/httplib.py 31 Jan 2003 14:07:31 -0000 1.42.10.10
+++ Lib/httplib.py 30 Jun 2003 15:01:26 -0000 1.42.10.11
@@ -231,6 +231,10 @@
line = self.fp.readline()
if self.debuglevel > 0:
print "reply:", repr(line)
+ if not line:
+ # Presumably, the server closed the connection before
+ # sending a valid response.
+ raise BadStatusLine(line)
try:
[version, status, reason] = line.split(None, 2)
except ValueError:
Index: Lib/inspect.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v
retrieving revision 1.26.10.3
retrieving revision 1.26.10.4
diff -u -r1.26.10.3 -r1.26.10.4
--- Lib/inspect.py 19 Jan 2003 14:16:19 -0000 1.26.10.3
+++ Lib/inspect.py 27 Jun 2003 18:16:21 -0000 1.26.10.4
@@ -619,6 +619,8 @@
'args' is a list of the argument names (it may contain nested lists).
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'defaults' is an n-tuple of the default values of the last n arguments."""
+ if ismethod(func):
+ func = func.im_func
if not isfunction(func): raise TypeError, 'arg is not a Python function'
args, varargs, varkw = getargs(func.func_code)
return args, varargs, varkw, func.func_defaults
Index: Lib/mimetypes.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v
retrieving revision 1.21
retrieving revision 1.21.6.1
diff -u -r1.21 -r1.21.6.1
--- Lib/mimetypes.py 5 Dec 2001 15:58:29 -0000 1.21
+++ Lib/mimetypes.py 30 Oct 2003 15:13:41 -0000 1.21.6.1
@@ -35,7 +35,7 @@
"/usr/local/etc/mime.types", # Apache 1.3
]
-inited = 0
+inited = False
class MimeTypes:
@@ -208,7 +208,7 @@
global guess_extension, guess_type
global suffix_map, types_map, encodings_map, common_types
global inited
- inited = 1
+ inited = True
db = MimeTypes()
if files is None:
files = knownfiles
Index: Lib/os.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v
retrieving revision 1.50.8.7
retrieving revision 1.50.8.8
diff -u -r1.50.8.7 -r1.50.8.8
--- Lib/os.py 28 Mar 2003 22:31:41 -0000 1.50.8.7
+++ Lib/os.py 2 Jul 2003 02:51:15 -0000 1.50.8.8
@@ -537,7 +537,7 @@
# At the moment, Windows doesn't implement spawnvp[e],
# so it won't have spawnlp[e] either.
def spawnlp(mode, file, *args):
- """spawnlp(mode, file, *args, env) -> integer
+ """spawnlp(mode, file, *args) -> integer
Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
Index: Lib/urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.24.8.7
retrieving revision 1.24.8.9
diff -u -r1.24.8.7 -r1.24.8.9
--- Lib/urllib2.py 22 May 2003 17:30:48 -0000 1.24.8.7
+++ Lib/urllib2.py 12 Jul 2003 07:35:35 -0000 1.24.8.9
@@ -418,15 +418,15 @@
"""
m = req.get_method()
if (code in (301, 302, 303, 307) and m in ("GET", "HEAD")
- or code in (302, 303) and m == "POST"):
- # Strictly (according to RFC 2616), 302 in response to a
- # POST MUST NOT cause a redirection without confirmation
+ or code in (301, 302, 303) and m == "POST"):
+ # Strictly (according to RFC 2616), 301 or 302 in response
+ # to a POST MUST NOT cause a redirection without confirmation
# from the user (of urllib2, in this case). In practice,
# essentially all clients do redirect in this case, so we
# do the same.
return Request(newurl, headers=req.headers)
else:
- raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
+ raise HTTPError(req.get_full_url(), code, msg, headers, fp)
# Implementation note: To avoid the server sending us into an
# infinite loop, the request object needs to track what URLs we
@@ -467,9 +467,9 @@
http_error_301 = http_error_303 = http_error_307 = http_error_302
- inf_msg = "The HTTP server returned a redirect error that would" \
+ inf_msg = "The HTTP server returned a redirect error that would " \
"lead to an infinite loop.\n" \
- "The last 302 error message was:\n"
+ "The last 30x error message was:\n"
class ProxyHandler(BaseHandler):
def __init__(self, proxies=None):
Index: Lib/whichdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v
retrieving revision 1.12
retrieving revision 1.12.8.1
diff -u -r1.12 -r1.12.8.1
--- Lib/whichdb.py 24 Oct 2001 20:33:34 -0000 1.12
+++ Lib/whichdb.py 14 Jun 2003 08:17:28 -0000 1.12.8.1
@@ -29,15 +29,19 @@
# Check for dumbdbm next -- this has a .dir and and a .dat file
try:
- f = open(filename + os.extsep + "dat", "rb")
- f.close()
+ # First check for presence of files
+ sizes = os.stat(filename + os.extsep + "dat").st_size, \
+ os.stat(filename + os.extsep + "dir").st_size
+ # dumbdbm files with no keys are empty
+ if sizes == (0, 0):
+ return "dumbdbm"
f = open(filename + os.extsep + "dir", "rb")
try:
if f.read(1) in ["'", '"']:
return "dumbdbm"
finally:
f.close()
- except IOError:
+ except (OSError, IOError):
pass
# See if the file exists, return None if not
Index: Lib/xmlrpclib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v
retrieving revision 1.15
retrieving revision 1.15.4.1
diff -u -r1.15 -r1.15.4.1
--- Lib/xmlrpclib.py 19 Dec 2001 21:40:04 -0000 1.15
+++ Lib/xmlrpclib.py 12 Jul 2003 07:53:52 -0000 1.15.4.1
@@ -1,6 +1,6 @@
#
# XML-RPC CLIENT LIBRARY
-# $Id: xmlrpclib.py,v 1.15 2001/12/19 21:40:04 effbot Exp $
+# $Id: xmlrpclib.py,v 1.15.4.1 2003/07/12 07:53:52 loewis Exp $
#
# an XML-RPC client interface for Python.
#
@@ -439,7 +439,10 @@
if isinstance(values, Fault):
# fault instance
write("<fault>\n")
- self.__dump(vars(values))
+ self.__dump({
+ 'faultCode': values.faultCode,
+ 'faultString': values.faultString,
+ })
write("</fault>\n")
else:
# parameter block
Index: Lib/zipfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/zipfile.py,v
retrieving revision 1.20
retrieving revision 1.20.6.1
diff -u -r1.20 -r1.20.6.1
--- Lib/zipfile.py 6 Dec 2001 06:23:25 -0000 1.20
+++ Lib/zipfile.py 18 Jun 2003 01:05:34 -0000 1.20.6.1
@@ -1,6 +1,4 @@
"Read and write ZIP files."
-# Written by James C. Ahlstrom jim@interet.com
-# All rights transferred to CNRI pursuant to the Python contribution agreement
import struct, os, time
import binascii
@@ -92,7 +90,18 @@
"""Class with attributes describing each file in the ZIP archive."""
def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
- self.filename = _normpath(filename) # Name of the file in the archive
+ self.orig_filename = filename # Original file name in archive
+# Terminate the file name at the first null byte. Null bytes in file
+# names are used as tricks by viruses in archives.
+ null_byte = filename.find(chr(0))
+ if null_byte >= 0:
+ filename = filename[0:null_byte]
+# This is used to ensure paths in generated ZIP files always use
+# forward slashes as the directory separator, as required by the
+# ZIP format specification.
+ if os.sep != "/":
+ filename = filename.replace(os.sep, "/")
+ self.filename = filename # Normalized file name
self.date_time = date_time # year, month, day, hour, min, sec
# Standard values:
self.compress_type = ZIP_STORED # Type of compression for the file
@@ -133,17 +142,6 @@
return header + self.filename + self.extra
-# This is used to ensure paths in generated ZIP files always use
-# forward slashes as the directory separator, as required by the
-# ZIP format specification.
-if os.sep != "/":
- def _normpath(path):
- return path.replace(os.sep, "/")
-else:
- def _normpath(path):
- return path
-
-
class ZipFile:
""" Class with methods to open, read, write, close, list zip files.
@@ -281,10 +279,10 @@
+ fheader[_FH_FILENAME_LENGTH]
+ fheader[_FH_EXTRA_FIELD_LENGTH])
fname = fp.read(fheader[_FH_FILENAME_LENGTH])
- if fname != data.filename:
+ if fname != data.orig_filename:
raise RuntimeError, \
'File name in directory "%s" and header "%s" differ.' % (
- data.filename, fname)
+ data.orig_filename, fname)
def namelist(self):
"""Return a list of file names in the archive."""
Index: Lib/distutils/command/bdist_wininst.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_wininst.py,v
retrieving revision 1.27.4.3
retrieving revision 1.27.4.4
diff -u -r1.27.4.3 -r1.27.4.4
--- Lib/distutils/command/bdist_wininst.py 18 Apr 2002 02:30:39 -0000 1.27.4.3
+++ Lib/distutils/command/bdist_wininst.py 12 Jun 2003 17:29:57 -0000 1.27.4.4
@@ -5,7 +5,7 @@
# created 2000/06/02, Thomas Heller
-__revision__ = "$Id: bdist_wininst.py,v 1.27.4.3 2002/04/18 02:30:39 anthonybaxter Exp $"
+__revision__ = "$Id: bdist_wininst.py,v 1.27.4.4 2003/06/12 17:29:57 theller Exp $"
import sys, os, string
from distutils.core import Command
@@ -82,7 +82,7 @@
self.run_command('build')
- install = self.reinitialize_command('install')
+ install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
install.warn_dir = 0
Index: Lib/distutils/command/install_scripts.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/install_scripts.py,v
retrieving revision 1.10.26.1
retrieving revision 1.10.26.2
diff -u -r1.10.26.1 -r1.10.26.2
--- Lib/distutils/command/install_scripts.py 22 Feb 2002 13:19:54 -0000 1.10.26.1
+++ Lib/distutils/command/install_scripts.py 27 Jun 2003 19:37:16 -0000 1.10.26.2
@@ -5,7 +5,7 @@
# contributed by Bastian Kleineidam
-__revision__ = "$Id: install_scripts.py,v 1.10.26.1 2002/02/22 13:19:54 mwh Exp $"
+__revision__ = "$Id: install_scripts.py,v 1.10.26.2 2003/06/27 19:37:16 montanaro Exp $"
import os
from distutils.core import Command
@@ -50,7 +50,7 @@
if self.dry_run:
self.announce("changing mode of %s" % file)
else:
- mode = ((os.stat(file)[ST_MODE]) | 0111) & 07777
+ mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777
self.announce("changing mode of %s to %o" % (file, mode))
os.chmod(file, mode)
Index: Lib/email/Message.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v
retrieving revision 1.9.6.4
retrieving revision 1.9.6.6
diff -u -r1.9.6.4 -r1.9.6.6
--- Lib/email/Message.py 8 May 2003 04:00:04 -0000 1.9.6.4
+++ Lib/email/Message.py 3 Sep 2003 04:14:01 -0000 1.9.6.6
@@ -58,6 +58,23 @@
else:
return param
+def _parseparam(s):
+ plist = []
+ while s[:1] == ';':
+ s = s[1:]
+ end = s.find(';')
+ while end > 0 and s.count('"', 0, end) % 2:
+ end = s.find(';', end + 1)
+ if end < 0:
+ end = len(s)
+ f = s[:end]
+ if '=' in f:
+ i = f.index('=')
+ f = f[:i].strip().lower() + '=' + f[i+1:].strip()
+ plist.append(f.strip())
+ s = s[end:]
+ return plist
+
def _unquotevalue(value):
if isinstance(value, TupleType):
@@ -525,7 +542,7 @@
if value is missing:
return failobj
params = []
- for p in paramre.split(value):
+ for p in _parseparam(';' + value):
try:
name, val = p.split('=', 1)
name = name.strip()
@@ -571,13 +588,16 @@
Parameter keys are always compared case insensitively. The return
value can either be a string, or a 3-tuple if the parameter was RFC
2231 encoded. When it's a 3-tuple, the elements of the value are of
- the form (CHARSET, LANGUAGE, VALUE), where LANGUAGE may be the empty
- string. Your application should be prepared to deal with these, and
- can convert the parameter to a Unicode string like so:
+ the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and
+ LANGUAGE can be None, in which case you should consider VALUE to be
+ encoded in the us-ascii charset. You can usually ignore LANGUAGE.
+
+ Your application should be prepared to deal with 3-tuple return
+ values, and can convert the parameter to a Unicode string like so:
param = msg.get_param('foo')
if isinstance(param, tuple):
- param = unicode(param[2], param[0])
+ param = unicode(param[2], param[0] or 'us-ascii')
In any case, the parameter value (either the returned string, or the
VALUE item in the 3-tuple) is always unquoted, unless unquote is set
@@ -708,7 +728,7 @@
if isinstance(filename, TupleType):
# It's an RFC 2231 encoded parameter
newvalue = _unquotevalue(filename)
- return unicode(newvalue[2], newvalue[0])
+ return unicode(newvalue[2], newvalue[0] or 'us-ascii')
else:
newvalue = _unquotevalue(filename.strip())
return newvalue
@@ -725,7 +745,8 @@
return failobj
if isinstance(boundary, TupleType):
# RFC 2231 encoded, so decode. It better end up as ascii
- return unicode(boundary[2], boundary[0]).encode('us-ascii')
+ charset = boundary[0] or 'us-ascii'
+ return unicode(boundary[2], charset).encode('us-ascii')
return _unquotevalue(boundary.strip())
def set_boundary(self, boundary):
@@ -792,7 +813,8 @@
return failobj
if isinstance(charset, TupleType):
# RFC 2231 encoded, so decode it, and it better end up as ascii.
- charset = unicode(charset[2], charset[0]).encode('us-ascii')
+ pcharset = charset[0] or 'us-ascii'
+ charset = unicode(charset[2], pcharset).encode('us-ascii')
# RFC 2046, $4.1.2 says charsets are not case sensitive
return charset.lower()
Index: Lib/email/Utils.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v
retrieving revision 1.9.6.2
retrieving revision 1.9.6.3
diff -u -r1.9.6.2 -r1.9.6.3
--- Lib/email/Utils.py 21 Mar 2003 21:09:31 -0000 1.9.6.2
+++ Lib/email/Utils.py 19 Aug 2003 04:56:47 -0000 1.9.6.3
@@ -280,7 +280,7 @@
import urllib
parts = s.split("'", 2)
if len(parts) == 1:
- return None, None, s
+ return None, None, urllib.unquote(s)
charset, language, s = parts
return charset, language, urllib.unquote(s)
Index: Lib/email/__init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v
retrieving revision 1.4.10.8
retrieving revision 1.4.10.9
diff -u -r1.4.10.8 -r1.4.10.9
--- Lib/email/__init__.py 29 May 2003 20:09:31 -0000 1.4.10.8
+++ Lib/email/__init__.py 19 Aug 2003 04:56:47 -0000 1.4.10.9
@@ -4,7 +4,7 @@
"""A package for parsing, handling, and generating email messages.
"""
-__version__ = '2.5.3'
+__version__ = '2.5.4'
__all__ = [
'base64MIME',
Index: Lib/email/test/test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.17.2.7
retrieving revision 1.17.2.9
diff -u -r1.17.2.7 -r1.17.2.9
--- Lib/email/test/test_email.py 8 May 2003 04:00:05 -0000 1.17.2.7
+++ Lib/email/test/test_email.py 3 Sep 2003 04:14:29 -0000 1.17.2.9
@@ -313,6 +313,13 @@
msg = self._msgobj('msg_22.txt')
self.assertEqual(msg.get_payload(1).get_param('name'), 'wibble.JPG')
+ def test_get_param_with_semis_in_quotes(self):
+ msg = email.message_from_string(
+ 'Content-Type: image/pjpeg; name="Jim&&Jill"\n')
+ self.assertEqual(msg.get_param('name'), 'Jim&&Jill')
+ self.assertEqual(msg.get_param('name', unquote=False),
+ '"Jim&&Jill"')
+
def test_has_key(self):
msg = email.message_from_string('Header: exists')
self.failUnless(msg.has_key('header'))
@@ -2650,6 +2657,43 @@
self.assertEqual(msg.get_param('NAME'),
(None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm'))
+ def test_rfc2231_no_language_or_charset_in_filename(self):
+ m = '''\
+Content-Disposition: inline;
+\tfilename*0="This%20is%20even%20more%20";
+\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20";
+\tfilename*2="is it not.pdf"
+
+'''
+ msg = email.message_from_string(m)
+ self.assertEqual(msg.get_filename(),
+ 'This is even more ***fun*** is it not.pdf')
+
+ def test_rfc2231_no_language_or_charset_in_boundary(self):
+ m = '''\
+Content-Type: multipart/alternative;
+\tboundary*0="This%20is%20even%20more%20";
+\tboundary*1="%2A%2A%2Afun%2A%2A%2A%20";
+\tboundary*2="is it not.pdf"
+
+'''
+ msg = email.message_from_string(m)
+ self.assertEqual(msg.get_boundary(),
+ 'This is even more ***fun*** is it not.pdf')
+
+ def test_rfc2231_no_language_or_charset_in_charset(self):
+ # This is a nonsensical charset value, but tests the code anyway
+ m = '''\
+Content-Type: text/plain;
+\tcharset*0="This%20is%20even%20more%20";
+\tcharset*1="%2A%2A%2Afun%2A%2A%2A%20";
+\tcharset*2="is it not.pdf"
+
+'''
+ msg = email.message_from_string(m)
+ self.assertEqual(msg.get_content_charset(),
+ 'this is even more ***fun*** is it not.pdf')
+
def _testclasses():
Index: Lib/encodings/rot_13.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/encodings/rot_13.py,v
retrieving revision 1.2
retrieving revision 1.2.20.1
diff -u -r1.2 -r1.2.20.1
--- Lib/encodings/rot_13.py 16 May 2001 09:41:45 -0000 1.2
+++ Lib/encodings/rot_13.py 18 Jul 2003 02:45:27 -0000 1.2.20.1
@@ -1,4 +1,4 @@
-#!/usr/local/bin/python2.1
+#!/usr/bin/env python
""" Python Character Mapping Codec for ROT13.
See http://ucsub.colorado.edu/~kominek/rot13/ for details.
Index: Lib/lib-tk/Tkinter.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v
retrieving revision 1.160.10.3
retrieving revision 1.160.10.4
diff -u -r1.160.10.3 -r1.160.10.4
--- Lib/lib-tk/Tkinter.py 29 Mar 2003 09:48:12 -0000 1.160.10.3
+++ Lib/lib-tk/Tkinter.py 7 Jun 2003 19:53:55 -0000 1.160.10.4
@@ -27,7 +27,7 @@
tk.mainloop()
"""
-__version__ = "$Revision: 1.160.10.3 $"
+__version__ = "$Revision: 1.160.10.4 $"
import sys
if sys.platform == "win32":
@@ -454,6 +454,12 @@
Identifier returned by after or after_idle must be
given as first parameter."""
+ try:
+ (script, type) = self.tk.splitlist(
+ self.tk.call('after', 'info', id))
+ self.deletecommand(script)
+ except TclError:
+ pass
self.tk.call('after', 'cancel', id)
def bell(self, displayof=0):
"""Ring a display's bell."""
Index: Lib/test/regrtest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v
retrieving revision 1.70.4.4
retrieving revision 1.70.4.6
diff -u -r1.70.4.4 -r1.70.4.6
--- Lib/test/regrtest.py 31 Mar 2003 22:11:45 -0000 1.70.4.4
+++ Lib/test/regrtest.py 21 Jun 2003 16:13:49 -0000 1.70.4.6
@@ -24,27 +24,34 @@
-v is incompatible with -g and does not compare test output files.
--s means to run only a single test and exit. This is useful when doing memory
-analysis on the Python interpreter (which tend to consume to many resources to
-run the full regression test non-stop). The file /tmp/pynexttest is read to
-find the next test to run. If this file is missing, the first test_*.py file
-in testdir or on the command line is used. (actually tempfile.gettempdir() is
-used instead of /tmp).
-
--u is used to specify which special resource intensive tests to run, such as
-those requiring large file support or network connectivity. The argument is a
-comma-separated list of words indicating the resources to test. Currently
-only the following are defined:
+-s means to run only a single test and exit. This is useful when
+doing memory analysis on the Python interpreter (which tend to consume
+too many resources to run the full regression test non-stop). The
+file /tmp/pynexttest is read to find the next test to run. If this
+file is missing, the first test_*.py file in testdir or on the command
+line is used. (actually tempfile.gettempdir() is used instead of
+/tmp).
+
+-u is used to specify which special resource intensive tests to run,
+such as those requiring large file support or network connectivity.
+The argument is a comma-separated list of words indicating the
+resources to test. Currently only the following are defined:
+
+ all - Enable all special resources.
curses - Tests that use curses and will modify the terminal's
state and output modes.
- largefile - It is okay to run some test that may create huge files. These
- tests can take a long time and may consume >2GB of disk space
- temporarily.
-
- network - It is okay to run tests that use external network resource,
- e.g. testing SSL support for sockets.
+ largefile - It is okay to run some test that may create huge
+ files. These tests can take a long time and may
+ consume >2GB of disk space temporarily.
+
+ network - It is okay to run tests that use external network
+ resource, e.g. testing SSL support for sockets.
+
+To enable all resources except one, use '-uall,-<resource>'. For
+example, to run all the tests except for the network tests, give the
+option '-uall,-network'.
"""
import sys
@@ -56,6 +63,9 @@
import test_support
+RESOURCE_NAMES = ['curses', 'largefile', 'network']
+
+
def usage(code, msg=''):
print __doc__
if msg: print msg
@@ -81,10 +91,10 @@
command-line will be used. If that's empty, too, then all *.py
files beginning with test_ will be used.
- The other default arguments (verbose, quiet, generate, exclude, single,
- randomize, findleaks, and use_resources) allow programmers calling main()
- directly to set the values that would normally be set by flags on the
- command line.
+ The other default arguments (verbose, quiet, generate, exclude,
+ single, randomize, findleaks, and use_resources) allow programmers
+ calling main() directly to set the values that would normally be
+ set by flags on the command line.
"""
@@ -121,9 +131,20 @@
elif o in ('-u', '--use'):
u = [x.lower() for x in a.split(',')]
for r in u:
- if r not in ('curses', 'largefile', 'network'):
- usage(1, 'Invalid -u/--use option: %s' % a)
- use_resources.extend(u)
+ if r == 'all':
+ use_resources[:] = RESOURCE_NAMES
+ continue
+ remove = False
+ if r[0] == '-':
+ remove = True
+ r = r[1:]
+ if r not in RESOURCE_NAMES:
+ usage(1, 'Invalid -u/--use option: ' + a)
+ if remove:
+ if r in use_resources:
+ use_resources.remove(r)
+ elif r not in use_resources:
+ use_resources.append(r)
if generate and verbose:
usage(2, "-g and -v don't go together!")
@@ -315,7 +336,7 @@
sys.stdout = save_stdout
except (ImportError, test_support.TestSkipped), msg:
if not quiet:
- print "test", test, "skipped --", msg
+ print test, "skipped --", msg
sys.stdout.flush()
return -1
except KeyboardInterrupt:
@@ -525,7 +546,7 @@
test_winreg
test_winsound
""",
- 'mac':
+ 'mac':
"""
test_al
test_bsddb
@@ -715,6 +736,75 @@
test_winreg
test_winsound
""",
+ 'sunos5':
+ """
+ test_al
+ test_bsddb
+ test_cd
+ test_cl
+ test_curses
+ test_dbm
+ test_email_codecs
+ test_gdbm
+ test_gl
+ test_gzip
+ test_imgfile
+ test_linuxaudiodev
+ test_mpz
+ test_openpty
+ test_socketserver
+ test_zipfile
+ test_zlib
+ """,
+ 'hp-ux11':
+ """
+ test_al
+ test_bsddb
+ test_cd
+ test_cl
+ test_curses
+ test_dl
+ test_gdbm
+ test_gl
+ test_gzip
+ test_imgfile
+ test_largefile
+ test_linuxaudiodev
+ test_locale
+ test_minidom
+ test_nis
+ test_ntpath
+ test_openpty
+ test_pyexpat
+ test_sax
+ test_socketserver
+ test_sunaudiodev
+ test_zipfile
+ test_zlib
+ """,
+ 'freebsd4':
+ """
+ test_al
+ test_cd
+ test_cl
+ test_curses
+ test_email_codecs
+ test_gdbm
+ test_gl
+ test_imgfile
+ test_linuxaudiodev
+ test_locale
+ test_minidom
+ test_nis
+ test_pyexpat
+ test_sax
+ test_socket_ssl
+ test_socketserver
+ test_sunaudiodev
+ test_unicode_file
+ test_winreg
+ test_winsound
+ """,
}
class _ExpectedSkips:
Index: Lib/test/test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.113.4.33
retrieving revision 1.113.4.35
diff -u -r1.113.4.33 -r1.113.4.35
--- Lib/test/test_descr.py 29 May 2003 15:14:52 -0000 1.113.4.33
+++ Lib/test/test_descr.py 13 Jul 2003 13:54:34 -0000 1.113.4.35
@@ -1116,6 +1116,22 @@
g==g
new_objects = len(gc.get_objects())
vereq(orig_objects, new_objects)
+ class H(object):
+ __slots__ = ['a', 'b']
+ def __init__(self):
+ self.a = 1
+ self.b = 2
+ def __del__(self):
+ assert self.a == 1
+ assert self.b == 2
+
+ save_stderr = sys.stderr
+ sys.stderr = sys.stdout
+ h = H()
+ try:
+ del h
+ finally:
+ sys.stderr = save_stderr
def dynamics():
if verbose: print "Testing class attribute propagation..."
@@ -1271,6 +1287,14 @@
vereq(super(D,D).goo(), (D,))
vereq(super(D,d).goo(), (D,))
+ # Verify that argument is checked for callability (SF bug 753451)
+ try:
+ classmethod(1).__get__(1)
+ except TypeError:
+ pass
+ else:
+ raise TestFailed, "classmethod should check for callability"
+
def staticmethods():
if verbose: print "Testing static methods..."
class C(object):
Index: Lib/test/test_extcall.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_extcall.py,v
retrieving revision 1.17
retrieving revision 1.17.14.1
diff -u -r1.17 -r1.17.14.1
--- Lib/test/test_extcall.py 24 Aug 2001 19:11:57 -0000 1.17
+++ Lib/test/test_extcall.py 21 Feb 2004 20:58:03 -0000 1.17.14.1
@@ -75,6 +75,31 @@
raise IndexError, i
g(*Nothing())
+class Nothing:
+ def __init__(self):
+ self.c = 0
+ def __iter__(self):
+ return self
+try:
+ g(*Nothing())
+except TypeError, attr:
+ pass
+else:
+ print "should raise TypeError"
+
+class Nothing:
+ def __init__(self):
+ self.c = 0
+ def __iter__(self):
+ return self
+ def next(self):
+ if self.c == 4:
+ raise StopIteration
+ c = self.c
+ self.c += 1
+ return c
+g(*Nothing())
+
# make sure the function call doesn't stomp on the dictionary?
d = {'a': 1, 'b': 2, 'c': 3}
d2 = d.copy()
Index: Lib/test/test_socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v
retrieving revision 1.23
retrieving revision 1.23.6.1
diff -u -r1.23 -r1.23.6.1
--- Lib/test/test_socket.py 9 Dec 2001 08:57:46 -0000 1.23
+++ Lib/test/test_socket.py 21 Jun 2003 15:59:01 -0000 1.23.6.1
@@ -84,11 +84,20 @@
print 'FQDN not found'
if hasattr(socket, 'getservbyname'):
- print socket.getservbyname('telnet', 'tcp')
+ # try a few protocols - not everyone has telnet enabled
+ class Found(Exception): pass
try:
- socket.getservbyname('telnet', 'udp')
- except socket.error:
+ for proto in ("telnet", "ssh", "www", "ftp"):
+ for how in ("tcp", "udp"):
+ try:
+ socket.getservbyname(proto, how)
+ raise Found
+ except socket.error:
+ pass
+ except Found:
pass
+ else:
+ print "socket.error", "socket.getservbyname failed"
import sys
if not sys.platform.startswith('java'):
Index: Lib/test/output/test_extcall
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_extcall,v
retrieving revision 1.12
retrieving revision 1.12.14.1
diff -u -r1.12 -r1.12.14.1
--- Lib/test/output/test_extcall 24 Aug 2001 19:46:21 -0000 1.12
+++ Lib/test/output/test_extcall 21 Feb 2004 20:58:04 -0000 1.12.14.1
@@ -17,6 +17,7 @@
1 (2, 3) {}
1 (2, 3, 4, 5) {}
0 (1, 2) {}
+0 (1, 2, 3) {}
1 () {'a': 1, 'b': 2, 'c': 3, 'd': 4}
{'a': 1, 'b': 2, 'c': 3}
{'a': 1, 'b': 2, 'c': 3}
Index: Lib/test/output/test_socket
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/output/Attic/test_socket,v
retrieving revision 1.2
retrieving revision 1.2.30.1
diff -u -r1.2 -r1.2.30.1
--- Lib/test/output/test_socket 9 May 1997 01:54:45 -0000 1.2
+++ Lib/test/output/test_socket 21 Jun 2003 15:59:13 -0000 1.2.30.1
@@ -1,3 +1,2 @@
test_socket
socket.error
-23
Index: Misc/NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.337.2.4.2.87
retrieving revision 1.337.2.4.2.95
diff -u -r1.337.2.4.2.87 -r1.337.2.4.2.95
--- Misc/NEWS 30 May 2003 20:57:36 -0000 1.337.2.4.2.87
+++ Misc/NEWS 3 Feb 2005 14:58:41 -0000 1.337.2.4.2.95
@@ -1,3 +1,30 @@
+What's New in Python 2.2.4?
+Release date: XX-XXX-XXXX
+===========================
+
+- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
+ disables recursive traversal through instance attributes, which can
+ be exploited in various ways.
+
+- 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 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.
+
+- SF #746304: Builtin functions are now copy.[deep]copyable.
+ Classes are now also deepcopyable.
+
+- SF #753592: webchecker/wsgui now handles user supplied directories.
+
+- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
+ when there are no lines.
+
+- SF bug 753451: classmethod checks that it's argument is callable.
+
What's New in Python 2.2.3 (final) ?
Release date: 30-May-2003
====================================
Index: Misc/RPM/python-2.2.spec
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/RPM/Attic/python-2.2.spec,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.6
diff -u -r1.1.2.4 -r1.1.2.6
--- Misc/RPM/python-2.2.spec 27 May 2003 14:36:02 -0000 1.1.2.4
+++ Misc/RPM/python-2.2.spec 5 Aug 2003 06:30:45 -0000 1.1.2.6
@@ -26,7 +26,7 @@
%define name python
%define version 2.2.3
-%define release 1
+%define release 2
%define __prefix /usr
%define libvers %(echo "%{version}" | awk -F. '{ printf "%s.%s", $1, $2 }')
@@ -121,6 +121,11 @@
%endif
%changelog
+* Wed Jul 16 2003 Sean Reifschneider <jafo-rpms@tummy.com>
+[Release 2.2.3-2]
+- Removing .cvsignore files in the build, so that they don't cause problems
+ with the packaged file list. Reported by David Hutchinson.
+
* Sun Oct 06 2002 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2.2b1-1]
- Updated for the 2.2.2b1 release.
@@ -201,6 +206,9 @@
./configure %{ipv6} %{pymalloc} --prefix=%{__prefix}
make
+# remove .cvsignore files
+find . -name .cvsignore | xargs rm -f
+
# fix paths
for file in \
Tools/scripts/pathfix.py \
@@ -315,6 +323,8 @@
%{__prefix}/lib/python%{libvers}/xml
%{__prefix}/lib/python%{libvers}/email
%{__prefix}/lib/python%{libvers}/compiler
+%{__prefix}/lib/python%{libvers}/lib-old
+%{__prefix}/lib/python%{libvers}/hotshot
%files devel
%defattr(-,root,root)
Index: Modules/_sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.77.6.1
retrieving revision 2.77.6.2
diff -u -r2.77.6.1 -r2.77.6.2
--- Modules/_sre.c 31 Jul 2002 11:19:49 -0000 2.77.6.1
+++ Modules/_sre.c 14 Jun 2003 15:03:06 -0000 2.77.6.2
@@ -88,9 +88,23 @@
/* FIXME: maybe the limit should be 40000 / sizeof(void*) ? */
#define USE_RECURSION_LIMIT 7500
#else
+#if defined(__GNUC__) && defined(WITH_THREAD) && defined(__FreeBSD__)
+/* the pthreads library on FreeBSD has a fixed 1MB stack size for the
+ * initial (or "primary") thread, which is insufficient for the default
+ * recursion limit. gcc 3.x at the default optimisation
+ * level (-O3) uses stack space more aggressively than gcc 2.95.
+ */
+#if (__GNUC__ > 2)
+#define USE_RECURSION_LIMIT 6500
+#else
+#define USE_RECURSION_LIMIT 7500
+#endif
+
+#else
#define USE_RECURSION_LIMIT 10000
#endif
#endif
+#endif
/* enables fast searching */
#define USE_FAST_SEARCH
Index: Modules/cPickle.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v
retrieving revision 2.73.2.1.2.6
retrieving revision 2.73.2.1.2.7
diff -u -r2.73.2.1.2.6 -r2.73.2.1.2.7
--- Modules/cPickle.c 21 May 2003 20:43:09 -0000 2.73.2.1.2.6
+++ Modules/cPickle.c 11 Jul 2003 20:37:13 -0000 2.73.2.1.2.7
@@ -4308,6 +4308,7 @@
Py_XDECREF(self->pers_func);
Py_XDECREF(self->arg);
Py_XDECREF(self->last_string);
+ Py_XDECREF(self->find_class);
Py_XDECREF(self->safe_constructors);
if (self->marks) {
@@ -4340,6 +4341,8 @@
VISIT(self->pers_func);
VISIT(self->arg);
VISIT(self->last_string);
+ VISIT(self->find_class);
+ VISIT(self->safe_constructors);
#undef VISIT
return 0;
}
@@ -4356,6 +4359,8 @@
CLEAR(self->pers_func);
CLEAR(self->arg);
CLEAR(self->last_string);
+ CLEAR(self->find_class);
+ CLEAR(self->safe_constructors);
#undef CLEAR
return 0;
}
Index: Modules/mmapmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v
retrieving revision 2.35.6.5
retrieving revision 2.35.6.6
diff -u -r2.35.6.5 -r2.35.6.6
--- Modules/mmapmodule.c 7 Feb 2003 19:46:44 -0000 2.35.6.5
+++ Modules/mmapmodule.c 15 Jul 2003 13:00:45 -0000 2.35.6.6
@@ -1,7 +1,7 @@
/*
/ Author: Sam Rushing <rushing@nightmare.com>
/ Hacked for Unix by AMK
- / $Id: mmapmodule.c,v 2.35.6.5 2003/02/07 19:46:44 nnorwitz Exp $
+ / $Id: mmapmodule.c,v 2.35.6.6 2003/07/15 13:00:45 akuchling Exp $
/ mmapmodule.cpp -- map a view of a file into memory
/
@@ -897,7 +897,8 @@
}
#ifdef HAVE_FSTAT
- if (fstat(fd, &st) == 0 && (size_t)map_size > st.st_size) {
+ if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode) &&
+ (size_t)map_size > st.st_size) {
PyErr_SetString(PyExc_ValueError,
"mmap length is greater than file size");
return NULL;
Index: Modules/posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.216.4.10
retrieving revision 2.216.4.11
diff -u -r2.216.4.10 -r2.216.4.11
--- Modules/posixmodule.c 23 Apr 2003 20:14:12 -0000 2.216.4.10
+++ Modules/posixmodule.c 11 Jun 2003 00:20:02 -0000 2.216.4.11
@@ -3416,7 +3416,7 @@
#ifdef HAVE_SYMLINK
static char posix_symlink__doc__[] =
"symlink(src, dst) -> None\n\
-Create a symbolic link.";
+Create a symbolic link pointing to src named dst.";
static PyObject *
posix_symlink(PyObject *self, PyObject *args)
Index: Objects/funcobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v
retrieving revision 2.50.4.3
retrieving revision 2.50.4.4
diff -u -r2.50.4.3 -r2.50.4.4
--- Objects/funcobject.c 22 May 2003 18:11:20 -0000 2.50.4.3
+++ Objects/funcobject.c 13 Jul 2003 13:54:34 -0000 2.50.4.4
@@ -611,6 +611,12 @@
if (!PyArg_ParseTuple(args, "O:callable", &callable))
return -1;
+ if (!PyCallable_Check(callable)) {
+ PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
+ callable->ob_type->tp_name);
+ return -1;
+ }
+
Py_INCREF(callable);
cm->cm_callable = callable;
return 0;
Index: Objects/typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.38
retrieving revision 2.126.4.39
diff -u -r2.126.4.38 -r2.126.4.39
--- Objects/typeobject.c 29 May 2003 15:13:18 -0000 2.126.4.38
+++ Objects/typeobject.c 16 Jun 2003 23:38:00 -0000 2.126.4.39
@@ -431,24 +431,33 @@
/* This function exists so we can DECREF self->ob_type */
- /* Find the nearest base with a different tp_dealloc
- and clear slots while we're at it */
+ /* Find the nearest base with a different tp_dealloc */
type = self->ob_type;
base = type;
while ((basedealloc = base->tp_dealloc) == subtype_dealloc) {
- if (base->ob_size)
- clear_slots(base, self);
base = base->tp_base;
assert(base);
}
- /* If we added weaklist, we clear it */
+ /* If we added a weaklist, we clear it. Do this *before* calling
+ the finalizer (__del__), clearing slots, or clearing the instance
+ dict. */
+
if (type->tp_weaklistoffset && !base->tp_weaklistoffset)
PyObject_ClearWeakRefs(self);
if (call_finalizer(self) < 0)
return;
+ /* Clear slots up to the nearest base with a different tp_dealloc */
+ base = type;
+ while ((basedealloc = base->tp_dealloc) == subtype_dealloc) {
+ if (base->ob_size)
+ clear_slots(base, self);
+ base = base->tp_base;
+ assert(base);
+ }
+
/* If we added a dict, DECREF it */
if (type->tp_dictoffset && !base->tp_dictoffset) {
PyObject **dictptr = _PyObject_GetDictPtr(self);
Index: Objects/unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.124.6.21
retrieving revision 2.124.6.22
diff -u -r2.124.6.21 -r2.124.6.22
--- Objects/unicodeobject.c 11 Apr 2003 18:21:22 -0000 2.124.6.21
+++ Objects/unicodeobject.c 17 Sep 2003 03:32:41 -0000 2.124.6.22
@@ -132,7 +132,12 @@
instead ! */
if (unicode == unicode_empty ||
(unicode->length == 1 &&
- unicode->str[0] < 256 &&
+ /* MvL said unicode->str[] may be signed. Python generally assumes
+ * an int contains at least 32 bits, and we don't use more than
+ * 32 bits even in a UCS4 build, so casting to unsigned int should
+ * be correct.
+ */
+ (unsigned int)unicode->str[0] < 256U &&
unicode_latin1[unicode->str[0]] == unicode)) {
PyErr_SetString(PyExc_SystemError,
"can't resize shared unicode objects");
@@ -211,6 +216,14 @@
PyErr_NoMemory();
goto onError;
}
+ /* Initialize the first element to guard against cases where
+ * the caller fails before initializing str -- unicode_resize()
+ * reads str[0], and the Keep-Alive optimization can keep memory
+ * allocated for str alive across a call to unicode_dealloc(unicode).
+ * We don't want unicode_resize to read uninitialized memory in
+ * that case.
+ */
+ unicode->str[0] = 0;
unicode->str[length] = 0;
unicode->length = length;
unicode->hash = -1;
Index: Python/ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.301.4.8
retrieving revision 2.301.4.9
diff -u -r2.301.4.8 -r2.301.4.9
--- Python/ceval.c 7 Oct 2002 09:47:20 -0000 2.301.4.8
+++ Python/ceval.c 29 Jun 2003 14:57:10 -0000 2.301.4.9
@@ -1365,6 +1365,11 @@
err = -1;
}
}
+ /* PyFile_SoftSpace() can exececute arbitrary code
+ if sys.stdout is an instance with a __getattr__.
+ If __getattr__ raises an exception, w will
+ be freed, so we need to prevent that temporarily. */
+ Py_XINCREF(w);
if (w != NULL && PyFile_SoftSpace(w, 1))
err = PyFile_WriteString(" ", w);
if (err == 0)
@@ -1390,6 +1395,7 @@
}
#endif
}
+ Py_XDECREF(w);
Py_DECREF(v);
Py_XDECREF(stream);
stream = NULL;
Index: Python/compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.234.4.8
retrieving revision 2.234.4.9
diff -u -r2.234.4.8 -r2.234.4.9
--- Python/compile.c 22 May 2003 16:43:03 -0000 2.234.4.8
+++ Python/compile.c 22 Sep 2003 04:42:17 -0000 2.234.4.9
@@ -4549,6 +4549,16 @@
}
static int
+symtable_error(struct symtable *st, int lineno)
+{
+ if (lineno == 0)
+ lineno = st->st_cur->ste_lineno;
+ PyErr_SyntaxLocation(st->st_filename, lineno);
+ st->st_errors++;
+ return -1;
+}
+
+static int
symtable_load_symbols(struct compiling *c)
{
static PyObject *implicit = NULL;
@@ -4612,9 +4622,7 @@
if (flags & DEF_PARAM) {
PyErr_Format(PyExc_SyntaxError, LOCAL_GLOBAL,
PyString_AS_STRING(name));
- PyErr_SyntaxLocation(st->st_filename,
- ste->ste_lineno);
- st->st_errors++;
+ symtable_error(st, 0);
goto fail;
}
if (PyDict_SetItem(c->c_globals, name, Py_None) < 0)
@@ -4959,9 +4967,7 @@
if ((flag & DEF_PARAM) && (val & DEF_PARAM)) {
PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT,
PyString_AsString(name));
- PyErr_SyntaxLocation(st->st_filename,
- st->st_cur->ste_lineno);
- return -1;
+ return symtable_error(st, 0);
}
val |= flag;
} else
@@ -5358,9 +5364,7 @@
PyErr_Format(PyExc_SyntaxError,
"name '%.400s' is local and global",
name);
- PyErr_SyntaxLocation(st->st_filename,
- st->st_cur->ste_lineno);
- st->st_errors++;
+ symtable_error(st, 0);
return;
}
else {
@@ -5420,9 +5424,7 @@
if (n->n_lineno >= st->st_future->ff_last_lineno) {
PyErr_SetString(PyExc_SyntaxError,
LATE_FUTURE);
- PyErr_SyntaxLocation(st->st_filename,
- n->n_lineno);
- st->st_errors++;
+ symtable_error(st, n->n_lineno);
return;
}
}
@@ -5515,9 +5517,8 @@
if (strcmp(STR(tmp), "__debug__") == 0) {
PyErr_SetString(PyExc_SyntaxError,
ASSIGN_DEBUG);
- PyErr_SyntaxLocation(st->st_filename,
- n->n_lineno);
- st->st_errors++;
+ symtable_error(st, n->n_lineno);
+ return;
}
symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag);
}
Index: Tools/idle/CallTips.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/Attic/CallTips.py,v
retrieving revision 1.9.12.1
retrieving revision 1.9.12.2
diff -u -r1.9.12.1 -r1.9.12.2
--- Tools/idle/CallTips.py 23 Sep 2002 14:23:15 -0000 1.9.12.1
+++ Tools/idle/CallTips.py 23 Jul 2003 16:25:43 -0000 1.9.12.2
@@ -148,8 +148,7 @@
# See if we can use the docstring
doc = getattr(ob, "__doc__", "")
if doc:
- while doc[:1] in " \t\n":
- doc = doc[1:]
+ doc = doc.lstrip()
pos = doc.find("\n")
if pos < 0 or pos > 70:
pos = 70
Index: Tools/webchecker/wsgui.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/webchecker/wsgui.py,v
retrieving revision 1.5
retrieving revision 1.5.18.1
diff -u -r1.5 -r1.5.18.1
--- Tools/webchecker/wsgui.py 11 May 2001 19:40:10 -0000 1.5
+++ Tools/webchecker/wsgui.py 1 Jul 2003 04:17:25 -0000 1.5.18.1
@@ -162,7 +162,7 @@
else:
self.sucker.savedir = dir
self.sucker.rootdir = os.path.dirname(
- websucker.Sucker.savefilename(self, url))
+ websucker.Sucker.savefilename(self.sucker, url))
self.go_button.configure(state=DISABLED)
self.auto_button.configure(state=DISABLED)
self.cancel_button.configure(state=NORMAL)
|