Repository navigation
Expand file tree
/
Copy pathNEWS
More file actions
5493 lines (4048 loc) · 220 KB
/
Copy pathNEWS
File metadata and controls
5493 lines (4048 loc) · 220 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.1 final?
=================================
*Release date: 30-MAR-2005*
Core and builtins
-----------------
- Move exception finalisation later in the shutdown process - this
fixes the crash seen in bug #1165761
Tests
-----
- SF patch 1167316: doctest.py fails self-test if run directly.
Build
-----
- SF patch 1171767: Darwin 8's headers are anal about POSIX compliance,
and linking has changed (prebinding is now deprecated, and libcc_dynamic
no longer exists). This configure patch makes things right.
What's New in Python 2.4.1c2?
=============================
*Release date: 17-MAR-2005*
Library
-------
- Fixed decimal operator and comparison methods to return NotImplemented
instead of raising a TypeError when interacting with other types.
Allows other classes to successfully implement __radd__ style methods.
- Bug #1163325: Decimal infinities failed to hash. Attempting to
hash a NaN raised an InvalidOperation instead of a TypeError.
- Bug #1160802: can't build Zope on Windows with 2.4.1c1. The
``MSVCCompiler`` class in distutils forgot to record that it was
initialized, and continued adding redundant entries to the system
``PATH`` environment variable until ``putenv()`` complained about the
size. This only affected building projects with many C extensions,
and only on Windows using Microsoft's compiler. This wasn't visible
before because a bugfix first included in 2.4.1c1 provoked it (bug
#1110478: revert os.environ.update to do putenv again).
- Bug #1156259: Seeking in codecs.reader was broken, now fixed.
Tests
-----
- Fix the test for socket.getfqdn() in test_socket to also consider the host
name returned by socket.gethostname() a valid return value for getfqdn().
Also clarified the wording of docs and docstring that this is the case.
Extensions Modules
------------------
- os.access now supports Unicode path names on non-Win32 systems.
What's New in Python 2.4.1c1?
=============================
*Release date: 10-MAR-2005*
Core and builtins
-----------------
- Bug #1155938: new style classes did not verify that __init__()
returns None.
- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
- Bug #1124295: the __name__ attribute of file objects was
inadvertently made inaccessible in restricted mode.
- Bug #1074011: closing sys.std{out,err} now causes a flush() and
an ferror() call.
- Bug #1085744: Add missing overflow check to PySequence_Tuple().
Make resize schedule linear (amortized).
- marshal.dumps() no longer crashes when the optional argument ``version``
is provided.
Extension Modules
-----------------
- Patches #925152, #1118602: Avoid reading after the end of the buffer
in pyexpat.GetInputContext.
- Patch #1093585: raise a ValueError for negative history items in readline.
{remove_history,replace_history}
Library
-------
- Patch #1075887: Don't require MSVC in distutils if there is nothing
to build.
- Patch #1103407: Properly deal with tarfile iterators when untarring
symbolic links on Windows.
- Patch #1117454: Remove code to special-case cookies without values
in LWPCookieJar.
- Patch #1117339: Add cookielib special name tests.
- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
- Patch #1121234: Properly cleanup _exit and tkerror commands.
- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
disables recursive traversal through instance attributes, which can
be exploited in various ways.
- Bug #1110478: Revert os.environ.update to do putenv again.
- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
- Bug #1067732: wininst --install-script doesn't leave residual files anymore.
- StringIO.truncate() now correctly adjusts the size attribute.
(Bug #951915).
- The decimal module wouldn't run on builds without threads (Bug #1083645).
- Bug #1086555: Fix leak in syslog module.
- atexit.register no longer references the sys module before importing it.
(Bug #1083202).
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
extended or overridden by subclasses. Formerly, the subclassed method would
be ignored by the rest of the module. (Bug #1078905).
- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
once when a size argument is given. This prevents a buffer overflow in the
tokenizer with very long source lines.
- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called immediately
after creating the object, without any intervening ``.decompress()`` calls.
- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
correctly.
Build
-----
- Bug #1158607: Build with --disable-unicode again.
- term.h is now properly detected again.
- Check for tzset no longer dependent on tm->tm_zone to exist in the struct
(not required by either ISO C nor the UNIX 2 spec).
Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
Closes bug #1096244. Thanks Gregory Bond.
Windows
-------
- Bug #1076861: The IDLE shortcut is now correct even if the target
directory contains a space.
- Bug #1085208 and similar: The installer does not fail anymore if
VBScript is not available on the target machine, not installed
properly, or outdated; the MSI package now does not rely on VB
anymore.
Macintosh
---------
- Bug #1091468: make frameworkinstall now works with DESTROOT builds
- On 10.3 and later extensions are built with -undefined dynamic_lookup.
This ensures that extensions can be built in older versions of Python after
a newer framework has been installed. In addition, an extension will not
accidentally pull in another copy of the Python interpreter.
On 10.2 and earlier (or if MACOSX_DEPLOYMENT_TARGET is set to a value <= 10.2)
extensions are linked directly to the dylib in the framework, in stead
of against the framework itself. This ensures that extensions can be built
in older versions of Python after a newer framework has been installed.
- PackageManager and the underlying pimp.py module have been updated to
version 0.5, which greatly simplifies maintainance of the package
databases.
Documentation
-------------
- Remove all latent references for "Macintosh" that referred to semantics for
Mac OS 9 and change to reflect the state for OS X.
Closes patch #1095802. Thanks Jack Jansen.
What's New in Python 2.4 final?
===============================
*Release date: 30-NOV-2004*
Core and builtins
-----------------
- Bug 875692: Improve signal handling, especially when using threads, by
forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
things_to_do is not cleared by Py_MakePendingCalls().
What's New in Python 2.4 (release candidate 1)
==============================================
*Release date: 18-NOV-2004*
Core and builtins
-----------------
- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
the years-old thread shutdown race bug 225673. Numeric history lesson
aside, all bugs in all three reports are fixed now.
Library
-------
- Bug 1052242: If exceptions are raised by an atexit handler function an
attempt is made to execute the remaining handlers. The last exception
raised is re-raised.
- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
doctests was broken in a dramatic but shallow way. Fixed.
- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
and ``month_abbr`` attributes emulate sequences of locale-correct
spellings of month and day names. Because the locale can change at
any time, the correct spelling is recomputed whenever one of these is
indexed. In the worst case, the index may be a slice object, so these
recomputed every day or month name each time they were indexed. This is
much slower than necessary in the usual case, when the index is just an
integer. In that case, only the single spelling needed is recomputed
now; and, when the index is a slice object, only the spellings needed
by the slice are recomputed now.
- Patch 1061679: Added ``__all__`` to pickletools.py.
Build
-----
- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
which has no known users. Thanks Bob Ippolito.
C API
-----
- The PyRange_New() function is deprecated.
What's New in Python 2.4 beta 2?
================================
*Release date: 03-NOV-2004*
License
-------
The Python Software Foundation changed the license under which Python
is released, to remove Python version numbers. There were no other
changes to the license. So, for example, wherever the license for
Python 2.3 said "Python 2.3", the new license says "Python". The
intent is to make it possible to refer to the PSF license in a more
durable way. For example, some people say they're confused by that
the Open Source Initiative's entry for the Python Software Foundation
License::
http://www.opensource.org/licenses/PythonSoftFoundation.php
says "Python 2.1.1" all over it, wondering whether it applies only
to Python 2.1.1.
The official name of the new license is the Python Software Foundation
License Version 2.
Core and builtins
-----------------
- Bug #1055820 Cyclic garbage collection was not protecting against that
calling a live weakref to a piece of cyclic trash could resurrect an
insane mutation of the trash if any Python code ran during gc (via
running a dead object's __del__ method, running another callback on a
weakref to a dead object, or via any Python code run in any other thread
that managed to obtain the GIL while a __del__ or callback was running
in the thread doing gc). The most likely symptom was "impossible"
``AttributeEror`` exceptions, appearing seemingly at random, on weakly
referenced objects. The cure was to clear all weakrefs to unreachable
objects before allowing any callbacks to run.
- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
Extension Modules
-----------------
- Bug #1048870: the compiler now generates distinct code objects for
functions with identical bodies. This was producing confusing
traceback messages which pointed to the function where the code
object was first defined rather than the function being executed.
Library
-------
- Patch #1056967 changes the semantics of Template.safe_substitute() so that
no ValueError is raised on an 'invalid' match group. Now the delimiter is
returned.
- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
paths with a base path before checking os.path.isfile().
- The whichdb module can now be run from the command line.
- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
the year) when the day of the week and year are also specified.
- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
- Bug #1017553: fix bug in tarfile.filemode()
- Patch #737473: fix bug that old source code is shown in tracebacks even if
the source code is updated and reloaded.
Build
-----
- Patch #1044395: --enable-shared is allowed in FreeBSD also.
What's New in Python 2.4 beta 1?
================================
*Release date: 15-OCT-2004*
Core and builtins
-----------------
- Patch #975056: Restartable signals were not correctly disabled on
BSD systems. Consistently use PyOS_setsig() instead of signal().
- The internal portable implementation of thread-local storage (TLS), used
by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
thread-correct. This could lead to a variety of problems, up to and
including segfaults. See bug 1041645 for an example.
- Added a command line option, -m module, which searches sys.path for the
module and then runs it. (Contributed by Nick Coghlan.)
- The bytecode optimizer now folds tuples of constants into a single
constant.
- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
an integer was compared to a float, the integer was coerced to a float.
That could yield spurious overflow errors (if the integer was very
large), and to anomalies such as
``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
longer performed, and cases like ``long(1e200)-1 < 1e200``,
``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
correctly now.
Extension modules
-----------------
- ``collections.deque`` objects didn't play quite right with garbage
collection, which could lead to a segfault in a release build, or
an assert failure in a debug build. Also, added overflow checks,
better detection of mutation during iteration, and shielded deque
comparisons from unusual subclass overrides of the __iter__() method.
Library
-------
- Patch 1046644: distutils build_ext grew two new options - --swig for
specifying the swig executable to use, and --swig-opts to specify
options to pass to swig. --swig-opts="-c++" is the new way to spell
--swig-cpp.
- Patch 983206: distutils now obeys environment variable LDSHARED, if
it is set.
- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
- time.strptime() now properly escapes timezones and all other locale-specific
strings for regex-specific symbols. Was breaking under Japanese Windows when
the timezone was specified as "Tokyo (standard time)".
Closes bug #1039270.
- Updates for the email package:
+ email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
+ All deprecated APIs that in email 2.x issued warnings have been removed:
_encoder argument to the MIMEText constructor, Message.add_payload(),
Utils.dump_address_pair(), Utils.decode(), Utils.encode()
+ New deprecations: Generator.__call__(), Message.get_type(),
Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
the Parser constructor. These will be removed in email 3.1.
+ Support for Python earlier than 2.3 has been removed (see PEP 291).
+ All defect classes have been renamed to end in 'Defect'.
+ Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
added to messages that claim to be multipart but really aren't.
+ Updates to documentation.
- re's findall() and finditer() functions now take an optional flags argument
just like the compile(), search(), and match() functions. Also, documented
the previously existing start and stop parameters for the findall() and
finditer() methods of regular expression objects.
- rfc822 Messages now support iterating over the headers.
- The (undocumented) tarfile.Tarfile.membernames has been removed;
applications should use the getmember function.
- httplib now offers symbolic constants for the HTTP status codes.
- SF bug #1028306: Trying to compare a ``datetime.date`` to a
``datetime.datetime`` mistakenly compared only the year, month and day.
Now it acts like a mixed-type comparison: ``False`` for ``==``,
``True`` for ``!=``, and raises ``TypeError`` for other comparison
operators. Because datetime is a subclass of date, comparing only the
base class (date) members can still be done, if that's desired, by
forcing using of the approprate date method; e.g.,
``a_date.__eq__(a_datetime)`` is true if and only if the year, month
and day members of ``a_date`` and ``a_datetime`` are equal.
- bdist_rpm now supports command line options --force-arch,
{pre,post}-install, {pre,post}-uninstall, and
{prep,build,install,clean,verify}-script.
- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
decoding incomplete input (when the input stream is temporarily exhausted).
``codecs.StreamReader`` now implements buffering, which enables proper
readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
has a new argument ``chars`` which specifies the number of characters to
return. ``codecs.StreamReader.readline()`` and
``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
- The documentation for doctest is greatly expanded, and now covers all
the new public features (of which there are many).
- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
updates it. This isn't good, because every ``testmod()`` call
contributes to bloating the "hidden" state of ``doctest.master``, but
some old code apparently relies on it. For now, all we can do is
encourage people to stitch doctests together via doctest's unittest
integration features instead.
- httplib now handles ipv6 address/port pairs.
- SF bug #1017864: ConfigParser now correctly handles default keys,
processing them with ``ConfigParser.optionxform`` when supplied,
consistent with the handling of config file entries and runtime-set
options.
- SF bug #997050: Document, test, & check for non-string values in
ConfigParser. Moved the new string-only restriction added in
rev. 1.65 to the SafeConfigParser class, leaving existing
ConfigParser & RawConfigParser behavior alone, and documented the
conditions under which non-string values work.
Build
-----
- Building on darwin now includes /opt/local/include and /opt/local/lib for
building extension modules. This is so as to include software installed as
a DarwinPorts port <http://darwinports.opendarwin.org/>
- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
platform C computes true for ``x != x`` if and only if X is a NaN.
Other platforms can override the default definition with a platform-
specific spelling in that platform's pyconfig.h. You can also override
pyport.h's default Py_IS_INFINITY definition now.
C API
-----
- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
non-zero if PyEval_InitThreads() has been called.
- The undocumented and unused extern int ``_PyThread_Started`` was removed.
- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
are two of the very few advertised as being safe to call without holding
the GIL. However, this wasn't true in a debug build, as bug 1041645
demonstrated. In a debug build, Python redirects the ``PyMem`` family
of calls to Python's small-object allocator, to get the benefit of
its extra debugging capabilities. But Python's small-object allocator
isn't threadsafe, relying on the GIL to avoid the expense of doing its
own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
call the platform ``malloc()`` directly now, regardless of build type.
- PyLong_AsUnsignedLong[Mask] now support int objects as well.
- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
decoding.
Tests
-----
- test__locale ported to unittest
Mac
---
- ``plistlib`` now supports non-dict root objects. There is also a new
interface for reading and writing plist files: ``readPlist(pathOrFile)``
and ``writePlist(rootObject, pathOrFile)``
Tools/Demos
-----------
- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
read the input files in universal-newline mode. This spares them
from consuming a great deal of time to deduce the useless result that,
e.g., a file with Windows line ends and a file with Linux line ends
have no lines in common.
What's New in Python 2.4 alpha 3?
=================================
*Release date: 02-SEP-2004*
Core and builtins
-----------------
- SF patch #1007189: ``from ... import ...`` statements now allow the name
list to be surrounded by parentheses.
- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
multiplication was sped a little by optimizing the C code. Gradeschool
squaring was sped by about a factor of 2, by exploiting that about half
the digit products are duplicates in a square. Because exponentiation
uses squaring often, this also speeds long power. For example, the time
to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
to this much. The cutoff for Karatsuba multiplication was raised,
since gradeschool multiplication got quicker, and the cutoff was
aggressively small regardless. The exponentiation algorithm was switched
from right-to-left to left-to-right, which is more efficient for small
bases. In addition, if the exponent is large, the algorithm now does
5 bits (instead of 1 bit) at a time. That cut the time to compute
17**1000000 on my box in half again, down to about 4.5 seconds.
- OverflowWarning is no longer generated. PEP 237 scheduled this to
occur in Python 2.3, but since OverflowWarning was disabled by default,
nobody realized it was still being generated. On the chance that user
code is still using them, the Python builtin OverflowWarning, and
corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
- Py_InitializeEx has been added.
- Fix the order of application of decorators. The proper order is bottom-up;
the first decorator listed is the last one called.
- SF patch #1005778. Fix a seg fault if the list size changed while
calling list.index(). This could happen if a rich comparison function
modified the list.
- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
functions is now writable.
- code_new (a.k.a new.code()) now checks its arguments sufficiently
carefully that passing them on to PyCode_New() won't trigger calls
to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
that the returned code object might be entirely insane.
- Subclasses of string can no longer be interned. The semantics of
interning were not clear here -- a subclass could be mutable, for
example -- and had bugs. Explicitly interning a subclass of string
via intern() will raise a TypeError. Internal operations that attempt
to intern a string subclass will have no effect.
- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
what xrange() intends, and repaired tests accordingly.
Extension modules
-----------------
- difflib now supports HTML side-by-side diff.
- os.urandom has been added for systems that support sources of random
data.
- Patch 1012740: truncate() on a writeable cStringIO now resets the
position to the end of the stream. This is consistent with the original
StringIO module and avoids inadvertently resurrecting data that was
supposed to have been truncated away.
- Added socket.socketpair().
- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
members to xml.parsers.expat.XMLParser object.
- The mpz, rotor, and xreadlines modules, all deprecated in earlier
versions of Python, have now been removed.
Library
-------
- Patch #934356: if a module defines __all__, believe that rather than using
heuristics for filtering out imported names.
- Patch #941486: added os.path.lexists(), which returns True for broken
symlinks, unlike os.path.exists().
- the random module now uses os.urandom() for seeding if it is available.
Added a new generator based on os.urandom().
- difflib and diff.py can now generate HTML.
- bdist_rpm now includes version and release in the BuildRoot, and
replaces - by ``_`` in version and release.
- distutils build/build_scripts now has an -e option to specify the
path to the Python interpreter for installed scripts.
- PEP 292 classes Template and SafeTemplate are added to the string module.
- tarfile now generates GNU tar files by default.
- HTTPResponse has now a getheaders method.
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
Percivall.
- logging.handlers.SMTPHandler.date_time has been removed;
the class now uses email.Utils.formatdate to generate the time stamp.
- A new function tkFont.nametofont was added to return an existing
font. The Font class constructor now has an additional exists argument
which, if True, requests to return/configure an existing font, rather
than creating a new one.
- Updated the decimal package's min() and max() methods to match the
latest revision of the General Decimal Arithmetic Specification.
Quiet NaNs are ignored and equal values are sorted based on sign
and exponent.
- The decimal package's Context.copy() method now returns deep copies.
- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
attribute will be kept around for backwards compatability and atexit
will just become the one preferred way to do it.
- patch #675551: Add get_history_item and replace_history_item functions
to the readline module.
- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
frame, u(p) to an older frame, not the other way around.
- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
path, as normalizing the path may alter the meaning of the path if it
contains symlinks.
- bug #851123: shutil.copyfile will raise an exception when trying to copy a
file onto a link to itself. Thanks Gregory Ball.
- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
so as to properly list all functions in a module when the module itself is
reached through a symlink. Thanks Johannes Gijsbers.
- doctest refactoring continued. See the docs for details. As part of
this effort, some old and little- (never?) used features are now
deprecated: the Tester class, the module is_private() function, and the
isprivate argument to testmod(). The Tester class supplied a feeble
"by hand" way to combine multiple doctests, if you knew exactly what
you were doing. The newer doctest features for unittest integration
already did a better job of that, are stronger now than ever, and the
new DocTestRunner class is a saner foundation if you want to do it by
hand. The "private name" filtering gimmick was a mistake from the
start, and testmod() changed long ago to ignore it by default. If
you want to filter out tests, the new DocTestFinder class can be used
to return a list of all doctests, and you can filter that list by
any computable criteria before passing it to a DocTestRunner instance.
- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
Tools/Demos
-----------
- IDLE's shortcut keys for windows are now case insensitive so that
Control-V works the same as Control-v.
- pygettext.py: Generate POT-Creation-Date header in ISO format.
Build
-----
- Backward incompatibility: longintrepr.h now triggers a compile-time
error if SHIFT (the number of bits in a Python long "digit") isn't
divisible by 5. This new requirement allows simple code for the new
5-bits-at-a-time long_pow() implementation. If necessary, the
restriction could be removed (by complicating long_pow(), or by
falling back to the 1-bit-at-a-time algorithm), but there are no
plans to do so.
- bug #991962: When building with --disable-toolbox-glue on Darwin no
attempt to build Mac-specific modules occurs.
- The --with-tsc flag to configure to enable VM profiling with the
processor's timestamp counter now works on PPC platforms.
- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
GCC's definition and avoid redefinition warnings.
- Detect pthreads support (provided by gnu pth pthread emulation) on
GNU/k*BSD systems.
- bug #1005737, #1007249: Fixed several build problems and warnings
found on old/legacy C compilers of HP-UX, IRIX and Tru64.
C API
-----
..
Documentation
-------------
- patch #1005936, bug #1009373: fix index entries which contain
an underscore when viewed with Acrobat.
- bug #990669: os.path.normpath may alter the meaning of a path if
it contains symbolic links. This has been documented in a comment
since 1992, but is now in the library reference as well.
New platforms
-------------
- FreeBSD 6 is now supported.
Tests
-----
..
Windows
-------
- Boosted the stack reservation for python.exe and pythonw.exe from
the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
within the default sys.getrecursionlimit() default value of 1000 were
able to suffer undetected C stack overflows. The standard test program
test_compiler was one such program. If a Python process on Windows
"just vanishes" without a trace, and without an error message of any
kind, but with an exit code of 128, undetected stack overflow may be
the problem.
Mac
---
..
What's New in Python 2.4 alpha 2?
=================================
*Release date: 05-AUG-2004*
Core and builtins
-----------------
- Patch #980695: Implements efficient string concatenation for statements
of the form s=s+t and s+=t. This will vary across implementations.
Accordingly, the str.join() method is strongly preferred for performance
sensitive code.
- PEP-0318, Function Decorators have been added to the language. These are
implemented using the Java-style @decorator syntax, like so::
@staticmethod
def foo(bar):
(The PEP needs to be updated to reflect the current state)
- When importing a module M raises an exception, Python no longer leaves M
in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
succeed, picking up a module object from sys.modules reflecting as much
of the initialization of M as completed before the exception was raised.
Subsequent imports got no indication that M was in a partially-
initialized state, and the importers could get into arbitrarily bad
trouble as a result (the M they got was in an unintended state,
arbitrarily far removed from M's author's intent). Now subsequent
imports of M will continue raising exceptions (but if, for example, the
source code for M is edited between import attempts, then perhaps later
attempts will succeed, or raise a different exception).
This can break existing code, but in such cases the code was probably
working before by accident. In the Python source, the only case of
breakage discovered was in a test accidentally relying on a damaged
module remaining in sys.modules. Cases are also known where tests
deliberately provoking import errors remove damaged modules from
sys.modules themselves, and such tests will break now if they do an
unconditional del sys.modules[M].
- u'%s' % obj will now try obj.__unicode__() first and fallback to
obj.__str__() if no __unicode__ method can be found.
- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
- Allow string and unicode return types from .encode()/.decode()
methods on string and unicode objects. Added unicode.decode()
which was missing for no apparent reason.
- An attempt to fix the mess that is Python's behaviour with
signal handlers and threads, complicated by readline's behaviour.
It's quite possible that there are still bugs here.
- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
types that support garbage collection.
- Compiler now treats None as a constant.
- The type of values returned by __int__, __float__, __long__,
__oct__, and __hex__ are now checked. Returning an invalid type
will cause a TypeError to be raised. This matches the behavior of
Jython.
- Implemented bind_textdomain_codeset() in locale module.
- Added a workaround for proper string operations in BSDs. str.split
and str.is* methods can now work correctly with UTF-8 locales.
- Bug #989185: unicode.iswide() and unicode.width() is dropped and
the East Asian Width support is moved to unicodedata extension
module.
- Patch #941229: The source code encoding in interactive mode
now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
allows for non-latin-1 users to write unicode strings directly.
Extension modules
-----------------
- cpickle now supports the same keyword arguments as pickle.
Library
-------
- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
TIS-620
- Thanks to Edward Loper, doctest has been massively refactored, and
many new features were added. Full docs will appear later. For now
the doctest module comments and new test cases give good coverage.
The refactoring provides many hook points for customizing behavior
(such as how to report errors, and how to compare expected to actual
output). New features include a <BLANKLINE> marker for expected
output containing blank lines, options to produce unified or context
diffs when actual output doesn't match expectations, an option to
normalize whitespace before comparing, and an option to use an
ellipsis to signify "don't care" regions of output.
- Tkinter now supports the wish -sync and -use options.
- The following methods in time support passing of None: ctime(), gmtime(),
and localtime(). If None is provided, the current time is used (the
same as when the argument is omitted).
[SF bug 658254, patch 663482]
- nntplib does now allow to ignore a .netrc file.
- urllib2 now recognizes Basic authentication even if other authentication
schemes are offered.
- Bug #1001053. wave.open() now accepts unicode filenames.
- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
underlying file object (provided it has a fileno() method). This is
needed if you want to use os.fsync() on a GzipFile.
- imaplib has two new methods: deleteacl and myrights.
- nntplib has two new methods: description and descriptions. They
use a more RFC-compliant way of getting a newsgroup description.
- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
raised during interpreter shutdown from a registered function with atexit
when dummy_threading is being used.
- Bug #857297/Patch #916874. Fix an error when extracting a hard link
from a tarfile.
- Patch #846659. Fix an error in tarfile.py when using
GNU longname/longlink creation.
- The obsolete FCNTL.py has been deleted. The builtin fcntl module
has been available (on platforms that support fcntl) since Python
1.5a3, and all FCNTL.py did is export fcntl's names, after generating
a deprecation warning telling you to use fcntl directly.
- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
iso2022_jp_2004, shift_jis_2004.
- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
implementations, exploiting Conditions (which didn't exist at the time
Queue was introduced). A minor semantic change is that the Full and
Empty exceptions raised by non-blocking calls now occur only if the
queue truly was full or empty at the instant the queue was checked (of
course the Queue may no longer be full or empty by the time a calling
thread sees those exceptions, though). Before, the exceptions could
also be raised if it was "merely inconvenient" for the implementation
to determine the true state of the Queue (because the Queue was locked
by some other method in progress).
- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
case of comparing two empty lists. This affected both context_diff() and
unified_diff(),
- Bug #980938: smtplib now prints debug output to sys.stderr.
- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
returning the last point in the path that was not part of any loop. Thanks
AM Kuchling.
- Bug #980327: ntpath not handles compressing erroneous slashes between the
drive letter and the rest of the path. Also clearly handles UNC addresses now
as well. Thanks Paul Moore.
- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
for file sizes (compressed and uncompressed) was being stored as signed
instead of unsigned.
- decimal.py now only uses signals in the IBM spec. The other conditions are
no longer part of the public API.
- codecs module now has two new generic APIs: encode() and decode()
which don't restrict the return types (unlike the unicode and
string methods of the same name).
- Non-blocking SSL sockets work again; they were broken in Python 2.3.
SF patch 945642.
- doctest unittest integration improvements:
o Improved the unitest test output for doctest-based unit tests
o Can now pass setUp and tearDown functions when creating
DocTestSuites.
- The threading module has a new class, local, for creating objects
that provide thread-local data.
- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
no longer returns spurious empty fields.
- Implemented bind_textdomain_codeset() in gettext module.
- Introduced in gettext module the l*gettext() family of functions,
which return translation strings encoded in the preferred encoding,
as informed by locale module's getpreferredencoding().
- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
- Add expansion of default values in help text: the string
"%default" in an option's help string is expanded to str() of
that option's default value, or "none" if no default value.
- Bug #955889: option default values that happen to be strings are
now processed in the same way as values from the command line; this
allows generation of nicer help when using custom types. Can
be disabled with parser.set_process_default_values(False).
- Bug #960515: don't crash when generating help for callback
options that specify 'type', but not 'dest' or 'metavar'.
- Feature #815264: change the default help format for short options
that take an argument from e.g. "-oARG" to "-o ARG"; add
set_short_opt_delimiter() and set_long_opt_delimiter() methods to
HelpFormatter to allow (slight) customization of the formatting.
- Patch #736940: internationalize Optik: all built-in user-
targeted literal strings are passed through gettext.gettext(). (If
you want translations (.po files), they're not included with Python
-- you'll find them in the Optik source distribution from