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
|
What's new in this release?
===========================
Below is a list of all relevant changes since release 1.5.1. Older
changes are in the file HISTORY. The most recent changes are listed
first.
A note on attributions: while I have sprinkled some names throughout
here, I'm grateful to many more people who remain unnamed. You may
find your name in the ACKS file. If you believe you deserve more
credit, let me know and I'll add you to the list!
======================================================================
From 1.5.2b1 to 1.5.2b2
=======================
General
-------
- Many memory leaks fixed.
- Many small bugs fixed.
- Command line option -OO (or -O -O) suppresses inclusion of doc
strings in resulting bytecode.
Windows-specific changes
------------------------
- New built-in module winsound provides an interface to the Win32
PlaySound() call.
- Re-enable the audioop module in the config.c file.
- On Windows, support spawnv() and associated P_* symbols.
- Fixed the conversion of times() return values on Windows.
- Removed freeze from the installer -- it doesn't work without the
source tree. (See FAQ 8.11.)
- On Windows 95/98, the Tkinter module now is smart enough to find
Tcl/Tk even when the PATH environment variable hasn't been set -- when
the import of _tkinter fails, it searches in a standard locations,
patches os.environ["PATH"], and tries again. When it still fails, a
clearer error message is produced. This should avoid most
installation problems with Tkinter use (e.g. in IDLE).
- The -i option doesn't make any calls to set[v]buf() for stdin --
this apparently screwed up _kbhit() and the _tkinter main loop.
- The ntpath module (and hence, os.path on Windows) now parses out UNC
paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
splitdrive() will \\host\mountpoint as the drive and \dir\file as the
path. ** EXPERIMENTAL **
- Added a hack to the exit code so that if (1) the exit status is
nonzero and (2) we think we have our own DOS box (i.e. we're not
started from a command line shell), we print a message and wait for
the user to hit a key before the DOS box is closed.
- Updated the installer to WISE 5.0g. Added a dialog warning about
the imminent Tcl installation. Added a dialog to specify the program
group name in the start menu. Upgraded the Tcl installer to Tcl
8.0.4.
Changes to intrinsics
---------------------
- The repr() or str() of a module object now shows the __file__
attribute (i.e., the file which it was loaded), or the string
"(built-in)" if there is no __file__ attribute.
- The range() function now avoids overflow during its calculations (if
at all possible).
- New info string sys.hexversion, which is an integer encoding the
version in hexadecimal. In other words, hex(sys.hexversion) ==
0x010502b2 for Python 1.5.2b2.
New or improved ports
---------------------
- Support for Nextstep descendants (future Mac systems).
- Improved BeOS support.
- Support dynamic loading of shared libraries on NetBSD platforms that
use ELF (i.e., MIPS and Alpha systems).
Configuration/build changes
---------------------------
- The Lib/test directory is no longer included in the default module
search path (sys.path) -- "test" has been a package ever since 1.5.
- Now using autoconf 2.13.
New library modules
-------------------
- New library modules asyncore and asynchat: these form Sam Rushing's
famous asynchronous socket library. Sam has gracefully allowed me to
incorporate these in the standard Python library.
- New module statvfs contains indexing constants for [f]statvfs()
return tuple.
Changes to the library
----------------------
- The wave module (platform-independent support for Windows sound
files) has been fixed to actually make it work.
- The sunau module (platform-independent support for Sun/NeXT sound
files) has been fixed to work across platforms. Also, a weird
encoding bug in the header of the audio test data file has been
corrected.
- Fix a bug in the urllib module that occasionally tripped up
webchecker and other ftp retrieves.
- ConfigParser's get() method now accepts an optional keyword argument
(vars) that is substituted on top of the defaults that were setup in
__init__. You can now also have recusive references in your
configuration file.
- Some improvements to the Queue module, including a put_nowait()
module and an optional "block" second argument, to get() and put(),
defaulting to 1.
- The updated xmllib module is once again compatible with the version
present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
- The bdb module (base class for the debugger) now supports
canonicalizing pathnames used in breakpoints. The derived class must
override the new canonical() method for this to work. Also changed
clear_break() to the backwards compatible old signature, and added
clear_bpbynumber() for the new functionality.
- In sgmllib (and hence htmllib), recognize attributes even if they
don't have space in front of them. I.e. '<a
name="foo"href="bar.html">' will now have two attributes recognized.
- In the debugger (pdb), change clear syntax to support three
alternatives: clear; clear file:line; clear bpno bpno ...
- The os.path module now pretends to be a submodule within the os
"package", so you can do things like "from os.path import exists".
- The standard exceptions now have doc strings.
- In the smtplib module, exceptions are now classes. Also avoid
inserting a non-standard space after "TO" in rcpt() command.
- The rfc822 module's getaddrlist() method now uses all occurrences of
the specified header instead of just the first. Some other bugfixes
too (to handle more weird addresses found in a very large test set,
and to avoid crashes on certain invalid dates), and a small test
module has been added.
- Fixed bug in urlparse in the common-case code for HTTP URLs; it
would lose the query, fragment, and/or parameter information.
- The sndhdr module no longer supports whatraw() -- it depended on a
rare extenral program.
- The UserList module/class now supports the extend() method, like
real list objects.
- The uu module now deals better with trailing garbage generated by
some broke uuencoders.
- The telnet module now has an my_interact() method which uses threads
instead of select. The interact() method uses this by default on
Windows (where the single-threaded version doesn't work).
- Add a class to mailbox.py for dealing with qmail directory
mailboxes. The test code was extended to notice these being used as
well.
Changes to extension modules
----------------------------
- Support for the [f]statvfs() system call, where it exists.
- Fixed some bugs in cPickle where bad input could cause it to dump
core.
- Fixed cStringIO to make the writelines() function actually work.
- Added strop.expandtabs() so string.expandtabs() is now much faster.
- Added fsync() and fdatasync(), if they appear to exist.
- Support for "long files" (64-bit seek pointers).
- Fixed a bug in the zlib module's flush() function.
- Added access() system call. It returns 1 if access granted, 0 if
not.
- The curses module implements an optional nlines argument to
w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
Changes to tools
----------------
- Some changes to IDLE; see Tools/idle/NEWS.txt.
- Latest version of Misc/python-mode.el included.
Changes to Tkinter
------------------
- Avoid tracebacks when an image is deleted after its root has been
destroyed.
Changes to the Python/C API
---------------------------
- When parentheses are used in a PyArg_Parse[Tuple]() call, any
sequence is now accepted, instead of requiring a tuple. This is in
line with the general trend towards accepting arbitrary sequences.
- Added PyModule_GetFilename().
- In PyNumber_Power(), remove unneeded and even harmful test for float
to the negative power (which is already and better done in
floatobject.c).
- New version identification symbols; read patchlevel.h for info. The
version numbers are now exported by Python.h.
- Rolled back the API version change -- it's back to 1007!
- The frozenmain.c function calls PyInitFrozenExtensions().
- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
INCREF.
======================================================================
From 1.5.2a2 to 1.5.2b1
=======================
Changes to intrinsics
---------------------
- New extension NotImplementedError, derived from RuntimeError. Not
used, but recommended use is for "abstract" methods to raise this.
- The parser will now spit out a warning or error when -t or -tt is
used for parser input coming from a string, too.
- The code generator now inserts extra SET_LINENO opcodes when
compiling multi-line argument lists.
- When comparing bound methods, use identity test on the objects, not
equality test.
New or improved ports
---------------------
- Chris Herborth has redone his BeOS port; it now works on PowerPC
(R3/R4) and x86 (R4 only). Threads work too in this port.
Renaming
--------
- Thanks to Chris Herborth, the thread primitives now have proper Py*
names in the source code (they already had those for the linker,
through some smart macros; but the source still had the old, un-Py
names).
Configuration/build changes
---------------------------
- Improved support for FreeBSD/3.
- Check for pthread_detach instead of pthread_create in libc.
- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
Otherwise modules such as thread didn't get incorporated in extensions.
New library modules
-------------------
- shlex.py by Eric Raymond provides a lexical analyzer class for
simple shell-like syntaxes.
- netrc.py by Eric Raymond provides a parser for .netrc files. (The
undocumented Netrc class in ftplib.py is now obsolete.)
- codeop.py is a new module that contains the compile_command()
function that was previously in code.py. This is so that JPython can
provide its own version of this function, while still sharing the
higher-level classes in code.py.
- turtle.py is a new module for simple turtle graphics. I'm still
working on it; let me know if you use this to teach Python to children
or other novices without prior programming experience.
Obsoleted library modules
-------------------------
- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
their status of obsoleteness. They don't do a particularly good job
and don't seem particularly relevant to the Python core.
New tools
---------
- I've added IDLE: my Integrated DeveLopment Environment for Python.
Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
work on Macintosh, but I haven't been able to test it there; it does
depend on new features in 1.5.2 and perhaps even new features in
1.5.2b1, especially the new code module). This is very much a work in
progress. I'd like to hear how people like it compared to PTUI (or
any other IDE they are familiar with).
- New tools by Barry Warsaw:
= audiopy: controls the Solaris Audio device
= pynche: The PYthonically Natural Color and Hue Editor
= world: Print mappings between country names and DNS country codes
New demos
---------
- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
song.
- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
Tkinter. (By Fredrik Lundh -- not by me!)
Changes to the library
----------------------
- compileall.py now avoids recompiling .py files that haven't changed;
it adds a -f option to force recompilation.
- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
patches).
- nntplib.py: statparse() no longer lowercases the message-id.
- types.py: use type(__stdin__) for FileType.
- urllib.py: fix translations for filenames with "funny" characters.
Patch by Sjoerd Mullender. Note that if you subclass one of the
URLopener classes, and you have copied code from the old urllib.py,
your subclass may stop working. A long-term solution is to provide
more methods so that you don't have to copy code.
- cgi.py: In read_multi, allow a subclass to override the class we
instantiate when we create a recursive instance, by setting the class
variable 'FieldStorageClass' to the desired class. By default, this
is set to None, in which case we use self.__class__ (as before).
Also, a patch by Jim Fulton to pass additional arguments to recursive
calls to the FieldStorage constructor from its read_multi method.
- UserList.py: In __getslice__, use self.__class__ instead of
UserList.
- In SimpleHTTPServer.py, the server specified in test() should be
BaseHTTPServer.HTTPServer, in case the request handler should want to
reference the two attributes added by BaseHTTPServer.server_bind. (By
Jeff Rush, for Bobo). Also open the file in binary mode, so serving
images from a Windows box might actually work.
- In CGIHTTPServer.py, the list of acceptable formats is -split-
on spaces but -joined- on commas, resulting in double commas
in the joined text. (By Jeff Rush.)
- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
new threaded versions of Unix Server classes, using the ThreadingMixIn
class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
method do_delete(); do_clear() was meant. By Greg Ward.
- getopt.py: accept a non-list sequence for the long options (request
by Jack Jansen). Because it might be a common mistake to pass a
single string, this situation is treated separately. Also added
docstrings (copied from the library manual) and removed the (now
redundant) module comments.
- tempfile.py: improvements to avoid security leaks.
- code.py: moved compile_command() to new module codeop.py.
- pickle.py: support pickle format 1.3 (binary float added). By Jim
Fulton. Also get rid of the undocumented obsolete Pickler dump_special
method.
- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
- imaplib.py: fix problem with some versions of IMAP4 servers that
choose to mix the case in their CAPABILITIES response.
- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
by Fredrik Lundh.
Changes to extension modules
----------------------------
- More doc strings for several modules were contributed by Chris
Petrilli: math, cmath, fcntl.
- Fixed a bug in zlibmodule.c that could cause core dumps on
decompression of rarely occurring input.
- cPickle.c: new version from Jim Fulton, with Open Source copyright
notice. Also, initialize self->safe_constructors early on to prevent
crash in early dealloc.
- cStringIO.c: new version from Jim Fulton, with Open Source copyright
notice. Also fixed a core dump in cStringIO.c when doing seeks.
- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
modifies its argument string (bad function!), so we make a temporary
copy.
- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
control pseudo-device, per audio(7I).
Changes to tools
----------------
- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
support for Emacs).
- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
only the names of offending files to be printed.
- freeze: when printing missing modules, also print the module they
were imported from.
- untabify.py: patch by Detlef Lannert to implement -t option
(set tab size).
Changes to Tkinter
------------------
- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
row2?
- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
doesn't work when running in a non-threaded environment. He added
some #ifdefs that fix this.
Changes to the Python/C API
---------------------------
- Bumped API version number to 1008 -- enough things have changed!
- There's a new macro, PyThreadState_GET(), which does the same work
as PyThreadState_Get() without the overhead of a function call (it
also avoids the error check). The two top calling locations of
PyThreadState_Get() have been changed to use this macro.
- All symbols intended for export from a DLL or shared library are now
marked as such (with the DL_IMPORT() macro) in the header file that
declares them. This was needed for the BeOS port, and should also
make some other ports easier. The PC port no longer needs the file
with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
macro which is only used for init methods in extension modules, and
for Py_Main().
Invisible changes to internals
------------------------------
- Fixed a bug in new_buffersize() in fileobject.c which could
return a buffer size that was way too large.
- Use PySys_WriteStderr instead of fprintf in most places.
- dictobject.c: remove dead code discovered by Vladimir Marangozov.
- tupleobject.c: make tuples less hungry -- an extra item was
allocated but never used. Tip by Vladimir Marangozov.
- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
Jansen)
- import.c: Jim Fulton fixes a reference count bug in
PyEval_GetGlobals.
- glmodule.c: check in the changed version after running the stubber
again -- this solves the conflict with curses over the 'clear' entry
point much nicer. (Jack Jansen had checked in the changes to cstubs
eons ago, but I never regenrated glmodule.c :-( )
- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
Marangozov.
- stropmodule.c: add a missing DECREF in an error exit. Submitted by
Jonathan Giddy.
======================================================================
From 1.5.2a1 to 1.5.2a2
=======================
General
-------
- It is now a syntax error to have a function argument without a
default following one with a default.
- __file__ is now set to the .py file if it was parsed (it used to
always be the .pyc/.pyo file).
- Don't exit with a fatal error during initialization when there's a
problem with the exceptions.py module.
- New environment variable PYTHONOPTIMIZE can be used to set -O.
- New version of python-mode.el for Emacs.
Miscellaneous fixed bugs
------------------------
- No longer print the (confusing) error message about stack underflow
while compiling.
- Some threading and locking bugs fixed.
- When errno is zero, report "Error", not "Success".
Documentation
-------------
- Documentation will be released separately.
- Doc strings added to array and md5 modules by Chris Petrilli.
Ports and build procedure
-------------------------
- Stop installing when a move or copy fails.
- New version of the OS/2 port code by Jeff Rush.
- The makesetup script handles absolute filenames better.
- The 'new' module is now enabled by default in the Setup file.
- I *think* I've solved the problem with the Linux build blowing up
sometimes due to a conflict between sigcheck/intrcheck and
signalmodule.
Built-in functions
------------------
- The second argument to apply() can now be any sequence, not just a
tuple.
Built-in types
--------------
- Lists have a new method: L1.extend(L2) is equivalent to the common
idiom L1[len(L1):] = L2.
- Better error messages when a sequence is indexed with a non-integer.
- Bettter error message when calling a non-callable object (include
the type in the message).
Python services
---------------
- New version of cPickle.c fixes some bugs.
- pickle.py: improved instantiation error handling.
- code.py: reworked quite a bit. New base class
InteractiveInterpreter and derived class InteractiveConsole. Fixed
several problems in compile_command().
- py_compile.py: print error message and continue on syntax errors.
Also fixed an old bug with the fstat code (it was never used).
- pyclbr.py: support submodules of packages.
String Services
---------------
- StringIO.py: raise the right exception (ValueError) for attempted
I/O on closed StringIO objects.
- re.py: fixed a bug in subn(), which caused .groups() to fail inside
the replacement function called by sub().
- The struct module has a new format 'P': void * in native mode.
Generic OS Services
-------------------
- Module time: Y2K robustness. 2-digit year acceptance depends on
value of time.accept2dyear, initialized from env var PYTHONY2K,
default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
(POSIX or X/Open recommendation).
- os.path: normpath(".//x") should return "x", not "/x".
- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
doesn't work.
- tempfile.py: regenerate the template after a fork() call.
Optional OS Services
--------------------
- In the signal module, disable restarting interrupted system calls
when we have siginterrupt().
Debugger
--------
- No longer set __args__; this feature is no longer supported and can
affect the debugged code.
- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
added aliases and some other useful new features, e.g. much better
breakpoint support: temporary breakpoint, disabled breakpoints,
breakpoints with ignore counts, and conditions; breakpoints can be set
on a file before it is loaded.
Profiler
--------
- Changes so that JPython can use it. Also fix the calibration code
so it actually works again
.
Internet Protocols and Support
------------------------------
- imaplib.py: new version from Piers Lauder.
- smtplib.py: change sendmail() method to accept a single string or a
list or strings as the destination (commom newbie mistake).
- poplib.py: LIST with a msg argument fixed.
- urlparse.py: some optimizations for common case (http).
- urllib.py: support content-length in info() for ftp protocol;
support for a progress meter through a third argument to
urlretrieve(); commented out gopher test (the test site is dead).
Internet Data handling
----------------------
- sgmllib.py: support tags with - or . in their name.
- mimetypes.py: guess_type() understands 'data' URLs.
Restricted Execution
--------------------
- The classes rexec.RModuleLoader and rexec.RModuleImporter no
longer exist.
Tkinter
-------
- When reporting an exception, store its info in sys.last_*. Also,
write all of it to stderr.
- Added NS, EW, and NSEW constants, for grid's sticky option.
- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
- Make bind variants without a sequence return a tuple of sequences
(formerly it returned a string, which wasn't very convenient).
- Add image commands to the Text widget (these are new in Tk 8.0).
- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
- Improved the thread code (but you still can't call update() from
another thread on Windows).
- Fixed unnecessary references to _default_root in the new dialog
modules.
- Miscellaneous problems fixed.
Windows General
---------------
- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
search for dependent dlls in the directory containing the .pyd.
- In debugging mode, call DebugBreak() in Py_FatalError().
Windows Installer
-----------------
- Install zlib.dll in the DLLs directory instead of in the win32
system directory, to avoid conflicts with other applications that have
their own zlib.dll.
Test Suite
----------
- test_long.py: new test for long integers, by Tim Peters.
- regrtest.py: improved so it can be used for other test suites as
well.
- test_strftime.py: use re to compare test results, to support legal
variants (e.g. on Linux).
Tools and Demos
---------------
- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
remove/add Windows style '\r\n' line endings), untabify.py (to remove
tabs), and rgrep.yp (reverse grep).
- Improvements to Tools/freeze/. Each Python module is now written to
its own C file. This prevents some compilers or assemblers from
blowing up on large frozen programs, and saves recompilation time if
only a few modules are changed. Other changes too, e.g. new command
line options -x and -i.
- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
Python/C API
------------
- New mechanism to support extensions of the type object while
remaining backward compatible with extensions compiled for previous
versions of Python 1.5. A flags field indicates presence of certain
fields.
- Addition to the buffer API to differentiate access to bytes and
8-bit characters (in anticipation of Unicode characters).
- New argument parsing format t# ("text") to indicate 8-bit
characters; s# simply means 8-bit bytes, for backwards compatibility.
- New object type, bufferobject.c is an example and can be used to
create buffers from memory.
- Some support for 64-bit longs, including some MS platforms.
- Many calls to fprintf(stderr, ...) have been replaced with calls to
PySys_WriteStderr(...).
- The calling context for PyOS_Readline() has changed: it must now be
called with the interpreter lock held! It releases the lock around
the call to the function pointed to by PyOS_ReadlineFunctionPointer
(default PyOS_StdioReadline()).
- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
- Renamed header file "thread.h" to "pythread.h".
- The code string of code objects may now be anything that supports the
buffer API.
======================================================================
From 1.5.1 to 1.5.2a1
=====================
General
-------
- When searching for the library, a landmark that is a compiled module
(string.pyc or string.pyo) is also accepted.
- When following symbolic links to the python executable, use a loop
so that a symlink to a symlink can work.
- Added a hack so that when you type 'quit' or 'exit' at the
interpreter, you get a friendly explanation of how to press Ctrl-D (or
Ctrl-Z) to exit.
- New and improved Misc/python-mode.el (Python mode for Emacs).
- Revert a new feature in Unix dynamic loading: for one or two
revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
out to be a bad idea.
Miscellaneous fixed bugs
------------------------
- All patches on the patch page have been integrated. (But much more
has been done!)
- Several memory leaks plugged (e.g. the one for classes with a
__getattr__ method).
- Removed the only use of calloc(). This triggered an obscure bug on
multiprocessor Sparc Solaris 2.6.
- Fix a peculiar bug that would allow "import sys.time" to succeed
(believing the built-in time module to be a part of the sys package).
- Fix a bug in the overflow checking when converting a Python long to
a C long (failed to convert -2147483648L, and some other cases).
Documentation
-------------
- Doc strings have been added to many extension modules: __builtin__,
errno, select, signal, socket, sys, thread, time. Also to methods of
list objects (try [].append.__doc__). A doc string on a type will now
automatically be propagated to an instance if the instance has methods
that are accessed in the usual way.
- The documentation has been expanded and the formatting improved.
(Remember that the documentation is now unbundled and has its own
release cycle though; see http://www.python.org/doc/.)
- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
Ports and build procedure
-------------------------
- The BeOS port is now integrated. Courtesy Chris Herborth.
- Symbol files for FreeBSD 2.x and 3.x have been contributed
(Lib/plat-freebsd[23]/*).
- Support HPUX 10.20 DCE threads.
- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
works, it won't also use -Olimit 1500 (which gives a warning for every
file). Also support the SGI_ABI environment variable better.
- The makesetup script now understands absolute pathnames ending in .o
in the module -- it assumes it's a file for which we have no source.
- Other miscellaneous improvements to the configure script and
Makefiles.
- The test suite now uses a different sound sample.
Built-in functions
------------------
- Better checks for invalid input to int(), long(), string.atoi(),
string.atol(). (Formerly, a sign without digits would be accepted as
a legal ways to spell zero.)
- Changes to map() and filter() to use the length of a sequence only
as a hint -- if an IndexError happens earlier, take that. (Formerly,
this was considered an error.)
- Experimental feature in getattr(): a third argument can specify a
default (instead of raising AttributeError).
- Implement round() slightly different, so that for negative ndigits
no additional errors happen in the last step.
- The open() function now adds the filename to the exception when it
fails.
Built-in exceptions
-------------------
- New standard exceptions EnvironmentError and PosixError.
EnvironmentError is the base class for IOError and PosixError;
PosixError is the same as os.error. All this so that either exception
class can be instantiated with a third argument indicating a filename.
The built-in function open() and most os/posix functions that take a
filename argument now use this.
Built-in types
--------------
- List objects now have an experimental pop() method; l.pop() returns
and removes the last item; l.pop(i) returns and removes the item at
i. Also, the sort() method is faster again. Sorting is now also
safer: it is impossible for the sorting function to modify the list
while the sort is going on (which could cause core dumps).
- Changes to comparisons: numbers are now smaller than any other type.
This is done to prevent the circularity where [] < 0L < 1 < [] is
true. As a side effect, cmp(None, 0) is now positive instead of
negative. This *shouldn't* affect any working code, but I've found
that the change caused several "sleeping" bugs to become active, so
beware!
- Instance methods may now have other callable objects than just
Python functions as their im_func. Use new.instancemethod() or write
your own C code to create them; new.instancemethod() may be called
with None for the instance to create an unbound method.
- Assignment to __name__, __dict__ or __bases__ of a class object is
now allowed (with stringent type checks); also allow assignment to
__getattr__ etc. The cached values for __getattr__ etc. are
recomputed after such assignments (but not for derived classes :-( ).
- Allow assignment to some attributes of function objects: func_code,
func_defaults and func_doc / __doc__. (With type checks except for
__doc__ / func_doc .)
Python services
---------------
- New tests (in Lib/test): reperf.py (regular expression benchmark),
sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
for the MimeWriter module).
- Generalized test/regrtest.py so that it is useful for testing other
packages.
- The ihooks.py module now understands package imports.
- In code.py, add a class that subsumes Fredrik Lundh's
PythonInterpreter class. The interact() function now uses this.
- In rlcompleter.py, in completer(), return None instead of raising an
IndexError when there are no more completions left.
- Fixed the marshal module to test for certain common kinds of invalid
input. (It's still not foolproof!)
- In the operator module, add an alias (now the preferred name)
"contains" for "sequenceincludes".
String Services
---------------
- In the string and strop modules, in the replace() function, treat an
empty pattern as an error (since it's not clear what was meant!).
- Some speedups to re.py, especially the string substitution and split
functions. Also added new function/method findall(), to find all
occurrences of a given substring.
- In cStringIO, add better argument type checking and support the
readonly 'closed' attribute (like regular files).
- In the struct module, unsigned 1-2 byte sized formats no longer
result in long integer values.
Miscellaneous services
----------------------
- In whrandom.py, added new method and function randrange(), same as
choice(range(start, stop, step)) but faster. This addresses the
problem that randint() was accidentally defined as taking an inclusive
range. Also, randint(a, b) is now redefined as randrange(a, b+1),
adding extra range and type checking to its arguments!
- Add some semi-thread-safety to random.gauss() (it used to be able to
crash when invoked from separate threads; now the worst it can do is
give a duplicate result occasionally).
- Some restructuring and generalization done to cmd.py.
- Major upgrade to ConfigParser.py; converted to using 're', added new
exceptions, support underscore in section header and option name. No
longer add 'name' option to every section; instead, add '__name__'.
- In getpass.py, don't use raw_input() to ask for the password -- we
don't want it to show up in the readline history! Also don't catch
interrupts (the try-finally already does all necessary cleanup).
Generic OS Services
-------------------
- New functions in os.py: makedirs(), removedirs(), renames(). New
variable: linesep (the line separator as found in binary files,
i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
this with files opened in (default) text mode; the line separator used
will always be '\n'!
- Changes to the 'os.path' submodule of os.py: added getsize(),
getmtime(), getatime() -- these fetch the most popular items from the
stat return tuple.
- In the time module, add strptime(), if it exists. (This parses a
time according to a format -- the inverse of strftime().) Also,
remove the call to mktime() from strftime() -- it messed up the
formatting of some non-local times.
- In the socket module, added a new function gethostbyname_ex().
Also, don't use #ifdef to test for some symbols that are enums on some
platforms (and should exist everywhere).
Optional OS Services
--------------------
- Some fixes to gzip.py. In particular, the readlines() method now
returns the lines *with* trailing newline characters, like readlines()
of regular file objects. Also, it didn't work together with cPickle;
fixed that.
- In whichdb.py, support byte-swapped dbhash (bsddb) files.
- In anydbm.py, look at the type of an existing database to determine
which module to use to open it. (The anydbm.error exception is now a
tuple.)
Unix Services
-------------
- In the termios module, in tcsetattr(), initialize the structure vy
calling tcgetattr().
- Added some of the "wait status inspection" macros as functions to
the posix module (and thus to the os module): WEXITSTATUS(),
WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
- In the syslog module, make the default facility more intuitive
(matching the docs).
Debugger
--------
- In pdb.py, support for setting breaks on files/modules that haven't
been loaded yet.
Internet Protocols and Support
------------------------------
- Changes in urllib.py; sped up unquote() and quote(). Fixed an
obscure bug in quote_plus(). Added urlencode(dict) -- convenience
function for sending a POST request with urlopen(). Use the getpass
module to ask for a password. Rewrote the (test) main program so that
when used as a script, it can retrieve one or more URLs to stdout.
Use -t to run the self-test. Made the proxy code work again.
- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
fail when someone asks for their HEAD. Also, for POST, set the
default content-type to application/x-www-form-urlencoded. Also, in
FieldStorage.__init__(), when method='GET', always get the query
string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
explicitly passed in fp.
- The smtplib.py module now supports ESMTP and has improved standard
compliance, for picky servers.
- Improved imaplib.py.
- Fixed UDP support in SocketServer.py (it never worked).
- Fixed a small bug in CGIHTTPServer.py.
Internet Data handling
----------------------
- In rfc822.py, add a new class AddressList. Also support a new
overridable method, isheader(). Also add a get() method similar to
dictionaries (and make getheader() an alias for it). Also, be smarter
about seekable (test whether fp.tell() works) and test for presence of
unread() method before trying seeks.
- In sgmllib.py, restore the call to report_unbalanced() that was lost
long ago. Also some other improvements: handle <? processing
instructions >, allow . and - in entity names, and allow \r\n as line
separator.
- Some restructuring and generalization done to multifile.py; support
a 'seekable' flag.
Restricted Execution
--------------------
- Improvements to rexec.py: package support; support a (minimal)
sys.exc_info(). Also made the (test) main program a bit fancier (you
can now use it to run arbitrary Python scripts in restricted mode).
Tkinter
-------
- On Unix, Tkinter can now safely be used from a multi-threaded
application. (Formerly, no threads would make progress while
Tkinter's mainloop() was active, because it didn't release the Python
interpreter lock.) Unfortunately, on Windows, threads other than the
main thread should not call update() or update_idletasks() because
this will deadlock the application.
- An interactive interpreter that uses readline and Tkinter no longer
uses up all available CPU time.
- Even if readline is not used, Tk windows created in an interactive
interpreter now get continuously updated. (This even works in Windows
as long as you don't hit a key.)
- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
- No longer register Tcl_finalize() as a low-level exit handler. It
may call back into Python, and that's a bad idea.
- Allow binding of Tcl commands (given as a string).
- Some minor speedups; replace explicitly coded getint() with int() in
most places.
- In FileDialog.py, remember the directory of the selected file, if
given.
- Change the names of all methods in the Wm class: they are now
wm_title(), etc. The old names (title() etc.) are still defined as
aliases.
- Add a new method of interpreter objects, interpaddr(). This returns
the address of the Tcl interpreter object, as an integer. Not very
useful for the Python programmer, but this can be called by another C
extension that needs to make calls into the Tcl/Tk C API and needs to
get the address of the Tcl interpreter object. A simple cast of the
return value to (Tcl_Interp *) will do the trick.
Windows General
---------------
- Don't insist on proper case for module source files if the filename
is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
doesn't). This should address problems with this feature on
oldfashioned filesystems (Novell servers?).
Windows Library
---------------
- os.environ is now all uppercase, but accesses are case insensitive,
and the putenv() calls made as a side effect of changing os.environ
are case preserving.
- Removed samefile(), sameopenfile(), samestat() from os.path (aka
ntpath.py) -- these cannot be made to work reliably (at least I
wouldn't know how).
- Fixed os.pipe() so that it returns file descriptors acceptable to
os.read() and os.write() (like it does on Unix), rather than Windows
file handles.
- Added a table of WSA error codes to socket.py.
- In the select module, put the (huge) file descriptor arrays on the
heap.
- The getpass module now raises KeyboardInterrupt when it sees ^C.
- In mailbox.py, fix tell/seek when using files opened in text mode.
- In rfc822.py, fix tell/seek when using files opened in text mode.
- In the msvcrt extension module, release the interpreter lock for
calls that may block: _locking(), _getch(), _getche(). Also fix a
bogus error return when open_osfhandle() doesn't have the right
argument list.
Windows Installer
-----------------
- The registry key used is now "1.5" instead of "1.5.x" -- so future
versions of 1.5 and Mark Hammond's win32all installer don't need to be
resynchronized.
Windows Tools
-------------
- Several improvements to freeze specifically for Windows.
Windows Build Procedure
-----------------------
- The VC++ project files and the WISE installer have been moved to the
PCbuild subdirectory, so they are distributed in the same subdirectory
where they must be used. This avoids confusion.
- New project files for Windows 3.1 port by Jim Ahlstrom.
- Got rid of the obsolete subdirectory PC/setup_nt/.
- The projects now use distinct filenames for the .exe, .dll, .lib and
.pyd files built in debug mode (by appending "_d" to the base name,
before the extension). This makes it easier to switch between the two
and get the right versions. There's a pragma in config.h that directs
the linker to include the appropriate .lib file (so python15.lib no
longer needs to be explicit in your project).
- The installer now installs more files (e.g. config.h). The idea is
that you shouldn't need the source distribution if you want build your
own extensions in C or C++.
Tools and Demos
---------------
- New script nm2def.py by Marc-Andre Lemburg, to construct
PC/python_nt.def automatically (some hand editing still required).
- New tool ndiff.py: Tim Peters' text diffing tool.
- Various and sundry improvements to the freeze script.
- The script texi2html.py (which was part of the Doc tree but is no
longer used there) has been moved to the Tools/scripts subdirectory.
- Some generalizations in the webchecker code. There's now a
primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
- The ftpmirror.py script now handles symbolic links properly, and
also files with multiple spaces in their names.
- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
last line is both indented and lacks a newline. This is now fixed.
Python/C API
------------
- Added missing prototypes for PyEval_CallFunction() and
PyEval_CallMethod().
- New macro PyList_SET_ITEM().
- New macros to access object members for PyFunction, PyCFunction
objects.
- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
dynamically add one or many entries to the table of built-in modules.
- New macro Py_InitModule3(name, methods, doc) which calls
Py_InitModule4() with appropriate arguments. (The -4 variant requires
you to pass an obscure version number constant which is always the same.)
- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
sys.stdout or sys.stderr using a printf-like interface. (Used in
_tkinter.c, for example.)
- New APIs for conversion between Python longs and C 'long long' if
your compiler supports it.
- PySequence_In() is now called PySequence_Contains().
(PySequence_In() is still supported for b/w compatibility; it is
declared obsolete because its argument order is confusing.)
- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
*never* raise an exception -- (even if the hash() fails, simply clear
the error). This was necessary because there is lots of code out
there that already assumes this.
- Changes to PySequence_Tuple() and PySequence_List() to use the
length of a sequence only as a hint -- if an IndexError happens
earlier, take that. (Formerly, this was considered an error.)
- Reformatted abstract.c to give it a more familiar "look" and fixed
many error checking bugs.
- Add NULL pointer checks to all calls of a C function through a type
object and extensions (e.g. nb_add).
- The code that initializes sys.path now calls Py_GetPythonHome()
instead of getenv("PYTHONHOME"). This, together with the new API
Py_SetPythonHome(), makes it easier for embedding applications to
change the notion of Python's "home" directory (where the libraries
etc. are sought).
- Fixed a very old bug in the parsing of "O?" format specifiers.
======================================================================
|