-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Expand file tree
/
Copy pathNEWS
More file actions
4259 lines (3176 loc) · 173 KB
/
NEWS
File metadata and controls
4259 lines (3176 loc) · 173 KB
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
+++++++++++
Python News
+++++++++++
(editors: check NEWS.help for information about editing NEWS using ReST.)
What's New in Python 2.4 alpha 1?
=================================
*Release date: DD-MMM-YYYY*
Core and builtins
-----------------
- Implemented a newcode opcode, LIST_APPEND, that simplifies
the generated bytecode for list comprehensions and further
improves their performance (about 35%).
- Implemented rich comparisons for floats, which seems to make
comparisons involving NaNs somewhat less surprising when the
underlying C compiler actually implements C99 semantics.
- Optimized list.extend() to save memory and no longer create
intermediate sequences. Also, extend() now pre-allocates the
needed memory whenever the length of the iterable is known in
advance -- this halves the time to extend the list.
- Optimized list resize operations to make fewer calls to the system
realloc(). Significantly speeds up list appends, list pops,
list comprehensions, and the list contructor (when the input iterable
length is not known).
- Changed the internal list over-allocation scheme. For larger lists,
overallocation ranged between 3% and 25%. Now, it is a constant 12%.
For smaller lists (n<8), overallocation was upto eight elements. Now,
the overallocation is no more than three elements -- this improves space
utilization for applications that have large numbers of small lists.
- The dict.update() method now accepts all the same argument forms
as the dict() constructor. This now includes item lists and/or
keyword arguments.
- Support for arbitrary objects supporting the read-only buffer
interface as the co_code field of code objects (something that was
only possible to create from C code) has been removed.
- Made omitted callback and None equivalent for weakref.ref() and
weakref.proxy(); the None case wasn't handled correctly in all
cases.
- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
assumed that initial existing entries in an object's weakref list
would not be removed while allocating a new weakref object. Since
GC could be invoked at that time, however, that assumption was
invalid. In a truly obscure case of GC being triggered during
creation for a new weakref object for an referent which already
has a weakref without a callback which is only referenced from
cyclic trash, a memory error can occur. This consistently created a
segfault in a debug build, but provided less predictable behavior in
a release build.
- input() builtin function now respects compiler flags such as
__future__ statements. SF patch 876178.
- Removed PendingDeprecationWarning from apply(). apply() remains
deprecated, but the nuisance warning will not be issued.
- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
collection twice, both before and after tearing down modules. The
call after tearing down modules has been disabled, because too much
of Python has been torn down then for __del__ methods and weakref
callbacks to execute sanely. The most common symptom was a sequence
of uninformative messages on stderr when Python shut down, produced
by threads trying to raise exceptions, but unable to report the nature
of their problems because too much of the sys module had already been
destroyed.
- Removed FutureWarnings related to hex/oct literals and conversions
and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
This addresses most of the remaining semantic changes promised by
PEP 237, except for repr() of a long, which still shows the trailing
'L'. The PEP appears to promise warnings for operations that
changed semantics compared to Python 2.3, but this is not
implemented; we've suffered through enough warnings related to
hex/oct literals and I think it's best to be silent now.
- For str and unicode objects, the ljust(), center(), and rjust()
methods now accept an optional argument specifying a fill
character other than a space.
- When method objects have an attribute that can be satisfied either
by the function object or by the method object, the function
object's attribute usually wins. Christian Tismer pointed out that
that this is really a mistake, because this only happens for special
methods (like __reduce__) where the method object's version is
really more appropriate than the function's attribute. So from now
on, all method attributes will have precedence over function
attributes with the same name.
- Critical bugfix, for SF bug 839548: if a weakref with a callback,
its callback, and its weakly referenced object, all became part of
cyclic garbage during a single run of garbage collection, the order
in which they were torn down was unpredictable. It was possible for
the callback to see partially-torn-down objects, leading to immediate
segfaults, or, if the callback resurrected garbage objects, to
resurrect insane objects that caused segfaults (or other surprises)
later. In one sense this wasn't surprising, because Python's cyclic gc
had no knowledge of Python's weakref objects. It does now. When
weakrefs with callbacks become part of cyclic garbage now, those
weakrefs are cleared first. The callbacks don't trigger then,
preventing the problems. If you need callbacks to trigger, then just
as when cyclic gc is not involved, you need to write your code so
that weakref objects outlive the objects they weakly reference.
- Critical bugfix, for SF bug 840829: if cyclic garbage collection
happened to occur during a weakref callback for a new-style class
instance, subtle memory corruption was the result (in a release build;
in a debug build, a segfault occurred reliably very soon after).
This has been repaired.
- Compiler flags set in PYTHONSTARTUP are now active in __main__.
- Added two builtin types, set() and frozenset().
- Added a reversed() builtin function that returns a reverse iterator
over a sequence.
- Added a sorted() builtin function that returns a new sorted list
from any iterable.
- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
- list.sort() now supports three keyword arguments: cmp, key, and reverse.
The key argument can be a function of one argument that extracts a
comparison key from the original record: mylist.sort(key=str.lower).
The reverse argument is a boolean value and if True will change the
sort order as if the comparison arguments were reversed. In addition,
the documentation has been amended to provide a guarantee that all sorts
starting with Py2.3 are guaranteed to be stable (the relative order of
records with equal keys is unchanged).
- Added test whether wchar_t is signed or not. A signed wchar_t is not
usable as internal unicode type base for Py_UNICODE since the
unicode implementation assumes an unsigned type.
- Fixed a bug in the cache of length-one Unicode strings that could
lead to a seg fault. The specific problem occurred when an earlier,
non-fatal error left an uninitialized Unicode object in the
freelist.
- The % formatting operator now supports '%F' which is equivalent to
'%f'. This has always been documented but never implemented.
- complex(obj) could leak a little memory if obj wasn't a string or
number.
- zip() with no arguments now returns an empty list instead of raising
a TypeError exception.
- obj.__contains__() now returns True/False instead of 1/0. SF patch
820195.
- Python no longer tries to be smart about recursive comparisons.
When comparing containers with cyclic references to themselves it
will now just hit the recursion limit. See SF patch 825639.
- str and unicode builtin types now have rsplit() method that is
same as split() except that it scans the string from the end
working towards the beginning. See SF feature request 801847.
- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
to clear the error when attempts to get the __getstate__ attribute
fail caused intermittent errors and odd behavior.
- buffer objects based on other objects no longer cache a pointer to
the data and the data length. Instead, the appropriate tp_as_buffer
method is called as necessary.
Extension modules
-----------------
- array objects now support the copy module. Also, their resizing
scheme has been updated the same as for list objects. The improves
the performance (speed and memory usage) of append() operations.
Also, array.extend() now accepts any iterable argument for repeated
appends without needing to create another temporary array.
- cStringIO.writelines() now accepts any iterable argument and writes
the lines one at a time rather than joining them and writing once.
Made a parallel change to StringIO.writelines(). Saves memory and
makes suitable for use with generator expressions.
- time.strftime() now checks that the values in its time tuple argument
are within the proper boundaries to prevent possible crashes from the
platform's C library implementation of strftime(). Can possibly
break code that uses values outside the range that didn't cause
problems previously (such as sitting day of year to 0). Fixes bug
#897625.
- The socket module now supports Bluetooth sockets, if the
system has <bluetooth/bluetooth.h>
- Added a collections module containing a new datatype, deque(),
offering high-performance, thread-safe, memory friendly appends
and pops on either side of the deque.
- Several modules now take advantage of collections.deque() for
improved performance: Queue, mutex, shlex, threading, and pydoc.
- The operator module has two new functions, attrgetter() and
itemgetter() which are useful for creating fast data extractor
functions for map(), list.sort(), itertools.groupby(), and
other functions that expect a function argument.
- socket.SHUT_{RD,WR,RDWR} was added.
- os.getsid was added.
- The pwd module incorrectly advertised its struct type as
struct_pwent; this has been renamed to struct_passwd. (The old name
is still supported for backwards compatibility.)
- The xml.parsers.expat module now provides Expat 1.95.7.
- socket.IPPROTO_IPV6 was added.
- readline.clear_history was added.
- select.select() now accepts sequences for its first three arguments.
- cStringIO now supports the f.closed attribute.
- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
- curses module now supports use_default_colors(). [patch #739124]
- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
- Implemented non-recursive SRE matching scheme (#757624).
- Implemented (?(id/name)yes|no) support in SRE (#572936).
- random.seed() with no arguments or None uses time.time() as a default
seed. Modified to match Py2.2 behavior and use fractional seconds so
that successive runs are more likely to produce different sequences.
- random.Random has a new method, getrandbits(k), which returns an int
with k random bits. This method is now an optional part of the API
for user defined generators. Any generator that defines genrandbits()
can now use randrange() for ranges with a length >= 2**53. Formerly,
randrange would return only even numbers for ranges that large (see
SF bug #812202). Generators that do not define genrandbits() now
issue a warning when randrange() is called with a range that large.
- itertools has a new function, groupby() for aggregating iterables
into groups sharing the same key (as determined by a key function).
It offers some of functionality of SQL's groupby keyword and of
the Unix uniq filter.
- itertools now has a new function, tee() which produces two independent
iterators from a single iterable.
- itertools.izip() with no arguments now returns an empty iterator instead
of raising a TypeError exception.
- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
as parameter.
Library
-------
- Support non-anonymous ftp URLs in urllib2.
- The encodings package will now applies codec name aliases
first before starting to try the import of the codec module.
This simplifies overriding built-in codecs with external
packages, e.g. the included CJK codecs with the JapaneseCodecs
package, by adjusting the aliases dictionary in encodings.aliases
accordingly.
- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
decoding standards.
- urllib2 now supports processors. A processor is a handler that
implements an xxx_request or xxx_response method. These methods are
called for all requests.
- distutils compilers now compile source files in the same order as
they are passed to the compiler.
- pprint.pprint() and pprint.pformat() now have additional parameters
indent, width and depth.
- Patch #750542: pprint now will pretty print subclasses of list, tuple
and dict too, as long as they don't overwrite __repr__().
- Bug #848614: distutils' msvccompiler fails to find the MSVC6
compiler because of incomplete registry entries.
- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
- Patch #841977: modulefinder didn't find extension modules in packages
- imaplib.IMAP4.thread was added.
- Plugged a minor hole in tempfile.mktemp() due to the use of
os.path.exists(), switched to using os.lstat() directly if possible.
- bisect.py and heapq.py now have underlying C implementations
for better performance
- traceback.format_exc has been added (similar to print_exc but it returns
a string).
- xmlrpclib.MultiCall has been added.
- poplib.POP3_SSL has been added.
- tmpfile.mkstemp now returns an absolute path even if dir is relative.
- urlparse is RFC 2396 compliant.
- The fieldnames argument to the csv module's DictReader constructor is now
optional. If omitted, the first row of the file will be used as the
list of fieldnames.
- encodings.bz2_codec was added for access to bz2 compression
using "a long string".encode('bz2')
- Various improvements to unittest.py, realigned with PyUnit CVS.
- dircache now passes exceptions to the caller, instead of returning
empty lists.
- The bsddb module and dbhash module now support the iterator and
mapping protocols which make them more substitutable for dictionaries
and shelves.
- The csv module's DictReader and DictWriter classes now accept keyword
arguments. This was an omission in the initial implementation.
- The email package handles some RFC 2231 parameters with missing
CHARSET fields better. It also includes a patch to parameter
parsing when semicolons appear inside quotes.
- sets.py now runs under Py2.2. In addition, the argument restrictions
for most set methods (but not the operators) have been relaxed to
allow any iterable.
- _strptime.py now has a behind-the-scenes caching mechanism for the most
recent TimeRE instance used along with the last five unique directive
patterns. The overall module was also made more thread-safe.
- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
and removed in Py2.4.
- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
- Patch #873597: CJK codecs are imported into rank of default codecs.
Tools/Demos
-----------
- A hotshotmain script was added to the Tools/scripts directory that
makes it easy to run a script under control of the hotshot profiler.
- The db2pickle and pickle2db scripts can now dump/load gdbm files.
- The file order on the command line of the pickle2db script was reversed.
It is now [ picklefile ] dbfile. This provides better symmetry with
db2pickle. The file arguments to both scripts are now source followed by
destination in situations where both files are given.
- The pydoc script will display a link to the module documentation for
modules determined to be part of the core distribution. The documentation
base directory defaults to http://www.python.org/doc/current/lib/ but can
be changed by setting the PYTHONDOCS environment variable.
- texcheck.py now detects double word errors.
- md5sum.py mistakenly opened input files in text mode by default, a
silent and dangerous change from previous releases. It once again
opens input files in binary mode by default. The -t and -b flags
remain for compatibility with the 2.3 release, but -b is the default
now.
- py-electric-colon now works when pending-delete/delete-selection mode is
in effect
- py-help-at-point is no longer bound to the F1 key - it's still bound to
C-c C-h
- Pynche was fixed to not crash when there is no ~/.pynche file and no
-d option was given.
Build
-----
- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
removed.
- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
supported (see PEP 11).
- Universal newline support can no longer be disabled (see PEP 11).
- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
(see PEP 11).
- Tests for sizeof(char) were removed since ANSI C mandates that
sizeof(char) must be 1.
C API
-----
- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
underlying array of PyObject pointers. Useful for high speed looping.
- Created a new method flag, METH_COEXIST, which causes a method to be loaded
even if already defined by a slot wrapper. This allows a __contains__
method, for example, to co-exist with a defined sq_contains slot. This
is helpful because the PyCFunction can take advantage of optimized calls
whenever METH_O or METH_NOARGS flags are defined.
- Added a new function, PyDict_Contains(d, k) which is like
PySequence_Contains() but is specific to dictionaries and executes
about 10% faster.
- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
Each return the singleton they mention after Py_INCREF()ing them.
- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
variable length argument list of Python objects without having to invoke
the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
is equivalent to Py_BuildValue("(OOO)", a, b, c).
New platforms
-------------
Tests
-----
Windows
-------
- The _winreg module could segfault when reading very large registry
values, due to unchecked alloca() calls (SF bug 851056). The fix is
uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
as appropriate, followed by a size check.
- file.truncate() could misbehave if the file was open for update
(modes r+, rb+, w+, wb+), and the most recent file operation before
the truncate() call was an input operation. SF bug 801631.
Mac
----
What's New in Python 2.3 final?
===============================
*Release date: 29-Jul-2003*
IDLE
----
- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
This was unique to Windows, and was fixed by adding an -n switch to
the command the Windows installer creates to execute "Edit with IDLE"
context-menu actions.
- IDLE displays a new message upon startup: some "personal firewall"
kinds of programs (for example, ZoneAlarm) open a dialog of their
own when any program opens a socket. IDLE does use sockets, talking
on the computer's internal loopback interface. This connection is not
visible on any external interface and no data is sent to or received
from the Internet. So, if you get such a dialog when opening IDLE,
asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
and rest assured no communication external to your machine is taking
place. If you don't allow it, IDLE won't be able to start.
What's New in Python 2.3 release candidate 2?
=============================================
*Release date: 24-Jul-2003*
Core and builtins
-----------------
- It is now possible to import from zipfiles containing additional
data bytes before the zip compatible archive. Zipfiles containing a
comment at the end are still unsupported.
Extension modules
-----------------
- A longstanding bug in the parser module's initialization could cause
fatal internal refcount confusion when the module got initialized more
than once. This has been fixed.
- Fixed memory leak in pyexpat; using the parser's ParseFile() method
with open files that aren't instances of the standard file type
caused an instance of the bound .read() method to be leaked on every
call.
- Fixed some leaks in the locale module.
Library
-------
- Lib/encodings/rot_13.py when used as a script, now more properly
uses the first Python interpreter on your path.
- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
fix a locale related bug in the test suite. Although another patch
was needed to actually fix the problem, the cache code was not
restored.
IDLE
----
- Calltips patches.
Build
-----
- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
on Panther (OSX 10.3).
C API
-----
Windows
-------
- The tempfile module could do insane imports on Windows if PYTHONCASEOK
was set, making temp file creation impossible. Repaired.
- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
Mac
---
- Various fixes to pimp.
- Scripts runs with pythonw no longer had full window manager access.
- Don't force boot-disk-only install, for reasons unknown it causes
more problems than it solves.
What's New in Python 2.3 release candidate 1?
=============================================
*Release date: 18-Jul-2003*
Core and builtins
-----------------
- The new function sys.getcheckinterval() returns the last value set
by sys.setcheckinterval().
- Several bugs in the symbol table phase of the compiler have been
fixed. Errors could be lost and compilation could fail without
reporting an error. SF patch 763201.
- The interpreter is now more robust about importing the warnings
module. In an executable generated by freeze or similar programs,
earlier versions of 2.3 would fail if the warnings module could
not be found on the file system. Fixes SF bug 771097.
- A warning about assignments to module attributes that shadow
builtins, present in earlier releases of 2.3, has been removed.
- It is not possible to create subclasses of builtin types like str
and tuple that define an itemsize. Earlier releases of Python 2.3
allowed this by mistake, leading to crashes and other problems.
- The thread_id is now initialized to 0 in a non-thread build. SF bug
770247.
- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
Extension modules
-----------------
- weakref.proxy() can now handle "del obj[i]" for proxy objects
defining __delitem__. Formerly, it generated a SystemError.
- SSL no longer crashes the interpreter when the remote side disconnects.
- On Unix the mmap module can again be used to map device files.
- time.strptime now exclusively uses the Python implementation
contained within the _strptime module.
- The print slot of weakref proxy objects was removed, because it was
not consistent with the object's repr slot.
- The mmap module only checks file size for regular files, not
character or block devices. SF patch 708374.
- The cPickle Pickler garbage collection support was fixed to traverse
the find_class attribute, if present.
- There are several fixes for the bsddb3 wrapper module.
bsddb3 no longer crashes if an environment is closed before a cursor
(SF bug 763298).
The DB and DBEnv set_get_returns_none function was extended to take
a level instead of a boolean flag. The new level 2 means that in
addition, cursor.set()/.get() methods return None instead of raising
an exception.
A typo was fixed in DBCursor.join_item(), preventing a crash.
Library
-------
- distutils now supports MSVC 7.1
- doctest now examines all docstrings by default. Previously, it would
skip over functions with private names (as indicated by the underscore
naming convention). The old default created too much of a risk that
user tests were being skipped inadvertently. Note, this change could
break code in the unlikely case that someone had intentionally put
failing tests in the docstrings of private functions. The breakage
is easily fixable by specifying the old behavior when calling testmod()
or Tester().
- There were several fixes to the way dumbdbms are closed. It's vital
that a dumbdbm database be closed properly, else the on-disk data
and directory files can be left in mutually inconsistent states.
dumbdbm.py's _Database.__del__() method attempted to close the
database properly, but a shutdown race in _Database._commit() could
prevent this from working, so that a program trusting __del__() to
get the on-disk files in synch could be badly surprised. The race
has been repaired. A sync() method was also added so that shelve
can guarantee data is written to disk.
The close() method can now be called more than once without complaint.
- The classes in threading.py are now new-style classes. That they
weren't before was an oversight.
- The urllib2 digest authentication handlers now define the correct
auth_header. The earlier versions would fail at runtime.
- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
when there are no lines.
- SF bug 763637: fix exception in Tkinter with after_cancel
which could occur with Tk 8.4
- SF bug 770601: CGIHTTPServer.py now passes the entire environment
to child processes.
- SF bug 765238: add filter to fnmatch's __all__.
- SF bug 748201: make time.strptime() error messages more helpful.
- SF patch 764470: Do not dump the args attribute of a Fault object in
xmlrpclib.
- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
responses.
- SF patch 766650: The whichdb module was fixed to recognize dbm files
generated by gdbm on OS/2 EMX.
- SF bugs 763047 and 763052: fixes bug of timezone value being left as
-1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
is true when it should only when time.daylight is true.
- SF bug 764548: re now allows subclasses of str and unicode to be
used as patterns.
- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
of varying sizes. Tk 8.4 returns a different number of values
than Tk 8.3.
- SF bug 763023: difflib.ratio() did not catch zero division.
- The Queue module now has an __all__ attribute.
Tools/Demos
-----------
- See Lib/idlelib/NEWS.txt for IDLE news.
- SF bug 753592: webchecker/wsgui now handles user supplied directories.
- The trace.py script has been removed. It is now in the standard library.
Build
-----
- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
- The socket module compiles on IRIX 6.5.10.
- An irix64 system is treated the same way as an irix6 system (SF
patch 764560).
- Several definitions were missing on FreeBSD 5.x unless the
__BSD_VISIBLE symbol was defined. configure now defines it as
needed.
C API
-----
- Unicode objects now support mbcs as a built-in encoding, so the C
API can use it without deferring to the encodings package.
Windows
-------
- The Windows implementation of PyThread_start_new_thread() never
checked error returns from Windows functions correctly. As a result,
it could claim to start a new thread even when the Microsoft
_beginthread() function failed (due to "too many threads" -- this is
on the order of thousands when it happens). In these cases, the
Python exception ::
thread.error: can't start new thread
is raised now.
- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
use. The interpreter now calls WSACleanup() from Py_Finalize()
instead of from DLL teardown.
Mac
---
- Bundlebuilder now inherits default values in the right way. It was
previously possible for app bundles to get a type of "BNDL" instead
of "APPL." Other improvements include, a --build-id option to
specify the CFBundleIdentifier and using the --python option to set
the executable in the bundle.
- Fixed two bugs in MacOSX framework handling.
- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
- Python is now compiled with -mno-fused-madd, making all tests pass
on Panther.
What's New in Python 2.3 beta 2?
================================
*Release date: 29-Jun-2003*
Core and builtins
-----------------
- A program can now set the environment variable PYTHONINSPECT to some
string value in Python, and cause the interpreter to enter the
interactive prompt at program exit, as if Python had been invoked
with the -i option.
- list.index() now accepts optional start and stop arguments. Similar
changes were made to UserList.index(). SF feature request 754014.
- SF patch 751998 fixes an unwanted side effect of the previous fix
for SF bug 742860 (the next item).
- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
wasn't threadsafe, was very inefficient (expected time O(len(dict))
instead of O(1)), and could raise a spurious RuntimeError if another
thread mutated the dict during __delitem__, or if a comparison function
mutated it. It also neglected to raise KeyError when the key wasn't
present; didn't raise TypeError when the key wasn't of a weakly
referencable type; and broke various more-or-less obscure dict
invariants by using a sequence of equality comparisons over the whole
set of dict keys instead of computing the key's hash code to narrow
the search to those keys with the same hash code. All of these are
considered to be bugs. A new implementation of __delitem__ repairs all
that, but note that fixing these bugs may change visible behavior in
code relying (whether intentionally or accidentally) on old behavior.
- SF bug 734869: Fixed a compiler bug that caused a fatal error when
compiling a list comprehension that contained another list comprehension
embedded in a lambda expression.
- SF bug 705231: builtin pow() no longer lets the platform C pow()
raise -1.0 to integer powers, because (at least) glibc gets it wrong
in some cases. The result should be -1.0 if the power is odd and 1.0
if the power is even, and any float with a sufficiently large exponent
is (mathematically) an exact even integer.
- SF bug 759227: A new-style class that implements __nonzero__() must
return a bool or int (but not an int subclass) from that method. This
matches the restriction on classic classes.
- The encoding attribute has been added for file objects, and set to
the terminal encoding on Unix and Windows.
- The softspace attribute of file objects became read-only by oversight.
It's writable again.
- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
tuple. By default, the iterators now access data elements directly
instead of going through __getitem__. If __getitem__ access is
preferred, then __iter__ can be overridden.
- SF bug 735247: The staticmethod and super types participate in
garbage collection. Before this change, it was possible for leaks to
occur in functions with non-global free variables that used these types.
Extension modules
-----------------
- the socket module has a new exception, socket.timeout, to allow
timeouts to be handled separately from other socket errors.
- SF bug 751276: cPickle has fixed to propagate exceptions raised in
user code. In earlier versions, cPickle caught and ignored any
exception when it performed operations that it expected to raise
specific exceptions like AttributeError.
- cPickle Pickler and Unpickler objects now participate in garbage
collection.
- mimetools.choose_boundary() could return duplicate strings at times,
especially likely on Windows. The strings returned are now guaranteed
unique within a single program run.
- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
dummy_thread has also been modified to try to simulate the behavior.
- array.array.insert() now treats negative indices as being relative
to the end of the array, just like list.insert() does. (SF bug #739313)
- The datetime module classes datetime, time, and timedelta are now
properly subclassable.
- _tkinter.{get|set}busywaitinterval was added.
- itertools.islice() now accepts stop=None as documented.
Fixes SF bug #730685.
- the bsddb185 module is built in one restricted instance -
/usr/include/db.h exists and defines HASHVERSION to be 2. This is true
for many BSD-derived systems.
Library
-------
- Some happy doctest extensions from Jim Fulton have been added to
doctest.py. These are already being used in Zope3. The two
primary ones:
doctest.debug(module, name) extracts the doctests from the named object
in the given module, puts them in a temp file, and starts pdb running
on that file. This is great when a doctest fails.
doctest.DocTestSuite(module=None) returns a synthesized unittest
TestSuite instance, to be run by the unittest framework, which
runs all the doctests in the module. This allows writing tests in
doctest style (which can be clearer and shorter than writing tests
in unittest style), without losing unittest's powerful testing
framework features (which doctest lacks).
- For compatibility with doctests created before 2.3, if an expected
output block consists solely of "1" and the actual output block
consists solely of "True", it's accepted as a match; similarly
for "0" and "False". This is quite un-doctest-like, but is practical.
The behavior can be disabled by passing the new doctest module
constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
argument.
- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
a bare except caught to much and reported all errors as a problem
in the archive.
- The logging module now has a new function, makeLogRecord() making
LogHandler easier to interact with DatagramHandler and SocketHandler.
- The cgitb module has been extended to support plain text display (SF patch
569574).
- A brand new version of IDLE (from the IDLEfork project at
SourceForge) is now included as Lib/idlelib. The old Tools/idle is
no more.
- Added a new module: trace (documentation missing). This module used
to be distributed in Tools/scripts. It uses sys.settrace() to trace
code execution -- either function calls or individual lines. It can
generate tracing output during execution or a post-mortem report of
code coverage.
- The threading module has new functions settrace() and setprofile()
that cooperate with the functions of the same name in the sys
module. A function registered with the threading module will
be used for all threads it creates. The new trace module uses this
to provide tracing for code running in threads.
- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
Taschuk. Copying a new-style class that had a reference to itself
didn't work. (The same thing worked fine for old-style classes.)
Builtin functions are now treated as atomic, fixing bug #746304.
- difflib.py has two new functions: context_diff() and unified_diff().
- More fixes to urllib (SF 549151): (a) When redirecting, always use
GET. This is common practice and more-or-less sanctioned by the
HTTP standard. (b) Add a handler for 307 redirection, which becomes
an error for POST, but a regular redirect for GET and HEAD
- Added optional 'onerror' argument to os.walk(), to control error
handling.
- inspect.is{method|data}descriptor was added, to allow pydoc display
__doc__ of data descriptors.
- Fixed socket speed loss caused by use of the _socketobject wrapper class
in socket.py.
- timeit.py now checks the current directory for imports.
- urllib2.py now knows how to order proxy classes, so the user doesn't
have to insert it in front of other classes, nor do dirty tricks like
inserting a "dummy" HTTPHandler after a ProxyHandler when building an
opener with proxy support.
- Iterators have been added for dbm keys.
- random.Random objects can now be pickled.
Tools/Demos
-----------
- pydoc now offers help on keywords and topics.
- Tools/idle is gone; long live Lib/idlelib.
- diff.py prints file diffs in context, unified, or ndiff formats,
providing a command line interface to difflib.py.
- texcheck.py is a new script for making a rough validation of Python LaTeX
files.
Build
-----
- Setting DESTDIR during 'make install' now allows specifying a
different root directory.
C API
-----
- PyType_Ready(): If a type declares that it participates in gc
(Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
tp_free slot is the default _PyObject_Del, and type does not define
a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
Previously _PyObject_Del was inherited, which could at best lead to a
segfault. In addition, if even after this magic the type's tp_free
slot is _PyObject_Del or NULL, and the type is a base type
(Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
type, its dealloc function must call type->tp_free, and since the type
is gc'able, tp_free must not be NULL or _PyObject_Del.
- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
from C) to interrupt a thread by sending it an exception. It is
intentional that you have to write your own C extension to call it
from Python.
New platforms
-------------
None this time.
Tests
-----
- test_imp rewritten so that it doesn't raise RuntimeError if run as a
side effect of being imported ("import test.autotest").
Windows
-------
- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
- The installer always suggested that Python be installed on the C:
drive, due to a hardcoded "C:" generated by the Wise installation
wizard. People with machines where C: is not the system drive
usually want Python installed on whichever drive is their system drive
instead. We removed the hardcoded "C:", and two testers on machines
where C: is not the system drive report that the installer now
suggests their system drive. Note that you can always select the