~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

Viewing changes to Misc/HISTORY

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Python History
 
2
--------------
 
3
 
 
4
This file contains the release messages for previous Python releases.
 
5
As you read on you go back to the dark ages of Python's history.
 
6
(Note: news about 2.5c2 and later 2.5 releases is in the Misc/NEWS
 
7
file of the release25-maint branch.)
 
8
 
 
9
 
 
10
======================================================================
 
11
 
 
12
 
 
13
What's New in Python 3.0 final
 
14
==============================
 
15
 
 
16
*Release date: 03-Dec-2008*
 
17
 
 
18
Core and Builtins
 
19
-----------------
 
20
 
 
21
- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
 
22
  interpreter to abort ("Fatal Python error: Could not reset the stack!")
 
23
  instead of throwing a MemoryError.
 
24
 
 
25
- Issue #3689: The list reversed iterator now supports __length_hint__
 
26
  instead of __len__.  Behavior now matches other reversed iterators.
 
27
 
 
28
- Issue #4367: Python would segfault during compiling when the unicodedata
 
29
  module couldn't be imported and \N escapes were present.
 
30
 
 
31
- Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
 
32
 
 
33
Library
 
34
-------
 
35
 
 
36
- Issue #4387: binascii now refuses to accept str as binary input.
 
37
 
 
38
- Issue #4073: Add 2to3 support to build_scripts, refactor that support
 
39
  in build_py.
 
40
 
 
41
- IDLE would print a "Unhandled server exception!" message when internal
 
42
  debugging is enabled.
 
43
 
 
44
- Issue #4455: IDLE failed to display the windows list when two windows have
 
45
  the same title.
 
46
 
 
47
- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
 
48
  exception.
 
49
 
 
50
- Issue #4433: Fixed an access violation when garbage collecting
 
51
  _ctypes.COMError instances.
 
52
 
 
53
- Issue #4429: Fixed UnicodeDecodeError in ctypes.
 
54
 
 
55
- Issue #4373: Corrected a potential reference leak in the pickle module and
 
56
  silenced a false positive ref leak in distutils.tests.test_build_ext.
 
57
 
 
58
- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
 
59
  files.
 
60
 
 
61
- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
 
62
  fail to properly display the error message.
 
63
 
 
64
Build
 
65
-----
 
66
 
 
67
- Issue #4407: Fix source file that caused the compileall step in Windows installer
 
68
  to fail.
 
69
 
 
70
Docs
 
71
----
 
72
 
 
73
- Issue #4449: Fixed multiprocessing examples
 
74
 
 
75
- Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
 
76
  for keys and values which will be converted to bytes before committal.
 
77
 
 
78
 
 
79
What's New in Python 3.0 release candidate 3?
 
80
=============================================
 
81
 
 
82
*Release date: 20-Nov-2008*
 
83
 
 
84
 
 
85
Core and Builtins
 
86
-----------------
 
87
 
 
88
- Issue #4349: sys.path included a non-existent platform directory because of a
 
89
  faulty Makefile.
 
90
 
 
91
- Issue #3327: Don't overallocate in the modules_by_index list.
 
92
 
 
93
- Issue #1721812:  Binary set operations and copy() returned the input type
 
94
  instead of the appropriate base type.  This was incorrect because set
 
95
  subclasses would be created without their __init__() method being called.
 
96
  The corrected behavior brings sets into line with lists and dicts.
 
97
 
 
98
- Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates to
 
99
  True, even when x doesn't compare equal to itself.  This was a regression
 
100
  from 2.6.
 
101
 
 
102
- Issue #3705: Command-line arguments were not correctly decoded when the
 
103
  terminal does not use UTF8.
 
104
 
 
105
Library
 
106
-------
 
107
 
 
108
- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
 
109
  the ctypes module is not present.
 
110
 
 
111
- FileIO's mode attribute now always includes ``"b"``.
 
112
 
 
113
- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String
 
114
  keys are now written out in UTF-8.
 
115
 
 
116
- Issue #4338: Fix distutils upload command.
 
117
 
 
118
- Issue #4354: Fix distutils register command.
 
119
 
 
120
- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
 
121
 
 
122
- Issue #4307: The named tuple that ``inspect.getfullargspec()`` returns now
 
123
  uses ``kwonlydefaults`` instead of ``kwdefaults``.
 
124
 
 
125
- Issue #4298: Fix a segfault when pickle.loads is passed a ill-formed input.
 
126
 
 
127
- Issue #4283: Fix a left-over "iteritems" call in distutils.
 
128
 
 
129
Build
 
130
-----
 
131
 
 
132
- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
 
133
 
 
134
- Issue #4289: Remove Cancel button from AdvancedDlg.
 
135
 
 
136
- Issue #1656675: Register a drop handler for .py* files on Windows.
 
137
 
 
138
Tools/Demos
 
139
-----------
 
140
 
 
141
- Demos of the socketserver module now work with Python 3.
 
142
 
 
143
 
 
144
What's New in Python 3.0 release candidate 2
 
145
============================================
 
146
 
 
147
*Release date: 05-Nov-2008*
 
148
 
 
149
Core and Builtins
 
150
-----------------
 
151
 
 
152
- Issue #4211: The __path__ attribute of frozen packages is now a list instead
 
153
  of a string as required by PEP 302.
 
154
 
 
155
- Issue #3727: Fixed poplib.
 
156
 
 
157
- Issue #3714: Fixed nntplib by using bytes where appropriate.
 
158
 
 
159
- Issue #1210: Fixed imaplib and its documentation.
 
160
 
 
161
- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` 
 
162
  method on file objects with closefd=False. The file descriptor is still
 
163
  kept open but the file object behaves like a closed file. The ``FileIO``
 
164
  object also got a new readonly attribute ``closefd``.
 
165
 
 
166
- Issue #3626: On cygwin, starting python with a non-existent script name
 
167
  would not display anything if the file name is only 1 character long.
 
168
 
 
169
- Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
 
170
  method does not return iterators for the 4th and 5th items.
 
171
 
 
172
- Issue #3723: Fixed initialization of subinterpreters.
 
173
 
 
174
- Issue #4213: The file system encoding is now normalized by the
 
175
  codec subsystem, for example UTF-8 is turned into utf-8.
 
176
 
 
177
- Issue #4200: Changed the atexit module to store its state in its
 
178
  PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
 
179
 
 
180
- Issue #4237: io.FileIO() was raising invalid warnings caused by
 
181
  insufficient initialization of PyFileIOObject struct members.
 
182
 
 
183
- Issue #4170: Pickling a collections.defaultdict object would crash the
 
184
  interpreter.
 
185
 
 
186
- Issue #4146: Compilation on OpenBSD has been restored.
 
187
 
 
188
- Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
 
189
 
 
190
- Issues #2384 and #3975: Tracebacks were not correctly printed when the
 
191
  source file contains a ``coding:`` header: the wrong line was displayed, and
 
192
  the encoding was not respected.
 
193
 
 
194
- Issue #3740: Null-initialize module state.
 
195
 
 
196
- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
 
197
 
 
198
- Issue #1688: On Windows, the input() prompt was not correctly displayed if it
 
199
  contains non-ascii characters.
 
200
 
 
201
- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
 
202
 
 
203
Library
 
204
-------
 
205
 
 
206
- Issue #3664: The pickle module could segfault if a subclass of Pickler fails
 
207
  to call the base __init__ method.
 
208
 
 
209
- Issue #3725: telnetlib now works completely in bytes.
 
210
 
 
211
- Issue #4072: Restore build_py_2to3.
 
212
 
 
213
- Issue #4014: Don't claim that Python has an Alpha release status, in addition
 
214
  to claiming it is Mature.
 
215
 
 
216
- Issue #3187: Add sys.setfilesystemencoding.
 
217
 
 
218
- Issue #3187: Better support for "undecodable" filenames.  Code by Victor
 
219
  Stinner, with small tweaks by GvR.
 
220
 
 
221
- Issue #3965: Allow repeated calls to turtle.Screen, by making it a
 
222
  true singleton object.
 
223
 
 
224
- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
 
225
 
 
226
- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
 
227
  raise a TypeError: "'tuple' object is not callable" instead of the expected
 
228
  dbm.error.
 
229
 
 
230
- Bug #3884: Make the turtle module toplevel again.
 
231
 
 
232
- Issue #3547: Fixed ctypes structures bitfields of varying integer
 
233
  sizes.
 
234
 
 
235
Extension Modules
 
236
-----------------
 
237
 
 
238
- Issue #3659: Subclasses of str didn't work as SQL parameters.
 
239
 
 
240
Build
 
241
-----
 
242
 
 
243
- Issue #4120: Exclude manifest from extension modules in VS2008.
 
244
 
 
245
- Issue #4091: Install pythonxy.dll in system32 again.
 
246
 
 
247
- Issue #4018: Disable "for me" installations on Vista.
 
248
 
 
249
- Issue #4204: Fixed module build errors on FreeBSD 4.
 
250
 
 
251
Tools/Demos
 
252
-----------
 
253
 
 
254
- Issue #3717: Fix Demo/embed/demo.c.
 
255
 
 
256
- Issue #4072: Add a distutils demo for build_py_2to3.
 
257
 
 
258
 
 
259
What's New in Python 3.0 release candidate 1
 
260
============================================
 
261
 
 
262
*Release date: 17-Sep-2008*
 
263
 
 
264
Core and Builtins
 
265
-----------------
 
266
 
 
267
- Issue #3827: memoryview lost its size attribute in favor of using len(view).
 
268
 
 
269
- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
 
270
 
 
271
- Issue #3705: fix crash when given a non-ascii value on the command line for
 
272
  the "-c" and "-m" parameters. Now the behaviour is as expected under Linux,
 
273
  although under Windows it fails at a later point.
 
274
 
 
275
- Issue #3279: Importing site at interpreter was failing silently because the
 
276
  site module uses the open builtin which was not initialized at the time.
 
277
 
 
278
- Issue #3660: Corrected a reference leak in str.encode() when the encoder
 
279
  does not return a bytes object.
 
280
 
 
281
- Issue #3774: Added a few more checks in PyTokenizer_FindEncoding to handle
 
282
  error conditions.
 
283
 
 
284
- Issue #3594: Fix Parser/tokenizer.c:fp_setreadl() to open the file being
 
285
  tokenized by either a file path or file pointer for the benefit of
 
286
  PyTokenizer_FindEncoding().
 
287
 
 
288
- Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin. On
 
289
  these systems, the mbstowcs() function is slightly buggy and must be
 
290
  replaced with strlen() for the purpose of counting of number of wide
 
291
  characters needed to represent the multi-byte character string.
 
292
 
 
293
- Issue #3697: "Fatal Python error: Cannot recover from stack overflow"
 
294
  could be easily encountered under Windows in debug mode when exercising
 
295
  the recursion limit checking code, due to bogus handling of recursion
 
296
  limit when USE_STACKCHEK was enabled.
 
297
 
 
298
- Issue 3639: The _warnings module could segfault the interpreter when
 
299
  unexpected types were passed in as arguments.
 
300
 
 
301
- Issue #3712: The memoryview object had a reference leak and didn't support
 
302
  cyclic garbage collection.
 
303
 
 
304
- Issue #3668: Fix a memory leak with the "s*" argument parser in
 
305
  PyArg_ParseTuple and friends, which occurred when the argument for "s*" 
 
306
  was correctly parsed but parsing of subsequent arguments failed.
 
307
 
 
308
- Issue #3611: An exception __context__ could be cleared in a complex pattern
 
309
  involving a __del__ method re-raising an exception.
 
310
 
 
311
- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to 
 
312
  match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
 
313
  mechanism. In the process, fix a bug where isinstance() and issubclass(),
 
314
  when given a tuple of classes as second argument, were looking up
 
315
  __instancecheck__ / __subclasscheck__ on the tuple rather than on each
 
316
  type object.
 
317
 
 
318
- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
 
319
 
 
320
- Issue #3651: Fix various memory leaks when using the buffer
 
321
  interface, or when the "s#" code of PyArg_ParseTuple is given a
 
322
  bytes object.
 
323
 
 
324
- Issue #3657: Fix uninitialized memory read when pickling longs.
 
325
  Found by valgrind.
 
326
 
 
327
- Apply security patches from Apple.
 
328
 
 
329
- Fix crashes on memory allocation failure found with failmalloc.
 
330
 
 
331
- Fix memory leaks found with valgrind and update suppressions file.
 
332
 
 
333
- Fix compiler warnings in opt mode which would lead to invalid memory reads.
 
334
 
 
335
- Fix problem using wrong name in decimal module reported by pychecker.
 
336
 
 
337
- Issue #3650: Fixed a reference leak in bytes.split('x').
 
338
 
 
339
- bytes(o) now tries to use o.__bytes__() before using fallbacks.
 
340
 
 
341
- Issue #1204: The configure script now tests for additional libraries
 
342
  that may be required when linking against readline.  This fixes issues
 
343
  with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
 
344
 
 
345
C API
 
346
-----
 
347
 
 
348
- PyObject_Bytes and PyBytes_FromObject were added.
 
349
 
 
350
Library
 
351
-------
 
352
 
 
353
- Issue #3756: make re.escape() handle bytes as well as str.
 
354
 
 
355
- Issue #3800: fix filter() related bug in formatter.py.
 
356
 
 
357
- Issue #874900: fix behaviour of threading module after a fork.
 
358
 
 
359
- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
 
360
 
 
361
- Issue #3776: Deprecate the bsddb package for removal in 3.0.
 
362
 
 
363
- Issue #3762: platform.architecture() fails if python is lanched via
 
364
  its symbolic link.
 
365
 
 
366
- Issue #3660: fix a memory leak in the C accelerator of the pickle module.
 
367
 
 
368
- Issue #3160: the "bdist_wininst" distutils command didn't work.
 
369
 
 
370
- Issue #1658: tkinter changes dict size during iteration in both
 
371
    tkinter.BaseWidget and tkinter.scrolledtext.ScrolledText.
 
372
 
 
373
- The bsddb module (and therefore the dbm.bsd module) has been removed.
 
374
  It is now maintained outside of the standard library at
 
375
  http://www.jcea.es/programacion/pybsddb.htm.
 
376
 
 
377
- Issue 600362:  Relocated parse_qs() and parse_qsl(), from the cgi module
 
378
  to the urlparse one.  Added a DeprecationWarning in the old module, it
 
379
  will be deprecated in the future.
 
380
 
 
381
- Issue #3719: platform.architecture() fails if there are spaces in the
 
382
  path to the Python binary.
 
383
 
 
384
- Issue 3602: As part of the merge of r66135, make the parameters on
 
385
  warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning.
 
386
 
 
387
- The deprecation warnings for the camelCase threading API names were removed.
 
388
 
 
389
- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing 
 
390
  SEM_VALUE_MAX.
 
391
 
 
392
Extension Modules
 
393
-----------------
 
394
 
 
395
- Issue #3782: os.write() must not accept unicode strings.
 
396
 
 
397
- Issue #2975: When compiling several extension modules with Visual Studio 2008
 
398
  from the same python interpreter, some environment variables would grow
 
399
  without limit.
 
400
 
 
401
- Issue #3643: Added a few more checks to _testcapi to prevent segfaults by
 
402
  exploitation of poor argument checking.
 
403
 
 
404
- bsddb code updated to version 4.7.3pre2. This code is the same than
 
405
  Python 2.6 one, since the intention is to keep an unified 2.x/3.x codebase.
 
406
  The Python code is automatically translated using "2to3". Please, do not
 
407
  update this code in Python 3.0 by hand. Update the 2.6 one and then
 
408
  do "2to3".
 
409
 
 
410
- The _bytesio and _stringio modules are now compiled into the python binary.
 
411
 
 
412
- Issue #3492 and #3790: Fixed the zlib module and zipimport module uses of
 
413
  mutable bytearray objects where they should have been using immutable bytes.
 
414
 
 
415
- Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to
 
416
  return bytes objects instead of bytearray objects.
 
417
 
 
418
 
 
419
Tools/Demos
 
420
-----------
 
421
 
 
422
- Fix Misc/gdbinit so it works.
 
423
 
 
424
 
 
425
Build
 
426
-----
 
427
 
 
428
- Issue #3812: Failed to build python if configure --without-threads.
 
429
 
 
430
- Issue #3791: Remove the bsddb module from the Windows installer, and the
 
431
  core bsddb library from the Windows build files.
 
432
 
 
433
 
 
434
What's new in Python 3.0b3?
 
435
===========================
 
436
 
 
437
*Release date: 20-Aug-2008*
 
438
 
 
439
Core and Builtins
 
440
-----------------
 
441
 
 
442
- Issue #3653: Fix a segfault when sys.excepthook was called with invalid
 
443
  arguments.
 
444
 
 
445
- Issue #2394: implement more of the memoryview API, with the caveat that
 
446
  only one-dimensional contiguous buffers are supported and exercised right
 
447
  now. Slicing, slice assignment and comparison (equality and inequality)
 
448
  have been added. Also, the tolist() method has been implemented, but only
 
449
  for byte buffers. Endly, the API has been updated to return bytes objects
 
450
  wherever it used to return bytearrays.
 
451
 
 
452
- Issue #3560: clean up the new C PyMemoryView API so that naming is
 
453
  internally consistent; add macros PyMemoryView_GET_BASE() and
 
454
  PyMemoryView_GET_BUFFER() to access useful properties of a memory views
 
455
  without relying on a particular implementation; remove the ill-named
 
456
  PyMemoryView() function (PyMemoryView_GET_BUFFER() can be used instead).
 
457
 
 
458
- ctypes function pointers that are COM methods have a boolean True
 
459
  value again.
 
460
 
 
461
- Issue #1819: function calls with several named parameters are now on
 
462
  average 35% faster (as measured by pybench).
 
463
 
 
464
- The undocumented C APIs PyUnicode_AsString() and
 
465
  PyUnicode_AsStringAndSize() were made private to the interpreter, in
 
466
  order to be able to refine their interfaces for Python 3.1.
 
467
 
 
468
  If you need to access the UTF-8 representation of a Unicode object
 
469
  as bytes string, please use PyUnicode_AsUTF8String() instead.
 
470
 
 
471
- Issue #3460: PyUnicode_Join() implementation is 10% to 80% faster thanks
 
472
  to Python 3.0's stricter semantics which allow to avoid successive
 
473
  reallocations of the result string (this also affects str.join()).
 
474
 
 
475
 
 
476
Library
 
477
-------
 
478
 
 
479
- Issue #1276: Added temporary aliases for CJK Mac encodings to resolve
 
480
  a build problem on MacOS with CJK locales.  It adds four temporary
 
481
  mappings to existing legacy codecs that are virtually compatible
 
482
  with Mac encodings.  They will be replaced by codecs correctly
 
483
  implemented in 3.1.
 
484
 
 
485
- Issue #3614: Corrected a typo in xmlrpc.client, leading to a NameError
 
486
  "global name 'header' is not defined".
 
487
 
 
488
- Issue #2834: update the regular expression library to match the unicode
 
489
  standards of py3k. In other words, mixing bytes and unicode strings
 
490
  (be it as pattern, search string or replacement string) raises a TypeError.
 
491
  Moreover, the re.UNICODE flag is enabled automatically for unicode patterns,
 
492
  and can be disabled by specifying a new re.ASCII flag; as for bytes
 
493
  patterns, ASCII matching is the only option and trying to specify re.UNICODE
 
494
  for such patterns raises a ValueError.
 
495
 
 
496
- Issue #3300: make urllib.parse.[un]quote() default to UTF-8.
 
497
  Code contributed by Matt Giuca.  quote() now encodes the input
 
498
  before quoting, unquote() decodes after unquoting.  There are
 
499
  new arguments to change the encoding and errors settings.
 
500
  There are also new APIs to skip the encode/decode steps.
 
501
  [un]quote_plus() are also affected.
 
502
 
 
503
- Issue #2235: numbers.Number now blocks inheritance of the default id()
 
504
  based hash because that hash mechanism is not correct for numeric types.
 
505
  All concrete numeric types that inherit from Number (rather than just
 
506
  registering with it) must explicitly provide a hash implementation in
 
507
  order for their instances to be hashable.
 
508
 
 
509
- Issue #2676: in the email package, content-type parsing was hanging on
 
510
  pathological input because of quadratic or exponential behaviour of a
 
511
  regular expression.
 
512
 
 
513
- Issue #3476: binary buffered reading through the new "io" library is now
 
514
  thread-safe.
 
515
 
 
516
- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
 
517
  menu entries were not deleted.
 
518
 
 
519
- Remove the TarFileCompat class from tarfile.py.
 
520
 
 
521
- Issue #2491: os.fdopen is now almost an alias for the built-in open(), and
 
522
  accepts the same parameters.  It just checks that its first argument is an
 
523
  integer.
 
524
 
 
525
- Issue #3394: zipfile.writestr sets external attributes when passed a
 
526
  file name rather than a ZipInfo instance, so files are extracted with
 
527
  mode 0600 rather than 000 under Unix.
 
528
 
 
529
- Issue #2523: Fix quadratic behaviour when read()ing a binary file without
 
530
  asking for a specific length.
 
531
 
 
532
Extension Modules
 
533
-----------------
 
534
 
 
535
- Bug #3542: Support Unicode strings in _msi module.
 
536
 
 
537
What's new in Python 3.0b2?
 
538
===========================
 
539
 
 
540
*Release date: 17-Jul-2008*
 
541
 
 
542
Core and Builtins
 
543
-----------------
 
544
 
 
545
- Issue #3008: the float type has a new instance method 'float.hex'
 
546
  and a new class method 'float.fromhex' to convert floating-point
 
547
  numbers to and from hexadecimal strings, respectively.
 
548
 
 
549
- Issue #3083: Add alternate (#) formatting for bin, oct, hex output
 
550
  for str.format().  This adds the prefix 0b, 0o, or 0x, respectively.
 
551
 
 
552
- Issue #3280: like chr(), the "%c" format now accepts unicode code points
 
553
  beyond the Basic Multilingual Plane (above 0xffff) on all configurations. On
 
554
  "narrow Unicode" builds, the result is a string of 2 code units, forming a
 
555
  UTF-16 surrogate pair.
 
556
 
 
557
- Issue #3282: str.isprintable() should return False for undefined
 
558
  Unicode characters.
 
559
 
 
560
- Issue #3236: Return small longs from PyLong_FromString.
 
561
 
 
562
- Exception tracebacks now support exception chaining.
 
563
 
 
564
Library
 
565
-------
 
566
 
 
567
- Removed the sunaudio module. Use sunau instead.
 
568
 
 
569
- Issue #3554: ctypes.string_at and ctypes.wstring_at did call Python
 
570
  api functions without holding the GIL, which could lead to a fatal
 
571
  error when they failed.
 
572
 
 
573
- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
 
574
 
 
575
- Removed "ast" function aliases from the parser module.
 
576
 
 
577
- Issue #3313: Fixed a crash when a failed dlopen() call does not set
 
578
  a valid dlerror() message.
 
579
 
 
580
- Issue #3258: Fixed a crash when a ctypes POINTER type to an
 
581
  incomplete structure was created.
 
582
 
 
583
- Issue #2683: Fix inconsistency in subprocess.Popen.communicate(): the
 
584
  argument now must be a bytes object in any case.
 
585
 
 
586
- Issue #3145: help("modules whatever") failed when trying to load the source
 
587
  code of every single module of the standard library, including invalid files
 
588
  used in the test suite.
 
589
 
 
590
- The gettext library now consistently uses Unicode strings for message ids
 
591
  and message strings, and ``ugettext()`` and the like don't exist anymore.
 
592
 
 
593
- The traceback module has been expanded to handle chained exceptions.
 
594
 
 
595
C API
 
596
-----
 
597
 
 
598
- Issue #3247: the function Py_FindMethod was removed. Modern types should
 
599
  use the tp_methods slot instead.
 
600
 
 
601
Tools/Demos
 
602
-----------
 
603
 
 
604
- The Mac/Demos directory has been removed.
 
605
 
 
606
- All of the Mac scripts have been removed (including BuildApplet.py).
 
607
 
 
608
 
 
609
What's new in Python 3.0b1?
 
610
===========================
 
611
 
 
612
*Release date: 18-Jun-2008*
 
613
 
 
614
Core and Builtins
 
615
-----------------
 
616
 
 
617
- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
 
618
  argument being anything other than a dict or None. Also fixed a bug in error
 
619
  handling when 'message' and 'category' were both set to None, triggering a
 
620
  bus error.
 
621
 
 
622
- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
 
623
  holds the last (strong) reference to its referent.
 
624
 
 
625
- Issue #2630: implement PEP 3138. repr() now returns printable
 
626
  Unicode characters unescaped, to get an ASCII-only representation
 
627
  of an object use ascii().
 
628
 
 
629
- Issue #1342: On windows, Python could not start when installed in a
 
630
  directory with non-ascii characters.
 
631
 
 
632
- Implement PEP 3121: new module initialization and finalization API.
 
633
 
 
634
- Removed the already-defunct ``-t`` option.
 
635
 
 
636
- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
 
637
  unmarshalling many code objects, which happens when importing a
 
638
  large .pyc file (~1000 functions).
 
639
 
 
640
- Issue #2963: fix merging oversight that disabled method cache for
 
641
  all types.
 
642
 
 
643
- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
 
644
 
 
645
- Issue #2895: Don't crash when given bytes objects as keyword names.
 
646
 
 
647
- Issue #2798: When parsing arguments with PyArg_ParseTuple, the "s"
 
648
  code now allows any unicode string and returns a utf-8 encoded
 
649
  buffer, just like the "s#" code already does.  The "z" code was
 
650
  corrected as well.
 
651
 
 
652
- Issue #2863: generators now have a ``gen.__name__`` attribute that
 
653
  equals ``gen.gi_code.co_name``, like ``func.__name___`` that equals
 
654
  ``func.func_code.co_name``.  The repr() of a generator now also
 
655
  contains this name.
 
656
 
 
657
- Issue #2831: enumerate() now has a ``start`` argument.
 
658
 
 
659
- Issue #2801: fix bug in the float.is_integer method where a
 
660
  ValueError was sometimes incorrectly raised.
 
661
 
 
662
- The ``--with-toolbox-glue`` option (and the associated
 
663
  pymactoolbox.h) have been removed.
 
664
 
 
665
- Issue #2196: hasattr() now lets exceptions which do not inherit
 
666
  Exception (KeyboardInterrupt, and SystemExit) propagate instead of
 
667
  ignoring them.
 
668
 
 
669
- #3021 Exception reraising sematics have been significantly improved.  However,
 
670
  f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
 
671
  code anymore.
 
672
 
 
673
- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
 
674
  removed.
 
675
 
 
676
Extension Modules
 
677
-----------------
 
678
 
 
679
- Renamed ``_winreg`` module to ``winreg``.
 
680
 
 
681
- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the
 
682
  platform.
 
683
 
 
684
- Support for Windows 9x has been removed from the winsound module.
 
685
 
 
686
- Issue #2870: cmathmodule.c compile error.
 
687
 
 
688
Library
 
689
-------
 
690
 
 
691
- The methods ``is_in_tuple()``, ``is_vararg()``, and ``is_keywordarg()`` of
 
692
  symtable.Symbol have been removed.
 
693
 
 
694
- Patch #3133: http.server.CGIHTTPRequestHandler did not work on windows.
 
695
 
 
696
- a new ``urllib`` package was created.  It consists of code from
 
697
  ``urllib``, ``urllib2``, ``urlparse``, and ``robotparser``.  The old
 
698
  modules have all been removed.  The new package has five submodules:
 
699
  ``urllib.parse``, ``urllib.request``, ``urllib.response``,
 
700
  ``urllib.error``, and ``urllib.robotparser``.  The
 
701
  ``urllib.request.urlopen()`` function uses the url opener from
 
702
  ``urllib2``.  (Note that the unittests have not been renamed for the
 
703
  beta, but they will be renamed in the future.)
 
704
 
 
705
- rfc822 has been removed in favor of the email package.
 
706
 
 
707
- mimetools has been removed in favor of the email package.
 
708
 
 
709
- Patch #2849: Remove use of rfc822 module from standard library.
 
710
 
 
711
- Added C optimized implementation of io.StringIO.
 
712
 
 
713
- The ``pickle`` module is now automatically use an optimized C
 
714
  implementation of Pickler and Unpickler when available. The
 
715
  ``cPickle`` module is no longer needed.
 
716
 
 
717
- Removed the ``htmllib`` and ``sgmllib`` modules.
 
718
 
 
719
- The deprecated ``SmartCookie`` and ``SimpleCookie`` classes have
 
720
  been removed from ``http.cookies``.
 
721
 
 
722
- The ``commands`` module has been removed. Its getoutput() and
 
723
  getstatusoutput() functions have been moved to the ``subprocess`` module.
 
724
 
 
725
- The ``http`` package was created; it contains the old ``httplib``
 
726
  as ``http.client``, ``Cookie`` as ``http.cookies``, ``cookielib``
 
727
  as ``http.cookiejar``, and the content of the three ``HTTPServer``
 
728
  modules as ``http.server``.
 
729
 
 
730
- The ``xmlrpc`` package was created; it contains the old
 
731
  ``xmlrpclib`` module as ``xmlrpc.client`` and the content of
 
732
  the old ``SimpleXMLRPCServer`` and ``DocXMLRPCServer`` modules
 
733
  as ``xmlrpc.server``.
 
734
 
 
735
- The ``dbm`` package was created, containing the old modules
 
736
  ``anydbm`` and ``whichdb`` in its ``__init__.py``, and having
 
737
  ``dbm.gnu`` (was ``gdbm``), ``dbm.bsd`` (was ``dbhash``),
 
738
  ``dbm.ndbm`` (was ``dbm``) and ``dbm.dumb`` (was ``dumbdbm``)
 
739
  as submodules.
 
740
 
 
741
- The ``repr`` module has been renamed to ``reprlib``.
 
742
 
 
743
- The ``statvfs`` module has been removed.
 
744
 
 
745
- Issue #1713041: fix pprint's handling of maximum depth.
 
746
 
 
747
- Issue #2250: Exceptions raised during evaluation of names in
 
748
  rlcompleter's ``Completer.complete()`` method are now caught and
 
749
  ignored.
 
750
 
 
751
- Patch #2659: Added ``break_on_hyphens`` option to textwrap's
 
752
  ``TextWrapper`` class.
 
753
 
 
754
- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
 
755
  large to fit in a C long.  ldexp(x, n) now returns a zero (with
 
756
  suitable sign) if n is large and negative; previously, it raised
 
757
  OverflowError.
 
758
 
 
759
- The ``ConfigParser`` module has been renamed to ``configparser``.
 
760
 
 
761
- Issue #2865: webbrowser.open() works again in a KDE environment.
 
762
 
 
763
- The ``multifile`` module has been removed.
 
764
 
 
765
- The ``SocketServer`` module has been renamed to ``socketserver``.
 
766
 
 
767
- Fixed the ``__all__`` setting on ``collections`` to include
 
768
  ``UserList`` and ``UserString``.
 
769
 
 
770
- The sre module has been removed.
 
771
 
 
772
- The Queue module has been renamed to queue.
 
773
 
 
774
- The copy_reg module has been renamed to copyreg.
 
775
 
 
776
- The mhlib module has been removed.
 
777
 
 
778
- The ihooks module has been removed.
 
779
 
 
780
- The fpformat module has been removed.
 
781
 
 
782
- The dircache module has been removed.
 
783
 
 
784
- The Canvas module has been removed.
 
785
 
 
786
- The Decimal module gained the magic methods __round__, __ceil__,
 
787
  __floor__ and __trunc__, to give support for round, math.ceil,
 
788
  math.floor and math.trunc.
 
789
 
 
790
- The user module has been removed.
 
791
 
 
792
- The mutex module has been removed.
 
793
 
 
794
- The imputil module has been removed.
 
795
 
 
796
- os.path.walk has been removed in favor of os.walk.
 
797
 
 
798
- pdb gained the "until" command.
 
799
 
 
800
- The test.test_support module has been renamed to test.support.
 
801
 
 
802
- The threading module API was renamed to be PEP 8 compliant.  The
 
803
  old names are still present, but will be removed in the near future.
 
804
 
 
805
Tools/Demos
 
806
-----------
 
807
 
 
808
- The bgen tool has been removed.
 
809
 
 
810
Build
 
811
-----
 
812
 
 
813
 
 
814
What's New in Python 3.0a5?
 
815
===========================
 
816
 
 
817
*Release date: 08-May-2008*
 
818
 
 
819
Core and Builtins
 
820
-----------------
 
821
 
 
822
- Fixed misbehaviour of PyLong_FromSsize_t on systems where
 
823
  sizeof(size_t) > sizeof(long).
 
824
 
 
825
- Issue #2221: Corrected a SystemError "error return without exception
 
826
  set", when the code executed by exec() raises an exception, and
 
827
  sys.stdout.flush() also raises an error.
 
828
 
 
829
- Bug #2565: The repr() of type objects now calls them 'class', not
 
830
  'type' - whether they are builtin types or not.
 
831
 
 
832
- The command line processing was converted to pass Unicode strings
 
833
  through as unmodified as possible; as a consequence, the C API
 
834
  related to command line arguments was changed to use wchar_t.
 
835
 
 
836
- All backslashes in raw strings are interpreted literally.  This
 
837
  means that '\u' and '\U' escapes are not treated specially.
 
838
 
 
839
Extension Modules
 
840
-----------------
 
841
 
 
842
Library
 
843
-------
 
844
 
 
845
- ctypes objects now support the PEP3118 buffer interface.
 
846
 
 
847
- Issue #2682: ctypes callback functions now longer contain a cyclic
 
848
  reference to themselves.
 
849
 
 
850
- Issue #2058: Remove the buf attribute and add __slots__ to the
 
851
  TarInfo class in order to reduce tarfile's memory usage.
 
852
 
 
853
- Bug #2606: Avoid calling .sort() on a dict_keys object.
 
854
 
 
855
- The bundled libffi copy is now in sync with the recently released
 
856
  libffi3.0.5 version, apart from some small changes to
 
857
  Modules/_ctypes/libffi/configure.ac.
 
858
 
 
859
Build
 
860
-----
 
861
 
 
862
- Issue #1496032: On alpha, use -mieee when gcc is the compiler.
 
863
 
 
864
- "make install" is now an alias for "make altinstall", to prevent
 
865
  accidentally overwriting a Python 2.x installation.  Use "make
 
866
  fullinstall" to force Python 3.0 to be installed as "python".
 
867
 
 
868
- Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when
 
869
  gcc is used as compiler.
 
870
 
 
871
 
 
872
What's New in Python 3.0a4?
 
873
===========================
 
874
 
 
875
*Release date: 02-Apr-2008*
 
876
 
 
877
Core and Builtins
 
878
-----------------
 
879
 
 
880
- Bug #2301: Don't try decoding the source code into the original
 
881
  encoding for syntax errors.
 
882
 
 
883
Extension Modules
 
884
-----------------
 
885
 
 
886
- The dl module was removed, use the ctypes module instead.
 
887
 
 
888
- Use wchar_t functions in _locale module.
 
889
 
 
890
Library
 
891
-------
 
892
 
 
893
- The class distutils.commands.build_py.build_py_2to3 can be used as a
 
894
  build_py replacement to automatically run 2to3 on modules that are
 
895
  going to be installed.
 
896
 
 
897
- A new pickle protocol (protocol 3) is added with explicit support
 
898
  for bytes.  This is the default protocol.  It intentionally cannot
 
899
  be unpickled by Python 2.x.
 
900
 
 
901
- When a pickle written by Python 2.x contains an (8-bit) str
 
902
  instance, this is now decoded to a (Unicode) str instance.  The
 
903
  encoding used to do this defaults to ASCII, but can be overridden
 
904
  via two new keyword arguments to the Unpickler class.  Previously
 
905
  this would create bytes instances, which is usually wrong: str
 
906
  instances are often used to pickle attribute names etc., and text is
 
907
  more common than binary data anyway.
 
908
 
 
909
- Default to ASCII as the locale.getpreferredencoding, if the POSIX
 
910
  system doesn't support CODESET and LANG isn't set or doesn't allow
 
911
  deduction of an encoding.
 
912
 
 
913
- Issue #1202: zlib.crc32 and zlib.adler32 now return an unsigned
 
914
  value.
 
915
 
 
916
- Issue #719888: Updated tokenize to use a bytes API.  generate_tokens
 
917
  has been renamed tokenize and now works with bytes rather than
 
918
  strings.  A new detect_encoding function has been added for
 
919
  determining source file encoding according to PEP-0263.  Token
 
920
  sequences returned by tokenize always start with an ENCODING token
 
921
  which specifies the encoding used to decode the file.  This token is
 
922
  used to encode the output of untokenize back to bytes.
 
923
 
 
924
 
 
925
What's New in Python 3.0a3?
 
926
===========================
 
927
 
 
928
*Release date: 29-Feb-2008*
 
929
 
 
930
Core and Builtins
 
931
-----------------
 
932
 
 
933
- Issue #2282: io.TextIOWrapper was not overriding seekable() from
 
934
  io.IOBase.
 
935
 
 
936
- Issue #2115: Important speedup in setting __slot__ attributes.  Also
 
937
  prevent a possible crash: an Abstract Base Class would try to access
 
938
  a slot on a registered virtual subclass.
 
939
 
 
940
- Fixed repr() and str() of complex numbers with infinity or nan as
 
941
  real or imaginary part.
 
942
 
 
943
- Clear all free list during a gc.collect() of the highest generation
 
944
  in order to allow pymalloc to free more arenas. Python may give back
 
945
  memory to the OS earlier.
 
946
 
 
947
- Issue #2045: Fix an infinite recursion triggered when printing a
 
948
  subclass of collections.defaultdict, if its default_factory is set
 
949
  to a bound method.
 
950
 
 
951
- Fixed a minor memory leak in dictobject.c. The content of the free
 
952
  list was not freed on interpreter shutdown.
 
953
 
 
954
- Limit free list of method and builtin function objects to 256
 
955
  entries each.
 
956
 
 
957
- Patch #1953: Added ``sys._compact_freelists()`` and the C API
 
958
  functions ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
 
959
  to compact the internal free lists of pre-allocted ints and floats.
 
960
 
 
961
- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
 
962
  Python expected the return type int but the fork familie returns
 
963
  pi_t.
 
964
 
 
965
- Issue #1678380: Fix a bug that identifies 0j and -0j when they
 
966
  appear in the same code unit.
 
967
 
 
968
- Issue #2025: Added tuple.count() and tuple.index() methods to comply
 
969
  with the collections.Sequence API.
 
970
 
 
971
- Fixed multiple reinitialization of the Python interpreter. The small
 
972
  int list in longobject.c has caused a seg fault during the third
 
973
  finalization.
 
974
 
 
975
- Issue #1973: bytes.fromhex('') raised SystemError.
 
976
 
 
977
- Issue #1771: remove cmp parameter from sorted() and list.sort().
 
978
 
 
979
- Issue #1969: split and rsplit in bytearray are inconsistent.
 
980
 
 
981
- map() no longer accepts None for the first argument.  Use zip()
 
982
  instead.
 
983
 
 
984
- Issue #1769: Now int("- 1") is not allowed any more.
 
985
 
 
986
- Object/longobject.c: long(float('nan')) raises an OverflowError
 
987
  instead of returning 0.
 
988
 
 
989
- Issue #1762972: __file__ points to the source file instead of the
 
990
  pyc/pyo file if the py file exists.
 
991
 
 
992
- Issue #1393: object_richcompare() returns NotImplemented instead of
 
993
  False if the objects aren't equal, to give the other side a chance.
 
994
 
 
995
- Issue #1692: Interpreter was not displaying location of SyntaxError.
 
996
 
 
997
- Improve some exception messages when Windows fails to load an
 
998
  extension module.  Now we get for example '%1 is not a valid Win32
 
999
  application' instead of 'error code 193'.  Also use Unicode strings
 
1000
  to deal with non-English locales.
 
1001
 
 
1002
- Issue #1587: Added instancemethod wrapper for PyCFunctions. The
 
1003
  Python C API has gained a new type *PyInstanceMethod_Type* and the
 
1004
  functions *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)*
 
1005
  and *PyInstanceMethod_Function(im)*.
 
1006
 
 
1007
- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed
 
1008
  from the gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE
 
1009
  are now enough to print the corresponding list of objects considered
 
1010
  by the garbage collector.
 
1011
 
 
1012
- Issue #1573: Improper use of the keyword-only syntax makes the
 
1013
  parser crash.
 
1014
 
 
1015
- Issue #1564: The set implementation should special-case PyUnicode
 
1016
  instead of PyString.
 
1017
 
 
1018
- Patch #1031213: Decode source line in SyntaxErrors back to its
 
1019
  original source encoding.
 
1020
 
 
1021
- inspect.getsource() includes the decorators again.
 
1022
 
 
1023
- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
 
1024
  mountpoint.
 
1025
 
 
1026
- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when
 
1027
  the first chunk fed to the decoder started with a BOM, but was
 
1028
  longer than 3 bytes.
 
1029
 
 
1030
Extension Modules
 
1031
-----------------
 
1032
 
 
1033
- Code for itertools ifilter(), imap(), and izip() moved to bultins
 
1034
  and renamed to filter(), map(), and zip().  Also, renamed
 
1035
  izip_longest() to zip_longest() and ifilterfalse() to filterfalse().
 
1036
 
 
1037
- Issue #1762972: Readded the reload() function as imp.reload().
 
1038
 
 
1039
- Bug #2111: mmap segfaults when trying to write a block opened with
 
1040
  PROT_READ.
 
1041
 
 
1042
- Issue #2063: correct order of utime and stime in os.times() result
 
1043
  on Windows.
 
1044
 
 
1045
Library
 
1046
-------
 
1047
 
 
1048
- Weakref dictionaries now inherit from MutableMapping.
 
1049
 
 
1050
- Created new UserDict class in collections module.  This one inherits
 
1051
  from and complies with the MutableMapping ABC.  Also, moved
 
1052
  UserString and UserList to the collections module.  The
 
1053
  MutableUserString class was removed.
 
1054
 
 
1055
- Removed UserDict.DictMixin.  Replaced all its uses with
 
1056
  collections.MutableMapping.
 
1057
 
 
1058
- Issue #1703: getpass() should flush after writing prompt.
 
1059
 
 
1060
- Issue #1585: IDLE uses non-existent xrange() function.
 
1061
 
 
1062
- Issue #1578: Problems in win_getpass.
 
1063
 
 
1064
Build
 
1065
-----
 
1066
 
 
1067
- Renamed --enable-unicode configure flag to --with-wide-unicode,
 
1068
  since Unicode strings can't be disabled anymore.
 
1069
 
 
1070
C API
 
1071
-----
 
1072
 
 
1073
- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
 
1074
  Py_TYPE and Py_REFCNT.
 
1075
 
 
1076
- New API PyImport_ImportModuleNoBlock(), works like
 
1077
  PyImport_ImportModule() but won't block on the import lock
 
1078
  (returning an error instead).
 
1079
 
 
1080
 
 
1081
What's New in Python 3.0a2?
 
1082
===========================
 
1083
 
 
1084
*Release date: 07-Dec-2007*
 
1085
 
 
1086
(Note: this list is incomplete.)
 
1087
 
 
1088
Core and Builtins
 
1089
-----------------
 
1090
 
 
1091
- str8 now has the same construction signature as bytes.
 
1092
 
 
1093
- Comparisons between str and str8 now return False/True for ==/!=.
 
1094
  sqlite3 returns str8 when recreating on object from it's __conform__
 
1095
  value.  The struct module returns str8 for all string-related
 
1096
  formats.  This was true before this change, but becomes more
 
1097
  apparent thanks to string comparisons always being False.
 
1098
 
 
1099
- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode,
 
1100
  buffer, encoding, newline)`.
 
1101
 
 
1102
- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
 
1103
 
 
1104
- Changed `__file__` and `co_filename` to unicode. The path names are decoded
 
1105
  with `Py_FileSystemDefaultEncoding` and a new API method
 
1106
  `PyUnicode_DecodeFSDefault(char*)` was added.
 
1107
 
 
1108
- io.open() and _fileio.FileIO have grown a new argument closefd. A
 
1109
  false value disables the closing of the file descriptor.
 
1110
 
 
1111
- Added a new option -b to issues warnings (-bb for errors) about
 
1112
  certain operations between bytes/buffer and str like str(b'') and
 
1113
  comparison.
 
1114
 
 
1115
- The standards streams sys.stdin, stdout and stderr may be None when
 
1116
  the when the C runtime library returns an invalid file descriptor
 
1117
  for the streams (fileno(stdin) < 0). For now this happens only for
 
1118
  Windows GUI apps and scripts started with `pythonw.exe`.
 
1119
 
 
1120
- Added PCbuild9 directory for VS 2008.
 
1121
 
 
1122
- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to
 
1123
  work around a name clash with VS 2008 on Windows.
 
1124
 
 
1125
- Unbound methods are gone for good. ClassObject.method returns an
 
1126
  ordinary function object, instance.method still returns a bound
 
1127
  method object.  The API of bound methods is cleaned up, too. The
 
1128
  im_class attribute is removed and im_func + im_self are renamed to
 
1129
  __func__ and __self__. The factory PyMethod_New takes only func and
 
1130
  instance as argument.
 
1131
 
 
1132
- intobject.h is no longer included by Python.h. The remains were
 
1133
  moved to longobject.h. It still exists to define several aliases
 
1134
  from PyInt to PyLong functions.
 
1135
 
 
1136
- Removed sys.maxint, use sys.maxsize instead.
 
1137
 
 
1138
Extension Modules
 
1139
-----------------
 
1140
 
 
1141
- The `hotshot` profiler has been removed; use `cProfile` instead.
 
1142
 
 
1143
Library
 
1144
-------
 
1145
 
 
1146
- When loading an external file using testfile(), the passed-in
 
1147
  encoding argument was being ignored if __loader__ is defined and
 
1148
  forcing the source to be UTF-8.
 
1149
 
 
1150
- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have
 
1151
  been removed in favor of the tempfile module.
 
1152
 
 
1153
- Removed the 'new' module.
 
1154
 
 
1155
- Removed all types from the 'types' module that are easily accessable
 
1156
  through builtins.
 
1157
 
 
1158
 
 
1159
What's New in Python 3.0a1?
 
1160
===========================
 
1161
 
 
1162
*Release date: 31-Aug-2007*
 
1163
 
 
1164
Core and Builtins
 
1165
-----------------
 
1166
 
 
1167
- PEP 3131: Support non-ASCII identifiers.
 
1168
 
 
1169
- PEP 3120: Change default encoding to UTF-8.
 
1170
 
 
1171
- PEP 3123: Use proper C inheritance for PyObject.
 
1172
 
 
1173
- Removed the __oct__ and __hex__ special methods and added a bin()
 
1174
  builtin function.
 
1175
 
 
1176
- PEP 3127: octal literals now start with "0o". Old-style octal
 
1177
  literals are invalid. There are binary literals with a prefix of
 
1178
  "0b".  This also affects int(x, 0).
 
1179
 
 
1180
- None, True, False are now keywords.
 
1181
 
 
1182
- PEP 3119: isinstance() and issubclass() can be overridden.
 
1183
 
 
1184
- Remove BaseException.message.
 
1185
 
 
1186
- Remove tuple parameter unpacking (PEP 3113).
 
1187
 
 
1188
- Remove the f_restricted attribute from frames.  This naturally leads
 
1189
  to the removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
 
1190
 
 
1191
- PEP 3132 was accepted. That means that you can do ``a, *b =
 
1192
  range(5)`` to assign 0 to a and [1, 2, 3, 4] to b.
 
1193
 
 
1194
- range() now returns an iterator rather than a list.  Floats are not
 
1195
  allowed.  xrange() is no longer defined.
 
1196
 
 
1197
- Patch #1660500: hide iteration variable in list comps, add set comps
 
1198
  and use common code to handle compilation of iterative expressions.
 
1199
 
 
1200
- By default, != returns the opposite of ==, unless the latter returns
 
1201
  NotImplemented.
 
1202
 
 
1203
- Patch #1680961: sys.exitfunc has been removed and replaced with a
 
1204
  private C-level API.
 
1205
 
 
1206
- PEP 3115: new metaclasses: the metaclass is now specified as a
 
1207
  keyword arg in the class statement, which can now use the full
 
1208
  syntax of a parameter list. Also, the metaclass can implement a
 
1209
  __prepare__ function which will be called to create the dictionary
 
1210
  for the new class namespace.
 
1211
 
 
1212
- The long-deprecated argument "pend" of PyFloat_FromString() has been
 
1213
  removed.
 
1214
 
 
1215
- The dir() function has been extended to call the __dir__() method on
 
1216
  its argument, if it exists. If not, it will work like before. This
 
1217
  allows customizing the output of dir() in the presence of a
 
1218
  __getattr__().
 
1219
 
 
1220
- Removed support for __members__ and __methods__.
 
1221
 
 
1222
- Removed indexing/slicing on BaseException.
 
1223
 
 
1224
- input() became raw_input(): the name input() now implements the
 
1225
  functionality formerly known as raw_input(); the name raw_input() is
 
1226
  no longer defined.
 
1227
 
 
1228
- Classes listed in an 'except' clause must inherit from
 
1229
  BaseException.
 
1230
 
 
1231
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
 
1232
  and .keys(), .items(), .values() return dict views, which behave
 
1233
  like sets.
 
1234
 
 
1235
- PEP 3105: print is now a function.  Also (not in the PEP) the
 
1236
  'softspace' attribute of files is now gone (since print() doesn't
 
1237
  use it).  A side effect of this change is that you can get
 
1238
  incomplete output lines in interactive sessions:
 
1239
 
 
1240
  >>> print(42, end="")
 
1241
  42>>>
 
1242
 
 
1243
  We may be able to fix this after the I/O library rewrite.
 
1244
 
 
1245
- PEP 3102: keyword-only arguments.
 
1246
 
 
1247
- Int/Long unification is complete.  The 'long' built-in type and
 
1248
  literals with trailing 'L' or 'l' have been removed.  Performance
 
1249
  may be sub-optimal (haven't really benchmarked).
 
1250
 
 
1251
- 'except E, V' must now be spelled as 'except E as V' and deletes V
 
1252
  at the end of the except clause; V must be a simple name.
 
1253
 
 
1254
- Added function annotations per PEP 3107.
 
1255
 
 
1256
- Added nonlocal declaration from PEP 3104:
 
1257
 
 
1258
  >>> def f(x):
 
1259
  ...     def inc():
 
1260
  ...         nonlocal x
 
1261
  ...         x += 1
 
1262
  ...         return x
 
1263
  ...     return inc
 
1264
  ...
 
1265
  >>> inc = f(0)
 
1266
  >>> inc()
 
1267
  1
 
1268
  >>> inc()
 
1269
  2
 
1270
 
 
1271
- Moved intern() to sys.intern().
 
1272
 
 
1273
- exec is now a function.
 
1274
 
 
1275
- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
 
1276
 
 
1277
- Classic classes are a thing of the past.  All classes are new style.
 
1278
 
 
1279
- Exceptions *must* derive from BaseException.
 
1280
 
 
1281
- Integer division always returns a float.  The -Q option is no more.
 
1282
  All the following are gone:
 
1283
 
 
1284
  * PyNumber_Divide and PyNumber_InPlaceDivide
 
1285
  * __div__, __rdiv__, and __idiv__
 
1286
  * nb_divide, nb_inplace_divide
 
1287
  * operator.div, operator.idiv, operator.__div__, operator.__idiv__
 
1288
    (Only __truediv__ and __floordiv__ remain, not sure how to handle
 
1289
    them if we want to re-use __div__ and friends.  If we do, it will
 
1290
    make it harder to write code for both 2.x and 3.x.)
 
1291
 
 
1292
- 'as' and 'with' are keywords.
 
1293
 
 
1294
- Absolute import is the default behavior for 'import foo' etc.
 
1295
 
 
1296
- Removed support for syntax: backticks (ie, `x`), <>.
 
1297
 
 
1298
- Removed these Python builtins: apply(), callable(), coerce(),
 
1299
  execfile(), file(), reduce(), reload().
 
1300
 
 
1301
- Removed these Python methods: {}.has_key.
 
1302
 
 
1303
- Removed these opcodes: BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT.
 
1304
 
 
1305
- Remove C API support for restricted execution.
 
1306
 
 
1307
- zip(), map() and filter() now return iterators, behaving like their
 
1308
  itertools counterparts.  This also affect map()'s behavior on
 
1309
  sequences of unequal length -- it now stops after the shortest one
 
1310
  is exhausted.
 
1311
 
 
1312
- Additions: set literals, set comprehensions, ellipsis literal.
 
1313
 
 
1314
- Added class decorators per PEP 3129.
 
1315
 
 
1316
 
 
1317
Extension Modules
 
1318
-----------------
 
1319
 
 
1320
- Removed the imageop module.  Obsolete long with its unit tests
 
1321
  becoming useless from the removal of rgbimg and imgfile.
 
1322
 
 
1323
- Removed these attributes from the operator module: div, idiv,
 
1324
  __div__, __idiv__, isCallable, sequenceIncludes.
 
1325
 
 
1326
- Removed these attributes from the sys module: exc_clear(), exc_type,
 
1327
  exc_value, exc_traceback.
 
1328
 
 
1329
 
 
1330
Library
 
1331
-------
 
1332
 
 
1333
- Removed the compiler package.  Use of the _ast module and (an
 
1334
  eventual) AST -> bytecode mechanism.
 
1335
 
 
1336
- Removed these modules: audiodev, Bastion, bsddb185, exceptions,
 
1337
  linuxaudiodev, md5, MimeWriter, mimify, popen2, rexec, sets, sha,
 
1338
  stringold, strop, sunaudiodev, timing, xmllib.
 
1339
 
 
1340
- Moved the toaiff module to Tools/Demos.
 
1341
 
 
1342
- Removed obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL,
 
1343
  DEVICE, ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile,
 
1344
  IOCTL, jpeg, panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
 
1345
 
 
1346
- Removed obsolete functions: commands.getstatus(), os.popen*().
 
1347
 
 
1348
- Removed functions in the string module that are also string methods;
 
1349
  Remove string.{letters, lowercase, uppercase}.
 
1350
 
 
1351
- Removed support for long obsolete platforms: plat-aix3, plat-irix5.
 
1352
 
 
1353
- Removed xmlrpclib.SlowParser.  It was based on xmllib.
 
1354
 
 
1355
- Patch #1680961: atexit has been reimplemented in C.
 
1356
 
 
1357
- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
 
1358
 
 
1359
Build
 
1360
-----
 
1361
 
 
1362
C API
 
1363
-----
 
1364
 
 
1365
- Removed these Python slots: __coerce__, __div__, __idiv__, __rdiv__.
 
1366
 
 
1367
- Removed these C APIs: PyNumber_Coerce(), PyNumber_CoerceEx(),
 
1368
  PyMember_Get, PyMember_Set.
 
1369
 
 
1370
- Removed these C slots/fields: nb_divide, nb_inplace_divide.
 
1371
 
 
1372
- Removed these macros: staticforward, statichere, PyArg_GetInt,
 
1373
  PyArg_NoArgs, _PyObject_Del.
 
1374
 
 
1375
- Removed these typedefs: intargfunc, intintargfunc, intobjargproc,
 
1376
  intintobjargproc, getreadbufferproc, getwritebufferproc,
 
1377
  getsegcountproc, getcharbufferproc, memberlist.
 
1378
 
 
1379
Tests
 
1380
-----
 
1381
 
 
1382
- Removed test.testall as test.regrtest replaces it.
 
1383
 
 
1384
Documentation
 
1385
-------------
 
1386
 
 
1387
Mac
 
1388
---
 
1389
 
 
1390
- The cfmfile module was removed.
 
1391
 
 
1392
Platforms
 
1393
---------
 
1394
 
 
1395
- Support for BeOS and AtheOS was removed (according to PEP 11).
 
1396
 
 
1397
- Support for RiscOS, Irix, Tru64 was removed (alledgedly).
 
1398
 
 
1399
Tools/Demos
 
1400
-----------
 
1401
 
 
1402
 
 
1403
What's New in Python 2.5 release candidate 1?
 
1404
=============================================
 
1405
 
 
1406
*Release date: 17-AUG-2006*
 
1407
 
 
1408
Core and builtins
 
1409
-----------------
 
1410
 
 
1411
- Unicode objects will no longer raise an exception when being
 
1412
  compared equal or unequal to a string and a UnicodeDecodeError
 
1413
  exception occurs, e.g. as result of a decoding failure.
 
1414
 
 
1415
  Instead, the equal (==) and unequal (!=) comparison operators will
 
1416
  now issue a UnicodeWarning and interpret the two objects as
 
1417
  unequal. The UnicodeWarning can be filtered as desired using
 
1418
  the warning framework, e.g. silenced completely, turned into an
 
1419
  exception, logged, etc.
 
1420
 
 
1421
  Note that compare operators other than equal and unequal will still
 
1422
  raise UnicodeDecodeError exceptions as they've always done.
 
1423
 
 
1424
- Fix segfault when doing string formatting on subclasses of long.
 
1425
 
 
1426
- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
 
1427
  with new-style classes.
 
1428
 
 
1429
- Fix bug related to __len__ functions returning negative values with
 
1430
  classic classes.
 
1431
 
 
1432
- Patch #1538606, Fix __index__() clipping.  There were some problems
 
1433
  discovered with the API and how integers that didn't fit into Py_ssize_t
 
1434
  were handled.  This patch attempts to provide enough alternatives
 
1435
  to effectively use __index__.
 
1436
 
 
1437
- Bug #1536021: __hash__ may now return long int; the final hash
 
1438
  value is obtained by invoking hash on the long int.
 
1439
 
 
1440
- Bug #1536786: buffer comparison could emit a RuntimeWarning.
 
1441
 
 
1442
- Bug #1535165: fixed a segfault in input() and raw_input() when
 
1443
  sys.stdin is closed.
 
1444
 
 
1445
- On Windows, the PyErr_Warn function is now exported from
 
1446
  the Python dll again.
 
1447
 
 
1448
- Bug #1191458: tracing over for loops now produces a line event
 
1449
  on each iteration.  Fixing this problem required changing the .pyc
 
1450
  magic number.  This means that .pyc files generated before 2.5c1
 
1451
  will be regenerated.
 
1452
 
 
1453
- Bug #1333982: string/number constants were inappropriately stored
 
1454
  in the byte code and co_consts even if they were not used, ie
 
1455
  immediately popped off the stack.
 
1456
 
 
1457
- Fixed a reference-counting problem in property().
 
1458
 
 
1459
 
 
1460
Library
 
1461
-------
 
1462
 
 
1463
- Fix a bug in the ``compiler`` package that caused invalid code to be
 
1464
  generated for generator expressions.
 
1465
 
 
1466
- The distutils version has been changed to 2.5.0. The change to
 
1467
  keep it programmatically in sync with the Python version running
 
1468
  the code (introduced in 2.5b3) has been reverted. It will continue
 
1469
  to be maintained manually as static string literal.
 
1470
 
 
1471
- If the Python part of a ctypes callback function returns None,
 
1472
  and this cannot be converted to the required C type, an exception is
 
1473
  printed with PyErr_WriteUnraisable.  Before this change, the C
 
1474
  callback returned arbitrary values to the calling code.
 
1475
 
 
1476
- The __repr__ method of a NULL ctypes.py_object() no longer raises
 
1477
  an exception.
 
1478
 
 
1479
- uuid.UUID now has a bytes_le attribute. This returns the UUID in
 
1480
  little-endian byte order for Windows. In addition, uuid.py gained some
 
1481
  workarounds for clocks with low resolution, to stop the code yielding
 
1482
  duplicate UUIDs.
 
1483
 
 
1484
- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
 
1485
  before raising SystemExit, allowing IDLE to honor quit() and exit().
 
1486
 
 
1487
- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
 
1488
 
 
1489
- Patch #1536071: trace.py should now find the full module name of a
 
1490
  file correctly even on Windows.
 
1491
 
 
1492
- logging's atexit hook now runs even if the rest of the module has
 
1493
  already been cleaned up.
 
1494
 
 
1495
- Bug #1112549, fix DoS attack on cgi.FieldStorage.
 
1496
 
 
1497
- Bug #1531405, format_exception no longer raises an exception if
 
1498
  str(exception) raised an exception.
 
1499
 
 
1500
- Fix a bug in the ``compiler`` package that caused invalid code to be
 
1501
  generated for nested functions.
 
1502
 
 
1503
 
 
1504
Extension Modules
 
1505
-----------------
 
1506
 
 
1507
- Patch #1511317: don't crash on invalid hostname (alias) info.
 
1508
 
 
1509
- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
 
1510
  raises the correct exceptions.
 
1511
 
 
1512
- Patch # 1536908: enable building ctypes on OpenBSD/AMD64.  The
 
1513
  '-no-stack-protector' compiler flag for OpenBSD has been removed.
 
1514
 
 
1515
- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
 
1516
  uses the _as_parameter_ attribute when objects are passed to foreign
 
1517
  function calls.  The ctypes version number was changed to 1.0.1.
 
1518
 
 
1519
- Bug #1530559, struct.pack raises TypeError where it used to convert.
 
1520
  Passing float arguments to struct.pack when integers are expected
 
1521
  now triggers a DeprecationWarning.
 
1522
 
 
1523
 
 
1524
Tests
 
1525
-----
 
1526
 
 
1527
- test_socketserver should now work on cygwin and not fail sporadically
 
1528
  on other platforms.
 
1529
 
 
1530
- test_mailbox should now work on cygwin versions 2006-08-10 and later.
 
1531
 
 
1532
- Bug #1535182: really test the xreadlines() method of bz2 objects.
 
1533
 
 
1534
- test_threading now skips testing alternate thread stack sizes on
 
1535
  platforms that don't support changing thread stack size.
 
1536
 
 
1537
 
 
1538
Documentation
 
1539
-------------
 
1540
 
 
1541
- Patch #1534922: unittest docs were corrected and enhanced.
 
1542
 
 
1543
 
 
1544
Build
 
1545
-----
 
1546
 
 
1547
- Bug #1535502, build _hashlib on Windows, and use masm assembler
 
1548
  code in OpenSSL.
 
1549
 
 
1550
- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
 
1551
 
 
1552
- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
 
1553
 
 
1554
 
 
1555
C API
 
1556
-----
 
1557
 
 
1558
- New API for Unicode rich comparisons: PyUnicode_RichCompare()
 
1559
 
 
1560
- Bug #1069160.  Internal correctness changes were made to
 
1561
  ``PyThreadState_SetAsyncExc()``.  A test case was added, and
 
1562
  the documentation was changed to state that the return value
 
1563
  is always 1 (normal) or 0 (if the specified thread wasn't found).
 
1564
 
 
1565
 
 
1566
What's New in Python 2.5 beta 3?
 
1567
================================
 
1568
 
 
1569
*Release date: 03-AUG-2006*
 
1570
 
 
1571
Core and builtins
 
1572
-----------------
 
1573
 
 
1574
- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
 
1575
  returned a long (see PEP 353).
 
1576
 
 
1577
- Bug #1515471: string.replace() accepts character buffers again.
 
1578
 
 
1579
- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
 
1580
  This provides the proper warning for struct.pack().
 
1581
  PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
 
1582
 
 
1583
- Patch #1531113: Fix augmented assignment with yield expressions.
 
1584
  Also fix a SystemError when trying to assign to yield expressions.
 
1585
 
 
1586
- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
 
1587
  with PEP 302.  This was fixed by adding an ``imp.NullImporter`` type that is
 
1588
  used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
 
1589
  excessive filesystem operations during imports.
 
1590
 
 
1591
- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
 
1592
  operations on signed longs that are formally undefined by C.
 
1593
  Unfortunately, at least one compiler now cares about that, so complicated
 
1594
  the code to make that compiler happy again.
 
1595
 
 
1596
- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
 
1597
 
 
1598
- Patch #1232023: Stop including current directory in search
 
1599
  path on Windows.
 
1600
 
 
1601
- Fix some potential crashes found with failmalloc.
 
1602
 
 
1603
- Fix warnings reported by Klocwork's static analysis tool.
 
1604
 
 
1605
- Bug #1512814, Fix incorrect lineno's when code within a function
 
1606
  had more than 255 blank lines.
 
1607
 
 
1608
- Patch #1521179: Python now accepts the standard options ``--help`` and
 
1609
  ``--version`` as well as ``/?`` on Windows.
 
1610
 
 
1611
- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
 
1612
  again.  Fixing this problem required changing the .pyc magic number.
 
1613
  This means that .pyc files generated before 2.5b3 will be regenerated.
 
1614
 
 
1615
- Bug #1524317:  Compiling Python ``--without-threads`` failed.
 
1616
  The Python core compiles again, and, in a build without threads, the
 
1617
  new ``sys._current_frames()`` returns a dictionary with one entry,
 
1618
  mapping the faux "thread id" 0 to the current frame.
 
1619
 
 
1620
- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
 
1621
 
 
1622
 
 
1623
Library
 
1624
-------
 
1625
 
 
1626
- Fix #1693149.  Now you can pass several modules separated by
 
1627
  comma to trace.py in the same --ignore-module option.
 
1628
 
 
1629
- Correction of patch #1455898: In the mbcs decoder, set final=False
 
1630
  for stream decoder, but final=True for the decode function.
 
1631
 
 
1632
- os.urandom no longer masks unrelated exceptions like SystemExit or
 
1633
  KeyboardInterrupt.
 
1634
 
 
1635
- Bug #1525866: Don't copy directory stat times in
 
1636
  shutil.copytree on Windows
 
1637
 
 
1638
- Bug #1002398: The documentation for os.path.sameopenfile now correctly
 
1639
  refers to file descriptors, not file objects.
 
1640
 
 
1641
- The renaming of the xml package to xmlcore, and the import hackery done
 
1642
  to make it appear at both names, has been removed.  Bug #1511497,
 
1643
  #1513611, and probably others.
 
1644
 
 
1645
- Bug #1441397: The compiler module now recognizes module and function
 
1646
  docstrings correctly as it did in Python 2.4.
 
1647
 
 
1648
- Bug #1529297:  The rewrite of doctest for Python 2.4 unintentionally
 
1649
  lost that tests are sorted by name before being run.  This rarely
 
1650
  matters for well-written tests, but can create baffling symptoms if
 
1651
  side effects from one test to the next affect outcomes.  ``DocTestFinder``
 
1652
  has been changed to sort the list of tests it returns.
 
1653
 
 
1654
- The distutils version has been changed to 2.5.0, and is now kept
 
1655
  in sync with sys.version_info[:3].
 
1656
 
 
1657
- Bug #978833: Really close underlying socket in _socketobject.close.
 
1658
 
 
1659
- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
 
1660
  title().
 
1661
 
 
1662
- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
 
1663
  to recursive calls and call it with the failing package name.
 
1664
 
 
1665
- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
 
1666
 
 
1667
- Patch #1515343: Fix printing of deprecated string exceptions with a
 
1668
  value in the traceback module.
 
1669
 
 
1670
- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
 
1671
 
 
1672
- Patch #1524429: Use repr() instead of backticks in Tkinter again.
 
1673
 
 
1674
- Bug #1520914: Change time.strftime() to accept a zero for any position in its
 
1675
  argument tuple.  For arguments where zero is illegal, the value is forced to
 
1676
  the minimum value that is correct.  This is to support an undocumented but
 
1677
  common way people used  to fill in inconsequential information in the time
 
1678
  tuple pre-2.4.
 
1679
 
 
1680
- Patch #1220874: Update the binhex module for Mach-O.
 
1681
 
 
1682
- The email package has improved RFC 2231 support, specifically for
 
1683
  recognizing the difference between encoded (name*0*=<blah>) and non-encoded
 
1684
  (name*0=<blah>) parameter continuations.  This may change the types of
 
1685
  values returned from email.message.Message.get_param() and friends.
 
1686
  Specifically in some cases where non-encoded continuations were used,
 
1687
  get_param() used to return a 3-tuple of (None, None, string) whereas now it
 
1688
  will just return the string (since non-encoded continuations don't have
 
1689
  charset and language parts).
 
1690
 
 
1691
  Also, whereas % values were decoded in all parameter continuations, they are
 
1692
  now only decoded in encoded parameter parts.
 
1693
 
 
1694
- Bug #1517990: IDLE keybindings on MacOS X now work correctly
 
1695
 
 
1696
- Bug #1517996: IDLE now longer shows the default Tk menu when a
 
1697
  path browser, class browser or debugger is the frontmost window on MacOS X
 
1698
 
 
1699
- Patch #1520294: Support for getset and member descriptors in types.py,
 
1700
  inspect.py, and pydoc.py.  Specifically, this allows for querying the type
 
1701
  of an object against these built-in types and more importantly, for getting
 
1702
  their docstrings printed in the interactive interpreter's help() function.
 
1703
 
 
1704
 
 
1705
Extension Modules
 
1706
-----------------
 
1707
 
 
1708
- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
 
1709
  a socket operation on a socket with a timeout, the exception will be
 
1710
  caught correctly.  Previously, the exception was not caught.
 
1711
 
 
1712
- Patch #1529514: The _ctypes extension is now compiled on more
 
1713
  openbsd target platforms.
 
1714
 
 
1715
- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
 
1716
  a memory leak, affecting pickles and deep copies.
 
1717
 
 
1718
- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
 
1719
  Paul Eggert.
 
1720
 
 
1721
- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
 
1722
 
 
1723
- Patch #1521817: Index range checking on ctypes arrays containing
 
1724
  exactly one element enabled again.  This allows iterating over these
 
1725
  arrays, without the need to check the array size before.
 
1726
 
 
1727
- Bug #1521375: When the code in ctypes.util.find_library was
 
1728
  run with root privileges, it could overwrite or delete
 
1729
  /dev/null in certain cases; this is now fixed.
 
1730
 
 
1731
- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
 
1732
  default mode for loading shared libraries in ctypes.
 
1733
 
 
1734
- Because of a misspelled preprocessor symbol, ctypes was always
 
1735
  compiled without thread support; this is now fixed.
 
1736
 
 
1737
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
 
1738
  methods now allow their database parameter to be None as the
 
1739
  sleepycat API allows.
 
1740
 
 
1741
- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
 
1742
  bluetooth API compared with Linux and FreeBSD.
 
1743
 
 
1744
Tests
 
1745
-----
 
1746
 
 
1747
- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
 
1748
  how long the test file should take to play.  Now accepts taking 2.93 secs
 
1749
  (exact time) +/- 10% instead of the hard-coded 3.1 sec.
 
1750
 
 
1751
- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
 
1752
  ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
 
1753
  run via ``regrtest.py``. Now they do.
 
1754
 
 
1755
Build
 
1756
-----
 
1757
 
 
1758
- Bug #1439538: Drop usage of test -e in configure as it is not portable.
 
1759
 
 
1760
Mac
 
1761
---
 
1762
 
 
1763
- PythonLauncher now works correctly when the path to the script contains
 
1764
  characters that are treated specially by the shell (such as quotes).
 
1765
 
 
1766
- Bug #1527397: PythonLauncher now launches scripts with the working directory
 
1767
  set to the directory that contains the script instead of the user home
 
1768
  directory. That latter was an implementation accident and not what users
 
1769
  expect.
 
1770
 
 
1771
 
 
1772
What's New in Python 2.5 beta 2?
 
1773
================================
 
1774
 
 
1775
*Release date: 11-JUL-2006*
 
1776
 
 
1777
Core and builtins
 
1778
-----------------
 
1779
 
 
1780
- Bug #1441486: The literal representation of -(sys.maxint - 1)
 
1781
  again evaluates to a int object, not a long.
 
1782
 
 
1783
- Bug #1501934: The scope of global variables that are locally assigned
 
1784
  using augmented assignment is now correctly determined.
 
1785
 
 
1786
- Bug #927248: Recursive method-wrapper objects can now safely
 
1787
  be released.
 
1788
 
 
1789
- Bug #1417699: Reject locale-specific decimal point in float()
 
1790
  and atof().
 
1791
 
 
1792
- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
 
1793
  omit a default "error" argument for NULL pointer.  This allows
 
1794
  the parser to take a codec from cjkcodecs again.
 
1795
 
 
1796
- Bug #1519018: 'as' is now validated properly in import statements.
 
1797
 
 
1798
- On 64 bit systems, int literals that use less than 64 bits are
 
1799
  now ints rather than longs.
 
1800
 
 
1801
- Bug #1512814, Fix incorrect lineno's when code at module scope
 
1802
  started after line 256.
 
1803
 
 
1804
- New function ``sys._current_frames()`` returns a dict mapping thread
 
1805
  id to topmost thread stack frame.  This is for expert use, and is
 
1806
  especially useful for debugging application deadlocks.  The functionality
 
1807
  was previously available in Fazal Majid's ``threadframe`` extension
 
1808
  module, but it wasn't possible to do this in a wholly threadsafe way from
 
1809
  an extension.
 
1810
 
 
1811
Library
 
1812
-------
 
1813
 
 
1814
- Bug #1257728: Mention Cygwin in distutils error message about a missing
 
1815
  VS 2003.
 
1816
 
 
1817
- Patch #1519566: Update turtle demo, make begin_fill idempotent.
 
1818
 
 
1819
- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
 
1820
  environment variable to be set in order to the SDK environment
 
1821
  for finding the compiler, include files, etc.
 
1822
 
 
1823
- Bug #1515998: Properly generate logical ids for files in bdist_msi.
 
1824
 
 
1825
- warnings.py now ignores ImportWarning by default
 
1826
 
 
1827
- string.Template() now correctly handles tuple-values. Previously,
 
1828
  multi-value tuples would raise an exception and single-value tuples would
 
1829
  be treated as the value they contain, instead.
 
1830
 
 
1831
- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
 
1832
  even if some data are received.
 
1833
 
 
1834
- Bug #1267547: Put proper recursive setup.py call into the
 
1835
  spec file generated by bdist_rpm.
 
1836
 
 
1837
- Bug #1514693: Update turtle's heading when switching between
 
1838
  degrees and radians.
 
1839
 
 
1840
- Reimplement turtle.circle using a polyline, to allow correct
 
1841
  filling of arcs.
 
1842
 
 
1843
- Bug #1514703: Only setup canvas window in turtle when the canvas
 
1844
  is created.
 
1845
 
 
1846
- Bug #1513223: .close() of a _socketobj now releases the underlying
 
1847
  socket again, which then gets closed as it becomes unreferenced.
 
1848
 
 
1849
- Bug #1504333: Make sgmllib support angle brackets in quoted
 
1850
  attribute values.
 
1851
 
 
1852
- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
 
1853
  sgmllib ('[' and ']' were not accepted).
 
1854
 
 
1855
- Fix a bug in the turtle module's end_fill function.
 
1856
 
 
1857
- Bug #1510580: The 'warnings' module improperly required that a Warning
 
1858
  category be either a types.ClassType and a subclass of Warning.  The proper
 
1859
  check is just that it is a subclass with Warning as the documentation states.
 
1860
 
 
1861
- The compiler module now correctly compiles the new try-except-finally
 
1862
  statement (bug #1509132).
 
1863
 
 
1864
- The wsgiref package is now installed properly on Unix.
 
1865
 
 
1866
- A bug was fixed in logging.config.fileConfig() which caused a crash on
 
1867
  shutdown when fileConfig() was called multiple times.
 
1868
 
 
1869
- The sqlite3 module did cut off data from the SQLite database at the first
 
1870
  null character before sending it to a custom converter. This has been fixed
 
1871
  now.
 
1872
 
 
1873
Extension Modules
 
1874
-----------------
 
1875
 
 
1876
- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
 
1877
  means that select() on sockets > FD_SETSIZE (typically 1024) work again.
 
1878
  The patch makes sockets use poll() internally where available.
 
1879
 
 
1880
- Assigning None to pointer type fields in ctypes structures possible
 
1881
  overwrote the wrong fields, this is fixed now.
 
1882
 
 
1883
- Fixed a segfault in _ctypes when ctypes.wintypes were imported
 
1884
  on non-Windows platforms.
 
1885
 
 
1886
- Bug #1518190: The ctypes.c_void_p constructor now accepts any
 
1887
  integer or long, without range checking.
 
1888
 
 
1889
- Patch #1517790: It is now possible to use custom objects in the ctypes
 
1890
  foreign function argtypes sequence as long as they provide a from_param
 
1891
  method, no longer is it required that the object is a ctypes type.
 
1892
 
 
1893
- The '_ctypes' extension module now works when Python is configured
 
1894
  with the --without-threads option.
 
1895
 
 
1896
- Bug #1513646: os.access on Windows now correctly determines write
 
1897
  access, again.
 
1898
 
 
1899
- Bug #1512695: cPickle.loads could crash if it was interrupted with
 
1900
  a KeyboardInterrupt.
 
1901
 
 
1902
- Bug #1296433: parsing XML with a non-default encoding and
 
1903
  a CharacterDataHandler could crash the interpreter in pyexpat.
 
1904
 
 
1905
- Patch #1516912: improve Modules support for OpenVMS.
 
1906
 
 
1907
Build
 
1908
-----
 
1909
 
 
1910
- Automate Windows build process for the Win64 SSL module.
 
1911
 
 
1912
- 'configure' now detects the zlib library the same way as distutils.
 
1913
  Previously, the slight difference could cause compilation errors of the
 
1914
  'zlib' module on systems with more than one version of zlib.
 
1915
 
 
1916
- The MSI compileall step was fixed to also support a TARGETDIR
 
1917
  with spaces in it.
 
1918
 
 
1919
- Bug #1517388: sqlite3.dll is now installed on Windows independent
 
1920
  of Tcl/Tk.
 
1921
 
 
1922
- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
 
1923
  trying to be installed even though it's empty.
 
1924
 
 
1925
Tests
 
1926
-----
 
1927
 
 
1928
- Call os.waitpid() at the end of tests that spawn child processes in order
 
1929
  to minimize resources (zombies).
 
1930
 
 
1931
Documentation
 
1932
-------------
 
1933
 
 
1934
- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
 
1935
  documentation for the warnings module.
 
1936
 
 
1937
- Patch #1509163: MS Toolkit Compiler no longer available.
 
1938
 
 
1939
- Patch #1504046: Add documentation for xml.etree.
 
1940
 
 
1941
 
 
1942
What's New in Python 2.5 beta 1?
 
1943
================================
 
1944
 
 
1945
*Release date: 20-JUN-2006*
 
1946
 
 
1947
Core and builtins
 
1948
-----------------
 
1949
 
 
1950
- Patch #1507676: Error messages returned by invalid abstract object operations
 
1951
  (such as iterating over an integer) have been improved and now include the
 
1952
  type of the offending object to help with debugging.
 
1953
 
 
1954
- Bug #992017: A classic class that defined a __coerce__() method that returned
 
1955
  its arguments swapped would infinitely recurse and segfault the interpreter.
 
1956
 
 
1957
- Fix the socket tests so they can be run concurrently.
 
1958
 
 
1959
- Removed 5 integers from C frame objects (PyFrameObject).
 
1960
  f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
 
1961
 
 
1962
- Bug #532646: object.__call__() will continue looking for the __call__
 
1963
  attribute on objects until one without one is found.  This leads to recursion
 
1964
  when you take a class and set its __call__ attribute to an instance of the
 
1965
  class.  Originally fixed for classic classes, but this fix is for new-style.
 
1966
  Removes the infinite_rec_3 crasher.
 
1967
 
 
1968
- The string and unicode methods startswith() and endswith() now accept
 
1969
  a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
 
1970
 
 
1971
- Buffer objects, at the C level, never used the char buffer
 
1972
  implementation even when the char buffer for the wrapped object was
 
1973
  explicitly requested (originally returned the read or write buffer).
 
1974
  Now a TypeError is raised if the char buffer is not present but is
 
1975
  requested.
 
1976
 
 
1977
- Patch #1346214: Statements like "if 0: suite" are now again optimized
 
1978
  away like they were in Python 2.4.
 
1979
 
 
1980
- Builtin exceptions are now full-blown new-style classes instead of
 
1981
  instances pretending to be classes, which speeds up exception handling
 
1982
  by about 80% in comparison to 2.5a2.
 
1983
 
 
1984
- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
 
1985
  Unicode 4.1.
 
1986
 
 
1987
- Patch #921466: sys.path_importer_cache is now used to cache valid and
 
1988
  invalid file paths for the built-in import machinery which leads to
 
1989
  fewer open calls on startup.
 
1990
 
 
1991
- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
 
1992
  of-2 bases.  The largest speedup is for inputs with about 1000 decimal
 
1993
  digits.  Conversion from non-power-of-2 bases remains quadratic-time in
 
1994
  the number of input digits (it was and remains linear-time for bases
 
1995
  2, 4, 8, 16 and 32).
 
1996
 
 
1997
- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
 
1998
  when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
 
1999
  an integer close to ``sys.maxint``.  This was repaired by patch
 
2000
  #1335972, which also gives a nice speedup.
 
2001
 
 
2002
- Patch #1337051: reduced size of frame objects.
 
2003
 
 
2004
- PyErr_NewException now accepts a tuple of base classes as its
 
2005
  "base" parameter.
 
2006
 
 
2007
- Patch #876206: function call speedup by retaining allocated frame
 
2008
  objects.
 
2009
 
 
2010
- Bug #1462152: file() now checks more thoroughly for invalid mode
 
2011
  strings and removes a possible "U" before passing the mode to the
 
2012
  C library function.
 
2013
 
 
2014
- Patch #1488312, Fix memory alignment problem on SPARC in unicode
 
2015
 
 
2016
- Bug #1487966: Fix SystemError with conditional expression in assignment
 
2017
 
 
2018
- WindowsError now has two error code attributes: errno, which carries
 
2019
  the error values from errno.h, and winerror, which carries the error
 
2020
  values from winerror.h. Previous versions put the winerror.h values
 
2021
  (from GetLastError()) into the errno attribute.
 
2022
 
 
2023
- Patch #1475845: Raise IndentationError for unexpected indent.
 
2024
 
 
2025
- Patch #1479181: split open() and file() from being aliases for each other.
 
2026
 
 
2027
- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
 
2028
  methods were always silently ignored by dictionaries when comparing keys.
 
2029
  They are now passed through (except when using the C API function
 
2030
  ``PyDict_GetItem()``, whose semantics did not change).
 
2031
 
 
2032
- Bug #1456209: In some obscure cases it was possible for a class with a
 
2033
  custom ``__eq__()`` method to confuse dict internals when class instances
 
2034
  were used as a dict's keys and the ``__eq__()`` method mutated the dict.
 
2035
  No, you don't have any code that did this ;-)
 
2036
 
 
2037
Extension Modules
 
2038
-----------------
 
2039
 
 
2040
- Bug #1295808: expat symbols should be namespaced in pyexpat
 
2041
 
 
2042
- Patch #1462338: Upgrade pyexpat to expat 2.0.0
 
2043
 
 
2044
- Change binascii.hexlify to accept a read-only buffer instead of only a char
 
2045
  buffer and actually follow its documentation.
 
2046
 
 
2047
- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
 
2048
 
 
2049
- Patch #1478788 (modified version): The functional extension module has
 
2050
  been renamed to _functools and a functools Python wrapper module added.
 
2051
  This provides a home for additional function related utilities that are
 
2052
  not specifically about functional programming. See PEP 309.
 
2053
 
 
2054
- Patch #1493701: performance enhancements for struct module.
 
2055
 
 
2056
- Patch #1490224: time.altzone is now set correctly on Cygwin.
 
2057
 
 
2058
- Patch #1435422: zlib's compress and decompress objects now have a
 
2059
  copy() method.
 
2060
 
 
2061
- Patch #1454481: thread stack size is now tunable at runtime for thread
 
2062
  enabled builds on Windows and systems with Posix threads support.
 
2063
 
 
2064
- On Win32, os.listdir now supports arbitrarily-long Unicode path names
 
2065
  (up to the system limit of 32K characters).
 
2066
 
 
2067
- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
 
2068
  As a result, these functions now raise WindowsError instead of OSError.
 
2069
 
 
2070
- ``time.clock()`` on Win64 should use the high-performance Windows
 
2071
  ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
 
2072
  Windows platforms).
 
2073
 
 
2074
- Calling Tk_Init twice is refused if the first call failed as that
 
2075
  may deadlock.
 
2076
 
 
2077
- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
 
2078
  accept it without potentially using an uninitialized pointer.
 
2079
 
 
2080
- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
 
2081
  assuming BerkeleyDB >= 4.0 and 4.4 respectively.  [pybsddb project SF
 
2082
  patch numbers 1494885 and 1494902]
 
2083
 
 
2084
- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
 
2085
  [pybsddb project SF patch number 1466734]
 
2086
 
 
2087
- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
 
2088
  parameter is supplied.  [SF pybsddb bug #1477863]
 
2089
 
 
2090
- bsddb: the __len__ method of a DB object has been fixed to return correct
 
2091
  results.  It could previously incorrectly return 0 in some cases.
 
2092
  Fixes SF bug 1493322 (pybsddb bug 1184012).
 
2093
 
 
2094
- bsddb: the bsddb.dbtables Modify method now raises the proper error and
 
2095
  aborts the db transaction safely when a modifier callback fails.
 
2096
  Fixes SF python patch/bug #1408584.
 
2097
 
 
2098
- bsddb: multithreaded DB access using the simple bsddb module interface
 
2099
  now works reliably.  It has been updated to use automatic BerkeleyDB
 
2100
  deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
 
2101
  database calls that would previously deadlock. [SF python bug #775414]
 
2102
 
 
2103
- Patch #1446489: add support for the ZIP64 extensions to zipfile.
 
2104
 
 
2105
- Patch #1506645: add Python wrappers for the curses functions
 
2106
  is_term_resized, resize_term and resizeterm.
 
2107
 
 
2108
Library
 
2109
-------
 
2110
 
 
2111
- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
 
2112
  functions.
 
2113
 
 
2114
- Patch #812986: Update turtle output even if not tracing.
 
2115
 
 
2116
- Patch #1494750: Destroy master after deleting children in
 
2117
  Tkinter.BaseWidget.
 
2118
 
 
2119
- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
 
2120
 
 
2121
- Patch #763580: Add name and value arguments to Tkinter variable
 
2122
  classes.
 
2123
 
 
2124
- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
 
2125
  mime.types file for determining MIME types.
 
2126
 
 
2127
- Bug #1339007: Shelf objects now don't raise an exception in their
 
2128
  __del__ method when initialization failed.
 
2129
 
 
2130
- Patch #1455898: The MBCS codec now supports the incremental mode for
 
2131
  double-byte encodings.
 
2132
 
 
2133
- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
 
2134
  guarantee that adjacent triples in the return list always describe
 
2135
  non-adjacent blocks.  Previously, a pair of matching blocks could end
 
2136
  up being described by multiple adjacent triples that formed a partition
 
2137
  of the matching pair.
 
2138
 
 
2139
- Bug #1498146: fix optparse to handle Unicode strings in option help,
 
2140
  description, and epilog.
 
2141
 
 
2142
- Bug #1366250: minor optparse documentation error.
 
2143
 
 
2144
- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
 
2145
  clarify docs.
 
2146
 
 
2147
- The wsgiref package has been added to the standard library.
 
2148
 
 
2149
- The functions update_wrapper() and wraps() have been added to the functools
 
2150
  module. These make it easier to copy relevant metadata from the original
 
2151
  function when writing wrapper functions.
 
2152
 
 
2153
- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
 
2154
  ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
 
2155
 
 
2156
- Patch #1359618: Speed up charmap encoder by using a trie structure
 
2157
  for lookup.
 
2158
 
 
2159
- The functions in the ``pprint`` module now sort dictionaries by key
 
2160
  before computing the display.  Before 2.5, ``pprint`` sorted a dictionary
 
2161
  if and only if its display required more than one line, although that
 
2162
  wasn't documented.  The new behavior increases predictability; e.g.,
 
2163
  using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
 
2164
 
 
2165
- Patch #1497027: try HTTP digest auth before basic auth in urllib2
 
2166
  (thanks for J. J. Lee).
 
2167
 
 
2168
- Patch #1496206: improve urllib2 handling of passwords with respect to
 
2169
  default HTTP and HTTPS ports.
 
2170
 
 
2171
- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
 
2172
 
 
2173
- Patch #1281707: speed up gzip.readline.
 
2174
 
 
2175
- Patch #1180296: Two new functions were added to the locale module:
 
2176
  format_string() to get the effect of  "format % items" but locale-aware,
 
2177
  and currency() to format a monetary number with currency sign.
 
2178
 
 
2179
- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
 
2180
  and several features added, such as speed and geometry control.
 
2181
 
 
2182
- Patch #1488881: add support for external file objects in bz2 compressed
 
2183
  tarfiles.
 
2184
 
 
2185
- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
 
2186
  stdout arguments, making it possible to redirect input and output
 
2187
  for remote debugging.
 
2188
 
 
2189
- Patch #1484695: Update the tarfile module to version 0.8. This fixes
 
2190
  a couple of issues, notably handling of long file names using the
 
2191
  GNU LONGNAME extension.
 
2192
 
 
2193
- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
 
2194
  new flag when ``name`` is already the name of an option flag.
 
2195
 
 
2196
- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
 
2197
  package.
 
2198
 
 
2199
- Patch #1472854: make the rlcompleter.Completer class usable on non-
 
2200
  UNIX platforms.
 
2201
 
 
2202
- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
 
2203
 
 
2204
- Bug #1472827: correctly escape newlines and tabs in attribute values in
 
2205
  the saxutils.XMLGenerator class.
 
2206
 
 
2207
 
 
2208
Build
 
2209
-----
 
2210
 
 
2211
- Bug #1502728: Correctly link against librt library on HP-UX.
 
2212
 
 
2213
- OpenBSD 3.9 is supported now.
 
2214
 
 
2215
- Patch #1492356: Port to Windows CE.
 
2216
 
 
2217
- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
 
2218
 
 
2219
- Patch #1471883: Add --enable-universalsdk.
 
2220
 
 
2221
C API
 
2222
-----
 
2223
 
 
2224
Tests
 
2225
-----
 
2226
 
 
2227
Tools
 
2228
-----
 
2229
 
 
2230
Documentation
 
2231
-------------
 
2232
 
 
2233
 
 
2234
 
 
2235
What's New in Python 2.5 alpha 2?
 
2236
=================================
 
2237
 
 
2238
*Release date: 27-APR-2006*
 
2239
 
 
2240
Core and builtins
 
2241
-----------------
 
2242
 
 
2243
- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
 
2244
  by converting these apis from macros into exported functions again:
 
2245
 
 
2246
    PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
 
2247
    PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
 
2248
    PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
 
2249
    PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
 
2250
    PyRun_String Py_CompileString
 
2251
 
 
2252
- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
 
2253
 
 
2254
- All uses of PyStructSequence_InitType have been changed to initialize
 
2255
  the type objects only once, even if the interpreter is initialized
 
2256
  multiple times.
 
2257
 
 
2258
- Bug #1454485, array.array('u') could crash the interpreter.  This was
 
2259
  due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
 
2260
  to unicode when it didn't make sense.  'u#' now requires a unicode string.
 
2261
 
 
2262
- Py_UNICODE is unsigned.  It was always documented as unsigned, but
 
2263
  due to a bug had a signed value in previous versions.
 
2264
 
 
2265
- Patch #837242: ``id()`` of any Python object always gives a positive
 
2266
  number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
 
2267
  ``PyLong_AsVoidPtr`` have been changed accordingly.  Note that it has
 
2268
  never been correct to implement a ``__hash()__`` method that returns the
 
2269
  ``id()`` of an object:
 
2270
 
 
2271
      def __hash__(self):
 
2272
          return id(self)  # WRONG
 
2273
 
 
2274
  because a hash result must be a (short) Python int but it was always
 
2275
  possible for ``id()`` to return a Python long.  However, because ``id()``
 
2276
  could return negative values before, on a 32-bit box an ``id()`` result
 
2277
  was always usable as a hash value before this patch.  That's no longer
 
2278
  necessarily so.
 
2279
 
 
2280
- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
 
2281
  to load extension modules and now provides the dl module. As a result,
 
2282
  sys.setdlopenflags() now works correctly on these systems. (SF patch
 
2283
  #1454844)
 
2284
 
 
2285
- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
 
2286
  involving generators that have paused outside of any ``try`` or ``with``
 
2287
  blocks.  (In 2.5a1, a paused generator that was part of a reference
 
2288
  cycle could not be garbage collected, regardless of whether it was
 
2289
  paused in a ``try`` or ``with`` block.)
 
2290
 
 
2291
Extension Modules
 
2292
-----------------
 
2293
 
 
2294
- Patch #1191065: Fix preprocessor problems on systems where recvfrom
 
2295
  is a macro.
 
2296
 
 
2297
- Bug #1467952: os.listdir() now correctly raises an error if readdir()
 
2298
  fails with an error condition.
 
2299
 
 
2300
- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
 
2301
 
 
2302
- Bug #1117761: bsddb.*open() no longer raises an exception when using
 
2303
  the cachesize parameter.
 
2304
 
 
2305
- Bug #1149413: bsddb.*open() no longer raises an exception when using
 
2306
  a temporary db (file=None) with the 'n' flag to truncate on open.
 
2307
 
 
2308
- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
 
2309
  as older versions cause excessive test failures.
 
2310
 
 
2311
- Patch #1062014: AF_UNIX sockets under Linux have a special
 
2312
  abstract namespace that is now fully supported.
 
2313
 
 
2314
Library
 
2315
-------
 
2316
 
 
2317
- Bug #1223937: subprocess.CalledProcessError reports the exit status
 
2318
  of the process using the returncode attribute, instead of
 
2319
  abusing errno.
 
2320
 
 
2321
- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
 
2322
  a doctest to be skipped (the code is not run, and the expected output
 
2323
  or exception is ignored).
 
2324
 
 
2325
- Fixed contextlib.nested to cope with exceptions being raised and
 
2326
  caught inside exit handlers.
 
2327
 
 
2328
- Updated optparse module to Optik 1.5.1 (allow numeric constants in
 
2329
  hex, octal, or binary; add ``append_const`` action; keep going if
 
2330
  gettext cannot be imported; added ``OptionParser.destroy()`` method;
 
2331
  added ``epilog`` for better help generation).
 
2332
 
 
2333
- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
 
2334
  called from a thread spawned as a side effect of importing a module.
 
2335
 
 
2336
- The pydoc module now supports documenting packages contained in
 
2337
  .zip or .egg files.
 
2338
 
 
2339
- The pkgutil module now has several new utility functions, such
 
2340
  as ``walk_packages()`` to support working with packages that are either
 
2341
  in the filesystem or zip files.
 
2342
 
 
2343
- The mailbox module can now modify and delete messages from
 
2344
  mailboxes, in addition to simply reading them.  Thanks to Gregory
 
2345
  K. Johnson for writing the code, and to the 2005 Google Summer of
 
2346
  Code for funding his work.
 
2347
 
 
2348
- The ``__del__`` method of class ``local`` in module ``_threading_local``
 
2349
  returned before accomplishing any of its intended cleanup.
 
2350
 
 
2351
- Patch #790710: Add breakpoint command lists in pdb.
 
2352
 
 
2353
- Patch #1063914: Add Tkinter.Misc.clipboard_get().
 
2354
 
 
2355
- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
 
2356
 
 
2357
- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
 
2358
  Windows. Bug #1469163.
 
2359
 
 
2360
- The warnings, linecache, inspect, traceback, site, and doctest modules
 
2361
  were updated to work correctly with modules imported from zipfiles or
 
2362
  via other PEP 302 __loader__ objects.
 
2363
 
 
2364
- Patch #1467770: Reduce usage of subprocess._active to processes which
 
2365
  the application hasn't waited on.
 
2366
 
 
2367
- Patch #1462222: Fix Tix.Grid.
 
2368
 
 
2369
- Fix exception when doing glob.glob('anything*/')
 
2370
 
 
2371
- The pstats.Stats class accepts an optional stream keyword argument to
 
2372
  direct output to an alternate file-like object.
 
2373
 
 
2374
Build
 
2375
-----
 
2376
 
 
2377
- The Makefile now has a reindent target, which runs reindent.py on
 
2378
  the library.
 
2379
 
 
2380
- Patch #1470875: Building Python with MS Free Compiler
 
2381
 
 
2382
- Patch #1161914: Add a python-config script.
 
2383
 
 
2384
- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
 
2385
  --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
 
2386
  specified. (Can be overridden by explicitly setting LINKCC.) Decouple
 
2387
  CXX from --with-cxx-main, see description in README.
 
2388
 
 
2389
- Patch #1429775: Link extension modules with the shared libpython.
 
2390
 
 
2391
- Fixed a libffi build problem on MIPS systems.
 
2392
 
 
2393
- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
 
2394
  now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
 
2395
  and "%zu" for unsigned integers of type ``size_t``.
 
2396
 
 
2397
Tests
 
2398
-----
 
2399
 
 
2400
- test_contextlib now checks contextlib.nested can cope with exceptions
 
2401
  being raised and caught inside exit handlers.
 
2402
 
 
2403
- test_cmd_line now checks operation of the -m and -c command switches
 
2404
 
 
2405
- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
 
2406
  it separately and by hand.  It also wasn't cleaning up its changes to
 
2407
  the current Decimal context.
 
2408
 
 
2409
- regrtest.py now has a -M option to run tests that test the new limits of
 
2410
  containers, on 64-bit architectures. Running these tests is only sensible
 
2411
  on 64-bit machines with more than two gigabytes of memory. The argument
 
2412
  passed is the maximum amount of memory for the tests to use.
 
2413
 
 
2414
Tools
 
2415
-----
 
2416
 
 
2417
- Added the Python benchmark suite pybench to the Tools/ directory;
 
2418
  contributed by Marc-Andre Lemburg.
 
2419
 
 
2420
Documentation
 
2421
-------------
 
2422
 
 
2423
- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
 
2424
 
 
2425
- PEP 343: Added Context Types section to the library reference
 
2426
  and attempted to bring other PEP 343 related documentation into
 
2427
  line with the implementation and/or python-dev discussions.
 
2428
 
 
2429
- Bug #1337990: clarified that ``doctest`` does not support examples
 
2430
  requiring both expected output and an exception.
 
2431
 
 
2432
 
 
2433
What's New in Python 2.5 alpha 1?
 
2434
=================================
 
2435
 
 
2436
*Release date: 05-APR-2006*
 
2437
 
 
2438
Core and builtins
 
2439
-----------------
 
2440
 
 
2441
- PEP 338: -m command line switch now delegates to runpy.run_module
 
2442
  allowing it to support modules in packages and zipfiles
 
2443
 
 
2444
- On Windows, .DLL is not an accepted file name extension for
 
2445
  extension modules anymore; extensions are only found if they
 
2446
  end in .PYD.
 
2447
 
 
2448
- Bug #1421664: sys.stderr.encoding is now set to the same value as
 
2449
  sys.stdout.encoding.
 
2450
 
 
2451
- __import__ accepts keyword arguments.
 
2452
 
 
2453
- Patch #1460496: round() now accepts keyword arguments.
 
2454
 
 
2455
- Fixed bug #1459029 - unicode reprs were double-escaped.
 
2456
 
 
2457
- Patch #1396919: The system scope threads are reenabled on FreeBSD
 
2458
  5.4 and later versions.
 
2459
 
 
2460
- Bug #1115379: Compiling a Unicode string with an encoding declaration
 
2461
  now gives a SyntaxError.
 
2462
 
 
2463
- Previously, Python code had no easy way to access the contents of a
 
2464
  cell object. Now, a ``cell_contents`` attribute has been added
 
2465
  (closes patch #1170323).
 
2466
 
 
2467
- Patch #1123430: Python's small-object allocator now returns an arena to
 
2468
  the system ``free()`` when all memory within an arena becomes unused
 
2469
  again.  Prior to Python 2.5, arenas (256KB chunks of memory) were never
 
2470
  freed.  Some applications will see a drop in virtual memory size now,
 
2471
  especially long-running applications that, from time to time, temporarily
 
2472
  use a large number of small objects.  Note that when Python returns an
 
2473
  arena to the platform C's ``free()``, there's no guarantee that the
 
2474
  platform C library will in turn return that memory to the operating system.
 
2475
  The effect of the patch is to stop making that impossible, and in tests it
 
2476
  appears to be effective at least on Microsoft C and gcc-based systems.
 
2477
  Thanks to Evan Jones for hard work and patience.
 
2478
 
 
2479
- Patch #1434038: property() now uses the getter's docstring if there is
 
2480
  no "doc" argument given. This makes it possible to legitimately use
 
2481
  property() as a decorator to produce a read-only property.
 
2482
 
 
2483
- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
 
2484
  nb_index slot to the PyNumberMethods struct.  The slot is consulted instead
 
2485
  of requiring an int or long in slicing and a few other contexts, enabling
 
2486
  other objects (e.g. Numeric Python's integers) to be used as slice indices.
 
2487
 
 
2488
- Fixed various bugs reported by Coverity's Prevent tool.
 
2489
 
 
2490
- PEP 352, patch #1104669: Make exceptions new-style objects.  Introduced the
 
2491
  new exception base class, BaseException, which has a new message attribute.
 
2492
  KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
 
2493
  Raising a string exception now raises a DeprecationWarning.
 
2494
 
 
2495
- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
 
2496
  explicitly relative, using 'from .module import name' to mean 'from the same
 
2497
  package as this module is in. Imports without dots still default to the
 
2498
  old relative-then-absolute, unless 'from __future__ import
 
2499
  absolute_import' is used.
 
2500
 
 
2501
- Properly check if 'warnings' raises an exception (usually when a filter set
 
2502
  to "error" is triggered) when raising a warning for raising string
 
2503
  exceptions.
 
2504
 
 
2505
- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
 
2506
  The name was removed from Include/code.h.
 
2507
 
 
2508
- PEP 308: conditional expressions were added: (x if cond else y).
 
2509
 
 
2510
- Patch 1433928:
 
2511
  - The copy module now "copies" function objects (as atomic objects).
 
2512
  - dict.__getitem__ now looks for a __missing__ hook before raising
 
2513
    KeyError.
 
2514
 
 
2515
- PEP 343: with statement implemented. Needs ``from __future__ import
 
2516
  with_statement``. Use of 'with' as a variable will generate a warning.
 
2517
  Use of 'as' as a variable will also generate a warning (unless it's
 
2518
  part of an import statement).
 
2519
  The following objects have __context__ methods:
 
2520
  - The built-in file type.
 
2521
  - The thread.LockType type.
 
2522
  - The following types defined by the threading module:
 
2523
    Lock, RLock, Condition, Semaphore, BoundedSemaphore.
 
2524
  - The decimal.Context class.
 
2525
 
 
2526
- Fix the encodings package codec search function to only search
 
2527
  inside its own package. Fixes problem reported in patch #1433198.
 
2528
 
 
2529
  Note: Codec packages should implement and register their own
 
2530
  codec search function. PEP 100 has the details.
 
2531
 
 
2532
- PEP 353: Using ``Py_ssize_t`` as the index type.
 
2533
 
 
2534
- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
 
2535
  info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
 
2536
  now allow Python to make use of memory blocks exceeding 2**32 bytes for
 
2537
  some purposes on 64-bit boxes.  A ``PYMALLOC_DEBUG`` build was limited
 
2538
  to 4-byte allocations before.
 
2539
 
 
2540
- Patch #1400181, fix unicode string formatting to not use the locale.
 
2541
  This is how string objects work.  u'%f' could use , instead of .
 
2542
  for the decimal point.  Now both strings and unicode always use periods.
 
2543
 
 
2544
- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
 
2545
  configure would break checking curses.h.
 
2546
 
 
2547
- Bug #959576: The pwd module is now builtin. This allows Python to be
 
2548
  built on UNIX platforms without $HOME set.
 
2549
 
 
2550
- Bug #1072182, fix some potential problems if characters are signed.
 
2551
 
 
2552
- Bug #889500, fix line number on SyntaxWarning for global declarations.
 
2553
 
 
2554
- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
 
2555
 
 
2556
- Support for converting hex strings to floats no longer works.
 
2557
  This was not portable.  float('0x3') now raises a ValueError.
 
2558
 
 
2559
- Patch #1382163: Expose Subversion revision number to Python.  New C API
 
2560
  function Py_GetBuildNumber().  New attribute sys.subversion.  Build number
 
2561
  is now displayed in interactive prompt banner.
 
2562
 
 
2563
- Implementation of PEP 341 - Unification of try/except and try/finally.
 
2564
  "except" clauses can now be written together with a "finally" clause in
 
2565
  one try statement instead of two nested ones.  Patch #1355913.
 
2566
 
 
2567
- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
 
2568
  now encodes backslash correctly.
 
2569
 
 
2570
- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
 
2571
 
 
2572
- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
 
2573
  and long longs.
 
2574
 
 
2575
- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
 
2576
  It was possible for dlerror() to return a NULL pointer, so
 
2577
  it will now use a default error message in this case.
 
2578
 
 
2579
- Replaced most Unicode charmap codecs with new ones using the
 
2580
  new Unicode translate string feature in the builtin charmap
 
2581
  codec; the codecs were created from the mapping tables available
 
2582
  at ftp.unicode.org and contain a few updates (e.g. the Mac OS
 
2583
  encodings now include a mapping for the Apple logo)
 
2584
 
 
2585
- Added a few more codecs for Mac OS encodings
 
2586
 
 
2587
- Sped up some Unicode operations.
 
2588
 
 
2589
- A new AST parser implementation was completed. The abstract
 
2590
  syntax tree is available for read-only (non-compile) access
 
2591
  to Python code; an _ast module was added.
 
2592
 
 
2593
- SF bug #1167751: fix incorrect code being produced for generator expressions.
 
2594
  The following code now raises a SyntaxError:  foo(a = i for i in range(10))
 
2595
 
 
2596
- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
 
2597
 
 
2598
- SF Bug #887946: fix segfault when redirecting stdin from a directory.
 
2599
  Provide a warning when a directory is passed on the command line.
 
2600
 
 
2601
- Fix segfault with invalid coding.
 
2602
 
 
2603
- SF bug #772896: unknown encoding results in MemoryError.
 
2604
 
 
2605
- All iterators now have a Boolean value of True.  Formerly, some iterators
 
2606
  supported a __len__() method which evaluated to False when the iterator
 
2607
  was empty.
 
2608
 
 
2609
- On 64-bit platforms, when __len__() returns a value that cannot be
 
2610
  represented as a C int, raise OverflowError.
 
2611
 
 
2612
- test__locale is skipped on OS X < 10.4 (only partial locale support is
 
2613
  present).
 
2614
 
 
2615
- SF bug #893549: parsing keyword arguments was broken with a few format
 
2616
  codes.
 
2617
 
 
2618
- Changes donated by Elemental Security to make it work on AIX 5.3
 
2619
  with IBM's 64-bit compiler (SF patch #1284289).  This also closes SF
 
2620
  bug #105470: test_pwd fails on 64bit system (Opteron).
 
2621
 
 
2622
- Changes donated by Elemental Security to make it work on HP-UX 11 on
 
2623
  Itanium2 with HP's 64-bit compiler (SF patch #1225212).
 
2624
 
 
2625
- Disallow keyword arguments for type constructors that don't use them
 
2626
  (fixes bug #1119418).
 
2627
 
 
2628
- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
 
2629
 
 
2630
- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
 
2631
  exceptions that cause a function to exit.
 
2632
 
 
2633
- The implementation of set() and frozenset() was revised to use its
 
2634
  own internal data structure.  Memory consumption is reduced by 1/3
 
2635
  and there are modest speed-ups as well.  The API is unchanged.
 
2636
 
 
2637
- SF bug #1238681:  freed pointer is used in longobject.c:long_pow().
 
2638
 
 
2639
- SF bug #1229429: PyObject_CallMethod failed to decrement some
 
2640
  reference counts in some error exit cases.
 
2641
 
 
2642
- SF bug #1185883:  Python's small-object memory allocator took over
 
2643
  a block managed by the platform C library whenever a realloc specified
 
2644
  a small new size.  However, there's no portable way to know then how
 
2645
  much of the address space following the pointer is valid, so there's no
 
2646
  portable way to copy data from the C-managed block into Python's
 
2647
  small-object space without risking a memory fault.  Python's small-object
 
2648
  realloc now leaves such blocks under the control of the platform C
 
2649
  realloc.
 
2650
 
 
2651
- SF bug #1232517: An overflow error was not detected properly when
 
2652
  attempting to convert a large float to an int in os.utime().
 
2653
 
 
2654
- SF bug #1224347: hex longs now print with lowercase letters just
 
2655
  like their int counterparts.
 
2656
 
 
2657
- SF bug #1163563: the original fix for bug #1010677 ("thread Module
 
2658
  Breaks PyGILState_Ensure()") broke badly in the case of multiple
 
2659
  interpreter states; back out that fix and do a better job (see
 
2660
  http://mail.python.org/pipermail/python-dev/2005-June/054258.html
 
2661
  for a longer write-up of the problem).
 
2662
 
 
2663
- SF patch #1180995: marshal now uses a binary format by default when
 
2664
  serializing floats.
 
2665
 
 
2666
- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
 
2667
  the routines that promise to produce IEEE 754 binary representations
 
2668
  of floats now simply copy bytes around.
 
2669
 
 
2670
- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
 
2671
  278.
 
2672
 
 
2673
- patch #1109424: int, long, float, complex, and unicode now check for the
 
2674
  proper magic slot for type conversions when subclassed.  Previously the
 
2675
  magic slot was ignored during conversion.  Semantics now match the way
 
2676
  subclasses of str always behaved.  int/long/float, conversion of an instance
 
2677
  to the base class has been moved to the proper nb_* magic slot and out of
 
2678
  PyNumber_*().
 
2679
  Thanks Walter Dļæ½rwald.
 
2680
 
 
2681
- Descriptors defined in C with a PyGetSetDef structure, where the setter is
 
2682
  NULL, now raise an AttributeError when attempting to set or delete the
 
2683
  attribute.  Previously a TypeError was raised, but this was inconsistent
 
2684
  with the equivalent pure-Python implementation.
 
2685
 
 
2686
- It is now safe to call PyGILState_Release() before
 
2687
  PyEval_InitThreads() (note that if there is reason to believe there
 
2688
  are multiple threads around you still must call PyEval_InitThreads()
 
2689
  before using the Python API; this fix is for extension modules that
 
2690
  have no way of knowing if Python is multi-threaded yet).
 
2691
 
 
2692
- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
 
2693
  disabled caused a crash.
 
2694
 
 
2695
- Bug #1165306: instancemethod_new allowed the creation of a method
 
2696
  with im_class == im_self == NULL, which caused a crash when called.
 
2697
 
 
2698
- Move exception finalisation later in the shutdown process - this
 
2699
  fixes the crash seen in bug #1165761
 
2700
 
 
2701
- Added two new builtins, any() and all().
 
2702
 
 
2703
- Defining a class with empty parentheses is now allowed
 
2704
  (e.g., ``class C(): pass`` is no longer a syntax error).
 
2705
  Patch #1176012 added support to the 'parser' module and 'compiler' package
 
2706
  (thanks to logistix for that added support).
 
2707
 
 
2708
- Patch #1115086: Support PY_LONGLONG in structmember.
 
2709
 
 
2710
- Bug #1155938: new style classes did not check that __init__() was
 
2711
  returning None.
 
2712
 
 
2713
- Patch #802188: Report characters after line continuation character
 
2714
  ('\') with a specific error message.
 
2715
 
 
2716
- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
 
2717
 
 
2718
- Bug #1124295: the __name__ attribute of file objects was
 
2719
  inadvertently made inaccessible in restricted mode.
 
2720
 
 
2721
- Bug #1074011: closing sys.std{out,err} now causes a flush() and
 
2722
  an ferror() call.
 
2723
 
 
2724
- min() and max() now support key= arguments with the same meaning as in
 
2725
  list.sort().
 
2726
 
 
2727
- The peephole optimizer now performs simple constant folding in expressions:
 
2728
      (2+3) --> (5).
 
2729
 
 
2730
- set and frozenset objects can now be marshalled.  SF #1098985.
 
2731
 
 
2732
- Bug #1077106: Poor argument checking could cause memory corruption
 
2733
  in calls to os.read().
 
2734
 
 
2735
- The parser did not complain about future statements in illegal
 
2736
  positions.  It once again reports a syntax error if a future
 
2737
  statement occurs after anything other than a doc string.
 
2738
 
 
2739
- Change the %s format specifier for str objects so that it returns a
 
2740
  unicode instance if the argument is not an instance of basestring and
 
2741
  calling __str__ on the argument returns a unicode instance.
 
2742
 
 
2743
- Patch #1413181:  changed ``PyThreadState_Delete()`` to forget about the
 
2744
  current thread state when the auto-GIL-state machinery knows about
 
2745
  it (since the thread state is being deleted, continuing to remember it
 
2746
  can't help, but can hurt if another thread happens to get created with
 
2747
  the same thread id).
 
2748
 
 
2749
Extension Modules
 
2750
-----------------
 
2751
 
 
2752
- Patch #1380952: fix SSL objects timing out on consecutive read()s
 
2753
 
 
2754
- Patch #1309579: wait3 and wait4 were added to the posix module.
 
2755
 
 
2756
- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
 
2757
  In addition, the existing ulaw code was updated.
 
2758
 
 
2759
- RFE #567972: Socket objects' family, type and proto properties are
 
2760
  now exposed via new attributes.
 
2761
 
 
2762
- Everything under lib-old was removed.  This includes the following modules:
 
2763
    Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
 
2764
    lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
 
2765
    util, whatsound, whrandom, zmod
 
2766
 
 
2767
- The following modules were removed:  regsub, reconvert, regex, regex_syntax.
 
2768
 
 
2769
- re and sre were swapped, so help(re) provides full help.  importing sre
 
2770
  is deprecated.  The undocumented re.engine variable no longer exists.
 
2771
 
 
2772
- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
 
2773
  SS2 (single-shift 2) escape sequences correctly.
 
2774
 
 
2775
- The unicodedata module was updated to the 4.1 version of the Unicode
 
2776
  database. The 3.2 version is still available as unicodedata.db_3_2_0
 
2777
  for applications that require this specific version (such as IDNA).
 
2778
 
 
2779
- The timing module is no longer built by default.  It was deprecated
 
2780
  in PEP 4 in Python 2.0 or earlier.
 
2781
 
 
2782
- Patch 1433928: Added a new type, defaultdict, to the collections module.
 
2783
  This uses the new __missing__ hook behavior added to dict (see above).
 
2784
 
 
2785
- Bug #854823: socketmodule now builds on Sun platforms even when
 
2786
  INET_ADDRSTRLEN is not defined.
 
2787
 
 
2788
- Patch #1393157: os.startfile() now has an optional argument to specify
 
2789
  a "command verb" to invoke on the file.
 
2790
 
 
2791
- Bug #876637, prevent stack corruption when socket descriptor
 
2792
  is larger than FD_SETSIZE.
 
2793
 
 
2794
- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
 
2795
  mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
 
2796
  mmap.mmap(0, size) should not be used on Windows for anonymous memory.
 
2797
 
 
2798
- Patch #1422385: The nis module now supports access to domains other
 
2799
  than the system default domain.
 
2800
 
 
2801
- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
 
2802
  are reported, the limit on path name lengths is removed, and stat reports
 
2803
  WindowsError now (instead of OSError).
 
2804
 
 
2805
- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
 
2806
 
 
2807
- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
 
2808
  before the env.
 
2809
 
 
2810
- Patch #1103116: Basic AF_NETLINK support.
 
2811
 
 
2812
- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
 
2813
 
 
2814
- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
 
2815
  Also fix ungetmouse() which did not accept arguments properly.
 
2816
  The code now conforms to the documented signature.
 
2817
 
 
2818
- Bug #1400115, Fix segfault when calling curses.panel.userptr()
 
2819
  without prior setting of the userptr.
 
2820
 
 
2821
- Fix 64-bit problems in bsddb.
 
2822
 
 
2823
- Patch #1365916: fix some unsafe 64-bit mmap methods.
 
2824
 
 
2825
- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
 
2826
  problem on AIX.
 
2827
 
 
2828
- Bug #869197: os.setgroups rejects long integer arguments
 
2829
 
 
2830
- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
 
2831
 
 
2832
- Bug #1344508, Fix UNIX mmap leaking file descriptors
 
2833
 
 
2834
- Patch #1338314, Bug #1336623: fix tarfile so it can extract
 
2835
  REGTYPE directories from tarfiles written by old programs.
 
2836
 
 
2837
- Patch #1407992, fixes broken bsddb module db associate when using
 
2838
  BerkeleyDB 3.3, 4.0 or 4.1.
 
2839
 
 
2840
- Get bsddb module to build with BerkeleyDB version 4.4
 
2841
 
 
2842
- Get bsddb module to build with BerkeleyDB version 3.2
 
2843
 
 
2844
- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
 
2845
  but Python incorrectly assumes it is in UTF-8 format
 
2846
 
 
2847
- Fix parse errors in the readline module when compiling without threads.
 
2848
 
 
2849
- Patch #1288833: Removed thread lock from socket.getaddrinfo on
 
2850
  FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
 
2851
 
 
2852
- Patches #1298449 and #1298499: Add some missing checks for error
 
2853
  returns in cStringIO.c.
 
2854
 
 
2855
- Patch #1297028: fix segfault if call type on MultibyteCodec,
 
2856
  MultibyteStreamReader, or MultibyteStreamWriter
 
2857
 
 
2858
- Fix memory leak in posix.access().
 
2859
 
 
2860
- Patch #1213831: Fix typo in unicodedata._getcode.
 
2861
 
 
2862
- Bug #1007046: os.startfile() did not accept unicode strings encoded in
 
2863
  the file system encoding.
 
2864
 
 
2865
- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
 
2866
  platforms that don't have inet_aton().
 
2867
 
 
2868
- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
 
2869
 
 
2870
- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
 
2871
  line without newlines.
 
2872
 
 
2873
- Bug #728515: mmap.resize() now resizes the file on Unix as it did
 
2874
  on Windows.
 
2875
 
 
2876
- Patch #1180695: Add nanosecond stat resolution, and st_gen,
 
2877
  st_birthtime for FreeBSD.
 
2878
 
 
2879
- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
 
2880
  the request code argument, which results in more C-like behaviour
 
2881
  for large or negative values.
 
2882
 
 
2883
- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
 
2884
  implementation treated all integer values except 1 as false.
 
2885
 
 
2886
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
 
2887
 
 
2888
- Patch #1212117: os.stat().st_flags is now accessible as a attribute
 
2889
  if available on the platform.
 
2890
 
 
2891
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
 
2892
  available on the platform.
 
2893
 
 
2894
- Bug #1166660: The readline module could segfault if hook functions
 
2895
  were set in a different thread than that which called readline.
 
2896
 
 
2897
- collections.deque objects now support a remove() method.
 
2898
 
 
2899
- operator.itemgetter() and operator.attrgetter() now support retrieving
 
2900
  multiple fields.  This provides direct support for sorting on multiple
 
2901
  keys (primary, secondary, etc).
 
2902
 
 
2903
- os.access now supports Unicode path names on non-Win32 systems.
 
2904
 
 
2905
- Patches #925152, #1118602: Avoid reading after the end of the buffer
 
2906
  in pyexpat.GetInputContext.
 
2907
 
 
2908
- Patches #749830, #1144555: allow UNIX mmap size to default to current
 
2909
  file size.
 
2910
 
 
2911
- Added functional.partial().  See PEP309.
 
2912
 
 
2913
- Patch #1093585: raise a ValueError for negative history items in readline.
 
2914
  {remove_history,replace_history}
 
2915
 
 
2916
- The spwd module has been added, allowing access to the shadow password
 
2917
  database.
 
2918
 
 
2919
- stat_float_times is now True.
 
2920
 
 
2921
- array.array objects are now picklable.
 
2922
 
 
2923
- the cPickle module no longer accepts the deprecated None option in the
 
2924
  args tuple returned by __reduce__().
 
2925
 
 
2926
- itertools.islice() now accepts None for the start and step arguments.
 
2927
  This allows islice() to work more readily with slices:
 
2928
      islice(s.start, s.stop, s.step)
 
2929
 
 
2930
- datetime.datetime() now has a strptime class method which can be used to
 
2931
  create datetime object using a string and format.
 
2932
 
 
2933
- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
 
2934
  with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
 
2935
 
 
2936
Library
 
2937
-------
 
2938
 
 
2939
- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
 
2940
  been renamed to have only a single underscore prefix.  This was done to
 
2941
  make subclassing easier.
 
2942
 
 
2943
- PEP 338: new module runpy defines a run_module function to support
 
2944
  executing modules which provide access to source code or a code object
 
2945
  via the PEP 302 import mechanisms.
 
2946
 
 
2947
- The email module's parsedate_tz function now sets the daylight savings
 
2948
  flag to -1 (unknown) since it can't tell from the date whether it should
 
2949
  be set.
 
2950
 
 
2951
- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
 
2952
  now sport attributes that provide access to the parts of the result.
 
2953
 
 
2954
- Patch #1462498: sgmllib now handles entity and character references
 
2955
  in attribute values.
 
2956
 
 
2957
- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
 
2958
  a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
 
2959
  later to build this - if you have an earlier version, the C extension
 
2960
  module will not be built.
 
2961
 
 
2962
- Bug #1460340: ``random.sample(dict)`` failed in various ways.  Dicts
 
2963
  aren't officially supported here, and trying to use them will probably
 
2964
  raise an exception some day.  But dicts have been allowed, and "mostly
 
2965
  worked", so support for them won't go away without warning.
 
2966
 
 
2967
- Bug #1445068: getpass.getpass() can now be given an explicit stream
 
2968
  argument to specify where to write the prompt.
 
2969
 
 
2970
- Patch #1462313, bug #1443328: the pickle modules now can handle classes
 
2971
  that have __private names in their __slots__.
 
2972
 
 
2973
- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
 
2974
 
 
2975
- patch #1457316: "setup.py upload" now supports --identity to select the
 
2976
  key to be used for signing the uploaded code.
 
2977
 
 
2978
- Queue.Queue objects now support .task_done() and .join() methods
 
2979
  to make it easier to monitor when daemon threads have completed
 
2980
  processing all enqueued tasks.  Patch #1455676.
 
2981
 
 
2982
- popen2.Popen objects now preserve the command in a .cmd attribute.
 
2983
 
 
2984
- Added the ctypes ffi package.
 
2985
 
 
2986
- email 4.0 package now integrated.  This is largely the same as the email 3.0
 
2987
  package that was included in Python 2.3, except that PEP 8 module names are
 
2988
  now used (e.g. mail.message instead of email.Message).  The MIME classes
 
2989
  have been moved to a subpackage (e.g. email.mime.text instead of
 
2990
  email.MIMEText).  The old names are still supported for now.  Several
 
2991
  deprecated Message methods have been removed and lots of bugs have been
 
2992
  fixed.  More details can be found in the email package documentation.
 
2993
 
 
2994
- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
 
2995
  (a subclass of tuple) that provides incremental decoders and encoders
 
2996
  (a way to use stateful codecs without the stream API). Python functions
 
2997
  codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
 
2998
  as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
 
2999
  have been added.
 
3000
 
 
3001
- Patch #1359365: Calling next() on a closed StringIO.String object raises
 
3002
  a ValueError instead of a StopIteration now (like file and cString.String do).
 
3003
  cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
 
3004
  called before (like file and StringIO.StringIO do).
 
3005
 
 
3006
- A regrtest option -w was added to re-run failed tests in verbose mode.
 
3007
 
 
3008
- Patch #1446372: quit and exit can now be called from the interactive
 
3009
  interpreter to exit.
 
3010
 
 
3011
- The function get_count() has been added to the gc module, and gc.collect()
 
3012
  grew an optional 'generation' argument.
 
3013
 
 
3014
- A library msilib to generate Windows Installer files, and a distutils
 
3015
  command bdist_msi have been added.
 
3016
 
 
3017
- PEP 343: new module contextlib.py defines decorator @contextmanager
 
3018
  and helpful context managers nested() and closing().
 
3019
 
 
3020
- The compiler package now supports future imports after the module docstring.
 
3021
 
 
3022
- Bug #1413790: zipfile now sanitizes absolute archive names that are
 
3023
  not allowed by the specs.
 
3024
 
 
3025
- Patch #1215184: FileInput now can be given an opening hook which can
 
3026
  be used to control how files are opened.
 
3027
 
 
3028
- Patch #1212287: fileinput.input() now has a mode parameter for
 
3029
  specifying the file mode input files should be opened with.
 
3030
 
 
3031
- Patch #1215184: fileinput now has a fileno() function for getting the
 
3032
  current file number.
 
3033
 
 
3034
- Patch #1349274: gettext.install() now optionally installs additional
 
3035
  translation functions other than _() in the builtin namespace.
 
3036
 
 
3037
- Patch #1337756: fileinput now accepts Unicode filenames.
 
3038
 
 
3039
- Patch #1373643: The chunk module can now read chunks larger than
 
3040
  two gigabytes.
 
3041
 
 
3042
- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
 
3043
 
 
3044
- Bug #1430298: It is now possible to send a mail with an empty
 
3045
  return address using smtplib.
 
3046
 
 
3047
- Bug #1432260: The names of lambda functions are now properly displayed
 
3048
  in pydoc.
 
3049
 
 
3050
- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
 
3051
  unless the system is Win32.
 
3052
 
 
3053
- Patch #1349118: urllib now supports user:pass@ style proxy
 
3054
  specifications, raises IOErrors when proxies for unsupported protocols
 
3055
  are defined, and uses the https proxy on https redirections.
 
3056
 
 
3057
- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
 
3058
 
 
3059
- Bug #1407902: Add support for sftp:// URIs to urlparse.
 
3060
 
 
3061
- Bug #1371247: Update Windows locale identifiers in locale.py.
 
3062
 
 
3063
- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
 
3064
  any more.
 
3065
 
 
3066
- Bug #1403410: The warnings module now doesn't get confused
 
3067
  when it can't find out the module name it generates a warning for.
 
3068
 
 
3069
- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
 
3070
 
 
3071
- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
 
3072
 
 
3073
- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
 
3074
  LoadError as documented, instead of IOError.  For compatibility,
 
3075
  LoadError subclasses IOError.
 
3076
 
 
3077
- Added the hashlib module.  It provides secure hash functions for MD5 and
 
3078
  SHA1, 224, 256, 384, and 512.  Note that recent developments make the
 
3079
  historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
 
3080
  In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
 
3081
  Ronald L. Rivest offered this advice for Python:
 
3082
 
 
3083
      "The consensus of researchers in this area (at least as
 
3084
      expressed at the NIST Hash Function Workshop 10/31/05),
 
3085
      is that SHA-256 is a good choice for the time being, but
 
3086
      that research should continue, and other alternatives may
 
3087
      arise from this research.  The larger SHA's also seem OK."
 
3088
 
 
3089
- Added a subset of Fredrik Lundh's ElementTree package.  Available
 
3090
  modules are xml.etree.ElementTree, xml.etree.ElementPath, and
 
3091
  xml.etree.ElementInclude, from ElementTree 1.2.6.
 
3092
 
 
3093
- Patch #1162825: Support non-ASCII characters in IDLE window titles.
 
3094
 
 
3095
- Bug #1365984: urllib now opens "data:" URLs again.
 
3096
 
 
3097
- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
 
3098
  is raised within the method itself on a previous call (e.g., passing in an
 
3099
  illegal argument)
 
3100
 
 
3101
- Bug #1340337: change time.strptime() to always return ValueError when there
 
3102
  is an error in the format string.
 
3103
 
 
3104
- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
 
3105
 
 
3106
- Bug #729103: pydoc.py: Fix docother() method to accept additional
 
3107
  "parent" argument.
 
3108
 
 
3109
- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
 
3110
  for padding.
 
3111
 
 
3112
- Bug #1296004: httplib.py: Limit maximal amount of data read from the
 
3113
  socket to avoid a MemoryError on Windows.
 
3114
 
 
3115
- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
 
3116
  to get the correct encoding.
 
3117
 
 
3118
- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
 
3119
  languages.
 
3120
 
 
3121
- Patch #1268314: Cache lines in StreamReader.readlines for performance.
 
3122
 
 
3123
- Bug #1290505: Fix clearing the regex cache for time.strptime().
 
3124
 
 
3125
- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
 
3126
 
 
3127
- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
 
3128
  functionality.
 
3129
 
 
3130
- Bug #1163178: Make IDNA return an empty string when the input is empty.
 
3131
 
 
3132
- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
 
3133
  separator and do not output trailing semicolon.
 
3134
 
 
3135
- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
 
3136
  ContentTooShortException, when the actually downloaded size does not
 
3137
  match the Content-Length header.
 
3138
 
 
3139
- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
 
3140
 
 
3141
- Bug #1178484: Return complete lines from codec stream readers
 
3142
  even if there is an exception in later lines, resulting in
 
3143
  correct line numbers for decoding errors in source code.
 
3144
 
 
3145
- Bug #1192315: Disallow negative arguments to clear() in pdb.
 
3146
 
 
3147
- Patch #827386: Support absolute source paths in msvccompiler.py.
 
3148
 
 
3149
- Patch #1105730: Apply the new implementation of commonprefix in posixpath
 
3150
  to ntpath, macpath, os2emxpath and riscospath.
 
3151
 
 
3152
- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
 
3153
  __hasattr__ and __delattr__ methods on class Tk that were breaking
 
3154
  Tkdnd.
 
3155
 
 
3156
- Bug #1015140: disambiguated the term "article id" in nntplib docs and
 
3157
  docstrings to either "article number" or "message id".
 
3158
 
 
3159
- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
 
3160
  parameter, but uses the usual "kwargs=None".
 
3161
 
 
3162
- textwrap now processes text chunks at O(n) speed instead of O(n**2).
 
3163
  Patch #1209527 (Contributed by Connelly).
 
3164
 
 
3165
- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
 
3166
  to W3C name (404 -> 'Not Found'). RFE #1216944.
 
3167
 
 
3168
- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
 
3169
  as this can cause problems with apps closing all file descriptors.
 
3170
 
 
3171
- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
 
3172
  it can be missing in embedded interpreters
 
3173
 
 
3174
- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
 
3175
 
 
3176
- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
 
3177
  error messages.
 
3178
 
 
3179
- Bug #1108948: Cookie.py produced invalid JavaScript code.
 
3180
 
 
3181
- The tokenize module now detects and reports indentation errors.
 
3182
  Bug #1224621.
 
3183
 
 
3184
- The tokenize module has a new untokenize() function to support a full
 
3185
  roundtrip from lexed tokens back to Python source code.  In addition,
 
3186
  the generate_tokens() function now accepts a callable argument that
 
3187
  terminates by raising StopIteration.
 
3188
 
 
3189
- Bug #1196315: fix weakref.WeakValueDictionary constructor.
 
3190
 
 
3191
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
 
3192
  component of the path.
 
3193
 
 
3194
- Patch #1120353: The xmlrpclib module provides better, more transparent,
 
3195
  support for datetime.{datetime,date,time} objects.  With use_datetime set
 
3196
  to True, applications shouldn't have to fiddle with the DateTime wrapper
 
3197
  class at all.
 
3198
 
 
3199
- distutils.commands.upload was added to support uploading distribution
 
3200
  files to PyPI.
 
3201
 
 
3202
- distutils.commands.register now encodes the data as UTF-8 before posting
 
3203
  them to PyPI.
 
3204
 
 
3205
- decimal operator and comparison methods now return NotImplemented
 
3206
  instead of raising a TypeError when interacting with other types.  This
 
3207
  allows other classes to implement __radd__ style methods and have them
 
3208
  work as expected.
 
3209
 
 
3210
- Bug #1163325:  Decimal infinities failed to hash.  Attempting to
 
3211
  hash a NaN raised an InvalidOperation instead of a TypeError.
 
3212
 
 
3213
- Patch #918101: Add tarfile open mode r|* for auto-detection of the
 
3214
  stream compression; add, for symmetry reasons, r:* as a synonym of r.
 
3215
 
 
3216
- Patch #1043890: Add extractall method to tarfile.
 
3217
 
 
3218
- Patch #1075887: Don't require MSVC in distutils if there is nothing
 
3219
  to build.
 
3220
 
 
3221
- Patch #1103407: Properly deal with tarfile iterators when untarring
 
3222
  symbolic links on Windows.
 
3223
 
 
3224
- Patch #645894: Use getrusage for computing the time consumption in
 
3225
  profile.py if available.
 
3226
 
 
3227
- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
 
3228
 
 
3229
- Patch #1117454: Remove code to special-case cookies without values
 
3230
  in LWPCookieJar.
 
3231
 
 
3232
- Patch #1117339: Add cookielib special name tests.
 
3233
 
 
3234
- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
 
3235
 
 
3236
- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
 
3237
 
 
3238
- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
 
3239
 
 
3240
- Patch #1104111: Alter setup.py --help and --help-commands.
 
3241
 
 
3242
- Patch #1121234: Properly cleanup _exit and tkerror commands.
 
3243
 
 
3244
- Patch #1049151: xdrlib now unpacks booleans as True or False.
 
3245
 
 
3246
- Fixed bug in a NameError bug in cookielib.  Patch #1116583.
 
3247
 
 
3248
- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001).  This
 
3249
  disables recursive traversal through instance attributes, which can
 
3250
  be exploited in various ways.
 
3251
 
 
3252
- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
 
3253
  flags on the HTTP listening socket.
 
3254
 
 
3255
- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
 
3256
  Fixed by reading the HTTP body in chunks instead of one big socket.read().
 
3257
 
 
3258
- Patches #893642, #1039083: add allow_none, encoding arguments to
 
3259
  constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
 
3260
 
 
3261
- Bug #1110478: Revert os.environ.update to do putenv again.
 
3262
 
 
3263
- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
 
3264
 
 
3265
- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
 
3266
 
 
3267
- Enhancements to the csv module:
 
3268
 
 
3269
  + Dialects are now validated by the underlying C code, better
 
3270
    reflecting its capabilities, and improving its compliance with
 
3271
    PEP 305.
 
3272
  + Dialect parameter parsing has been re-implemented to improve error
 
3273
    reporting.
 
3274
  + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
 
3275
    dictates.
 
3276
  + the parser now removes the escapechar prefix from escaped characters.
 
3277
  + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
 
3278
    types, rather than any object that can be represented as a numeric.
 
3279
  + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
 
3280
    to floats.
 
3281
  + reader now allows \r characters to be quoted (previously it only allowed
 
3282
    \n to be quoted).
 
3283
  + writer doublequote handling improved.
 
3284
  + Dialect classes passed to the module are no longer instantiated by
 
3285
    the module before being parsed (the former validation scheme required
 
3286
    this, but the mechanism was unreliable).
 
3287
  + The dialect registry now contains instances of the internal
 
3288
    C-coded dialect type, rather than references to python objects.
 
3289
  + the internal c-coded dialect type is now immutable.
 
3290
  + register_dialect now accepts the same keyword dialect specifications
 
3291
    as the reader and writer, allowing the user to register dialects
 
3292
    without first creating a dialect class.
 
3293
  + a configurable limit to the size of parsed fields has been added -
 
3294
    previously, an unmatched quote character could result in the entire
 
3295
    file being read into the field buffer before an error was reported.
 
3296
  + A new module method csv.field_size_limit() has been added that sets
 
3297
    the parser field size limit (returning the former limit). The initial
 
3298
    limit is 128kB.
 
3299
  + A line_num attribute has been added to the reader object, which tracks
 
3300
    the number of lines read from the source iterator. This is not
 
3301
    the same as the number of records returned, as records can span
 
3302
    multiple lines.
 
3303
  + reader and writer objects were not being registered with the cyclic-GC.
 
3304
    This has been fixed.
 
3305
 
 
3306
- _DummyThread objects in the threading module now delete self.__block that is
 
3307
  inherited from _Thread since it uses up a lock allocated by 'thread'.  The
 
3308
  lock primitives tend to be limited in number and thus should not be wasted on
 
3309
  a _DummyThread object.  Fixes bug #1089632.
 
3310
 
 
3311
- The imghdr module now detects Exif files.
 
3312
 
 
3313
- StringIO.truncate() now correctly adjusts the size attribute.
 
3314
  (Bug #951915).
 
3315
 
 
3316
- locale.py now uses an updated locale alias table (built using
 
3317
  Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
 
3318
  alias file); the encoding lookup was enhanced to use Python's
 
3319
  encoding alias table.
 
3320
 
 
3321
- moved deprecated modules to Lib/lib-old:  whrandom, tzparse, statcache.
 
3322
 
 
3323
- the pickle module no longer accepts the deprecated None option in the
 
3324
  args tuple returned by __reduce__().
 
3325
 
 
3326
- optparse now optionally imports gettext.  This allows its use in setup.py.
 
3327
 
 
3328
- the pickle module no longer uses the deprecated bin parameter.
 
3329
 
 
3330
- the shelve module no longer uses the deprecated binary parameter.
 
3331
 
 
3332
- the pstats module no longer uses the deprecated ignore() method.
 
3333
 
 
3334
- the filecmp module no longer uses the deprecated use_statcache argument.
 
3335
 
 
3336
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
 
3337
  extended or overridden by subclasses.  Formerly, the subclassed method would
 
3338
  be ignored by the rest of the module.  (Bug #1078905).
 
3339
 
 
3340
- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
 
3341
  the same meaning as in list.sort().
 
3342
 
 
3343
- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
 
3344
  once when a size argument is given. This prevents a buffer overflow in the
 
3345
  tokenizer with very long source lines.
 
3346
 
 
3347
- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
 
3348
  immediately after creating the object, without any intervening
 
3349
  ``.decompress()`` calls.
 
3350
 
 
3351
- The reconvert.quote function can now emit triple-quoted strings.  The
 
3352
  reconvert module now has some simple documentation.
 
3353
 
 
3354
- ``UserString.MutableString`` now supports negative indices in
 
3355
  ``__setitem__`` and ``__delitem__``
 
3356
 
 
3357
- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
 
3358
  correctly.
 
3359
 
 
3360
- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
 
3361
  ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
 
3362
  character even if the user has passed a size parameter to get a proper
 
3363
  line ending. Remove the special handling of a "\r\n" that has been split
 
3364
  between two lines.
 
3365
 
 
3366
- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
 
3367
  about illegal code points. The codec now supports PEP 293 style error
 
3368
  handlers.
 
3369
 
 
3370
- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
 
3371
  from the input stream, so that the output is a byte string in the correct
 
3372
  encoding instead of a unicode string.
 
3373
 
 
3374
- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
 
3375
  considering it exactly like a '*'.
 
3376
 
 
3377
- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
 
3378
  ``encodings.aliases``.
 
3379
 
 
3380
- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
 
3381
 
 
3382
- Patch #1413711: Certain patterns of differences were making difflib
 
3383
  touch the recursion limit.
 
3384
 
 
3385
- Bug #947906: An object oriented interface has been added to the calendar
 
3386
  module. It's possible to generate HTML calendar now and the module can be
 
3387
  called as a script (e.g. via ``python -mcalendar``). Localized month and
 
3388
  weekday names can be ouput (even if an exotic encoding is used) using
 
3389
  special classes that use unicode.
 
3390
 
 
3391
Build
 
3392
-----
 
3393
 
 
3394
- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
 
3395
  by using -mieee gcc option.
 
3396
 
 
3397
- Patch #1432345: Make python compile on DragonFly.
 
3398
 
 
3399
- Build support for Win64-AMD64 was added.
 
3400
 
 
3401
- Patch #1428494: Prefer linking against ncursesw over ncurses library.
 
3402
 
 
3403
- Patch #881820: look for openpty and forkpty also in libbsd.
 
3404
 
 
3405
- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
 
3406
  The zlib module is now builtin on Windows.
 
3407
 
 
3408
- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
 
3409
 
 
3410
- Bug #1189330: configure did not correctly determine the necessary
 
3411
  value of LINKCC if python was built with GCC 4.0.
 
3412
 
 
3413
- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
 
3414
  vulnerability in zlib 1.2.1 and 1.2.2.
 
3415
 
 
3416
- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
 
3417
  flags that change binary compatibility.  Changes were also made to
 
3418
  distutils.sysconfig to also use the environment variable when used during
 
3419
  compilation of the interpreter and of C extensions through distutils.
 
3420
 
 
3421
- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
 
3422
  and linking has changed (prebinding is now deprecated, and libcc_dynamic
 
3423
  no longer exists). This configure patch makes things right.
 
3424
 
 
3425
- Bug #1158607: Build with --disable-unicode again.
 
3426
 
 
3427
- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
 
3428
  defined.  Discovered as a result of not being able to build on OS X.
 
3429
 
 
3430
- setup.py now uses the directories specified in LDFLAGS using the -L option
 
3431
  and in CPPFLAGS using the -I option for adding library and include
 
3432
  directories, respectively, for compiling extension modules against.  This has
 
3433
  led to the core being compiled using the values in CPPFLAGS.  It also removes
 
3434
  the need for the special-casing of both DarwinPorts and Fink for darwin since
 
3435
  the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
 
3436
  ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
 
3437
  Fink, ``-I/opt/local/include`` for DarwinPorts).
 
3438
 
 
3439
- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
 
3440
  to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
 
3441
  Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
 
3442
  Closes bug #1096244.  Thanks Gregory Bond.
 
3443
 
 
3444
C API
 
3445
-----
 
3446
 
 
3447
- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
 
3448
  ``PyObject_{Free, FREE}``.  They map to the system ``free()`` now.  If memory
 
3449
  is obtained via the ``PyObject_`` family, it must be released via the
 
3450
  ``PyObject_`` family, and likewise for the ``PyMem_`` family.  This has
 
3451
  always been officially true, but when Python's small-object allocator was
 
3452
  introduced, an attempt was made to cater to a few extension modules
 
3453
  discovered at the time that obtained memory via ``PyObject_New`` but
 
3454
  released it via ``PyMem_DEL``.  It's years later, and if such code still
 
3455
  exists it will fail now (probably with segfaults, but calling wrong
 
3456
  low-level memory management functions can yield many symptoms).
 
3457
 
 
3458
- Added a C API for set and frozenset objects.
 
3459
 
 
3460
- Removed PyRange_New().
 
3461
 
 
3462
- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
 
3463
  mapping argument now. This string is used as a mapping table. Byte values
 
3464
  greater than the length of the string and 0xFFFE are treated as undefined
 
3465
  mappings.
 
3466
 
 
3467
 
 
3468
Tests
 
3469
-----
 
3470
 
 
3471
- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
 
3472
 
 
3473
- Patch #1276356: New resource "urlfetch" is implemented.  This enables
 
3474
  even impatient people to run tests that require remote files.
 
3475
 
 
3476
 
 
3477
Documentation
 
3478
-------------
 
3479
 
 
3480
- Bug #1402224: Add warning to dl docs about crashes.
 
3481
 
 
3482
- Bug #1396471: Document that Windows' ftell() can return invalid
 
3483
  values for text files with UNIX-style line endings.
 
3484
 
 
3485
- Bug #1274828: Document os.path.splitunc().
 
3486
 
 
3487
- Bug #1190204: Clarify which directories are searched by site.py.
 
3488
 
 
3489
- Bug #1193849: Clarify os.path.expanduser() documentation.
 
3490
 
 
3491
- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
 
3492
 
 
3493
- Bug #755617: Document the effects of os.chown() on Windows.
 
3494
 
 
3495
- Patch #1180012: The documentation for modulefinder is now in the library reference.
 
3496
 
 
3497
- Patch #1213031: Document that os.chown() accepts argument values of -1.
 
3498
 
 
3499
- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
 
3500
 
 
3501
- Bug #1175022: Correct the example code for property().
 
3502
 
 
3503
- Document the IterableUserDict class in the UserDict module.
 
3504
  Closes bug #1166582.
 
3505
 
 
3506
- Remove all latent references for "Macintosh" that referred to semantics for
 
3507
  Mac OS 9 and change to reflect the state for OS X.
 
3508
  Closes patch #1095802.  Thanks Jack Jansen.
 
3509
 
 
3510
Mac
 
3511
---
 
3512
 
 
3513
 
 
3514
New platforms
 
3515
-------------
 
3516
 
 
3517
- FreeBSD 7 support is added.
 
3518
 
 
3519
 
 
3520
Tools/Demos
 
3521
-----------
 
3522
 
 
3523
- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
 
3524
  directory for syntax highlighting in Vim.  Vim directory was added and placed
 
3525
  vimrc to it (was previous up a level).
 
3526
 
 
3527
- Added two new files to Tools/scripts: pysource.py, which recursively
 
3528
  finds Python source files, and findnocoding.py, which finds Python
 
3529
  source files that need an encoding declaration.
 
3530
  Patch #784089, credits to Oleg Broytmann.
 
3531
 
 
3532
- Bug #1072853: pindent.py used an uninitialized variable.
 
3533
 
 
3534
- Patch #1177597: Correct Complex.__init__.
 
3535
 
 
3536
- Fixed a display glitch in Pynche, which could cause the right arrow to
 
3537
  wiggle over by a pixel.
 
3538
 
 
3539
 
 
3540
What's New in Python 2.4 final?
 
3541
===============================
 
3542
 
 
3543
*Release date: 30-NOV-2004*
 
3544
 
 
3545
Core and builtins
 
3546
-----------------
 
3547
 
 
3548
- Bug 875692: Improve signal handling, especially when using threads, by
 
3549
  forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
 
3550
  things_to_do is not cleared by Py_MakePendingCalls().
 
3551
 
 
3552
 
 
3553
What's New in Python 2.4 (release candidate 1)
 
3554
==============================================
 
3555
 
 
3556
*Release date: 18-NOV-2004*
 
3557
 
 
3558
Core and builtins
 
3559
-----------------
 
3560
 
 
3561
- Bug 1061968:  Fixes in 2.4a3 to address thread bug 1010677 reintroduced
 
3562
  the years-old thread shutdown race bug 225673.  Numeric history lesson
 
3563
  aside, all bugs in all three reports are fixed now.
 
3564
 
 
3565
 
 
3566
Library
 
3567
-------
 
3568
 
 
3569
- Bug 1052242: If exceptions are raised by an atexit handler function an
 
3570
  attempt is made to execute the remaining handlers.  The last exception
 
3571
  raised is re-raised.
 
3572
 
 
3573
- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
 
3574
  doctests was broken in a dramatic but shallow way.  Fixed.
 
3575
 
 
3576
- Bug 1065388:  ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
 
3577
  and ``month_abbr`` attributes emulate sequences of locale-correct
 
3578
  spellings of month and day names.  Because the locale can change at
 
3579
  any time, the correct spelling is recomputed whenever one of these is
 
3580
  indexed.  In the worst case, the index may be a slice object, so these
 
3581
  recomputed every day or month name each time they were indexed.  This is
 
3582
  much slower than necessary in the usual case, when the index is just an
 
3583
  integer.  In that case, only the single spelling needed is recomputed
 
3584
  now; and, when the index is a slice object, only the spellings needed
 
3585
  by the slice are recomputed now.
 
3586
 
 
3587
- Patch 1061679: Added ``__all__`` to pickletools.py.
 
3588
 
 
3589
Build
 
3590
-----
 
3591
 
 
3592
- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
 
3593
  and CoreFoundation on OS X.  Involved removing PyMac_GetAppletScriptFile()
 
3594
  which has no known users.  Thanks Bob Ippolito.
 
3595
 
 
3596
C API
 
3597
-----
 
3598
 
 
3599
- The PyRange_New() function is deprecated.
 
3600
 
 
3601
 
 
3602
What's New in Python 2.4 beta 2?
 
3603
================================
 
3604
 
 
3605
*Release date: 03-NOV-2004*
 
3606
 
 
3607
License
 
3608
-------
 
3609
 
 
3610
The Python Software Foundation changed the license under which Python
 
3611
is released, to remove Python version numbers.  There were no other
 
3612
changes to the license.  So, for example, wherever the license for
 
3613
Python 2.3 said "Python 2.3", the new license says "Python".  The
 
3614
intent is to make it possible to refer to the PSF license in a more
 
3615
durable way.  For example, some people say they're confused by that
 
3616
the Open Source Initiative's entry for the Python Software Foundation
 
3617
License::
 
3618
 
 
3619
      http://www.opensource.org/licenses/PythonSoftFoundation.php
 
3620
 
 
3621
says "Python 2.1.1" all over it, wondering whether it applies only
 
3622
to Python 2.1.1.
 
3623
 
 
3624
The official name of the new license is the Python Software Foundation
 
3625
License Version 2.
 
3626
 
 
3627
Core and builtins
 
3628
-----------------
 
3629
 
 
3630
- Bug #1055820 Cyclic garbage collection was not protecting against that
 
3631
  calling a live weakref to a piece of cyclic trash could resurrect an
 
3632
  insane mutation of the trash if any Python code ran during gc (via
 
3633
  running a dead object's __del__ method, running another callback on a
 
3634
  weakref to a dead object, or via any Python code run in any other thread
 
3635
  that managed to obtain the GIL while a __del__ or callback was running
 
3636
  in the thread doing gc).  The most likely symptom was "impossible"
 
3637
  ``AttributeError`` exceptions, appearing seemingly at random, on weakly
 
3638
  referenced objects.  The cure was to clear all weakrefs to unreachable
 
3639
  objects before allowing any callbacks to run.
 
3640
 
 
3641
- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
 
3642
 
 
3643
Extension Modules
 
3644
-----------------
 
3645
 
 
3646
- Bug #1048870:  the compiler now generates distinct code objects for
 
3647
  functions with identical bodies.  This was producing confusing
 
3648
  traceback messages which pointed to the function where the code
 
3649
  object was first defined rather than the function being executed.
 
3650
 
 
3651
Library
 
3652
-------
 
3653
 
 
3654
- Patch #1056967 changes the semantics of Template.safe_substitute() so that
 
3655
  no ValueError is raised on an 'invalid' match group.  Now the delimiter is
 
3656
  returned.
 
3657
 
 
3658
- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
 
3659
 
 
3660
- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
 
3661
  paths with a base path before checking os.path.isfile().
 
3662
 
 
3663
- The whichdb module can now be run from the command line.
 
3664
 
 
3665
- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
 
3666
  the year) when the day of the week and year are also specified.
 
3667
 
 
3668
- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
 
3669
 
 
3670
- Bug #1017553: fix bug in tarfile.filemode()
 
3671
 
 
3672
- Patch #737473: fix bug that old source code is shown in tracebacks even if
 
3673
  the source code is updated and reloaded.
 
3674
 
 
3675
Build
 
3676
-----
 
3677
 
 
3678
- Patch #1044395: --enable-shared is allowed in FreeBSD also.
 
3679
 
 
3680
What's New in Python 2.4 beta 1?
 
3681
================================
 
3682
 
 
3683
*Release date: 15-OCT-2004*
 
3684
 
 
3685
Core and builtins
 
3686
-----------------
 
3687
 
 
3688
- Patch #975056: Restartable signals were not correctly disabled on
 
3689
  BSD systems. Consistently use PyOS_setsig() instead of signal().
 
3690
 
 
3691
- The internal portable implementation of thread-local storage (TLS), used
 
3692
  by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
 
3693
  thread-correct.  This could lead to a variety of problems, up to and
 
3694
  including segfaults.  See bug 1041645 for an example.
 
3695
 
 
3696
- Added a command line option, -m module, which searches sys.path for the
 
3697
  module and then runs it.  (Contributed by Nick Coghlan.)
 
3698
 
 
3699
- The bytecode optimizer now folds tuples of constants into a single
 
3700
  constant.
 
3701
 
 
3702
- SF bug #513866:  Float/long comparison anomaly.  Prior to 2.4b1, when
 
3703
  an integer was compared to a float, the integer was coerced to a float.
 
3704
  That could yield spurious overflow errors (if the integer was very
 
3705
  large), and to anomalies such as
 
3706
  ``long(1e200)+1 == 1e200 == long(1e200)-1``.  Coercion to float is no
 
3707
  longer performed, and cases like ``long(1e200)-1 < 1e200``,
 
3708
  ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
 
3709
  correctly now.
 
3710
 
 
3711
Extension modules
 
3712
-----------------
 
3713
 
 
3714
- ``collections.deque`` objects didn't play quite right with garbage
 
3715
  collection, which could lead to a segfault in a release build, or
 
3716
  an assert failure in a debug build.  Also, added overflow checks,
 
3717
  better detection of mutation during iteration, and shielded deque
 
3718
  comparisons from unusual subclass overrides of the __iter__() method.
 
3719
 
 
3720
Library
 
3721
-------
 
3722
 
 
3723
- Patch 1046644: distutils build_ext grew two new options - --swig for
 
3724
  specifying the swig executable to use, and --swig-opts to specify
 
3725
  options to pass to swig. --swig-opts="-c++" is the new way to spell
 
3726
  --swig-cpp.
 
3727
 
 
3728
- Patch 983206: distutils now obeys environment variable LDSHARED, if
 
3729
  it is set.
 
3730
 
 
3731
- Added Peter Astrand's subprocess.py module.  See PEP 324 for details.
 
3732
 
 
3733
- time.strptime() now properly escapes timezones and all other locale-specific
 
3734
  strings for regex-specific symbols.  Was breaking under Japanese Windows when
 
3735
  the timezone was specified as "Tokyo (standard time)".
 
3736
  Closes bug #1039270.
 
3737
 
 
3738
- Updates for the email package:
 
3739
 
 
3740
  + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
 
3741
  + All deprecated APIs that in email 2.x issued warnings have been removed:
 
3742
    _encoder argument to the MIMEText constructor, Message.add_payload(),
 
3743
    Utils.dump_address_pair(), Utils.decode(), Utils.encode()
 
3744
  + New deprecations: Generator.__call__(), Message.get_type(),
 
3745
    Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
 
3746
    the Parser constructor.  These will be removed in email 3.1.
 
3747
  + Support for Python earlier than 2.3 has been removed (see PEP 291).
 
3748
  + All defect classes have been renamed to end in 'Defect'.
 
3749
  + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
 
3750
    added to messages that claim to be multipart but really aren't.
 
3751
  + Updates to documentation.
 
3752
 
 
3753
- re's findall() and finditer() functions now take an optional flags argument
 
3754
  just like the compile(), search(), and match() functions.  Also, documented
 
3755
  the previously existing start and stop parameters for the findall() and
 
3756
  finditer() methods of regular expression objects.
 
3757
 
 
3758
- rfc822 Messages now support iterating over the headers.
 
3759
 
 
3760
- The (undocumented) tarfile.Tarfile.membernames has been removed;
 
3761
  applications should use the getmember function.
 
3762
 
 
3763
- httplib now offers symbolic constants for the HTTP status codes.
 
3764
 
 
3765
- SF bug #1028306:  Trying to compare a ``datetime.date`` to a
 
3766
  ``datetime.datetime`` mistakenly compared only the year, month and day.
 
3767
  Now it acts like a mixed-type comparison:  ``False`` for ``==``,
 
3768
  ``True`` for ``!=``, and raises ``TypeError`` for other comparison
 
3769
  operators.  Because datetime is a subclass of date, comparing only the
 
3770
  base class (date) members can still be done, if that's desired, by
 
3771
  forcing using of the approprate date method; e.g.,
 
3772
  ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
 
3773
  and day members of ``a_date`` and ``a_datetime`` are equal.
 
3774
 
 
3775
- bdist_rpm now supports command line options --force-arch,
 
3776
  {pre,post}-install,  {pre,post}-uninstall, and
 
3777
  {prep,build,install,clean,verify}-script.
 
3778
 
 
3779
- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
 
3780
  decoding incomplete input (when the input stream is temporarily exhausted).
 
3781
  ``codecs.StreamReader`` now implements buffering, which enables proper
 
3782
  readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
 
3783
  has a new argument ``chars`` which specifies the number of characters to
 
3784
  return. ``codecs.StreamReader.readline()`` and
 
3785
  ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
 
3786
  Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
 
3787
 
 
3788
- The documentation for doctest is greatly expanded, and now covers all
 
3789
  the new public features (of which there are many).
 
3790
 
 
3791
- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
 
3792
  updates it.  This isn't good, because every ``testmod()`` call
 
3793
  contributes to bloating the "hidden" state of ``doctest.master``, but
 
3794
  some old code apparently relies on it.  For now, all we can do is
 
3795
  encourage people to stitch doctests together via doctest's unittest
 
3796
  integration features instead.
 
3797
 
 
3798
- httplib now handles ipv6 address/port pairs.
 
3799
 
 
3800
- SF bug #1017864: ConfigParser now correctly handles default keys,
 
3801
  processing them with ``ConfigParser.optionxform`` when supplied,
 
3802
  consistent with the handling of config file entries and runtime-set
 
3803
  options.
 
3804
 
 
3805
- SF bug #997050: Document, test, & check for non-string values in
 
3806
  ConfigParser.  Moved the new string-only restriction added in
 
3807
  rev. 1.65 to the SafeConfigParser class, leaving existing
 
3808
  ConfigParser & RawConfigParser behavior alone, and documented the
 
3809
  conditions under which non-string values work.
 
3810
 
 
3811
Build
 
3812
-----
 
3813
 
 
3814
- Building on darwin now includes /opt/local/include and /opt/local/lib for
 
3815
  building extension modules.  This is so as to include software installed as
 
3816
  a DarwinPorts port <http://darwinports.opendarwin.org/>
 
3817
 
 
3818
- pyport.h now defines a Py_IS_NAN macro.  It works as-is when the
 
3819
  platform C computes true for ``x != x`` if and only if X is a NaN.
 
3820
  Other platforms can override the default definition with a platform-
 
3821
  specific spelling in that platform's pyconfig.h.  You can also override
 
3822
  pyport.h's default Py_IS_INFINITY definition now.
 
3823
 
 
3824
C API
 
3825
-----
 
3826
 
 
3827
- SF patch 1044089:  New function ``PyEval_ThreadsInitialized()`` returns
 
3828
  non-zero if PyEval_InitThreads() has been called.
 
3829
 
 
3830
- The undocumented and unused extern int ``_PyThread_Started`` was removed.
 
3831
 
 
3832
- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
 
3833
  are two of the very few advertised as being safe to call without holding
 
3834
  the GIL.  However, this wasn't true in a debug build, as bug 1041645
 
3835
  demonstrated.  In a debug build, Python redirects the ``PyMem`` family
 
3836
  of calls to Python's small-object allocator, to get the benefit of
 
3837
  its extra debugging capabilities.  But Python's small-object allocator
 
3838
  isn't threadsafe, relying on the GIL to avoid the expense of doing its
 
3839
  own locking.  ``PyInterpreterState_New()`` and ``PyThreadState_New()``
 
3840
  call the platform ``malloc()`` directly now, regardless of build type.
 
3841
 
 
3842
- PyLong_AsUnsignedLong[Mask] now support int objects as well.
 
3843
 
 
3844
- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
 
3845
  ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
 
3846
  decoding.
 
3847
 
 
3848
Tests
 
3849
-----
 
3850
 
 
3851
- test__locale ported to unittest
 
3852
 
 
3853
Mac
 
3854
---
 
3855
 
 
3856
- ``plistlib`` now supports non-dict root objects.  There is also a new
 
3857
  interface for reading and writing plist files: ``readPlist(pathOrFile)``
 
3858
  and ``writePlist(rootObject, pathOrFile)``
 
3859
 
 
3860
Tools/Demos
 
3861
-----------
 
3862
 
 
3863
- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
 
3864
  read the input files in universal-newline mode.  This spares them
 
3865
  from consuming a great deal of time to deduce the useless result that,
 
3866
  e.g., a file with Windows line ends and a file with Linux line ends
 
3867
  have no lines in common.
 
3868
 
 
3869
 
 
3870
What's New in Python 2.4 alpha 3?
 
3871
=================================
 
3872
 
 
3873
*Release date: 02-SEP-2004*
 
3874
 
 
3875
Core and builtins
 
3876
-----------------
 
3877
 
 
3878
- SF patch #1007189: ``from ... import ...`` statements now allow the name
 
3879
  list to be surrounded by parentheses.
 
3880
 
 
3881
- Some speedups for long arithmetic, thanks to Trevor Perrin.  Gradeschool
 
3882
  multiplication was sped a little by optimizing the C code.  Gradeschool
 
3883
  squaring was sped by about a factor of 2, by exploiting that about half
 
3884
  the digit products are duplicates in a square.  Because exponentiation
 
3885
  uses squaring often, this also speeds long power.  For example, the time
 
3886
  to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
 
3887
  to this much.  The cutoff for Karatsuba multiplication was raised,
 
3888
  since gradeschool multiplication got quicker, and the cutoff was
 
3889
  aggressively small regardless.  The exponentiation algorithm was switched
 
3890
  from right-to-left to left-to-right, which is more efficient for small
 
3891
  bases.  In addition, if the exponent is large, the algorithm now does
 
3892
  5 bits (instead of 1 bit) at a time.  That cut the time to compute
 
3893
  17**1000000 on my box in half again, down to about 4.5 seconds.
 
3894
 
 
3895
- OverflowWarning is no longer generated.  PEP 237 scheduled this to
 
3896
  occur in Python 2.3, but since OverflowWarning was disabled by default,
 
3897
  nobody realized it was still being generated.  On the chance that user
 
3898
  code is still using them, the Python builtin OverflowWarning, and
 
3899
  corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
 
3900
 
 
3901
- Py_InitializeEx has been added.
 
3902
 
 
3903
- Fix the order of application of decorators.  The proper order is bottom-up;
 
3904
  the first decorator listed is the last one called.
 
3905
 
 
3906
- SF patch #1005778.  Fix a seg fault if the list size changed while
 
3907
  calling list.index().  This could happen if a rich comparison function
 
3908
  modified the list.
 
3909
 
 
3910
- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
 
3911
  functions is now writable.
 
3912
 
 
3913
- code_new (a.k.a new.code()) now checks its arguments sufficiently
 
3914
  carefully that passing them on to PyCode_New() won't trigger calls
 
3915
  to Py_FatalError() or PyErr_BadInternalCall().  It is still the case
 
3916
  that the returned code object might be entirely insane.
 
3917
 
 
3918
- Subclasses of string can no longer be interned.  The semantics of
 
3919
  interning were not clear here -- a subclass could be mutable, for
 
3920
  example -- and had bugs.  Explicitly interning a subclass of string
 
3921
  via intern() will raise a TypeError.  Internal operations that attempt
 
3922
  to intern a string subclass will have no effect.
 
3923
 
 
3924
- Bug 1003935:  xrange() could report bogus OverflowErrors.  Documented
 
3925
  what xrange() intends, and repaired tests accordingly.
 
3926
 
 
3927
Extension modules
 
3928
-----------------
 
3929
 
 
3930
- difflib now supports HTML side-by-side diff.
 
3931
 
 
3932
- os.urandom has been added for systems that support sources of random
 
3933
  data.
 
3934
 
 
3935
- Patch 1012740:  truncate() on a writable cStringIO now resets the
 
3936
  position to the end of the stream.  This is consistent with the original
 
3937
  StringIO module and avoids inadvertently resurrecting data that was
 
3938
  supposed to have been truncated away.
 
3939
 
 
3940
- Added socket.socketpair().
 
3941
 
 
3942
- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
 
3943
  members to xml.parsers.expat.XMLParser object.
 
3944
 
 
3945
- The mpz, rotor, and xreadlines modules, all deprecated in earlier
 
3946
  versions of Python, have now been removed.
 
3947
 
 
3948
Library
 
3949
-------
 
3950
 
 
3951
- Patch #934356: if a module defines __all__, believe that rather than using
 
3952
  heuristics for filtering out imported names.
 
3953
 
 
3954
- Patch #941486: added os.path.lexists(), which returns True for broken
 
3955
  symlinks, unlike os.path.exists().
 
3956
 
 
3957
- the random module now uses os.urandom() for seeding if it is available.
 
3958
  Added a new generator based on os.urandom().
 
3959
 
 
3960
- difflib and diff.py can now generate HTML.
 
3961
 
 
3962
- bdist_rpm now includes version and release in the BuildRoot, and
 
3963
  replaces - by ``_`` in version and release.
 
3964
 
 
3965
- distutils build/build_scripts now has an -e option to specify the
 
3966
  path to the Python interpreter for installed scripts.
 
3967
 
 
3968
- PEP 292 classes Template and SafeTemplate are added to the string module.
 
3969
 
 
3970
- tarfile now generates GNU tar files by default.
 
3971
 
 
3972
- HTTPResponse has now a getheaders method.
 
3973
 
 
3974
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
 
3975
  Percivall.
 
3976
 
 
3977
- logging.handlers.SMTPHandler.date_time has been removed;
 
3978
  the class now uses email.Utils.formatdate to generate the time stamp.
 
3979
 
 
3980
- A new function tkFont.nametofont was added to return an existing
 
3981
  font. The Font class constructor now has an additional exists argument
 
3982
  which, if True, requests to return/configure an existing font, rather
 
3983
  than creating a new one.
 
3984
 
 
3985
- Updated the decimal package's min() and max() methods to match the
 
3986
  latest revision of the General Decimal Arithmetic Specification.
 
3987
  Quiet NaNs are ignored and equal values are sorted based on sign
 
3988
  and exponent.
 
3989
 
 
3990
- The decimal package's Context.copy() method now returns deep copies.
 
3991
 
 
3992
- Deprecated sys.exitfunc in favor of the atexit module.  The sys.exitfunc
 
3993
  attribute will be kept around for backwards compatibility and atexit
 
3994
  will just become the one preferred way to do it.
 
3995
 
 
3996
- patch #675551: Add get_history_item and replace_history_item functions
 
3997
  to the readline module.
 
3998
 
 
3999
- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
 
4000
  of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
 
4001
  frame, u(p) to an older frame, not the other way around.
 
4002
 
 
4003
- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
 
4004
  path, as normalizing the path may alter the meaning of the path if it
 
4005
  contains symlinks.
 
4006
 
 
4007
- bug #851123: shutil.copyfile will raise an exception when trying to copy a
 
4008
  file onto a link to itself. Thanks Gregory Ball.
 
4009
 
 
4010
- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
 
4011
  so as to properly list all functions in a module when the module itself is
 
4012
  reached through a symlink.  Thanks Johannes Gijsbers.
 
4013
 
 
4014
- doctest refactoring continued.  See the docs for details.  As part of
 
4015
  this effort, some old and little- (never?) used features are now
 
4016
  deprecated:  the Tester class, the module is_private() function, and the
 
4017
  isprivate argument to testmod().  The Tester class supplied a feeble
 
4018
  "by hand" way to combine multiple doctests, if you knew exactly what
 
4019
  you were doing.  The newer doctest features for unittest integration
 
4020
  already did a better job of that, are stronger now than ever, and the
 
4021
  new DocTestRunner class is a saner foundation if you want to do it by
 
4022
  hand.  The "private name" filtering gimmick was a mistake from the
 
4023
  start, and testmod() changed long ago to ignore it by default.  If
 
4024
  you want to filter out tests, the new DocTestFinder class can be used
 
4025
  to return a list of all doctests, and you can filter that list by
 
4026
  any computable criteria before passing it to a DocTestRunner instance.
 
4027
 
 
4028
- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
 
4029
 
 
4030
Tools/Demos
 
4031
-----------
 
4032
 
 
4033
- IDLE's shortcut keys for windows are now case insensitive so that
 
4034
  Control-V works the same as Control-v.
 
4035
 
 
4036
- pygettext.py: Generate POT-Creation-Date header in ISO format.
 
4037
 
 
4038
Build
 
4039
-----
 
4040
 
 
4041
- Backward incompatibility:  longintrepr.h now triggers a compile-time
 
4042
  error if SHIFT (the number of bits in a Python long "digit") isn't
 
4043
  divisible by 5.  This new requirement allows simple code for the new
 
4044
  5-bits-at-a-time long_pow() implementation.  If necessary, the
 
4045
  restriction could be removed (by complicating long_pow(), or by
 
4046
  falling back to the 1-bit-at-a-time algorithm), but there are no
 
4047
  plans to do so.
 
4048
 
 
4049
- bug #991962: When building with --disable-toolbox-glue on Darwin no
 
4050
  attempt to build Mac-specific modules occurs.
 
4051
 
 
4052
- The --with-tsc flag to configure to enable VM profiling with the
 
4053
  processor's timestamp counter now works on PPC platforms.
 
4054
 
 
4055
- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
 
4056
  GCC's definition and avoid redefinition warnings.
 
4057
 
 
4058
- Detect pthreads support (provided by gnu pth pthread emulation) on
 
4059
  GNU/k*BSD systems.
 
4060
 
 
4061
- bug #1005737, #1007249: Fixed several build problems and warnings
 
4062
  found on old/legacy C compilers of HP-UX, IRIX and Tru64.
 
4063
 
 
4064
C API
 
4065
-----
 
4066
 
 
4067
..
 
4068
 
 
4069
Documentation
 
4070
-------------
 
4071
 
 
4072
- patch #1005936, bug #1009373: fix index entries which contain
 
4073
  an underscore when viewed with Acrobat.
 
4074
 
 
4075
- bug #990669: os.path.normpath may alter the meaning of a path if
 
4076
  it contains symbolic links. This has been documented in a comment
 
4077
  since 1992, but is now in the library reference as well.
 
4078
 
 
4079
New platforms
 
4080
-------------
 
4081
 
 
4082
- FreeBSD 6 is now supported.
 
4083
 
 
4084
Tests
 
4085
-----
 
4086
 
 
4087
..
 
4088
 
 
4089
Windows
 
4090
-------
 
4091
 
 
4092
- Boosted the stack reservation for python.exe and pythonw.exe from
 
4093
  the default 1MB to 2MB.  Stack frames under VC 7.1 for 2.4 are enough
 
4094
  bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
 
4095
  within the default sys.getrecursionlimit() default value of 1000 were
 
4096
  able to suffer undetected C stack overflows.  The standard test program
 
4097
  test_compiler was one such program.  If a Python process on Windows
 
4098
  "just vanishes" without a trace, and without an error message of any
 
4099
  kind, but with an exit code of 128, undetected stack overflow may be
 
4100
  the problem.
 
4101
 
 
4102
Mac
 
4103
---
 
4104
 
 
4105
..
 
4106
 
 
4107
 
 
4108
What's New in Python 2.4 alpha 2?
 
4109
=================================
 
4110
 
 
4111
*Release date: 05-AUG-2004*
 
4112
 
 
4113
Core and builtins
 
4114
-----------------
 
4115
 
 
4116
- Patch #980695:  Implements efficient string concatenation for statements
 
4117
  of the form s=s+t and s+=t.  This will vary across implementations.
 
4118
  Accordingly, the str.join() method is strongly preferred for performance
 
4119
  sensitive code.
 
4120
 
 
4121
- PEP-0318, Function Decorators have been added to the language. These are
 
4122
  implemented using the Java-style @decorator syntax, like so::
 
4123
 
 
4124
     @staticmethod
 
4125
     def foo(bar):
 
4126
 
 
4127
  (The PEP needs to be updated to reflect the current state)
 
4128
 
 
4129
- When importing a module M raises an exception, Python no longer leaves M
 
4130
  in sys.modules.  Before 2.4a2 it did, and a subsequent import of M would
 
4131
  succeed, picking up a module object from sys.modules reflecting as much
 
4132
  of the initialization of M as completed before the exception was raised.
 
4133
  Subsequent imports got no indication that M was in a partially-
 
4134
  initialized state, and the importers could get into arbitrarily bad
 
4135
  trouble as a result (the M they got was in an unintended state,
 
4136
  arbitrarily far removed from M's author's intent).  Now subsequent
 
4137
  imports of M will continue raising exceptions (but if, for example, the
 
4138
  source code for M is edited between import attempts, then perhaps later
 
4139
  attempts will succeed, or raise a different exception).
 
4140
 
 
4141
  This can break existing code, but in such cases the code was probably
 
4142
  working before by accident.  In the Python source, the only case of
 
4143
  breakage discovered was in a test accidentally relying on a damaged
 
4144
  module remaining in sys.modules.  Cases are also known where tests
 
4145
  deliberately provoking import errors remove damaged modules from
 
4146
  sys.modules themselves, and such tests will break now if they do an
 
4147
  unconditional del sys.modules[M].
 
4148
 
 
4149
- u'%s' % obj will now try obj.__unicode__() first and fallback to
 
4150
  obj.__str__() if no __unicode__ method can be found.
 
4151
 
 
4152
- Patch #550732: Add PyArg_VaParseTupleAndKeywords().  Analogous to
 
4153
  PyArg_VaParse().  Both are now documented.  Thanks Greg Chapman.
 
4154
 
 
4155
- Allow string and unicode return types from .encode()/.decode()
 
4156
  methods on string and unicode objects.  Added unicode.decode()
 
4157
  which was missing for no apparent reason.
 
4158
 
 
4159
- An attempt to fix the mess that is Python's behaviour with
 
4160
  signal handlers and threads, complicated by readline's behaviour.
 
4161
  It's quite possible that there are still bugs here.
 
4162
 
 
4163
- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
 
4164
  types that support garbage collection.
 
4165
 
 
4166
- Compiler now treats None as a constant.
 
4167
 
 
4168
- The type of values returned by __int__, __float__, __long__,
 
4169
  __oct__, and __hex__ are now checked.  Returning an invalid type
 
4170
  will cause a TypeError to be raised.  This matches the behavior of
 
4171
  Jython.
 
4172
 
 
4173
- Implemented bind_textdomain_codeset() in locale module.
 
4174
 
 
4175
- Added a workaround for proper string operations in BSDs.  str.split
 
4176
  and str.is* methods can now work correctly with UTF-8 locales.
 
4177
 
 
4178
- Bug #989185: unicode.iswide() and unicode.width() is dropped and
 
4179
  the East Asian Width support is moved to unicodedata extension
 
4180
  module.
 
4181
 
 
4182
- Patch #941229: The source code encoding in interactive mode
 
4183
  now refers sys.stdin.encoding not just ISO-8859-1 anymore.  This
 
4184
  allows for non-latin-1 users to write unicode strings directly.
 
4185
 
 
4186
Extension modules
 
4187
-----------------
 
4188
 
 
4189
- cpickle now supports the same keyword arguments as pickle.
 
4190
 
 
4191
Library
 
4192
-------
 
4193
 
 
4194
- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
 
4195
  TIS-620
 
4196
 
 
4197
- Thanks to Edward Loper, doctest has been massively refactored, and
 
4198
  many new features were added.  Full docs will appear later.  For now
 
4199
  the doctest module comments and new test cases give good coverage.
 
4200
  The refactoring provides many hook points for customizing behavior
 
4201
  (such as how to report errors, and how to compare expected to actual
 
4202
  output).  New features include a <BLANKLINE> marker for expected
 
4203
  output containing blank lines, options to produce unified or context
 
4204
  diffs when actual output doesn't match expectations, an option to
 
4205
  normalize whitespace before comparing, and an option to use an
 
4206
  ellipsis to signify "don't care" regions of output.
 
4207
 
 
4208
- Tkinter now supports the wish -sync and -use options.
 
4209
 
 
4210
- The following methods in time support passing of None: ctime(), gmtime(),
 
4211
  and localtime().  If None is provided, the current time is used (the
 
4212
  same as when the argument is omitted).
 
4213
  [SF bug 658254, patch 663482]
 
4214
 
 
4215
- nntplib does now allow to ignore a .netrc file.
 
4216
 
 
4217
- urllib2 now recognizes Basic authentication even if other authentication
 
4218
  schemes are offered.
 
4219
 
 
4220
- Bug #1001053.  wave.open() now accepts unicode filenames.
 
4221
 
 
4222
- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
 
4223
  underlying file object (provided it has a fileno() method).  This is
 
4224
  needed if you want to use os.fsync() on a GzipFile.
 
4225
 
 
4226
- imaplib has two new methods: deleteacl and myrights.
 
4227
 
 
4228
- nntplib has two new methods: description and descriptions. They
 
4229
  use a more RFC-compliant way of getting a newsgroup description.
 
4230
 
 
4231
- Bug #993394.  Fix a possible red herring of KeyError in 'threading' being
 
4232
  raised during interpreter shutdown from a registered function with atexit
 
4233
  when dummy_threading is being used.
 
4234
 
 
4235
- Bug #857297/Patch #916874.  Fix an error when extracting a hard link
 
4236
  from a tarfile.
 
4237
 
 
4238
- Patch #846659.  Fix an error in tarfile.py when using
 
4239
  GNU longname/longlink creation.
 
4240
 
 
4241
- The obsolete FCNTL.py has been deleted.  The builtin fcntl module
 
4242
  has been available (on platforms that support fcntl) since Python
 
4243
  1.5a3, and all FCNTL.py did is export fcntl's names, after generating
 
4244
  a deprecation warning telling you to use fcntl directly.
 
4245
 
 
4246
- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
 
4247
  iso2022_jp_2004, shift_jis_2004.
 
4248
 
 
4249
- Bug #788520.  Queue.{get, get_nowait, put, put_nowait} have new
 
4250
  implementations, exploiting Conditions (which didn't exist at the time
 
4251
  Queue was introduced).  A minor semantic change is that the Full and
 
4252
  Empty exceptions raised by non-blocking calls now occur only if the
 
4253
  queue truly was full or empty at the instant the queue was checked (of
 
4254
  course the Queue may no longer be full or empty by the time a calling
 
4255
  thread sees those exceptions, though).  Before, the exceptions could
 
4256
  also be raised if it was "merely inconvenient" for the implementation
 
4257
  to determine the true state of the Queue (because the Queue was locked
 
4258
  by some other method in progress).
 
4259
 
 
4260
- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
 
4261
  case of comparing two empty lists.  This affected both context_diff() and
 
4262
  unified_diff(),
 
4263
 
 
4264
- Bug #980938: smtplib now prints debug output to sys.stderr.
 
4265
 
 
4266
- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
 
4267
  returning the last point in the path that was not part of any loop.  Thanks
 
4268
  AM Kuchling.
 
4269
 
 
4270
- Bug #980327: ntpath not handles compressing erroneous slashes between the
 
4271
  drive letter and the rest of the path.  Also clearly handles UNC addresses now
 
4272
  as well.  Thanks Paul Moore.
 
4273
 
 
4274
- bug #679953: zipfile.py should now work for files over 2 GB.  The packed data
 
4275
  for file sizes (compressed and uncompressed) was being stored as signed
 
4276
  instead of unsigned.
 
4277
 
 
4278
- decimal.py now only uses signals in the IBM spec.  The other conditions are
 
4279
  no longer part of the public API.
 
4280
 
 
4281
- codecs module now has two new generic APIs: encode() and decode()
 
4282
  which don't restrict the return types (unlike the unicode and
 
4283
  string methods of the same name).
 
4284
 
 
4285
- Non-blocking SSL sockets work again; they were broken in Python 2.3.
 
4286
  SF patch 945642.
 
4287
 
 
4288
- doctest unittest integration improvements:
 
4289
 
 
4290
  o Improved the unitest test output for doctest-based unit tests
 
4291
 
 
4292
  o Can now pass setUp and tearDown functions when creating
 
4293
    DocTestSuites.
 
4294
 
 
4295
- The threading module has a new class, local, for creating objects
 
4296
  that provide thread-local data.
 
4297
 
 
4298
- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
 
4299
  no longer returns spurious empty fields.
 
4300
 
 
4301
- Implemented bind_textdomain_codeset() in gettext module.
 
4302
 
 
4303
- Introduced in gettext module the l*gettext() family of functions,
 
4304
  which return translation strings encoded in the preferred encoding,
 
4305
  as informed by locale module's getpreferredencoding().
 
4306
 
 
4307
- optparse module (and tests) upgraded to Optik 1.5a1.  Changes:
 
4308
 
 
4309
  - Add expansion of default values in help text: the string
 
4310
    "%default" in an option's help string is expanded to str() of
 
4311
    that option's default value, or "none" if no default value.
 
4312
 
 
4313
  - Bug #955889: option default values that happen to be strings are
 
4314
    now processed in the same way as values from the command line; this
 
4315
    allows generation of nicer help when using custom types.  Can
 
4316
    be disabled with parser.set_process_default_values(False).
 
4317
 
 
4318
  - Bug #960515: don't crash when generating help for callback
 
4319
    options that specify 'type', but not 'dest' or 'metavar'.
 
4320
 
 
4321
  - Feature #815264: change the default help format for short options
 
4322
    that take an argument from e.g. "-oARG" to "-o ARG"; add
 
4323
    set_short_opt_delimiter() and set_long_opt_delimiter() methods to
 
4324
    HelpFormatter to allow (slight) customization of the formatting.
 
4325
 
 
4326
  - Patch #736940: internationalize Optik: all built-in user-
 
4327
    targeted literal strings are passed through gettext.gettext().  (If
 
4328
    you want translations (.po files), they're not included with Python
 
4329
    -- you'll find them in the Optik source distribution from
 
4330
    http://optik.sourceforge.net/ .)
 
4331
 
 
4332
  - Bug #878453: respect $COLUMNS environment variable for
 
4333
    wrapping help output.
 
4334
 
 
4335
  - Feature #988122: expand "%prog" in the 'description' passed
 
4336
    to OptionParser, just like in the 'usage' and 'version' strings.
 
4337
    (This is *not* done in the 'description' passed to OptionGroup.)
 
4338
 
 
4339
C API
 
4340
-----
 
4341
 
 
4342
- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx():  if an
 
4343
  error occurs while loading the module, these now delete the module's
 
4344
  entry from sys.modules.  All ways of loading modules eventually call
 
4345
  one of these, so this is an error-case change in semantics for all
 
4346
  ways of loading modules.  In rare cases, a module loader may wish
 
4347
  to keep a module object in sys.modules despite that the module's
 
4348
  code cannot be executed.  In such cases, the module loader must
 
4349
  arrange to reinsert the name and module object in sys.modules.
 
4350
  PyImport_ReloadModule() has been changed to reinsert the original
 
4351
  module object into sys.modules if the module reload fails, so that
 
4352
  its visible semantics have not changed.
 
4353
 
 
4354
- A large pile of datetime field-extraction macros is now documented,
 
4355
  thanks to Anthony Tuininga (patch #986010).
 
4356
 
 
4357
Documentation
 
4358
-------------
 
4359
 
 
4360
- Improved the tutorial on creating types in C.
 
4361
 
 
4362
  - point out the importance of reassigning data members before
 
4363
    assigning their values
 
4364
 
 
4365
  - correct my misconception about return values from visitprocs. Sigh.
 
4366
 
 
4367
  - mention the labor saving Py_VISIT and Py_CLEAR macros.
 
4368
 
 
4369
- Major rewrite of the math module docs, to address common confusions.
 
4370
 
 
4371
Tests
 
4372
-----
 
4373
 
 
4374
- The test data files for the decimal test suite are now installed on
 
4375
  platforms that use the Makefile.
 
4376
 
 
4377
- SF patch 995225:  The test file testtar.tar accidentally contained
 
4378
  CVS keywords (like $Id: HISTORY 69847 2009-02-21 20:59:32Z mark.dickinson $), which could cause spurious failures in
 
4379
  test_tarfile.py depending on how the test file was checked out.
 
4380
 
 
4381
 
 
4382
What's New in Python 2.4 alpha 1?
 
4383
=================================
 
4384
 
 
4385
*Release date: 08-JUL-2004*
 
4386
 
 
4387
Core and builtins
 
4388
-----------------
 
4389
 
 
4390
- weakref.ref is now the type object also known as
 
4391
  weakref.ReferenceType; it can be subclassed like any other new-style
 
4392
  class.  There's less per-entry overhead in WeakValueDictionary
 
4393
  objects now (one object instead of three).
 
4394
 
 
4395
- Bug #951851: Python crashed when reading import table of certain
 
4396
  Windows DLLs.
 
4397
 
 
4398
- Bug #215126.  The locals argument to eval(), execfile(), and exec now
 
4399
  accept any mapping type.
 
4400
 
 
4401
- marshal now shares interned strings. This change introduces
 
4402
  a new .pyc magic.
 
4403
 
 
4404
- Bug #966623. classes created with type() in an exec(, {}) don't
 
4405
  have a __module__, but code in typeobject assumed it would always
 
4406
  be there.
 
4407
 
 
4408
- Python no longer relies on the LC_NUMERIC locale setting to be
 
4409
  the "C" locale; as a result, it no longer tries to prevent changing
 
4410
  the LC_NUMERIC category.
 
4411
 
 
4412
- Bug #952807:  Unpickling pickled instances of subclasses of
 
4413
  datetime.date, datetime.datetime and datetime.time could yield insane
 
4414
  objects.  Thanks to Jiwon Seo for a fix.
 
4415
 
 
4416
- Bug #845802: Python crashes when __init__.py is a directory.
 
4417
 
 
4418
- Unicode objects received two new methods: iswide() and width().
 
4419
  These query East Asian width information, as specified in Unicode
 
4420
  TR11.
 
4421
 
 
4422
- Improved the tuple hashing algorithm to give fewer collisions in
 
4423
  common cases.  Fixes bug  #942952.
 
4424
 
 
4425
- Implemented generator expressions (PEP 289).  Coded by Jiwon Seo.
 
4426
 
 
4427
- Enabled the profiling of C extension functions (and builtins) - check
 
4428
  new documentation and modified profile and bdb modules for more details
 
4429
 
 
4430
- Set file.name to the object passed to open (instead of a new string)
 
4431
 
 
4432
- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
 
4433
 
 
4434
- Optimized the byte coding for multiple assignments like "a,b=b,a" and
 
4435
  "a,b,c=1,2,3".  Improves their speed by 25% to 30%.
 
4436
 
 
4437
- Limit the nested depth of a tuple for the second argument to isinstance()
 
4438
  and issubclass() to the recursion limit of the interpreter.
 
4439
  Fixes bug  #858016 .
 
4440
 
 
4441
- Optimized dict iterators, creating separate types for each
 
4442
  and having them reveal their length.  Also optimized the
 
4443
  methods:  keys(), values(), and items().
 
4444
 
 
4445
- Implemented a newcode opcode, LIST_APPEND, that simplifies
 
4446
  the generated bytecode for list comprehensions and further
 
4447
  improves their performance (about 35%).
 
4448
 
 
4449
- Implemented rich comparisons for floats, which seems to make
 
4450
  comparisons involving NaNs somewhat less surprising when the
 
4451
  underlying C compiler actually implements C99 semantics.
 
4452
 
 
4453
- Optimized list.extend() to save memory and no longer create
 
4454
  intermediate sequences.  Also, extend() now pre-allocates the
 
4455
  needed memory whenever the length of the iterable is known in
 
4456
  advance -- this halves the time to extend the list.
 
4457
 
 
4458
- Optimized list resize operations to make fewer calls to the system
 
4459
  realloc().  Significantly speeds up list appends, list pops,
 
4460
  list comprehensions, and the list constructor (when the input iterable
 
4461
  length is not known).
 
4462
 
 
4463
- Changed the internal list over-allocation scheme.  For larger lists,
 
4464
  overallocation ranged between 3% and 25%.  Now, it is a constant 12%.
 
4465
  For smaller lists (n<8), overallocation was upto eight elements.  Now,
 
4466
  the overallocation is no more than three elements -- this improves space
 
4467
  utilization for applications that have large numbers of small lists.
 
4468
 
 
4469
- Most list bodies now get re-used rather than freed.  Speeds up list
 
4470
  instantiation and deletion by saving calls to malloc() and free().
 
4471
 
 
4472
- The dict.update() method now accepts all the same argument forms
 
4473
  as the dict() constructor.  This now includes item lists and/or
 
4474
  keyword arguments.
 
4475
 
 
4476
- Support for arbitrary objects supporting the read-only buffer
 
4477
  interface as the co_code field of code objects (something that was
 
4478
  only possible to create from C code) has been removed.
 
4479
 
 
4480
- Made omitted callback and None equivalent for weakref.ref() and
 
4481
  weakref.proxy(); the None case wasn't handled correctly in all
 
4482
  cases.
 
4483
 
 
4484
- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
 
4485
  assumed that initial existing entries in an object's weakref list
 
4486
  would not be removed while allocating a new weakref object.  Since
 
4487
  GC could be invoked at that time, however, that assumption was
 
4488
  invalid.  In a truly obscure case of GC being triggered during
 
4489
  creation for a new weakref object for an referent which already
 
4490
  has a weakref without a callback which is only referenced from
 
4491
  cyclic trash, a memory error can occur.  This consistently created a
 
4492
  segfault in a debug build, but provided less predictable behavior in
 
4493
  a release build.
 
4494
 
 
4495
- input() builtin function now respects compiler flags such as
 
4496
  __future__ statements.  SF patch 876178.
 
4497
 
 
4498
- Removed PendingDeprecationWarning from apply().  apply() remains
 
4499
  deprecated, but the nuisance warning will not be issued.
 
4500
 
 
4501
- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
 
4502
  collection twice, both before and after tearing down modules.  The
 
4503
  call after tearing down modules has been disabled, because too much
 
4504
  of Python has been torn down then for __del__ methods and weakref
 
4505
  callbacks to execute sanely.  The most common symptom was a sequence
 
4506
  of uninformative messages on stderr when Python shut down, produced
 
4507
  by threads trying to raise exceptions, but unable to report the nature
 
4508
  of their problems because too much of the sys module had already been
 
4509
  destroyed.
 
4510
 
 
4511
- Removed FutureWarnings related to hex/oct literals and conversions
 
4512
  and left shifts.  (Thanks to Kalle Svensson for SF patch 849227.)
 
4513
  This addresses most of the remaining semantic changes promised by
 
4514
  PEP 237, except for repr() of a long, which still shows the trailing
 
4515
  'L'.  The PEP appears to promise warnings for operations that
 
4516
  changed semantics compared to Python 2.3, but this is not
 
4517
  implemented; we've suffered through enough warnings related to
 
4518
  hex/oct literals and I think it's best to be silent now.
 
4519
 
 
4520
- For str and unicode objects, the ljust(), center(), and rjust()
 
4521
  methods now accept an optional argument specifying a fill
 
4522
  character other than a space.
 
4523
 
 
4524
- When method objects have an attribute that can be satisfied either
 
4525
  by the function object or by the method object, the function
 
4526
  object's attribute usually wins.  Christian Tismer pointed out that
 
4527
  that this is really a mistake, because this only happens for special
 
4528
  methods (like __reduce__) where the method object's version is
 
4529
  really more appropriate than the function's attribute.  So from now
 
4530
  on, all method attributes will have precedence over function
 
4531
  attributes with the same name.
 
4532
 
 
4533
- Critical bugfix, for SF bug 839548:  if a weakref with a callback,
 
4534
  its callback, and its weakly referenced object, all became part of
 
4535
  cyclic garbage during a single run of garbage collection, the order
 
4536
  in which they were torn down was unpredictable.  It was possible for
 
4537
  the callback to see partially-torn-down objects, leading to immediate
 
4538
  segfaults, or, if the callback resurrected garbage objects, to
 
4539
  resurrect insane objects that caused segfaults (or other surprises)
 
4540
  later.  In one sense this wasn't surprising, because Python's cyclic gc
 
4541
  had no knowledge of Python's weakref objects.  It does now.  When
 
4542
  weakrefs with callbacks become part of cyclic garbage now, those
 
4543
  weakrefs are cleared first.  The callbacks don't trigger then,
 
4544
  preventing the problems.  If you need callbacks to trigger, then just
 
4545
  as when cyclic gc is not involved, you need to write your code so
 
4546
  that weakref objects outlive the objects they weakly reference.
 
4547
 
 
4548
- Critical bugfix, for SF bug 840829:  if cyclic garbage collection
 
4549
  happened to occur during a weakref callback for a new-style class
 
4550
  instance, subtle memory corruption was the result (in a release build;
 
4551
  in a debug build, a segfault occurred reliably very soon after).
 
4552
  This has been repaired.
 
4553
 
 
4554
- Compiler flags set in PYTHONSTARTUP are now active in __main__.
 
4555
 
 
4556
- Added two builtin types, set() and frozenset().
 
4557
 
 
4558
- Added a reversed() builtin function that returns a reverse iterator
 
4559
  over a sequence.
 
4560
 
 
4561
- Added a sorted() builtin function that returns a new sorted list
 
4562
  from any iterable.
 
4563
 
 
4564
- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
 
4565
 
 
4566
- list.sort() now supports three keyword arguments:  cmp, key, and reverse.
 
4567
  The key argument can be a function of one argument that extracts a
 
4568
  comparison key from the original record:  mylist.sort(key=str.lower).
 
4569
  The reverse argument is a boolean value and if True will change the
 
4570
  sort order as if the comparison arguments were reversed.  In addition,
 
4571
  the documentation has been amended to provide a guarantee that all sorts
 
4572
  starting with Py2.3 are guaranteed to be stable (the relative order of
 
4573
  records with equal keys is unchanged).
 
4574
 
 
4575
- Added test whether wchar_t is signed or not. A signed wchar_t is not
 
4576
  usable as internal unicode type base for Py_UNICODE since the
 
4577
  unicode implementation assumes an unsigned type.
 
4578
 
 
4579
- Fixed a bug in the cache of length-one Unicode strings that could
 
4580
  lead to a seg fault.  The specific problem occurred when an earlier,
 
4581
  non-fatal error left an uninitialized Unicode object in the
 
4582
  freelist.
 
4583
 
 
4584
- The % formatting operator now supports '%F' which is equivalent to
 
4585
  '%f'.  This has always been documented but never implemented.
 
4586
 
 
4587
- complex(obj) could leak a little memory if obj wasn't a string or
 
4588
  number.
 
4589
 
 
4590
- zip() with no arguments now returns an empty list instead of raising
 
4591
  a TypeError exception.
 
4592
 
 
4593
- obj.__contains__() now returns True/False instead of 1/0.  SF patch
 
4594
  820195.
 
4595
 
 
4596
- Python no longer tries to be smart about recursive comparisons.
 
4597
  When comparing containers with cyclic references to themselves it
 
4598
  will now just hit the recursion limit.  See SF patch 825639.
 
4599
 
 
4600
- str and unicode builtin types now have an rsplit() method that is
 
4601
  same as split() except that it scans the string from the end
 
4602
  working towards the beginning.  See SF feature request 801847.
 
4603
 
 
4604
- Fixed a bug in object.__reduce_ex__ when using protocol 2.  Failure
 
4605
  to clear the error when attempts to get the __getstate__ attribute
 
4606
  fail caused intermittent errors and odd behavior.
 
4607
 
 
4608
- buffer objects based on other objects no longer cache a pointer to
 
4609
  the data and the data length.  Instead, the appropriate tp_as_buffer
 
4610
  method is called as necessary.
 
4611
 
 
4612
- fixed: if a file is opened with an explicit buffer size >= 1, repeated
 
4613
  close() calls would attempt to free() the buffer already free()ed on
 
4614
  the first call.
 
4615
 
 
4616
 
 
4617
Extension modules
 
4618
-----------------
 
4619
 
 
4620
- Added socket.getservbyport(), and make the second argument in
 
4621
  getservbyname() and getservbyport() optional.
 
4622
 
 
4623
- time module code that deals with input POSIX timestamps will now raise
 
4624
  ValueError if more than a second is lost in precision when the
 
4625
  timestamp is cast to the platform C time_t type.  There's no chance
 
4626
  that the platform will do anything sensible with the result in such
 
4627
  cases.  This includes ctime(), localtime() and gmtime().  Assorted
 
4628
  fromtimestamp() and utcfromtimestamp() methods in the datetime module
 
4629
  were also protected.  Closes bugs #919012 and 975996.
 
4630
 
 
4631
- fcntl.ioctl now warns if the mutate flag is not specified.
 
4632
 
 
4633
- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
 
4634
 
 
4635
- the weakref module now supports additional objects:  array.array,
 
4636
  sre.pattern_objects, file objects, and sockets.
 
4637
 
 
4638
- operator.isMappingType() and operator.isSequenceType() now give
 
4639
  fewer false positives.
 
4640
 
 
4641
- socket.sslerror is now a subclass of socket.error .  Also added
 
4642
  socket.error to the socket module's C API.
 
4643
 
 
4644
- Bug #920575: A problem where the _locale module segfaults on
 
4645
  nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
 
4646
 
 
4647
- array objects now support the copy module.  Also, their resizing
 
4648
  scheme has been updated to match that used for list objects.  This improves
 
4649
  the performance (speed and memory usage) of append() operations.
 
4650
  Also, array.array() and array.extend() now accept any iterable argument
 
4651
  for repeated appends without needing to create another temporary array.
 
4652
 
 
4653
- cStringIO.writelines() now accepts any iterable argument and writes
 
4654
  the lines one at a time rather than joining them and writing once.
 
4655
  Made a parallel change to StringIO.writelines().  Saves memory and
 
4656
  makes suitable for use with generator expressions.
 
4657
 
 
4658
- time.strftime() now checks that the values in its time tuple argument
 
4659
  are within the proper boundaries to prevent possible crashes from the
 
4660
  platform's C library implementation of strftime().  Can possibly
 
4661
  break code that uses values outside the range that didn't cause
 
4662
  problems previously (such as sitting day of year to 0).  Fixes bug
 
4663
  #897625.
 
4664
 
 
4665
- The socket module now supports Bluetooth sockets, if the
 
4666
  system has <bluetooth/bluetooth.h>
 
4667
 
 
4668
- Added a collections module containing a new datatype, deque(),
 
4669
  offering high-performance, thread-safe, memory friendly appends
 
4670
  and pops on either side of the deque.
 
4671
 
 
4672
- Several modules now take advantage of collections.deque() for
 
4673
  improved performance:  Queue, mutex, shlex, threading, and pydoc.
 
4674
 
 
4675
- The operator module has two new functions, attrgetter() and
 
4676
  itemgetter() which are useful for creating fast data extractor
 
4677
  functions for map(), list.sort(), itertools.groupby(), and
 
4678
  other functions that expect a function argument.
 
4679
 
 
4680
- socket.SHUT_{RD,WR,RDWR} was added.
 
4681
 
 
4682
- os.getsid was added.
 
4683
 
 
4684
- The pwd module incorrectly advertised its struct type as
 
4685
  struct_pwent; this has been renamed to struct_passwd.  (The old name
 
4686
  is still supported for backwards compatibility.)
 
4687
 
 
4688
- The xml.parsers.expat module now provides Expat 1.95.7.
 
4689
 
 
4690
- socket.IPPROTO_IPV6 was added.
 
4691
 
 
4692
- readline.clear_history was added.
 
4693
 
 
4694
- select.select() now accepts sequences for its first three arguments.
 
4695
 
 
4696
- cStringIO now supports the f.closed attribute.
 
4697
 
 
4698
- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
 
4699
 
 
4700
- curses module now supports use_default_colors().  [patch #739124]
 
4701
 
 
4702
- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
 
4703
 
 
4704
- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
 
4705
 
 
4706
- Implemented non-recursive SRE matching scheme (#757624).
 
4707
 
 
4708
- Implemented (?(id/name)yes|no) support in SRE (#572936).
 
4709
 
 
4710
- random.seed() with no arguments or None uses time.time() as a default
 
4711
  seed.  Modified to match Py2.2 behavior and use fractional seconds so
 
4712
  that successive runs are more likely to produce different sequences.
 
4713
 
 
4714
- random.Random has a new method, getrandbits(k), which returns an int
 
4715
  with k random bits.  This method is now an optional part of the API
 
4716
  for user defined generators.  Any generator that defines genrandbits()
 
4717
  can now use randrange() for ranges with a length >= 2**53.  Formerly,
 
4718
  randrange would return only even numbers for ranges that large (see
 
4719
  SF bug #812202).  Generators that do not define genrandbits() now
 
4720
  issue a warning when randrange() is called with a range that large.
 
4721
 
 
4722
- itertools has a new function, groupby() for aggregating iterables
 
4723
  into groups sharing the same key (as determined by a key function).
 
4724
  It offers some of functionality of SQL's groupby keyword and of
 
4725
  the Unix uniq filter.
 
4726
 
 
4727
- itertools now has a new tee() function which produces two independent
 
4728
  iterators from a single iterable.
 
4729
 
 
4730
- itertools.izip() with no arguments now returns an empty iterator instead
 
4731
  of raising a TypeError exception.
 
4732
 
 
4733
- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
 
4734
  as parameter.
 
4735
 
 
4736
Library
 
4737
-------
 
4738
 
 
4739
- Added a new module: cProfile, a C profiler with the same interface as the
 
4740
  profile module.  cProfile avoids some of the drawbacks of the hotshot
 
4741
  profiler and provides a bit more information than the other two profilers.
 
4742
  Based on "lsprof" (patch #1212837).
 
4743
 
 
4744
- Bug #1266283: The new function "lexists" is now in os.path.__all__.
 
4745
 
 
4746
- Bug #981530: Fix UnboundLocalError in shutil.rmtree().  This affects
 
4747
  the documented behavior: the function passed to the onerror()
 
4748
  handler can now also be os.listdir.
 
4749
 
 
4750
- Bug #754449: threading.Thread objects no longer mask exceptions raised during
 
4751
  interpreter shutdown with another exception from attempting to handle the
 
4752
  original exception.
 
4753
 
 
4754
- Added decimal.py per PEP 327.
 
4755
 
 
4756
- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
 
4757
  "netloc" portion of a URL.
 
4758
 
 
4759
- Bug #919012: shutil.move() will not try to move a directory into itself.
 
4760
  Thanks Johannes Gijsbers.
 
4761
 
 
4762
- Bug #934282: pydoc.stripid() is now case-insensitive.  Thanks Robin Becker.
 
4763
 
 
4764
- Bug #823209:  cmath.log() now takes an optional base argument so that its
 
4765
  API matches math.log().
 
4766
 
 
4767
- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
 
4768
  that generate a -debuginfo.rpm
 
4769
 
 
4770
- os.path.devnull has been added for all supported platforms.
 
4771
 
 
4772
- Fixed #877165: distutils now picks the right C++ compiler command
 
4773
  on cygwin and mingw32.
 
4774
 
 
4775
- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
 
4776
 
 
4777
- refactored site.py into functions.  Also wrote regression tests for the
 
4778
  module.
 
4779
 
 
4780
- The distutils install command now supports the --home option and
 
4781
  installation scheme for all platforms.
 
4782
 
 
4783
- asyncore.loop now has a repeat count parameter that defaults to
 
4784
  looping forever.
 
4785
 
 
4786
- The distutils sdist command now ignores all .svn directories, in
 
4787
  addition to CVS and RCS directories.  .svn directories hold
 
4788
  administrative files for the Subversion source control system.
 
4789
 
 
4790
- Added a new module: cookielib.  Automatic cookie handling for HTTP
 
4791
  clients.  Also, support for cookielib has been added to urllib2, so
 
4792
  urllib2.urlopen() can transparently handle cookies.
 
4793
 
 
4794
- stringprep.py now uses built-in set() instead of sets.Set().
 
4795
 
 
4796
- Bug #876278: Unbounded recursion in modulefinder
 
4797
 
 
4798
- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
 
4799
  Applications relying on the wrong order need to be corrected.
 
4800
 
 
4801
- Bug #926075: Fixed a bug that returns a wrong pattern object
 
4802
  for a string or unicode object in sre.compile() when a different
 
4803
  type pattern with the same value exists.
 
4804
 
 
4805
- Added countcallers arg to trace.Trace class (--trackcalls command line arg
 
4806
  when run from the command prompt).
 
4807
 
 
4808
- Fixed a caching bug in platform.platform() where the argument of 'terse' was
 
4809
  not taken into consideration when caching value.
 
4810
 
 
4811
- Added two new command-line arguments for profile (output file and
 
4812
  default sort).
 
4813
 
 
4814
- Added global runctx function to profile module
 
4815
 
 
4816
- Add hlist missing entryconfigure and entrycget methods.
 
4817
 
 
4818
- The ptcp154 codec was added for Kazakh character set support.
 
4819
 
 
4820
- Support non-anonymous ftp URLs in urllib2.
 
4821
 
 
4822
- The encodings package will now apply codec name aliases
 
4823
  first before starting to try the import of the codec module.
 
4824
  This simplifies overriding built-in codecs with external
 
4825
  packages, e.g. the included CJK codecs with the JapaneseCodecs
 
4826
  package, by adjusting the aliases dictionary in encodings.aliases
 
4827
  accordingly.
 
4828
 
 
4829
- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
 
4830
  decoding standards.
 
4831
 
 
4832
- urllib2 now supports processors.  A processor is a handler that
 
4833
  implements an xxx_request or xxx_response method.  These methods are
 
4834
  called for all requests.
 
4835
 
 
4836
- distutils compilers now compile source files in the same order as
 
4837
  they are passed to the compiler.
 
4838
 
 
4839
- pprint.pprint() and pprint.pformat() now have additional parameters
 
4840
  indent, width and depth.
 
4841
 
 
4842
- Patch #750542: pprint now will pretty print subclasses of list, tuple
 
4843
  and dict too, as long as they don't overwrite __repr__().
 
4844
 
 
4845
- Bug #848614: distutils' msvccompiler fails to find the MSVC6
 
4846
  compiler because of incomplete registry entries.
 
4847
 
 
4848
- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
 
4849
 
 
4850
- Patch #841977: modulefinder didn't find extension modules in packages
 
4851
 
 
4852
- imaplib.IMAP4.thread was added.
 
4853
 
 
4854
- Plugged a minor hole in tempfile.mktemp() due to the use of
 
4855
  os.path.exists(), switched to using os.lstat() directly if possible.
 
4856
 
 
4857
- bisect.py and heapq.py now have underlying C implementations
 
4858
  for better performance.
 
4859
 
 
4860
- heapq.py has two new functions, nsmallest() and nlargest().
 
4861
 
 
4862
- traceback.format_exc has been added (similar to print_exc but it returns
 
4863
  a string).
 
4864
 
 
4865
- xmlrpclib.MultiCall has been added.
 
4866
 
 
4867
- poplib.POP3_SSL has been added.
 
4868
 
 
4869
- tmpfile.mkstemp now returns an absolute path even if dir is relative.
 
4870
 
 
4871
- urlparse is RFC 2396 compliant.
 
4872
 
 
4873
- The fieldnames argument to the csv module's DictReader constructor is now
 
4874
  optional.  If omitted, the first row of the file will be used as the
 
4875
  list of fieldnames.
 
4876
 
 
4877
- encodings.bz2_codec was added for access to bz2 compression
 
4878
  using "a long string".encode('bz2')
 
4879
 
 
4880
- Various improvements to unittest.py, realigned with PyUnit CVS.
 
4881
 
 
4882
- dircache now passes exceptions to the caller, instead of returning
 
4883
  empty lists.
 
4884
 
 
4885
- The bsddb module and dbhash module now support the iterator and
 
4886
  mapping protocols which make them more substitutable for dictionaries
 
4887
  and shelves.
 
4888
 
 
4889
- The csv module's DictReader and DictWriter classes now accept keyword
 
4890
  arguments.  This was an omission in the initial implementation.
 
4891
 
 
4892
- The email package handles some RFC 2231 parameters with missing
 
4893
  CHARSET fields better.  It also includes a patch to parameter
 
4894
  parsing when semicolons appear inside quotes.
 
4895
 
 
4896
- sets.py now runs under Py2.2.  In addition, the argument restrictions
 
4897
  for most set methods (but not the operators) have been relaxed to
 
4898
  allow any iterable.
 
4899
 
 
4900
- _strptime.py now has a behind-the-scenes caching mechanism for the most
 
4901
  recent TimeRE instance used along with the last five unique directive
 
4902
  patterns.  The overall module was also made more thread-safe.
 
4903
 
 
4904
- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
 
4905
  and removed in Py2.4.
 
4906
 
 
4907
- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
 
4908
 
 
4909
- Patch #873597: CJK codecs are imported into rank of default codecs.
 
4910
 
 
4911
Tools/Demos
 
4912
-----------
 
4913
 
 
4914
- A hotshotmain script was added to the Tools/scripts directory that
 
4915
  makes it easy to run a script under control of the hotshot profiler.
 
4916
 
 
4917
- The db2pickle and pickle2db scripts can now dump/load gdbm files.
 
4918
 
 
4919
- The file order on the command line of the pickle2db script was reversed.
 
4920
  It is now [ picklefile ] dbfile.  This provides better symmetry with
 
4921
  db2pickle.  The file arguments to both scripts are now source followed by
 
4922
  destination in situations where both files are given.
 
4923
 
 
4924
- The pydoc script will display a link to the module documentation for
 
4925
  modules determined to be part of the core distribution.  The documentation
 
4926
  base directory defaults to http://www.python.org/doc/current/lib/ but can
 
4927
  be changed by setting the PYTHONDOCS environment variable.
 
4928
 
 
4929
- texcheck.py now detects double word errors.
 
4930
 
 
4931
- md5sum.py mistakenly opened input files in text mode by default, a
 
4932
  silent and dangerous change from previous releases.  It once again
 
4933
  opens input files in binary mode by default.  The -t and -b flags
 
4934
  remain for compatibility with the 2.3 release, but -b is the default
 
4935
  now.
 
4936
 
 
4937
- py-electric-colon now works when pending-delete/delete-selection mode is
 
4938
  in effect
 
4939
 
 
4940
- py-help-at-point is no longer bound to the F1 key - it's still bound to
 
4941
  C-c C-h
 
4942
 
 
4943
- Pynche was fixed to not crash when there is no ~/.pynche file and no
 
4944
  -d option was given.
 
4945
 
 
4946
Build
 
4947
-----
 
4948
 
 
4949
- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
 
4950
  build under OS X.
 
4951
 
 
4952
- Profiling using gprof is now available if Python is configured with
 
4953
  --enable-profiling.
 
4954
 
 
4955
- Profiling the VM using the Pentium TSC is now possible if Python
 
4956
  is configured --with-tsc.
 
4957
 
 
4958
- In order to find libraries, setup.py now also looks in /lib64, for use
 
4959
  on AMD64.
 
4960
 
 
4961
- Bug #934635: Fixed a bug where the configure script couldn't detect
 
4962
  getaddrinfo() properly if the KAME stack had SCTP support.
 
4963
 
 
4964
- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
 
4965
  removed.
 
4966
 
 
4967
- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
 
4968
  supported (see PEP 11).
 
4969
 
 
4970
- Universal newline support can no longer be disabled (see PEP 11).
 
4971
 
 
4972
- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
 
4973
 
 
4974
- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
 
4975
  (see PEP 11).
 
4976
 
 
4977
- Tests for sizeof(char) were removed since ANSI C mandates that
 
4978
  sizeof(char) must be 1.
 
4979
 
 
4980
C API
 
4981
-----
 
4982
 
 
4983
- Thanks to Anthony Tuininga, the datetime module now supplies a C API
 
4984
  containing type-check macros and constructors.  See new docs in the
 
4985
  Python/C API Reference Manual for details.
 
4986
 
 
4987
- Private function _PyTime_DoubleToTimet added, to convert a Python
 
4988
  timestamp (C double) to platform time_t with some out-of-bounds
 
4989
  checking.  Declared in new header file timefuncs.h.  It would be
 
4990
  good to expose some other internal timemodule.c functions there.
 
4991
 
 
4992
- New public functions PyEval_EvaluateFrame and PyGen_New to expose
 
4993
  generator objects.
 
4994
 
 
4995
- New public functions Py_IncRef() and Py_DecRef(), exposing the
 
4996
  functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
 
4997
  runtime dynamic embedding of Python.  See patch #938302, by Bob
 
4998
  Ippolito.
 
4999
 
 
5000
- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
 
5001
  underlying array of PyObject pointers.  Useful for high speed looping.
 
5002
 
 
5003
- Created a new method flag, METH_COEXIST, which causes a method to be loaded
 
5004
  even if already defined by a slot wrapper.  This allows a __contains__
 
5005
  method, for example, to co-exist with a defined sq_contains slot.  This
 
5006
  is helpful because the PyCFunction can take advantage of optimized calls
 
5007
  whenever METH_O or METH_NOARGS flags are defined.
 
5008
 
 
5009
- Added a new function, PyDict_Contains(d, k) which is like
 
5010
  PySequence_Contains() but is specific to dictionaries and executes
 
5011
  about 10% faster.
 
5012
 
 
5013
- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
 
5014
  Each return the singleton they mention after Py_INCREF()ing them.
 
5015
 
 
5016
- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
 
5017
  variable length argument list of Python objects without having to invoke
 
5018
  the more complex machinery of Py_BuildValue().  PyTuple_Pack(3, a, b, c)
 
5019
  is equivalent to Py_BuildValue("(OOO)", a, b, c).
 
5020
 
 
5021
Windows
 
5022
-------
 
5023
 
 
5024
- The _winreg module could segfault when reading very large registry
 
5025
  values, due to unchecked alloca() calls (SF bug 851056).  The fix is
 
5026
  uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
 
5027
  as appropriate, followed by a size check.
 
5028
 
 
5029
- file.truncate() could misbehave if the file was open for update
 
5030
  (modes r+, rb+, w+, wb+), and the most recent file operation before
 
5031
  the truncate() call was an input operation.  SF bug 801631.
 
5032
 
 
5033
 
 
5034
What's New in Python 2.3 final?
 
5035
===============================
 
5036
 
 
5037
*Release date: 29-Jul-2003*
 
5038
 
 
5039
IDLE
 
5040
----
 
5041
 
 
5042
- Bug 778400:  IDLE hangs when selecting "Edit with IDLE" from explorer.
 
5043
  This was unique to Windows, and was fixed by adding an -n switch to
 
5044
  the command the Windows installer creates to execute "Edit with IDLE"
 
5045
  context-menu actions.
 
5046
 
 
5047
- IDLE displays a new message upon startup:  some "personal firewall"
 
5048
  kinds of programs (for example, ZoneAlarm) open a dialog of their
 
5049
  own when any program opens a socket.  IDLE does use sockets, talking
 
5050
  on the computer's internal loopback interface.  This connection is not
 
5051
  visible on any external interface and no data is sent to or received
 
5052
  from the Internet.  So, if you get such a dialog when opening IDLE,
 
5053
  asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
 
5054
  and rest assured no communication external to your machine is taking
 
5055
  place.  If you don't allow it, IDLE won't be able to start.
 
5056
 
 
5057
 
 
5058
What's New in Python 2.3 release candidate 2?
 
5059
=============================================
 
5060
 
 
5061
*Release date: 24-Jul-2003*
 
5062
 
 
5063
Core and builtins
 
5064
-----------------
 
5065
 
 
5066
- It is now possible to import from zipfiles containing additional
 
5067
  data bytes before the zip compatible archive.  Zipfiles containing a
 
5068
  comment at the end are still unsupported.
 
5069
 
 
5070
Extension modules
 
5071
-----------------
 
5072
 
 
5073
- A longstanding bug in the parser module's initialization could cause
 
5074
  fatal internal refcount confusion when the module got initialized more
 
5075
  than once.  This has been fixed.
 
5076
 
 
5077
- Fixed memory leak in pyexpat; using the parser's ParseFile() method
 
5078
  with open files that aren't instances of the standard file type
 
5079
  caused an instance of the bound .read() method to be leaked on every
 
5080
  call.
 
5081
 
 
5082
- Fixed some leaks in the locale module.
 
5083
 
 
5084
Library
 
5085
-------
 
5086
 
 
5087
- Lib/encodings/rot_13.py when used as a script, now more properly
 
5088
  uses the first Python interpreter on your path.
 
5089
 
 
5090
- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
 
5091
  fix a locale related bug in the test suite.  Although another patch
 
5092
  was needed to actually fix the problem, the cache code was not
 
5093
  restored.
 
5094
 
 
5095
IDLE
 
5096
----
 
5097
 
 
5098
- Calltips patches.
 
5099
 
 
5100
Build
 
5101
-----
 
5102
 
 
5103
- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
 
5104
  on Panther (OSX 10.3).
 
5105
 
 
5106
C API
 
5107
-----
 
5108
 
 
5109
Windows
 
5110
-------
 
5111
 
 
5112
- The tempfile module could do insane imports on Windows if PYTHONCASEOK
 
5113
  was set, making temp file creation impossible.  Repaired.
 
5114
 
 
5115
- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
 
5116
 
 
5117
Mac
 
5118
---
 
5119
 
 
5120
- Various fixes to pimp.
 
5121
 
 
5122
- Scripts runs with pythonw no longer had full window manager access.
 
5123
 
 
5124
- Don't force boot-disk-only install, for reasons unknown it causes
 
5125
  more problems than it solves.
 
5126
 
 
5127
 
 
5128
What's New in Python 2.3 release candidate 1?
 
5129
=============================================
 
5130
 
 
5131
*Release date: 18-Jul-2003*
 
5132
 
 
5133
Core and builtins
 
5134
-----------------
 
5135
 
 
5136
- The new function sys.getcheckinterval() returns the last value set
 
5137
  by sys.setcheckinterval().
 
5138
 
 
5139
- Several bugs in the symbol table phase of the compiler have been
 
5140
  fixed.  Errors could be lost and compilation could fail without
 
5141
  reporting an error.  SF patch 763201.
 
5142
 
 
5143
- The interpreter is now more robust about importing the warnings
 
5144
  module.  In an executable generated by freeze or similar programs,
 
5145
  earlier versions of 2.3 would fail if the warnings module could
 
5146
  not be found on the file system.  Fixes SF bug 771097.
 
5147
 
 
5148
- A warning about assignments to module attributes that shadow
 
5149
  builtins, present in earlier releases of 2.3, has been removed.
 
5150
 
 
5151
- It is not possible to create subclasses of builtin types like str
 
5152
  and tuple that define an itemsize.  Earlier releases of Python 2.3
 
5153
  allowed this by mistake, leading to crashes and other problems.
 
5154
 
 
5155
- The thread_id is now initialized to 0 in a non-thread build.  SF bug
 
5156
  770247.
 
5157
 
 
5158
- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
 
5159
 
 
5160
Extension modules
 
5161
-----------------
 
5162
 
 
5163
- weakref.proxy() can now handle "del obj[i]" for proxy objects
 
5164
  defining __delitem__.  Formerly, it generated a SystemError.
 
5165
 
 
5166
- SSL no longer crashes the interpreter when the remote side disconnects.
 
5167
 
 
5168
- On Unix the mmap module can again be used to map device files.
 
5169
 
 
5170
- time.strptime now exclusively uses the Python implementation
 
5171
  contained within the _strptime module.
 
5172
 
 
5173
- The print slot of weakref proxy objects was removed, because it was
 
5174
  not consistent with the object's repr slot.
 
5175
 
 
5176
- The mmap module only checks file size for regular files, not
 
5177
  character or block devices.  SF patch 708374.
 
5178
 
 
5179
- The cPickle Pickler garbage collection support was fixed to traverse
 
5180
  the find_class attribute, if present.
 
5181
 
 
5182
- There are several fixes for the bsddb3 wrapper module.
 
5183
 
 
5184
  bsddb3 no longer crashes if an environment is closed before a cursor
 
5185
  (SF bug 763298).
 
5186
 
 
5187
  The DB and DBEnv set_get_returns_none function was extended to take
 
5188
  a level instead of a boolean flag.  The new level 2 means that in
 
5189
  addition, cursor.set()/.get() methods return None instead of raising
 
5190
  an exception.
 
5191
 
 
5192
  A typo was fixed in DBCursor.join_item(), preventing a crash.
 
5193
 
 
5194
Library
 
5195
-------
 
5196
 
 
5197
- distutils now supports MSVC 7.1
 
5198
 
 
5199
- doctest now examines all docstrings by default.  Previously, it would
 
5200
  skip over functions with private names (as indicated by the underscore
 
5201
  naming convention).  The old default created too much of a risk that
 
5202
  user tests were being skipped inadvertently.  Note, this change could
 
5203
  break code in the unlikely case that someone had intentionally put
 
5204
  failing tests in the docstrings of private functions.  The breakage
 
5205
  is easily fixable by specifying the old behavior when calling testmod()
 
5206
  or Tester().
 
5207
 
 
5208
- There were several fixes to the way dumbdbms are closed.  It's vital
 
5209
  that a dumbdbm database be closed properly, else the on-disk data
 
5210
  and directory files can be left in mutually inconsistent states.
 
5211
  dumbdbm.py's _Database.__del__() method attempted to close the
 
5212
  database properly, but a shutdown race in _Database._commit() could
 
5213
  prevent this from working, so that a program trusting __del__() to
 
5214
  get the on-disk files in synch could be badly surprised.  The race
 
5215
  has been repaired.  A sync() method was also added so that shelve
 
5216
  can guarantee data is written to disk.
 
5217
 
 
5218
  The close() method can now be called more than once without complaint.
 
5219
 
 
5220
- The classes in threading.py are now new-style classes.  That they
 
5221
  weren't before was an oversight.
 
5222
 
 
5223
- The urllib2 digest authentication handlers now define the correct
 
5224
  auth_header.  The earlier versions would fail at runtime.
 
5225
 
 
5226
- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
 
5227
  when there are no lines.
 
5228
 
 
5229
- SF bug 763637: fix exception in Tkinter with after_cancel
 
5230
  which could occur with Tk 8.4
 
5231
 
 
5232
- SF bug 770601: CGIHTTPServer.py now passes the entire environment
 
5233
  to child processes.
 
5234
 
 
5235
- SF bug 765238: add filter to fnmatch's __all__.
 
5236
 
 
5237
- SF bug 748201: make time.strptime() error messages more helpful.
 
5238
 
 
5239
- SF patch 764470: Do not dump the args attribute of a Fault object in
 
5240
  xmlrpclib.
 
5241
 
 
5242
- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
 
5243
  responses.
 
5244
 
 
5245
- SF patch 766650: The whichdb module was fixed to recognize dbm files
 
5246
  generated by gdbm on OS/2 EMX.
 
5247
 
 
5248
- SF bugs 763047 and 763052: fixes bug of timezone value being left as
 
5249
  -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
 
5250
  is true when it should only when time.daylight is true.
 
5251
 
 
5252
- SF bug 764548: re now allows subclasses of str and unicode to be
 
5253
  used as patterns.
 
5254
 
 
5255
- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
 
5256
  of varying sizes.  Tk 8.4 returns a different number of values
 
5257
  than Tk 8.3.
 
5258
 
 
5259
- SF bug 763023: difflib.ratio() did not catch zero division.
 
5260
 
 
5261
- The Queue module now has an __all__ attribute.
 
5262
 
 
5263
Tools/Demos
 
5264
-----------
 
5265
 
 
5266
- See Lib/idlelib/NEWS.txt for IDLE news.
 
5267
 
 
5268
- SF bug 753592: webchecker/wsgui now handles user supplied directories.
 
5269
 
 
5270
- The trace.py script has been removed.  It is now in the standard library.
 
5271
 
 
5272
Build
 
5273
-----
 
5274
 
 
5275
- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
 
5276
 
 
5277
- The socket module compiles on IRIX 6.5.10.
 
5278
 
 
5279
- An irix64 system is treated the same way as an irix6 system (SF
 
5280
  patch 764560).
 
5281
 
 
5282
- Several definitions were missing on FreeBSD 5.x unless the
 
5283
  __BSD_VISIBLE symbol was defined.  configure now defines it as
 
5284
  needed.
 
5285
 
 
5286
C API
 
5287
-----
 
5288
 
 
5289
- Unicode objects now support mbcs as a built-in encoding, so the C
 
5290
  API can use it without deferring to the encodings package.
 
5291
 
 
5292
Windows
 
5293
-------
 
5294
 
 
5295
- The Windows implementation of PyThread_start_new_thread() never
 
5296
  checked error returns from Windows functions correctly.  As a result,
 
5297
  it could claim to start a new thread even when the Microsoft
 
5298
  _beginthread() function failed (due to "too many threads" -- this is
 
5299
  on the order of thousands when it happens).  In these cases, the
 
5300
  Python exception ::
 
5301
 
 
5302
      thread.error: can't start new thread
 
5303
 
 
5304
  is raised now.
 
5305
 
 
5306
- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
 
5307
  use.  The interpreter now calls WSACleanup() from Py_Finalize()
 
5308
  instead of from DLL teardown.
 
5309
 
 
5310
Mac
 
5311
---
 
5312
 
 
5313
- Bundlebuilder now inherits default values in the right way.  It was
 
5314
  previously possible for app bundles to get a type of "BNDL" instead
 
5315
  of "APPL."  Other improvements include, a --build-id option to
 
5316
  specify the CFBundleIdentifier and using the --python option to set
 
5317
  the executable in the bundle.
 
5318
 
 
5319
- Fixed two bugs in MacOSX framework handling.
 
5320
 
 
5321
- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
 
5322
 
 
5323
- Python is now compiled with -mno-fused-madd, making all tests pass
 
5324
  on Panther.
 
5325
 
 
5326
What's New in Python 2.3 beta 2?
 
5327
================================
 
5328
 
 
5329
*Release date: 29-Jun-2003*
 
5330
 
 
5331
Core and builtins
 
5332
-----------------
 
5333
 
 
5334
- A program can now set the environment variable PYTHONINSPECT to some
 
5335
  string value in Python, and cause the interpreter to enter the
 
5336
  interactive prompt at program exit, as if Python had been invoked
 
5337
  with the -i option.
 
5338
 
 
5339
- list.index() now accepts optional start and stop arguments.  Similar
 
5340
  changes were made to UserList.index(). SF feature request 754014.
 
5341
 
 
5342
- SF patch 751998 fixes an unwanted side effect of the previous fix
 
5343
  for SF bug 742860 (the next item).
 
5344
 
 
5345
- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys".  This
 
5346
  wasn't threadsafe, was very inefficient (expected time O(len(dict))
 
5347
  instead of O(1)), and could raise a spurious RuntimeError if another
 
5348
  thread mutated the dict during __delitem__, or if a comparison function
 
5349
  mutated it.  It also neglected to raise KeyError when the key wasn't
 
5350
  present; didn't raise TypeError when the key wasn't of a weakly
 
5351
  referencable type; and broke various more-or-less obscure dict
 
5352
  invariants by using a sequence of equality comparisons over the whole
 
5353
  set of dict keys instead of computing the key's hash code to narrow
 
5354
  the search to those keys with the same hash code.  All of these are
 
5355
  considered to be bugs.  A new implementation of __delitem__ repairs all
 
5356
  that, but note that fixing these bugs may change visible behavior in
 
5357
  code relying (whether intentionally or accidentally) on old behavior.
 
5358
 
 
5359
- SF bug 734869: Fixed a compiler bug that caused a fatal error when
 
5360
  compiling a list comprehension that contained another list comprehension
 
5361
  embedded in a lambda expression.
 
5362
 
 
5363
- SF bug 705231:  builtin pow() no longer lets the platform C pow()
 
5364
  raise -1.0 to integer powers, because (at least) glibc gets it wrong
 
5365
  in some cases.  The result should be -1.0 if the power is odd and 1.0
 
5366
  if the power is even, and any float with a sufficiently large exponent
 
5367
  is (mathematically) an exact even integer.
 
5368
 
 
5369
- SF bug 759227: A new-style class that implements __nonzero__() must
 
5370
  return a bool or int (but not an int subclass) from that method.  This
 
5371
  matches the restriction on classic classes.
 
5372
 
 
5373
- The encoding attribute has been added for file objects, and set to
 
5374
  the terminal encoding on Unix and Windows.
 
5375
 
 
5376
- The softspace attribute of file objects became read-only by oversight.
 
5377
  It's writable again.
 
5378
 
 
5379
- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
 
5380
  tuple.  By default, the iterators now access data elements directly
 
5381
  instead of going through __getitem__.  If __getitem__ access is
 
5382
  preferred, then __iter__ can be overridden.
 
5383
 
 
5384
- SF bug 735247: The staticmethod and super types participate in
 
5385
  garbage collection. Before this change, it was possible for leaks to
 
5386
  occur in functions with non-global free variables that used these types.
 
5387
 
 
5388
Extension modules
 
5389
-----------------
 
5390
 
 
5391
- the socket module has a new exception, socket.timeout, to allow
 
5392
  timeouts to be handled separately from other socket errors.
 
5393
 
 
5394
- SF bug 751276: cPickle has fixed to propagate exceptions raised in
 
5395
  user code.  In earlier versions, cPickle caught and ignored any
 
5396
  exception when it performed operations that it expected to raise
 
5397
  specific exceptions like AttributeError.
 
5398
 
 
5399
- cPickle Pickler and Unpickler objects now participate in garbage
 
5400
  collection.
 
5401
 
 
5402
- mimetools.choose_boundary() could return duplicate strings at times,
 
5403
  especially likely on Windows.  The strings returned are now guaranteed
 
5404
  unique within a single program run.
 
5405
 
 
5406
- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
 
5407
  dummy_thread has also been modified to try to simulate the behavior.
 
5408
 
 
5409
- array.array.insert() now treats negative indices as being relative
 
5410
  to the end of the array, just like list.insert() does. (SF bug #739313)
 
5411
 
 
5412
- The datetime module classes datetime, time, and timedelta are now
 
5413
  properly subclassable.
 
5414
 
 
5415
- _tkinter.{get|set}busywaitinterval was added.
 
5416
 
 
5417
- itertools.islice() now accepts stop=None as documented.
 
5418
  Fixes SF bug #730685.
 
5419
 
 
5420
- the bsddb185 module is built in one restricted instance -
 
5421
  /usr/include/db.h exists and defines HASHVERSION to be 2.  This is true
 
5422
  for many BSD-derived systems.
 
5423
 
 
5424
 
 
5425
Library
 
5426
-------
 
5427
 
 
5428
- Some happy doctest extensions from Jim Fulton have been added to
 
5429
  doctest.py.  These are already being used in Zope3.  The two
 
5430
  primary ones:
 
5431
 
 
5432
  doctest.debug(module, name) extracts the doctests from the named object
 
5433
  in the given module, puts them in a temp file, and starts pdb running
 
5434
  on that file.  This is great when a doctest fails.
 
5435
 
 
5436
  doctest.DocTestSuite(module=None) returns a synthesized unittest
 
5437
  TestSuite instance, to be run by the unittest framework, which
 
5438
  runs all the doctests in the module.  This allows writing tests in
 
5439
  doctest style (which can be clearer and shorter than writing tests
 
5440
  in unittest style), without losing unittest's powerful testing
 
5441
  framework features (which doctest lacks).
 
5442
 
 
5443
- For compatibility with doctests created before 2.3, if an expected
 
5444
  output block consists solely of "1" and the actual output block
 
5445
  consists solely of "True", it's accepted as a match; similarly
 
5446
  for "0" and "False".  This is quite un-doctest-like, but is practical.
 
5447
  The behavior can be disabled by passing the new doctest module
 
5448
  constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
 
5449
  argument.
 
5450
 
 
5451
- ZipFile.testzip() now only traps BadZipfile exceptions.  Previously,
 
5452
  a bare except caught to much and reported all errors as a problem
 
5453
  in the archive.
 
5454
 
 
5455
- The logging module now has a new function, makeLogRecord() making
 
5456
  LogHandler easier to interact with DatagramHandler and SocketHandler.
 
5457
 
 
5458
- The cgitb module has been extended to support plain text display (SF patch
 
5459
  569574).
 
5460
 
 
5461
- A brand new version of IDLE (from the IDLEfork project at
 
5462
  SourceForge) is now included as Lib/idlelib.  The old Tools/idle is
 
5463
  no more.
 
5464
 
 
5465
- Added a new module: trace (documentation missing).  This module used
 
5466
  to be distributed in Tools/scripts.  It uses sys.settrace() to trace
 
5467
  code execution -- either function calls or individual lines.  It can
 
5468
  generate tracing output during execution or a post-mortem report of
 
5469
  code coverage.
 
5470
 
 
5471
- The threading module has new functions settrace() and setprofile()
 
5472
  that cooperate with the functions of the same name in the sys
 
5473
  module.  A function registered with the threading module will
 
5474
  be used for all threads it creates.  The new trace module uses this
 
5475
  to provide tracing for code running in threads.
 
5476
 
 
5477
- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
 
5478
  Taschuk.  Copying a new-style class that had a reference to itself
 
5479
  didn't work.  (The same thing worked fine for old-style classes.)
 
5480
  Builtin functions are now treated as atomic, fixing bug #746304.
 
5481
 
 
5482
- difflib.py has two new functions:  context_diff() and unified_diff().
 
5483
 
 
5484
- More fixes to urllib (SF 549151): (a) When redirecting, always use
 
5485
  GET.  This is common practice and more-or-less sanctioned by the
 
5486
  HTTP standard. (b) Add a handler for 307 redirection, which becomes
 
5487
  an error for POST, but a regular redirect for GET and HEAD
 
5488
 
 
5489
- Added optional 'onerror' argument to os.walk(), to control error
 
5490
  handling.
 
5491
 
 
5492
- inspect.is{method|data}descriptor was added, to allow pydoc display
 
5493
  __doc__ of data descriptors.
 
5494
 
 
5495
- Fixed socket speed loss caused by use of the _socketobject wrapper class
 
5496
  in socket.py.
 
5497
 
 
5498
- timeit.py now checks the current directory for imports.
 
5499
 
 
5500
- urllib2.py now knows how to order proxy classes, so the user doesn't
 
5501
  have to insert it in front of other classes, nor do dirty tricks like
 
5502
  inserting a "dummy" HTTPHandler after a ProxyHandler when building an
 
5503
  opener with proxy support.
 
5504
 
 
5505
- Iterators have been added for dbm keys.
 
5506
 
 
5507
- random.Random objects can now be pickled.
 
5508
 
 
5509
Tools/Demos
 
5510
-----------
 
5511
 
 
5512
- pydoc now offers help on keywords and topics.
 
5513
 
 
5514
- Tools/idle is gone; long live Lib/idlelib.
 
5515
 
 
5516
- diff.py prints file diffs in context, unified, or ndiff formats,
 
5517
  providing a command line interface to difflib.py.
 
5518
 
 
5519
- texcheck.py is a new script for making a rough validation of Python LaTeX
 
5520
  files.
 
5521
 
 
5522
Build
 
5523
-----
 
5524
 
 
5525
- Setting DESTDIR during 'make install' now allows specifying a
 
5526
  different root directory.
 
5527
 
 
5528
C API
 
5529
-----
 
5530
 
 
5531
- PyType_Ready():  If a type declares that it participates in gc
 
5532
  (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
 
5533
  tp_free slot is the default _PyObject_Del, and type does not define
 
5534
  a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
 
5535
  Previously _PyObject_Del was inherited, which could at best lead to a
 
5536
  segfault.  In addition, if even after this magic the type's tp_free
 
5537
  slot is _PyObject_Del or NULL, and the type is a base type
 
5538
  (Py_TPFLAGS_BASETYPE), TypeError is raised:  since the type is a base
 
5539
  type, its dealloc function must call type->tp_free, and since the type
 
5540
  is gc'able, tp_free must not be NULL or _PyObject_Del.
 
5541
 
 
5542
- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
 
5543
  from C) to interrupt a thread by sending it an exception.  It is
 
5544
  intentional that you have to write your own C extension to call it
 
5545
  from Python.
 
5546
 
 
5547
 
 
5548
New platforms
 
5549
-------------
 
5550
 
 
5551
None this time.
 
5552
 
 
5553
Tests
 
5554
-----
 
5555
 
 
5556
- test_imp rewritten so that it doesn't raise RuntimeError if run as a
 
5557
  side effect of being imported ("import test.autotest").
 
5558
 
 
5559
Windows
 
5560
-------
 
5561
 
 
5562
- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
 
5563
 
 
5564
- The installer always suggested that Python be installed on the C:
 
5565
  drive, due to a hardcoded "C:" generated by the Wise installation
 
5566
  wizard.  People with machines where C: is not the system drive
 
5567
  usually want Python installed on whichever drive is their system drive
 
5568
  instead.  We removed the hardcoded "C:", and two testers on machines
 
5569
  where C: is not the system drive report that the installer now
 
5570
  suggests their system drive.  Note that you can always select the
 
5571
  directory you want in the "Select Destination Directory" dialog --
 
5572
  that's what it's for.
 
5573
 
 
5574
Mac
 
5575
---
 
5576
 
 
5577
- There's a new module called "autoGIL", which offers a mechanism to
 
5578
  automatically release the Global Interpreter Lock when an event loop
 
5579
  goes to sleep, allowing other threads to run. It's currently only
 
5580
  supported on OSX, in the Mach-O version.
 
5581
- The OSA modules now allow direct access to properties of the
 
5582
  toplevel application class (in AppleScript terminology).
 
5583
- The Package Manager can now update itself.
 
5584
 
 
5585
SourceForge Bugs and Patches Applied
 
5586
------------------------------------
 
5587
 
 
5588
430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
 
5589
598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
 
5590
622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
 
5591
661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
 
5592
683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
 
5593
697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
 
5594
713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
 
5595
724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
 
5596
727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
 
5597
729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
 
5598
730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
 
5599
731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
 
5600
732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
 
5601
733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
 
5602
735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
 
5603
740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
 
5604
744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
 
5605
745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
 
5606
747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
 
5607
749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
 
5608
751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
 
5609
753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
 
5610
755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
 
5611
757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
 
5612
760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
 
5613
 
 
5614
 
 
5615
What's New in Python 2.3 beta 1?
 
5616
================================
 
5617
 
 
5618
*Release date: 25-Apr-2003*
 
5619
 
 
5620
Core and builtins
 
5621
-----------------
 
5622
 
 
5623
- New format codes B, H, I, k and K have been implemented for
 
5624
  PyArg_ParseTuple and PyBuild_Value.
 
5625
 
 
5626
- New builtin function sum(seq, start=0) returns the sum of all the
 
5627
  items in iterable object seq, plus start (items are normally numbers,
 
5628
  and cannot be strings).
 
5629
 
 
5630
- bool() called without arguments now returns False rather than
 
5631
  raising an exception.  This is consistent with calling the
 
5632
  constructors for the other builtin types -- called without argument
 
5633
  they all return the false value of that type.  (SF patch #724135)
 
5634
 
 
5635
- In support of PEP 269 (making the pgen parser generator accessible
 
5636
  from Python), some changes to the pgen code structure were made; a
 
5637
  few files that used to be linked only with pgen are now linked with
 
5638
  Python itself.
 
5639
 
 
5640
- The repr() of a weakref object now shows the __name__ attribute of
 
5641
  the referenced object, if it has one.
 
5642
 
 
5643
- super() no longer ignores data descriptors, except __class__.  See
 
5644
  the thread started at
 
5645
  http://mail.python.org/pipermail/python-dev/2003-April/034338.html
 
5646
 
 
5647
- list.insert(i, x) now interprets negative i as it would be
 
5648
  interpreted by slicing, so negative values count from the end of the
 
5649
  list.  This was the only place where such an interpretation was not
 
5650
  placed on a list index.
 
5651
 
 
5652
- range() now works even if the arguments are longs with magnitude
 
5653
  larger than sys.maxint, as long as the total length of the sequence
 
5654
  fits.  E.g., range(2**100, 2**101, 2**100) is the following list:
 
5655
  [1267650600228229401496703205376L].  (SF patch #707427.)
 
5656
 
 
5657
- Some horridly obscure problems were fixed involving interaction
 
5658
  between garbage collection and old-style classes with "ambitious"
 
5659
  getattr hooks.  If an old-style instance didn't have a __del__ method,
 
5660
  but did have a __getattr__ hook, and the instance became reachable
 
5661
  only from an unreachable cycle, and the hook resurrected or deleted
 
5662
  unreachable objects when asked to resolve "__del__", anything up to
 
5663
  a segfault could happen.  That's been repaired.
 
5664
 
 
5665
- dict.pop now takes an optional argument specifying a default
 
5666
  value to return if the key is not in the dict.  If a default is not
 
5667
  given and the key is not found, a KeyError will still be raised.
 
5668
  Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
 
5669
  [SF patch #693753] (contributed by Michael Stone.)
 
5670
 
 
5671
- sys.getfilesystemencoding() was added to expose
 
5672
  Py_FileSystemDefaultEncoding.
 
5673
 
 
5674
- New function sys.exc_clear() clears the current exception.  This is
 
5675
  rarely needed, but can sometimes be useful to release objects
 
5676
  referenced by the traceback held in sys.exc_info()[2].  (SF patch
 
5677
  #693195.)
 
5678
 
 
5679
- On 64-bit systems, a dictionary could contain duplicate long/int keys
 
5680
  if the key value was larger than 2**32.  See SF bug #689659.
 
5681
 
 
5682
- Fixed SF bug #663074. The codec system was using global static
 
5683
  variables to store internal data. As a result, any attempts to use the
 
5684
  unicode system with multiple active interpreters, or successive
 
5685
  interpreter executions, would fail.
 
5686
 
 
5687
- "%c" % u"a" now returns a unicode string instead of raising a
 
5688
  TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
 
5689
  of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
 
5690
 
 
5691
Extension modules
 
5692
-----------------
 
5693
 
 
5694
- The socket module now provides the functions inet_pton and inet_ntop
 
5695
  for converting between string and packed representation of IP
 
5696
  addresses.  There is also a new module variable, has_ipv6, which is
 
5697
  True iff the current Python has IPv6 support.  See SF patch #658327.
 
5698
 
 
5699
- Tkinter wrappers around Tcl variables now pass objects directly
 
5700
  to Tcl, instead of first converting them to strings.
 
5701
 
 
5702
- The .*? pattern in the re module is now special-cased to avoid the
 
5703
  recursion limit.  (SF patch #720991 -- many thanks to Gary Herron
 
5704
  and Greg Chapman.)
 
5705
 
 
5706
- New function sys.call_tracing() allows pdb to debug code
 
5707
  recursively.
 
5708
 
 
5709
- New function gc.get_referents(obj) returns a list of objects
 
5710
  directly referenced by obj.  In effect, it exposes what the object's
 
5711
  tp_traverse slot does, and can be helpful when debugging memory
 
5712
  leaks.
 
5713
 
 
5714
- The iconv module has been removed from this release.
 
5715
 
 
5716
- The platform-independent routines for packing floats in IEEE formats
 
5717
  (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
 
5718
  pickling of floats) ignored that rounding can cause a carry to
 
5719
  propagate.  The worst consequence was that, in rare cases, <f and >f
 
5720
  could produce strings that, when unpacked again, were a factor of 2
 
5721
  away from the original float.  This has been fixed.  See SF bug
 
5722
  #705836.
 
5723
 
 
5724
- New function time.tzset() provides access to the C library tzset()
 
5725
  function, if supported.  (SF patch #675422.)
 
5726
 
 
5727
- Using createfilehandler, deletefilehandler, createtimerhandler functions
 
5728
  on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
 
5729
  See SF bug #692416.
 
5730
 
 
5731
- Modified the fcntl.ioctl() function to allow modification of a passed
 
5732
  mutable buffer (for details see the reference documentation).
 
5733
 
 
5734
- Made user requested changes to the itertools module.
 
5735
  Subsumed the times() function into repeat().
 
5736
  Added chain() and cycle().
 
5737
 
 
5738
- The rotor module is now deprecated; the encryption algorithm it uses
 
5739
  is not believed to be secure, and including crypto code with Python
 
5740
  has implications for exporting and importing it in various countries.
 
5741
 
 
5742
- The socket module now always uses the _socketobject wrapper class, even on
 
5743
  platforms which have dup(2).  The makefile() method is built directly
 
5744
  on top of the socket without duplicating the file descriptor, allowing
 
5745
  timeouts to work properly.
 
5746
 
 
5747
Library
 
5748
-------
 
5749
 
 
5750
- New generator function os.walk() is an easy-to-use alternative to
 
5751
  os.path.walk().  See os module docs for details.  os.path.walk()
 
5752
  isn't deprecated at this time, but may become deprecated in a
 
5753
  future release.
 
5754
 
 
5755
- Added new module "platform" which provides a wide range of tools
 
5756
  for querying platform dependent features.
 
5757
 
 
5758
- netrc now allows ASCII punctuation characters in passwords.
 
5759
 
 
5760
- shelve now supports the optional writeback argument, and exposes
 
5761
  pickle protocol versions.
 
5762
 
 
5763
- Several methods of nntplib.NNTP have grown an optional file argument
 
5764
  which specifies a file where to divert the command's output
 
5765
  (already supported by the body() method).  (SF patch #720468)
 
5766
 
 
5767
- The self-documenting XML server library DocXMLRPCServer was added.
 
5768
 
 
5769
- Support for internationalized domain names has been added through
 
5770
  the 'idna' and 'punycode' encodings, the 'stringprep' module, the
 
5771
  'mkstringprep' tool, and enhancements to the socket and httplib
 
5772
  modules.
 
5773
 
 
5774
- htmlentitydefs has two new dictionaries: name2codepoint maps
 
5775
  HTML entity names to Unicode codepoints (as integers).
 
5776
  codepoint2name is the reverse mapping. See SF patch #722017.
 
5777
 
 
5778
- pdb has a new command, "debug", which lets you step through
 
5779
  arbitrary code from the debugger's (pdb) prompt.
 
5780
 
 
5781
- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
 
5782
  return 'not a == b' rather than 'a != b'.  This gives the desired
 
5783
  result for classes that define __eq__ without defining __ne__.
 
5784
 
 
5785
- sgmllib now supports SGML marked sections, in particular the
 
5786
  MS Office extensions.
 
5787
 
 
5788
- The urllib module now offers support for the iterator protocol.
 
5789
  SF patch 698520 contributed by Brett Cannon.
 
5790
 
 
5791
- New module timeit provides a simple framework for timing the
 
5792
  execution speed of expressions and statements.
 
5793
 
 
5794
- sets.Set objects now support mixed-type __eq__ and __ne__, instead
 
5795
  of raising TypeError.  If x is a Set object and y is a non-Set object,
 
5796
  x == y is False, and x != y is True.  This is akin to the change made
 
5797
  for mixed-type comparisons of datetime objects in 2.3a2; more info
 
5798
  about the rationale is in the NEWS entry for that.  See also SF bug
 
5799
  report <http://www.python.org/sf/693121>.
 
5800
 
 
5801
- On Unix platforms, if os.listdir() is called with a Unicode argument,
 
5802
  it now returns Unicode strings.  (This behavior was added earlier
 
5803
  to the Windows NT/2k/XP version of os.listdir().)
 
5804
 
 
5805
- Distutils: both 'py_modules' and 'packages' keywords can now be specified
 
5806
  in core.setup().  Previously you could supply one or the other, but
 
5807
  not both of them.  (SF patch #695090 from Bernhard Herzog)
 
5808
 
 
5809
- New csv package makes it easy to read/write CSV files.
 
5810
 
 
5811
- Module shlex has been extended to allow posix-like shell parsings,
 
5812
  including a split() function for easy spliting of quoted strings and
 
5813
  commands. An iterator interface was also implemented.
 
5814
 
 
5815
Tools/Demos
 
5816
-----------
 
5817
 
 
5818
- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
 
5819
  See the module docstring for details.
 
5820
 
 
5821
Build
 
5822
-----
 
5823
 
 
5824
- Fix problem building on OSF1 because the compiler only accepted
 
5825
  preprocessor directives that start in column 1.  (SF bug #691793.)
 
5826
 
 
5827
C API
 
5828
-----
 
5829
 
 
5830
- Added PyGC_Collect(), equivalent to calling gc.collect().
 
5831
 
 
5832
- PyThreadState_GetDict() was changed not to raise an exception or
 
5833
  issue a fatal error when no current thread state is available.  This
 
5834
  makes it possible to print dictionaries when no thread is active.
 
5835
 
 
5836
- LONG_LONG was renamed to PY_LONG_LONG.  Extensions that use this and
 
5837
  need compatibility with previous versions can use this:
 
5838
 
 
5839
    #ifndef  PY_LONG_LONG
 
5840
    #define  PY_LONG_LONG  LONG_LONG
 
5841
    #endif
 
5842
 
 
5843
- Added PyObject_SelfIter() to fill the tp_iter slot for the
 
5844
  typical case where the method returns its self argument.
 
5845
 
 
5846
- The extended type structure used for heap types (new-style
 
5847
  classes defined by Python code using a class statement) is now
 
5848
  exported from object.h as PyHeapTypeObject.  (SF patch #696193.)
 
5849
 
 
5850
New platforms
 
5851
-------------
 
5852
 
 
5853
None this time.
 
5854
 
 
5855
Tests
 
5856
-----
 
5857
 
 
5858
- test_timeout now requires -u network to be passed to regrtest to run.
 
5859
  See SF bug #692988.
 
5860
 
 
5861
Windows
 
5862
-------
 
5863
 
 
5864
- os.fsync() now exists on Windows, and calls the Microsoft _commit()
 
5865
  function.
 
5866
 
 
5867
- New function winsound.MessageBeep() wraps the Win32 API
 
5868
  MessageBeep().
 
5869
 
 
5870
Mac
 
5871
---
 
5872
 
 
5873
- os.listdir() now returns Unicode strings on MacOS X when called with
 
5874
  a Unicode argument. See the general news item under "Library".
 
5875
 
 
5876
- A new method MacOS.WMAvailable() returns true if it is safe to access
 
5877
  the window manager, false otherwise.
 
5878
 
 
5879
- EasyDialogs dialogs are now movable-modal, and if the application is
 
5880
  currently in the background they will ask to be moved to the foreground
 
5881
  before displaying.
 
5882
 
 
5883
- OSA Scripting support has improved a lot, and gensuitemodule.py can now
 
5884
  be used by mere mortals. The documentation is now also more or less
 
5885
  complete.
 
5886
 
 
5887
- The IDE (in a framework build) now includes introductory documentation
 
5888
  in Apple Help Viewer format.
 
5889
 
 
5890
 
 
5891
What's New in Python 2.3 alpha 2?
 
5892
=================================
 
5893
 
 
5894
*Release date: 19-Feb-2003*
 
5895
 
 
5896
Core and builtins
 
5897
-----------------
 
5898
 
 
5899
- Negative positions returned from PEP 293 error callbacks are now
 
5900
  treated as being relative to the end of the input string. Positions
 
5901
  that are out of bounds raise an IndexError.
 
5902
 
 
5903
- sys.path[0] (the directory from which the script is loaded) is now
 
5904
  turned into an absolute pathname, unless it is the empty string.
 
5905
  (SF patch #664376.)
 
5906
 
 
5907
- Finally fixed the bug in compile() and exec where a string ending
 
5908
  with an indented code block but no newline would raise SyntaxError.
 
5909
  This would have been a four-line change in parsetok.c...  Except
 
5910
  codeop.py depends on this behavior, so a compilation flag had to be
 
5911
  invented that causes the tokenizer to revert to the old behavior;
 
5912
  this required extra changes to 2 .h files, 2 .c files, and 2 .py
 
5913
  files.  (Fixes SF bug #501622.)
 
5914
 
 
5915
- If a new-style class defines neither __new__ nor __init__, its
 
5916
  constructor would ignore all arguments.  This is changed now: the
 
5917
  constructor refuses arguments in this case.  This might break code
 
5918
  that worked under Python 2.2.  The simplest fix is to add a no-op
 
5919
  __init__: ``def __init__(self, *args, **kw): pass``.
 
5920
 
 
5921
- Through a bytecode optimizer bug (and I bet you didn't even know
 
5922
  Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
 
5923
  with a leading minus sign would come out with the wrong sign.
 
5924
  ("Unsigned" hex/oct constants are those with a face value in the
 
5925
  range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
 
5926
  always been interpreted as negative numbers through sign folding.)
 
5927
  E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
 
5928
  come out as -4294967295.  This was the case in Python 2.2 through
 
5929
  2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
 
5930
  value, but according to PEP 237 it really needs to be 1 now.  This
 
5931
  will be backported to Python 2.2.3 a well.  (SF #660455)
 
5932
 
 
5933
- int(s, base) sometimes sign-folds hex and oct constants; it only
 
5934
  does this when base is 0 and s.strip() starts with a '0'.  When the
 
5935
  sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
 
5936
  machine, which returns -1, a FutureWarning is now issued; in Python
 
5937
  2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
 
5938
  int("0xffffffff", 16) right now.  (PEP 347)
 
5939
 
 
5940
- super(X, x): x may now be a proxy for an X instance, i.e.
 
5941
  issubclass(x.__class__, X) but not issubclass(type(x), X).
 
5942
 
 
5943
- isinstance(x, X): if X is a new-style class, this is now equivalent
 
5944
  to issubclass(type(x), X) or issubclass(x.__class__, X).  Previously
 
5945
  only type(x) was tested.  (For classic classes this was already the
 
5946
  case.)
 
5947
 
 
5948
- compile(), eval() and the exec statement now fully support source code
 
5949
  passed as unicode strings.
 
5950
 
 
5951
- int subclasses can be initialized with longs if the value fits in an int.
 
5952
  See SF bug #683467.
 
5953
 
 
5954
- long(string, base) takes time linear in len(string) when base is a power
 
5955
  of 2 now.  It used to take time quadratic in len(string).
 
5956
 
 
5957
- filter returns now Unicode results for Unicode arguments.
 
5958
 
 
5959
- raw_input can now return Unicode objects.
 
5960
 
 
5961
- List objects' sort() method now accepts None as the comparison function.
 
5962
  Passing None is semantically identical to calling sort() with no
 
5963
  arguments.
 
5964
 
 
5965
- Fixed crash when printing a subclass of str and __str__ returned self.
 
5966
  See SF bug #667147.
 
5967
 
 
5968
- Fixed an invalid RuntimeWarning and an undetected error when trying
 
5969
  to convert a long integer into a float which couldn't fit.
 
5970
  See SF bug #676155.
 
5971
 
 
5972
- Function objects now have a __module__ attribute that is bound to
 
5973
  the name of the module in which the function was defined.  This
 
5974
  applies for C functions and methods as well as functions and methods
 
5975
  defined in Python.  This attribute is used by pickle.whichmodule(),
 
5976
  which changes the behavior of whichmodule slightly.  In Python 2.2
 
5977
  whichmodule() returns "__main__" for functions that are not defined
 
5978
  at the top-level of a module (examples: methods, nested functions).
 
5979
  Now whichmodule() will return the proper module name.
 
5980
 
 
5981
Extension modules
 
5982
-----------------
 
5983
 
 
5984
- operator.isNumberType() now checks that the object has a nb_int or
 
5985
  nb_float slot, rather than simply checking whether it has a non-NULL
 
5986
  tp_as_number pointer.
 
5987
 
 
5988
- The imp module now has ways to acquire and release the "import
 
5989
  lock": imp.acquire_lock() and imp.release_lock().  Note: this is a
 
5990
  reentrant lock, so releasing the lock only truly releases it when
 
5991
  this is the last release_lock() call.  You can check with
 
5992
  imp.lock_held().  (SF bug #580952 and patch #683257.)
 
5993
 
 
5994
- Change to cPickle to match pickle.py (see below and PEP 307).
 
5995
 
 
5996
- Fix some bugs in the parser module.  SF bug #678518.
 
5997
 
 
5998
- Thanks to Scott David Daniels, a subtle bug in how the zlib
 
5999
  extension implemented flush() was fixed.  Scott also rewrote the
 
6000
  zlib test suite using the unittest module.  (SF bug #640230 and
 
6001
  patch #678531.)
 
6002
 
 
6003
- Added an itertools module containing high speed, memory efficient
 
6004
  looping constructs inspired by tools from Haskell and SML.
 
6005
 
 
6006
- The SSL module now handles sockets with a timeout set correctly (SF
 
6007
  patch #675750, fixing SF bug #675552).
 
6008
 
 
6009
- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
 
6010
 
 
6011
- Fixed broken threadstate swap in readline that could cause fatal
 
6012
  errors when a readline hook was being invoked while a background
 
6013
  thread was active.  (SF bugs #660476 and #513033.)
 
6014
 
 
6015
- fcntl now exposes the strops.h I_* constants.
 
6016
 
 
6017
- Fix a crash on Solaris that occurred when calling close() on
 
6018
  an mmap'ed file which was already closed.  (SF patch #665913)
 
6019
 
 
6020
- Fixed several serious bugs in the zipimport implementation.
 
6021
 
 
6022
- datetime changes:
 
6023
 
 
6024
  The date class is now properly subclassable.  (SF bug #720908)
 
6025
 
 
6026
  The datetime and datetimetz classes have been collapsed into a single
 
6027
  datetime class, and likewise the time and timetz classes into a single
 
6028
  time class.  Previously, a datetimetz object with tzinfo=None acted
 
6029
  exactly like a datetime object, and similarly for timetz.  This wasn't
 
6030
  enough of a difference to justify distinct classes, and life is simpler
 
6031
  now.
 
6032
 
 
6033
  today() and now() now round system timestamps to the closest
 
6034
  microsecond <http://www.python.org/sf/661086>.  This repairs an
 
6035
  irritation most likely seen on Windows systems.
 
6036
 
 
6037
  In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
 
6038
  ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
 
6039
  as 0 instead, but a tzinfo subclass wishing to participate in
 
6040
  time zone conversion has to take a stand on whether it supports
 
6041
  DST; if you don't care about DST, then code dst() to return 0 minutes,
 
6042
  meaning that DST is never in effect).
 
6043
 
 
6044
  The tzinfo methods utcoffset() and dst() must return a timedelta object
 
6045
  (or None) now.  In 2.3a1 they could also return an int or long, but that
 
6046
  was an unhelpfully redundant leftover from an earlier version wherein
 
6047
  they couldn't return a timedelta.  TOOWTDI.
 
6048
 
 
6049
  The example tzinfo class for local time had a bug.  It was replaced
 
6050
  by a later example coded by Guido.
 
6051
 
 
6052
  datetime.astimezone(tz) no longer raises an exception when the
 
6053
  input datetime has no UTC equivalent in tz.  For typical "hybrid" time
 
6054
  zones (a single tzinfo subclass modeling both standard and daylight
 
6055
  time), this case can arise one hour per year, at the hour daylight time
 
6056
  ends.  See new docs for details.  In short, the new behavior mimics
 
6057
  the local wall clock's behavior of repeating an hour in local time.
 
6058
 
 
6059
  dt.astimezone() can no longer be used to convert between naive and aware
 
6060
  datetime objects.  If you merely want to attach, or remove, a tzinfo
 
6061
  object, without any conversion of date and time members, use
 
6062
  dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
 
6063
  tzinfo subclass instance.
 
6064
 
 
6065
  A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
 
6066
  to give complete control over how a UTC time is to be converted to
 
6067
  a local time.  The default astimezone() implementation calls fromutc()
 
6068
  as its last step, so a tzinfo subclass can affect that too by overriding
 
6069
  fromutc().  It's expected that the default fromutc() implementation will
 
6070
  be suitable as-is for "almost all" time zone subclasses, but the
 
6071
  creativity of political time zone fiddling appears unbounded -- fromutc()
 
6072
  allows the highly motivated to emulate any scheme expressible in Python.
 
6073
 
 
6074
  datetime.now():  The optional tzinfo argument was undocumented (that's
 
6075
  repaired), and its name was changed to tz ("tzinfo" is overloaded enough
 
6076
  already).  With a tz argument, now(tz) used to return the local date
 
6077
  and time, and attach tz to it, without any conversion of date and time
 
6078
  members.  This was less than useful.  Now now(tz) returns the current
 
6079
  date and time as local time in tz's time zone, akin to ::
 
6080
 
 
6081
      tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
 
6082
 
 
6083
  where "utc" is an instance of a tzinfo subclass modeling UTC.  Without
 
6084
  a tz argument, now() continues to return the current local date and time,
 
6085
  as a naive datetime object.
 
6086
 
 
6087
  datetime.fromtimestamp():  Like datetime.now() above, this had less than
 
6088
  useful behavior when the optional tinzo argument was specified.  See
 
6089
  also SF bug report <http://www.python.org/sf/660872>.
 
6090
 
 
6091
  date and datetime comparison:  In order to prevent comparison from
 
6092
  falling back to the default compare-object-addresses strategy, these
 
6093
  raised TypeError whenever they didn't understand the other object type.
 
6094
  They still do, except when the other object has a "timetuple" attribute,
 
6095
  in which case they return NotImplemented now.  This gives other
 
6096
  datetime objects (e.g., mxDateTime) a chance to intercept the
 
6097
  comparison.
 
6098
 
 
6099
  date, time, datetime and timedelta comparison:  When the exception
 
6100
  for mixed-type comparisons in the last paragraph doesn't apply, if
 
6101
  the comparison is == then False is returned, and if the comparison is
 
6102
  != then True is returned.  Because dict lookup and the "in" operator
 
6103
  only invoke __eq__, this allows, for example, ::
 
6104
 
 
6105
      if some_datetime in some_sequence:
 
6106
 
 
6107
  and ::
 
6108
 
 
6109
      some_dict[some_timedelta] = whatever
 
6110
 
 
6111
  to work as expected, without raising TypeError just because the
 
6112
  sequence is heterogeneous, or the dict has mixed-type keys.  [This
 
6113
  seems like a good idea to implement for all mixed-type comparisons
 
6114
  that don't want to allow falling back to address comparison.]
 
6115
 
 
6116
  The constructors building a datetime from a timestamp could raise
 
6117
  ValueError if the platform C localtime()/gmtime() inserted "leap
 
6118
  seconds".  Leap seconds are ignored now.  On such platforms, it's
 
6119
  possible to have timestamps that differ by a second, yet where
 
6120
  datetimes constructed from them are equal.
 
6121
 
 
6122
  The pickle format of date, time and datetime objects has changed
 
6123
  completely.  The undocumented pickler and unpickler functions no
 
6124
  longer exist.  The undocumented __setstate__() and __getstate__()
 
6125
  methods no longer exist either.
 
6126
 
 
6127
Library
 
6128
-------
 
6129
 
 
6130
- The logging module was updated slightly; the WARN level was renamed
 
6131
  to WARNING, and the matching function/method warn() to warning().
 
6132
 
 
6133
- The pickle and cPickle modules were updated with a new pickling
 
6134
  protocol (documented by pickletools.py, see below) and several
 
6135
  extensions to the pickle customization API (__reduce__, __setstate__
 
6136
  etc.).  The copy module now uses more of the pickle customization
 
6137
  API to copy objects that don't implement __copy__ or __deepcopy__.
 
6138
  See PEP 307 for details.
 
6139
 
 
6140
- The distutils "register" command now uses http://www.python.org/pypi
 
6141
  as the default repository.  (See PEP 301.)
 
6142
 
 
6143
- the platform dependent path related variables sep, altsep,
 
6144
  pathsep, curdir, pardir and defpath are now defined in the platform
 
6145
  dependent path modules (e.g. ntpath.py) rather than os.py, so these
 
6146
  variables are now available via os.path.  They continue to be
 
6147
  available from the os module.
 
6148
  (see <http://www.python.org/sf/680789>).
 
6149
 
 
6150
- array.array was added to the types repr.py knows about (see
 
6151
  <http://www.python.org/sf/680789>).
 
6152
 
 
6153
- The new pickletools.py contains lots of documentation about pickle
 
6154
  internals, and supplies some helpers for working with pickles, such as
 
6155
  a symbolic pickle disassembler.
 
6156
 
 
6157
- Xmlrpclib.py now supports the builtin boolean type.
 
6158
 
 
6159
- py_compile has a new 'doraise' flag and a new PyCompileError
 
6160
  exception.
 
6161
 
 
6162
- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
 
6163
  class.
 
6164
 
 
6165
- The sets module now raises TypeError in __cmp__, to clarify that
 
6166
  sets are not intended to be three-way-compared; the comparison
 
6167
  operators are overloaded as subset/superset tests.
 
6168
 
 
6169
- Bastion.py and rexec.py are disabled.  These modules are not safe in
 
6170
  Python 2.2. or 2.3.
 
6171
 
 
6172
- realpath is now exported when doing ``from poxixpath import *``.
 
6173
  It is also exported for ntpath, macpath, and os2emxpath.
 
6174
  See SF bug #659228.
 
6175
 
 
6176
- New module tarfile from Lars GustƤbel provides a comprehensive interface
 
6177
  to tar archive files with transparent gzip and bzip2 compression.
 
6178
  See SF patch #651082.
 
6179
 
 
6180
- urlparse can now parse imap:// URLs.  See SF feature request #618024.
 
6181
 
 
6182
- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
 
6183
  the gain value which is passed to Tk.  SF bug# 602259.
 
6184
 
 
6185
- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
 
6186
  See SF patch #642974.
 
6187
 
 
6188
- The dospath module was deleted.  Use the ntpath module when manipulating
 
6189
  DOS paths from other platforms.
 
6190
 
 
6191
Tools/Demos
 
6192
-----------
 
6193
 
 
6194
- Two new scripts (db2pickle.py and pickle2db.py) were added to the
 
6195
  Tools/scripts directory to facilitate conversion from the old bsddb module
 
6196
  to the new one.  While the user-visible API of the new module is
 
6197
  compatible with the old one, it's likely that the version of the
 
6198
  underlying database library has changed.  To convert from the old library,
 
6199
  run the db2pickle.py script using the old version of Python to convert it
 
6200
  to a pickle file.  After upgrading Python, run the pickle2db.py script
 
6201
  using the new version of Python to reconstitute your database.  For
 
6202
  example:
 
6203
 
 
6204
    % python2.2 db2pickle.py -h some.db > some.pickle
 
6205
    % python2.3 pickle2db.py -h some.db.new < some.pickle
 
6206
 
 
6207
  Run the scripts without any args to get a usage message.
 
6208
 
 
6209
 
 
6210
Build
 
6211
-----
 
6212
 
 
6213
- The audio driver tests (test_ossaudiodev.py and
 
6214
  test_linuxaudiodev.py) are no longer run by default.  This is
 
6215
  because they don't always work, depending on your hardware and
 
6216
  software.  To run these tests, you must use an invocation like ::
 
6217
 
 
6218
    ./python Lib/test/regrtest.py -u audio test_ossaudiodev
 
6219
 
 
6220
- On systems which build using the configure script, compiler flags which
 
6221
  used to be lumped together using the OPT flag have been split into two
 
6222
  groups, OPT and BASECFLAGS.  OPT is meant to carry just optimization- and
 
6223
  debug-related flags like "-g" and "-O3".  BASECFLAGS is meant to carry
 
6224
  compiler flags that are required to get a clean compile.  On some
 
6225
  platforms (many Linux flavors in particular) BASECFLAGS will be empty by
 
6226
  default.  On others, such as Mac OS X and SCO, it will contain required
 
6227
  flags.  This change allows people building Python to override OPT without
 
6228
  fear of clobbering compiler flags which are required to get a clean build.
 
6229
 
 
6230
- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
 
6231
  relevant search lists in setup.py.  This allows users building Python to
 
6232
  take advantage of the many packages available from the fink project
 
6233
  <http://fink.sf.net/>.
 
6234
 
 
6235
- A new Makefile target, scriptsinstall, installs a number of useful scripts
 
6236
  from the Tools/scripts directory.
 
6237
 
 
6238
C API
 
6239
-----
 
6240
 
 
6241
- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
 
6242
  instead of a plain ``PyObject *``.  (SF patch #686601.)
 
6243
 
 
6244
- PyNumber_Check() now checks that the object has a nb_int or nb_float
 
6245
  slot, rather than simply checking whether it has a non-NULL
 
6246
  tp_as_number pointer.
 
6247
 
 
6248
- A C type that inherits from a base type that defines tp_as_buffer
 
6249
  will now inherit the tp_as_buffer pointer if it doesn't define one.
 
6250
  (SF #681367)
 
6251
 
 
6252
- The PyArg_Parse functions now issue a DeprecationWarning if a float
 
6253
  argument is provided when an integer is specified (this affects the 'b',
 
6254
  'B', 'h', 'H', 'i', and 'l' codes).  Future versions of Python will
 
6255
  raise a TypeError.
 
6256
 
 
6257
Tests
 
6258
-----
 
6259
 
 
6260
- Several tests weren't being run from regrtest.py (test_timeout.py,
 
6261
  test_tarfile.py, test_netrc.py, test_multifile.py,
 
6262
  test_importhooks.py and test_imp.py).  Now they are.  (Note to
 
6263
  developers: please read Lib/test/README when creating a new test, to
 
6264
  make sure to do it right!  All tests need to use either unittest or
 
6265
  pydoc.)
 
6266
 
 
6267
- Added test_posix.py, a test suite for the posix module.
 
6268
 
 
6269
- Added test_hexoct.py, a test suite for hex/oct constant folding.
 
6270
 
 
6271
Windows
 
6272
-------
 
6273
 
 
6274
- The timeout code for socket connect() didn't work right; this has
 
6275
  now been fixed.  test_timeout.py should pass (at least most of the
 
6276
  time).
 
6277
 
 
6278
- distutils' msvccompiler class now passes the preprocessor options to
 
6279
  the resource compiler.  See SF patch #669198.
 
6280
 
 
6281
- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
 
6282
  release without strong cryptography.
 
6283
 
 
6284
- sys.path[0], if it contains a directory name, is now always an
 
6285
  absolute pathname. (SF patch #664376.)
 
6286
 
 
6287
- The new logging package is now installed by the Windows installer.  It
 
6288
  wasn't in 2.3a1 due to oversight.
 
6289
 
 
6290
Mac
 
6291
---
 
6292
 
 
6293
- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
 
6294
  and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
 
6295
 
 
6296
- Most of the standard library now uses pathnames or FSRefs in preference
 
6297
  of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
 
6298
  in stead of macfs. macfs will probably be deprecated in the future.
 
6299
 
 
6300
- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
 
6301
  This also makes macfs.FSSpec.SetDates() work again.
 
6302
 
 
6303
- There is a new module pimp, the package install manager for Python, and
 
6304
  accompanying applet PackageManager. These allow you to easily download
 
6305
  and install pretested extension packages either in source or binary
 
6306
  form. Only in MacPython-OSX.
 
6307
 
 
6308
- Applets are now built with bundlebuilder in MacPython-OSX, which should make
 
6309
  them more robust and also provides a path towards BuildApplication. The
 
6310
  downside of this change is that applets can no longer be run from the
 
6311
  Terminal window, this will hopefully be fixed in the 2.3b1.
 
6312
 
 
6313
 
 
6314
What's New in Python 2.3 alpha 1?
 
6315
=================================
 
6316
 
 
6317
*Release date: 31-Dec-2002*
 
6318
 
 
6319
Type/class unification and new-style classes
 
6320
--------------------------------------------
 
6321
 
 
6322
- One can now assign to __bases__ and __name__ of new-style classes.
 
6323
 
 
6324
- dict() now accepts keyword arguments so that dict(one=1, two=2)
 
6325
  is the equivalent of {"one": 1, "two": 2}.  Accordingly,
 
6326
  the existing (but undocumented) 'items' keyword argument has
 
6327
  been eliminated.  This means that dict(items=someMapping) now has
 
6328
  a different meaning than before.
 
6329
 
 
6330
- int() now returns a long object if the argument is outside the
 
6331
  integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
 
6332
  all return long objects instead of raising an OverflowError.
 
6333
 
 
6334
- Assignment to __class__ is disallowed if either the old or the new
 
6335
  class is a statically allocated type object (such as defined by an
 
6336
  extension module).  This prevents anomalies like 2.__class__ = bool.
 
6337
 
 
6338
- New-style object creation and deallocation have been sped up
 
6339
  significantly; they are now faster than classic instance creation
 
6340
  and deallocation.
 
6341
 
 
6342
- The __slots__ variable can now mention "private" names, and the
 
6343
  right thing will happen (e.g. __slots__ = ["__foo"]).
 
6344
 
 
6345
- The built-ins slice() and buffer() are now callable types.  The
 
6346
  types classobj (formerly class), code, function, instance, and
 
6347
  instancemethod (formerly instance-method), which have no built-in
 
6348
  names but are accessible through the types module, are now also
 
6349
  callable.  The type dict-proxy is renamed to dictproxy.
 
6350
 
 
6351
- Cycles going through the __class__ link of a new-style instance are
 
6352
  now detected by the garbage collector.
 
6353
 
 
6354
- Classes using __slots__ are now properly garbage collected.
 
6355
  [SF bug 519621]
 
6356
 
 
6357
- Tightened the __slots__ rules: a slot name must be a valid Python
 
6358
  identifier.
 
6359
 
 
6360
- The constructor for the module type now requires a name argument and
 
6361
  takes an optional docstring argument.  Previously, this constructor
 
6362
  ignored its arguments.  As a consequence, deriving a class from a
 
6363
  module (not from the module type) is now illegal; previously this
 
6364
  created an unnamed module, just like invoking the module type did.
 
6365
  [SF bug 563060]
 
6366
 
 
6367
- A new type object, 'basestring', is added.  This is a common base type
 
6368
  for 'str' and 'unicode', and can be used instead of
 
6369
  types.StringTypes, e.g. to test whether something is "a string":
 
6370
  isinstance(x, basestring) is True for Unicode and 8-bit strings.  This
 
6371
  is an abstract base class and cannot be instantiated directly.
 
6372
 
 
6373
- Changed new-style class instantiation so that when C's __new__
 
6374
  method returns something that's not a C instance, its __init__ is
 
6375
  not called.  [SF bug #537450]
 
6376
 
 
6377
- Fixed super() to work correctly with class methods.  [SF bug #535444]
 
6378
 
 
6379
- If you try to pickle an instance of a class that has __slots__ but
 
6380
  doesn't define or override __getstate__, a TypeError is now raised.
 
6381
  This is done by adding a bozo __getstate__ to the class that always
 
6382
  raises TypeError.  (Before, this would appear to be pickled, but the
 
6383
  state of the slots would be lost.)
 
6384
 
 
6385
Core and builtins
 
6386
-----------------
 
6387
 
 
6388
- Import from zipfiles is now supported.  The name of a zipfile placed
 
6389
  on sys.path causes the import statement to look for importable Python
 
6390
  modules (with .py, pyc and .pyo extensions) and packages inside the
 
6391
  zipfile.  The zipfile import follows the specification (though not
 
6392
  the sample implementation) of PEP 273.  The semantics of __path__ are
 
6393
  compatible with those that have been implemented in Jython since
 
6394
  Jython 2.1.
 
6395
 
 
6396
- PEP 302 has been accepted.  Although it was initially developed to
 
6397
  support zipimport, it offers a new, general import hook mechanism.
 
6398
  Several new variables have been added to the sys module:
 
6399
  sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
 
6400
  make extending the import statement much more convenient than
 
6401
  overriding the __import__ built-in function.  For a description of
 
6402
  these, see PEP 302.
 
6403
 
 
6404
- A frame object's f_lineno attribute can now be written to from a
 
6405
  trace function to change which line will execute next.  A command to
 
6406
  exploit this from pdb has been added.  [SF patch #643835]
 
6407
 
 
6408
- The _codecs support module for codecs.py was turned into a builtin
 
6409
  module to assure that at least the builtin codecs are available
 
6410
  to the Python parser for source code decoding according to PEP 263.
 
6411
 
 
6412
- issubclass now supports a tuple as the second argument, just like
 
6413
  isinstance does. ``issubclass(X, (A, B))`` is equivalent to
 
6414
  ``issubclass(X, A) or issubclass(X, B)``.
 
6415
 
 
6416
- Thanks to Armin Rigo, the last known way to provoke a system crash
 
6417
  by cleverly arranging for a comparison function to mutate a list
 
6418
  during a list.sort() operation has been fixed.  The effect of
 
6419
  attempting to mutate a list, or even to inspect its contents or
 
6420
  length, while a sort is in progress, is not defined by the language.
 
6421
  The C implementation of Python 2.3 attempts to detect mutations,
 
6422
  and raise ValueError if one occurs, but there's no guarantee that
 
6423
  all mutations will be caught, or that any will be caught across
 
6424
  releases or implementations.
 
6425
 
 
6426
- Unicode file name processing for Windows (PEP 277) is implemented.
 
6427
  All platforms now have an os.path.supports_unicode_filenames attribute,
 
6428
  which is set to True on Windows NT/2000/XP, and False elsewhere.
 
6429
 
 
6430
- Codec error handling callbacks (PEP 293) are implemented.
 
6431
  Error handling in unicode.encode or str.decode can now be customized.
 
6432
 
 
6433
- A subtle change to the semantics of the built-in function intern():
 
6434
  interned strings are no longer immortal.  You must keep a reference
 
6435
  to the return value intern() around to get the benefit.
 
6436
 
 
6437
- Use of 'None' as a variable, argument or attribute name now
 
6438
  issues a SyntaxWarning.  In the future, None may become a keyword.
 
6439
 
 
6440
- SET_LINENO is gone.  co_lnotab is now consulted to determine when to
 
6441
  call the trace function.  C code that accessed f_lineno should call
 
6442
  PyCode_Addr2Line instead (f_lineno is still there, but only kept up
 
6443
  to date when there is a trace function set).
 
6444
 
 
6445
- There's a new warning category, FutureWarning.  This is used to warn
 
6446
  about a number of situations where the value or sign of an integer
 
6447
  result will change in Python 2.4 as a result of PEP 237 (integer
 
6448
  unification).  The warnings implement stage B0 mentioned in that
 
6449
  PEP.  The warnings are about the following situations:
 
6450
 
 
6451
    - Octal and hex literals without 'L' prefix in the inclusive range
 
6452
      [0x80000000..0xffffffff]; these are currently negative ints, but
 
6453
      in Python 2.4 they will be positive longs with the same bit
 
6454
      pattern.
 
6455
 
 
6456
    - Left shifts on integer values that cause the outcome to lose
 
6457
      bits or have a different sign than the left operand.  To be
 
6458
      precise: x<<n where this currently doesn't yield the same value
 
6459
      as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
 
6460
 
 
6461
    - Conversions from ints to string that show negative values as
 
6462
      unsigned ints in the inclusive range [0x80000000..0xffffffff];
 
6463
      this affects the functions hex() and oct(), and the string
 
6464
      formatting codes %u, %o, %x, and %X.  In Python 2.4, these will
 
6465
      show signed values (e.g. hex(-1) currently returns "0xffffffff";
 
6466
      in Python 2.4 it will return "-0x1").
 
6467
 
 
6468
- The bits manipulated under the cover by sys.setcheckinterval() have
 
6469
  been changed.  Both the check interval and the ticker used to be
 
6470
  per-thread values.  They are now just a pair of global variables.
 
6471
  In addition, the default check interval was boosted from 10 to 100
 
6472
  bytecode instructions.  This may have some effect on systems that
 
6473
  relied on the old default value.  In particular, in multi-threaded
 
6474
  applications which try to be highly responsive, response time will
 
6475
  increase by some (perhaps imperceptible) amount.
 
6476
 
 
6477
- When multiplying very large integers, a version of the so-called
 
6478
  Karatsuba algorithm is now used.  This is most effective if the
 
6479
  inputs have roughly the same size.  If they both have about N digits,
 
6480
  Karatsuba multiplication has O(N**1.58) runtime (the exponent is
 
6481
  log_base_2(3)) instead of the previous O(N**2).  Measured results may
 
6482
  be better or worse than that, depending on platform quirks.  Besides
 
6483
  the O() improvement in raw instruction count, the Karatsuba algorithm
 
6484
  appears to have much better cache behavior on extremely large integers
 
6485
  (starting in the ballpark of a million bits).  Note that this is a
 
6486
  simple implementation, and there's no intent here to compete with,
 
6487
  e.g., GMP.  It gives a very nice speedup when it applies, but a package
 
6488
  devoted to fast large-integer arithmetic should run circles around it.
 
6489
 
 
6490
- u'%c' will now raise a ValueError in case the argument is an
 
6491
  integer outside the valid range of Unicode code point ordinals.
 
6492
 
 
6493
- The tempfile module has been overhauled for enhanced security.  The
 
6494
  mktemp() function is now deprecated; new, safe replacements are
 
6495
  mkstemp() (for files) and mkdtemp() (for directories), and the
 
6496
  higher-level functions NamedTemporaryFile() and TemporaryFile().
 
6497
  Use of some global variables in this module is also deprecated; the
 
6498
  new functions have keyword arguments to provide the same
 
6499
  functionality.  All Lib, Tools and Demo modules that used the unsafe
 
6500
  interfaces have been updated to use the safe replacements.  Thanks
 
6501
  to Zack Weinberg!
 
6502
 
 
6503
- When x is an object whose class implements __mul__ and __rmul__,
 
6504
  1.0*x would correctly invoke __rmul__, but 1*x would erroneously
 
6505
  invoke __mul__.  This was due to the sequence-repeat code in the int
 
6506
  type.  This has been fixed now.
 
6507
 
 
6508
- Previously, "str1 in str2" required str1 to be a string of length 1.
 
6509
  This restriction has been relaxed to allow str1 to be a string of
 
6510
  any length.  Thus "'el' in 'hello world'" returns True now.
 
6511
 
 
6512
- File objects are now their own iterators.  For a file f, iter(f) now
 
6513
  returns f (unless f is closed), and f.next() is similar to
 
6514
  f.readline() when EOF is not reached; however, f.next() uses a
 
6515
  readahead buffer that messes up the file position, so mixing
 
6516
  f.next() and f.readline() (or other methods) doesn't work right.
 
6517
  Calling f.seek() drops the readahead buffer, but other operations
 
6518
  don't.  It so happens that this gives a nice additional speed boost
 
6519
  to "for line in file:"; the xreadlines method and corresponding
 
6520
  module are now obsolete.  Thanks to Oren Tirosh!
 
6521
 
 
6522
- Encoding declarations (PEP 263, phase 1) have been implemented.  A
 
6523
  comment of the form "# -*- coding: <encodingname> -*-" in the first
 
6524
  or second line of a Python source file indicates the encoding.
 
6525
 
 
6526
- list.sort() has a new implementation.  While cross-platform results
 
6527
  may vary, and in data-dependent ways, this is much faster on many
 
6528
  kinds of partially ordered lists than the previous implementation,
 
6529
  and reported to be just as fast on randomly ordered lists on
 
6530
  several major platforms.  This sort is also stable (if A==B and A
 
6531
  precedes B in the list at the start, A precedes B after the sort too),
 
6532
  although the language definition does not guarantee stability.  A
 
6533
  potential drawback is that list.sort() may require temp space of
 
6534
  len(list)*2 bytes (``*4`` on a 64-bit machine).  It's therefore possible
 
6535
  for list.sort() to raise MemoryError now, even if a comparison function
 
6536
  does not.  See <http://www.python.org/sf/587076> for full details.
 
6537
 
 
6538
- All standard iterators now ensure that, once StopIteration has been
 
6539
  raised, all future calls to next() on the same iterator will also
 
6540
  raise StopIteration.  There used to be various counterexamples to
 
6541
  this behavior, which could caused confusion or subtle program
 
6542
  breakage, without any benefits.  (Note that this is still an
 
6543
  iterator's responsibility; the iterator framework does not enforce
 
6544
  this.)
 
6545
 
 
6546
- Ctrl+C handling on Windows has been made more consistent with
 
6547
  other platforms.  KeyboardInterrupt can now reliably be caught,
 
6548
  and Ctrl+C at an interactive prompt no longer terminates the
 
6549
  process under NT/2k/XP (it never did under Win9x).  Ctrl+C will
 
6550
  interrupt time.sleep() in the main thread, and any child processes
 
6551
  created via the popen family (on win2k; we can't make win9x work
 
6552
  reliably) are also interrupted (as generally happens on for Linux/Unix.)
 
6553
  [SF bugs 231273, 439992 and 581232]
 
6554
 
 
6555
- sys.getwindowsversion() has been added on Windows.  This
 
6556
  returns a tuple with information about the version of Windows
 
6557
  currently running.
 
6558
 
 
6559
- Slices and repetitions of buffer objects now consistently return
 
6560
  a string.  Formerly, strings would be returned most of the time,
 
6561
  but a buffer object would be returned when the repetition count
 
6562
  was one or when the slice range was all inclusive.
 
6563
 
 
6564
- Unicode objects in sys.path are no longer ignored but treated
 
6565
  as directory names.
 
6566
 
 
6567
- Fixed string.startswith and string.endswith builtin methods
 
6568
  so they accept negative indices.  [SF bug 493951]
 
6569
 
 
6570
- Fixed a bug with a continue inside a try block and a yield in the
 
6571
  finally clause.  [SF bug 567538]
 
6572
 
 
6573
- Most builtin sequences now support "extended slices", i.e. slices
 
6574
  with a third "stride" parameter.  For example, "hello world"[::-1]
 
6575
  gives "dlrow olleh".
 
6576
 
 
6577
- A new warning PendingDeprecationWarning was added to provide
 
6578
  direction on features which are in the process of being deprecated.
 
6579
  The warning will not be printed by default.  To see the pending
 
6580
  deprecations, use -Walways::PendingDeprecationWarning::
 
6581
  as a command line option or warnings.filterwarnings() in code.
 
6582
 
 
6583
- Deprecated features of xrange objects have been removed as
 
6584
  promised.  The start, stop, and step attributes and the tolist()
 
6585
  method no longer exist.  xrange repetition and slicing have been
 
6586
  removed.
 
6587
 
 
6588
- New builtin function enumerate(x), from PEP 279.  Example:
 
6589
  enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
 
6590
  The argument can be an arbitrary iterable object.
 
6591
 
 
6592
- The assert statement no longer tests __debug__ at runtime.  This means
 
6593
  that assert statements cannot be disabled by assigning a false value
 
6594
  to __debug__.
 
6595
 
 
6596
- A method zfill() was added to str and unicode, that fills a numeric
 
6597
  string to the left with zeros.  For example,
 
6598
  "+123".zfill(6) -> "+00123".
 
6599
 
 
6600
- Complex numbers supported divmod() and the // and % operators, but
 
6601
  these make no sense.  Since this was documented, they're being
 
6602
  deprecated now.
 
6603
 
 
6604
- String and unicode methods lstrip(), rstrip() and strip() now take
 
6605
  an optional argument that specifies the characters to strip.  For
 
6606
  example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
 
6607
 
 
6608
- There's a new dictionary constructor (a class method of the dict
 
6609
  class), dict.fromkeys(iterable, value=None).  It constructs a
 
6610
  dictionary with keys taken from the iterable and all values set to a
 
6611
  single value.  It can be used for building sets and for removing
 
6612
  duplicates from sequences.
 
6613
 
 
6614
- Added a new dict method pop(key).  This removes and returns the
 
6615
  value corresponding to key.  [SF patch #539949]
 
6616
 
 
6617
- A new built-in type, bool, has been added, as well as built-in
 
6618
  names for its two values, True and False.  Comparisons and sundry
 
6619
  other operations that return a truth value have been changed to
 
6620
  return a bool instead.  Read PEP 285 for an explanation of why this
 
6621
  is backward compatible.
 
6622
 
 
6623
- Fixed two bugs reported as SF #535905: under certain conditions,
 
6624
  deallocating a deeply nested structure could cause a segfault in the
 
6625
  garbage collector, due to interaction with the "trashcan" code;
 
6626
  access to the current frame during destruction of a local variable
 
6627
  could access a pointer to freed memory.
 
6628
 
 
6629
- The optional object allocator ("pymalloc") has been enabled by
 
6630
  default.  The recommended practice for memory allocation and
 
6631
  deallocation has been streamlined.  A header file is included,
 
6632
  Misc/pymemcompat.h, which can be bundled with 3rd party extensions
 
6633
  and lets them use the same API with Python versions from 1.5.2
 
6634
  onwards.
 
6635
 
 
6636
- PyErr_Display will provide file and line information for all exceptions
 
6637
  that have an attribute print_file_and_line, not just SyntaxErrors.
 
6638
 
 
6639
- The UTF-8 codec will now encode and decode Unicode surrogates
 
6640
  correctly and without raising exceptions for unpaired ones.
 
6641
 
 
6642
- Universal newlines (PEP 278) is implemented.  Briefly, using 'U'
 
6643
  instead of 'r' when opening a text file for reading changes the line
 
6644
  ending convention so that any of '\r', '\r\n', and '\n' is
 
6645
  recognized (even mixed in one file); all three are converted to
 
6646
  '\n', the standard Python line end character.
 
6647
 
 
6648
- file.xreadlines() now raises a ValueError if the file is closed:
 
6649
  Previously, an xreadlines object was returned which would raise
 
6650
  a ValueError when the xreadlines.next() method was called.
 
6651
 
 
6652
- sys.exit() inadvertently allowed more than one argument.
 
6653
  An exception will now be raised if more than one argument is used.
 
6654
 
 
6655
- Changed evaluation order of dictionary literals to conform to the
 
6656
  general left to right evaluation order rule. Now {f1(): f2()} will
 
6657
  evaluate f1 first.
 
6658
 
 
6659
- Fixed bug #521782: when a file was in non-blocking mode, file.read()
 
6660
  could silently lose data or wrongly throw an unknown error.
 
6661
 
 
6662
- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
 
6663
  slots are now always tried after trying the corresponding nb_* slots.
 
6664
  This fixes a number of minor bugs (see bug #624807).
 
6665
 
 
6666
- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
 
6667
 
 
6668
Extension modules
 
6669
-----------------
 
6670
 
 
6671
- Added three operators to the operator module:
 
6672
    operator.pow(a,b) which is equivalent to:  a**b.
 
6673
    operator.is_(a,b) which is equivalent to:  a is b.
 
6674
    operator.is_not(a,b) which is equivalent to:  a is not b.
 
6675
 
 
6676
- posix.openpty now works on all systems that have /dev/ptmx.
 
6677
 
 
6678
- A module zipimport exists to support importing code from zip
 
6679
  archives.
 
6680
 
 
6681
- The new datetime module supplies classes for manipulating dates and
 
6682
  times.  The basic design came from the Zope "fishbowl process", and
 
6683
  favors practical commercial applications over calendar esoterica.  See
 
6684
 
 
6685
      http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
 
6686
 
 
6687
- _tkinter now returns Tcl objects, instead of strings. Objects which
 
6688
  have Python equivalents are converted to Python objects, other objects
 
6689
  are wrapped. This can be configured through the wantobjects method,
 
6690
  or Tkinter.wantobjects.
 
6691
 
 
6692
- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
 
6693
  been added as the package bsddb.  The traditional bsddb module is
 
6694
  still available in source code, but not built automatically anymore,
 
6695
  and is now named bsddb185.  This supports Berkeley DB versions from
 
6696
  3.0 to 4.1.  For help converting your databases from the old module (which
 
6697
  probably used an obsolete version of Berkeley DB) to the new module, see
 
6698
  the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
 
6699
  section above.
 
6700
 
 
6701
- unicodedata was updated to Unicode 3.2. It supports normalization
 
6702
  and names for Hangul syllables and CJK unified ideographs.
 
6703
 
 
6704
- resource.getrlimit() now returns longs instead of ints.
 
6705
 
 
6706
- readline now dynamically adjusts its input/output stream if
 
6707
  sys.stdin/stdout changes.
 
6708
 
 
6709
- The _tkinter module (and hence Tkinter) has dropped support for
 
6710
  Tcl/Tk 8.0 and 8.1.  Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
 
6711
  supported.
 
6712
 
 
6713
- cPickle.BadPickleGet is now a class.
 
6714
 
 
6715
- The time stamps in os.stat_result are floating point numbers
 
6716
  after stat_float_times has been called.
 
6717
 
 
6718
- If the size passed to mmap.mmap() is larger than the length of the
 
6719
  file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
 
6720
 
 
6721
- The xreadlines module is slated for obsolescence.
 
6722
 
 
6723
- The strptime function in the time module is now always available (a
 
6724
  Python implementation is used when the C library doesn't define it).
 
6725
 
 
6726
- The 'new' module is no longer an extension, but a Python module that
 
6727
  only exists for backwards compatibility.  Its contents are no longer
 
6728
  functions but callable type objects.
 
6729
 
 
6730
- The bsddb.*open functions can now take 'None' as a filename.
 
6731
  This will create a temporary in-memory bsddb that won't be
 
6732
  written to disk.
 
6733
 
 
6734
- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
 
6735
  posix.getpgid have been added where available.
 
6736
 
 
6737
- The locale module now exposes the C library's gettext interface. It
 
6738
  also has a new function getpreferredencoding.
 
6739
 
 
6740
- A security hole ("double free") was found in zlib-1.1.3, a popular
 
6741
  third party compression library used by some Python modules.  The
 
6742
  hole was quickly plugged in zlib-1.1.4, and the Windows build of
 
6743
  Python now ships with zlib-1.1.4.
 
6744
 
 
6745
- pwd, grp, and resource return enhanced tuples now, with symbolic
 
6746
  field names.
 
6747
 
 
6748
- array.array is now a type object. A new format character
 
6749
  'u' indicates Py_UNICODE arrays. For those, .tounicode and
 
6750
  .fromunicode methods are available. Arrays now support __iadd__
 
6751
  and __imul__.
 
6752
 
 
6753
- dl now builds on every system that has dlfcn.h.  Failure in case
 
6754
  of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
 
6755
  is called.
 
6756
 
 
6757
- The sys module acquired a new attribute, api_version, which evaluates
 
6758
  to the value of the PYTHON_API_VERSION macro with which the
 
6759
  interpreter was compiled.
 
6760
 
 
6761
- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
 
6762
  when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
 
6763
  returns (None, None, 'ab'), as expected. Also fixed handling of
 
6764
  lastindex/lastgroup match attributes in similar cases. For example,
 
6765
  when running the expression r'(a)(b)?b' over 'ab', lastindex must be
 
6766
  1, not 2.
 
6767
 
 
6768
- Fixed bug #581080: sre scanner was not checking the buffer limit
 
6769
  before increasing the current pointer. This was creating an infinite
 
6770
  loop in the search function, once the pointer exceeded the buffer
 
6771
  limit.
 
6772
 
 
6773
- The os.fdopen function now enforces a file mode starting with the
 
6774
  letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
 
6775
  bug #623464.
 
6776
 
 
6777
- The linuxaudiodev module is now deprecated; it is being replaced by
 
6778
  ossaudiodev.  The interface has been extended to cover a lot more of
 
6779
  OSS (see www.opensound.com), including most DSP ioctls and the
 
6780
  OSS mixer API.  Documentation forthcoming in 2.3a2.
 
6781
 
 
6782
Library
 
6783
-------
 
6784
 
 
6785
- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
 
6786
 
 
6787
- Freeze's modulefinder.py has been moved to the standard library;
 
6788
  slightly improved so it will issue less false missing submodule
 
6789
  reports (see sf path #643711 for details).  Documentation will follow
 
6790
  with Python 2.3a2.
 
6791
 
 
6792
- os.path exposes getctime.
 
6793
 
 
6794
- unittest.py now has two additional methods called assertAlmostEqual()
 
6795
  and failIfAlmostEqual().  They implement an approximate comparison
 
6796
  by rounding the difference between the two arguments and comparing
 
6797
  the result to zero.  Approximate comparison is essential for
 
6798
  unit tests of floating point results.
 
6799
 
 
6800
- calendar.py now depends on the new datetime module rather than
 
6801
  the time module.  As a result, the range of allowable dates
 
6802
  has been increased.
 
6803
 
 
6804
- pdb has a new 'j(ump)' command to select the next line to be
 
6805
  executed.
 
6806
 
 
6807
- The distutils created windows installers now can run a
 
6808
  postinstallation script.
 
6809
 
 
6810
- doctest.testmod can now be called without argument, which means to
 
6811
  test the current module.
 
6812
 
 
6813
- When canceling a server that implemented threading with a keyboard
 
6814
  interrupt, the server would shut down but not terminate (waiting on
 
6815
  client threads). A new member variable, daemon_threads, was added to
 
6816
  the ThreadingMixIn class in SocketServer.py to make it explicit that
 
6817
  this behavior needs to be controlled.
 
6818
 
 
6819
- A new module, optparse, provides a fancy alternative to getopt for
 
6820
  command line parsing.  It is a slightly modified version of Greg
 
6821
  Ward's Optik package.
 
6822
 
 
6823
- UserDict.py now defines a DictMixin class which defines all dictionary
 
6824
  methods for classes that already have a minimum mapping interface.
 
6825
  This greatly simplifies writing classes that need to be substitutable
 
6826
  for dictionaries (such as the shelve module).
 
6827
 
 
6828
- shelve.py now subclasses from UserDict.DictMixin.  Now shelve supports
 
6829
  all dictionary methods.  This eases the transition to persistent
 
6830
  storage for scripts originally written with dictionaries in mind.
 
6831
 
 
6832
- shelve.open and the various classes in shelve.py now accept an optional
 
6833
  binary flag, which defaults to False.  If True, the values stored in the
 
6834
  shelf are binary pickles.
 
6835
 
 
6836
- A new package, logging, implements the logging API defined by PEP
 
6837
  282.  The code is written by Vinay Sajip.
 
6838
 
 
6839
- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
 
6840
  modules are iterators now.
 
6841
 
 
6842
- gzip.py now handles files exceeding 2GB.  Files over 4GB also work
 
6843
  now (provided the OS supports it, and Python is configured with large
 
6844
  file support), but in that case the underlying gzip file format can
 
6845
  record only the least-significant 32 bits of the file size, so that
 
6846
  some tools working with gzipped files may report an incorrect file
 
6847
  size.
 
6848
 
 
6849
- xml.sax.saxutils.unescape has been added, to replace entity references
 
6850
  with their entity value.
 
6851
 
 
6852
- Queue.Queue.{put,get} now support an optional timeout argument.
 
6853
 
 
6854
- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
 
6855
  option of tkFileDialog is exposed as function askopenfile{,name}s.
 
6856
 
 
6857
- Various configure methods of Tkinter have been stream-lined, so that
 
6858
  tag_configure, image_configure, window_configure now return a
 
6859
  dictionary when invoked with no argument.
 
6860
 
 
6861
- Importing the readline module now no longer has the side effect of
 
6862
  calling setlocale(LC_CTYPE, "").  The initial "C" locale, or
 
6863
  whatever locale is explicitly set by the user, is preserved.  If you
 
6864
  want repr() of 8-bit strings in your preferred encoding to preserve
 
6865
  all printable characters of that encoding, you have to add the
 
6866
  following code to your $PYTHONSTARTUP file or to your application's
 
6867
  main():
 
6868
 
 
6869
    import locale
 
6870
    locale.setlocale(locale.LC_CTYPE, "")
 
6871
 
 
6872
- shutil.move was added. shutil.copytree now reports errors as an
 
6873
  exception at the end, instead of printing error messages.
 
6874
 
 
6875
- Encoding name normalization was generalized to not only
 
6876
  replace hyphens with underscores, but also all other non-alphanumeric
 
6877
  characters (with the exception of the dot which is used for Python
 
6878
  package names during lookup). The aliases.py mapping was updated
 
6879
  to the new standard.
 
6880
 
 
6881
- mimetypes has two new functions: guess_all_extensions() which
 
6882
  returns a list of all known extensions for a mime type, and
 
6883
  add_type() which adds one mapping between a mime type and
 
6884
  an extension to the database.
 
6885
 
 
6886
- New module: sets, defines the class Set that implements a mutable
 
6887
  set type using the keys of a dict to represent the set.  There's
 
6888
  also a class ImmutableSet which is useful when you need sets of sets
 
6889
  or when you need to use sets as dict keys, and a class BaseSet which
 
6890
  is the base class of the two.
 
6891
 
 
6892
- Added random.sample(population,k) for random sampling without replacement.
 
6893
  Returns a k length list of unique elements chosen from the population.
 
6894
 
 
6895
- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
 
6896
  OverflowError.  That is, it now accepts any combination of 'start'
 
6897
  and 'stop' arguments so long as each is in the range of Python's
 
6898
  bounded integers.
 
6899
 
 
6900
- Thanks to Raymond Hettinger, random.random() now uses a new core
 
6901
  generator.  The Mersenne Twister algorithm is implemented in C,
 
6902
  threadsafe, faster than the previous generator, has an astronomically
 
6903
  large period (2**19937-1), creates random floats to full 53-bit
 
6904
  precision, and may be the most widely tested random number generator
 
6905
  in existence.
 
6906
 
 
6907
  The random.jumpahead(n) method has different semantics for the new
 
6908
  generator.  Instead of jumping n steps ahead, it uses n and the
 
6909
  existing state to create a new state.  This means that jumpahead()
 
6910
  continues to support multi-threaded code needing generators of
 
6911
  non-overlapping sequences.  However, it will break code which relies
 
6912
  on jumpahead moving a specific number of steps forward.
 
6913
 
 
6914
  The attributes random.whseed and random.__whseed have no meaning for
 
6915
  the new generator.  Code using these attributes should switch to a
 
6916
  new class, random.WichmannHill which is provided for backward
 
6917
  compatibility and to make an alternate generator available.
 
6918
 
 
6919
- New "algorithms" module: heapq, implements a heap queue.  Thanks to
 
6920
  Kevin O'Connor for the code and FranƧois Pinard for an entertaining
 
6921
  write-up explaining the theory and practical uses of heaps.
 
6922
 
 
6923
- New encoding for the Palm OS character set: palmos.
 
6924
 
 
6925
- binascii.crc32() and the zipfile module had problems on some 64-bit
 
6926
  platforms.  These have been fixed.  On a platform with 8-byte C longs,
 
6927
  crc32() now returns a signed-extended 4-byte result, so that its value
 
6928
  as a Python int is equal to the value computed a 32-bit platform.
 
6929
 
 
6930
- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
 
6931
  argument.
 
6932
 
 
6933
- Some fixes in the copy module: when an object is copied through its
 
6934
  __reduce__ method, there was no check for a __setstate__ method on
 
6935
  the result [SF patch 565085]; deepcopy should treat instances of
 
6936
  custom metaclasses the same way it treats instances of type 'type'
 
6937
  [SF patch 560794].
 
6938
 
 
6939
- Sockets now support timeout mode.  After s.settimeout(T), where T is
 
6940
  a float expressing seconds, subsequent operations raise an exception
 
6941
  if they cannot be completed within T seconds.  To disable timeout
 
6942
  mode, use s.settimeout(None).  There's also a module function,
 
6943
  socket.setdefaulttimeout(T), which sets the default for all sockets
 
6944
  created henceforth.
 
6945
 
 
6946
- getopt.gnu_getopt was added.  This supports GNU-style option
 
6947
  processing, where options can be mixed with non-option arguments.
 
6948
 
 
6949
- Stop using strings for exceptions.  String objects used for
 
6950
  exceptions are now classes deriving from Exception.  The objects
 
6951
  changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
 
6952
  tabnanny.NannyNag, and xdrlib.Error.
 
6953
 
 
6954
- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
 
6955
  BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
 
6956
  Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
 
6957
  big endian systems were added to the codecs module. The old names
 
6958
  BOM32_* and BOM64_* were off by a factor of 2.
 
6959
 
 
6960
- Added conversion functions math.degrees() and math.radians().
 
6961
 
 
6962
- math.log() now takes an optional argument:  math.log(x[, base]).
 
6963
 
 
6964
- ftplib.retrlines() now tests for callback is None rather than testing
 
6965
  for False.  Was causing an error when given a callback object which
 
6966
  was callable but also returned len() as zero.  The change may
 
6967
  create new breakage if the caller relied on the undocumented behavior
 
6968
  and called with callback set to [] or some other False value not
 
6969
  identical to None.
 
6970
 
 
6971
- random.gauss() uses a piece of hidden state used by nothing else,
 
6972
  and the .seed() and .whseed() methods failed to reset it.  In other
 
6973
  words, setting the seed didn't completely determine the sequence of
 
6974
  results produced by random.gauss().  It does now.  Programs repeatedly
 
6975
  mixing calls to a seed method with calls to gauss() may see different
 
6976
  results now.
 
6977
 
 
6978
- The pickle.Pickler class grew a clear_memo() method to mimic that
 
6979
  provided by cPickle.Pickler.
 
6980
 
 
6981
- difflib's SequenceMatcher class now does a dynamic analysis of
 
6982
  which elements are so frequent as to constitute noise.  For
 
6983
  comparing files as sequences of lines, this generally works better
 
6984
  than the IS_LINE_JUNK function, and function ndiff's linejunk
 
6985
  argument defaults to None now as a result.  A happy benefit is
 
6986
  that SequenceMatcher may run much faster now when applied
 
6987
  to large files with many duplicate lines (for example, C program
 
6988
  text with lots of repeated "}" and "return NULL;" lines).
 
6989
 
 
6990
- New Text.dump() method in Tkinter module.
 
6991
 
 
6992
- New distutils commands for building packagers were added to
 
6993
  support pkgtool on Solaris and swinstall on HP-UX.
 
6994
 
 
6995
- distutils now has a new abstract binary packager base class
 
6996
  command/bdist_packager, which simplifies writing packagers.
 
6997
  This will hopefully provide the missing bits to encourage
 
6998
  people to submit more packagers, e.g. for Debian, FreeBSD
 
6999
  and other systems.
 
7000
 
 
7001
- The UTF-16, -LE and -BE stream readers now raise a
 
7002
  NotImplementedError for all calls to .readline(). Previously, they
 
7003
  used to just produce garbage or fail with an encoding error --
 
7004
  UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
 
7005
  work well with these.
 
7006
 
 
7007
- compileall now supports quiet operation.
 
7008
 
 
7009
- The BaseHTTPServer now implements optional HTTP/1.1 persistent
 
7010
  connections.
 
7011
 
 
7012
- socket module: the SSL support was broken out of the main
 
7013
  _socket module C helper and placed into a new _ssl helper
 
7014
  which now gets imported by socket.py if available and working.
 
7015
 
 
7016
- encodings package: added aliases for all supported IANA character
 
7017
  sets
 
7018
 
 
7019
- ftplib: to safeguard the user's privacy, anonymous login will use
 
7020
  "anonymous@" as default password, rather than the real user and host
 
7021
  name.
 
7022
 
 
7023
- webbrowser: tightened up the command passed to os.system() so that
 
7024
  arbitrary shell code can't be executed because a bogus URL was
 
7025
  passed in.
 
7026
 
 
7027
- gettext.translation has an optional fallback argument, and
 
7028
  gettext.find an optional all argument. Translations will now fallback
 
7029
  on a per-message basis. The module supports plural forms, by means
 
7030
  of gettext.[d]ngettext and Translation.[u]ngettext.
 
7031
 
 
7032
- distutils bdist commands now offer a --skip-build option.
 
7033
 
 
7034
- warnings.warn now accepts a Warning instance as first argument.
 
7035
 
 
7036
- The xml.sax.expatreader.ExpatParser class will no longer create
 
7037
  circular references by using itself as the locator that gets passed
 
7038
  to the content handler implementation.  [SF bug #535474]
 
7039
 
 
7040
- The email.Parser.Parser class now properly parses strings regardless
 
7041
  of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
 
7042
  or CRLF).  Also, the Header class's constructor default arguments
 
7043
  has changed slightly so that an explicit maxlinelen value is always
 
7044
  honored, and so unicode conversion error handling can be specified.
 
7045
 
 
7046
- distutils' build_ext command now links C++ extensions with the C++
 
7047
  compiler available in the Makefile or CXX environment variable, if
 
7048
  running under \*nix.
 
7049
 
 
7050
- New module bz2: provides a comprehensive interface for the bz2 compression
 
7051
  library.  It implements a complete file interface, one-shot (de)compression
 
7052
  functions, and types for sequential (de)compression.
 
7053
 
 
7054
- New pdb command 'pp' which is like 'p' except that it pretty-prints
 
7055
  the value of its expression argument.
 
7056
 
 
7057
- Now bdist_rpm distutils command understands a verify_script option in
 
7058
  the config file, including the contents of the referred filename in
 
7059
  the "%verifyscript" section of the rpm spec file.
 
7060
 
 
7061
- Fixed bug #495695: webbrowser module would run graphic browsers in a
 
7062
  unix environment even if DISPLAY was not set. Also, support for
 
7063
  skipstone browser was included.
 
7064
 
 
7065
- Fixed bug #636769: rexec would run unallowed code if subclasses of
 
7066
  strings were used as parameters for certain functions.
 
7067
 
 
7068
Tools/Demos
 
7069
-----------
 
7070
 
 
7071
- pygettext.py now supports globbing on Windows, and accepts module
 
7072
  names in addition to accepting file names.
 
7073
 
 
7074
- The SGI demos (Demo/sgi) have been removed.  Nobody thought they
 
7075
  were interesting any more.  (The SGI library modules and extensions
 
7076
  are still there; it is believed that at least some of these are
 
7077
  still used and useful.)
 
7078
 
 
7079
- IDLE supports the new encoding declarations (PEP 263); it can also
 
7080
  deal with legacy 8-bit files if they use the locale's encoding. It
 
7081
  allows non-ASCII strings in the interactive shell and executes them
 
7082
  in the locale's encoding.
 
7083
 
 
7084
- freeze.py now produces binaries which can import shared modules,
 
7085
  unlike before when this failed due to missing symbol exports in
 
7086
  the generated binary.
 
7087
 
 
7088
Build
 
7089
-----
 
7090
 
 
7091
- On Unix, IDLE is now installed automatically.
 
7092
 
 
7093
- The fpectl module is not built by default; it's dangerous or useless
 
7094
  except in the hands of experts.
 
7095
 
 
7096
- The public Python C API will generally be declared using PyAPI_FUNC
 
7097
  and PyAPI_DATA macros, while Python extension module init functions
 
7098
  will be declared with PyMODINIT_FUNC.  DL_EXPORT/DL_IMPORT macros
 
7099
  are deprecated.
 
7100
 
 
7101
- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
 
7102
  get into infinite loops, when a new-style class got garbage-collected.
 
7103
  Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
 
7104
  that new-style classes be immortal in COUNT_ALLOCS builds.  Note that
 
7105
  COUNT_ALLOCS is not enabled by default, in either release or debug
 
7106
  builds, and that new-style classes are immortal only in COUNT_ALLOCS
 
7107
  builds.
 
7108
 
 
7109
- Compiling out the cyclic garbage collector is no longer an option.
 
7110
  The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
 
7111
  that it's always defined (for the benefit of any extension modules
 
7112
  that may be conditionalizing on it).  A bonus is that any extension
 
7113
  type participating in cyclic gc can choose to participate in the
 
7114
  Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
 
7115
  to require editing the core to teach the trashcan mechanism about the
 
7116
  new type.
 
7117
 
 
7118
- According to Annex F of the current C standard,
 
7119
 
 
7120
    The Standard C macro HUGE_VAL and its float and long double analogs,
 
7121
    HUGE_VALF and HUGE_VALL, expand to expressions whose values are
 
7122
    positive infinities.
 
7123
 
 
7124
  Python only uses the double HUGE_VAL, and only to #define its own symbol
 
7125
  Py_HUGE_VAL.  Some platforms have incorrect definitions for HUGE_VAL.
 
7126
  pyport.h used to try to worm around that, but the workarounds triggered
 
7127
  other bugs on other platforms, so we gave up.  If your platform defines
 
7128
  HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
 
7129
  that works on your platform.  The only instance of this I'm sure about
 
7130
  is on an unknown subset of Cray systems, described here:
 
7131
 
 
7132
  http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
 
7133
 
 
7134
  Presumably 2.3a1 breaks such systems.  If anyone uses such a system, help!
 
7135
 
 
7136
- The configure option --without-doc-strings can be used to remove the
 
7137
  doc strings from the builtin functions and modules; this reduces the
 
7138
  size of the executable.
 
7139
 
 
7140
- The universal newlines option (PEP 278) is on by default.  On Unix
 
7141
  it can be disabled by passing --without-universal-newlines to the
 
7142
  configure script.  On other platforms, remove
 
7143
  WITH_UNIVERSAL_NEWLINES from pyconfig.h.
 
7144
 
 
7145
- On Unix, a shared libpython2.3.so can be created with --enable-shared.
 
7146
 
 
7147
- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
 
7148
  preprocessor symbols were eliminated.  The internal decisions they
 
7149
  controlled stopped being experimental long ago.
 
7150
 
 
7151
- The tools used to build the documentation now work under Cygwin as
 
7152
  well as Unix.
 
7153
 
 
7154
- The bsddb and dbm module builds have been changed to try and avoid version
 
7155
  skew problems and disable linkage with Berkeley DB 1.85 unless the
 
7156
  installer knows what s/he's doing.  See the section on building these
 
7157
  modules in the README file for details.
 
7158
 
 
7159
C API
 
7160
-----
 
7161
 
 
7162
- PyNumber_Check() now returns true for string and unicode objects.
 
7163
  This is a result of these types having a partially defined
 
7164
  tp_as_number slot.  (This is not a feature, but an indication that
 
7165
  PyNumber_Check() is not very useful to determine numeric behavior.
 
7166
  It may be deprecated.)
 
7167
 
 
7168
- The string object's layout has changed: the pointer member
 
7169
  ob_sinterned has been replaced by an int member ob_sstate.  On some
 
7170
  platforms (e.g. most 64-bit systems) this may change the offset of
 
7171
  the ob_sval member, so as a precaution the API_VERSION has been
 
7172
  incremented.  The apparently unused feature of "indirect interned
 
7173
  strings", supported by the ob_sinterned member, is gone.  Interned
 
7174
  strings are now usually mortal; there is a new API,
 
7175
  PyString_InternImmortal() that creates immortal interned strings.
 
7176
  (The ob_sstate member can only take three values; however, while
 
7177
  making it a char saves a few bytes per string object on average, in
 
7178
  it also slowed things down a bit because ob_sval was no longer
 
7179
  aligned.)
 
7180
 
 
7181
- The Py_InitModule*() functions now accept NULL for the 'methods'
 
7182
  argument.  Modules without global functions are becoming more common
 
7183
  now that factories can be types rather than functions.
 
7184
 
 
7185
- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
 
7186
  level.
 
7187
 
 
7188
- New functions PyErr_SetExcFromWindowsErr() and
 
7189
  PyErr_SetExcFromWindowsErrWithFilename(). Similar to
 
7190
  PyErr_SetFromWindowsErrWithFilename() and
 
7191
  PyErr_SetFromWindowsErr(), but they allow to specify
 
7192
  the exception type to raise. Available on Windows.
 
7193
 
 
7194
- Py_FatalError() is now declared as taking a const char* argument.  It
 
7195
  was previously declared without const.  This should not affect working
 
7196
  code.
 
7197
 
 
7198
- Added new macro PySequence_ITEM(o, i) that directly calls
 
7199
  sq_item without rechecking that o is a sequence and without
 
7200
  adjusting for negative indices.
 
7201
 
 
7202
- PyRange_New() now raises ValueError if the fourth argument is not 1.
 
7203
  This is part of the removal of deprecated features of the xrange
 
7204
  object.
 
7205
 
 
7206
- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
 
7207
  coercion if both arguments have the same type but this type has the
 
7208
  CHECKTYPES flag set.  This is to better support proxies.
 
7209
 
 
7210
- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
 
7211
  "``void (*)(void *)``".
 
7212
 
 
7213
- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
 
7214
 
 
7215
- A type can now inherit its metatype from its base type.  Previously,
 
7216
  when PyType_Ready() was called, if ob_type was found to be NULL, it
 
7217
  was always set to &PyType_Type; now it is set to base->ob_type,
 
7218
  where base is tp_base, defaulting to &PyObject_Type.
 
7219
 
 
7220
- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
 
7221
 
 
7222
- The PyCore_* family of APIs have been removed.
 
7223
 
 
7224
- The "u#" parser marker will now pass through Unicode objects as-is
 
7225
  without going through the buffer API.
 
7226
 
 
7227
- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
 
7228
 
 
7229
- An old #define of ANY as void has been removed from pyport.h.  This
 
7230
  hasn't been used since Python's pre-ANSI days, and the #define has
 
7231
  been marked as obsolete since then.  SF bug 495548 says it created
 
7232
  conflicts with other packages, so keeping it around wasn't harmless.
 
7233
 
 
7234
- Because Python's magic number scheme broke on January 1st, we decided
 
7235
  to stop Python development.  Thanks for all the fish!
 
7236
 
 
7237
- Some of us don't like fish, so we changed Python's magic number
 
7238
  scheme to a new one. See Python/import.c for details.
 
7239
 
 
7240
New platforms
 
7241
-------------
 
7242
 
 
7243
- OpenVMS is now supported.
 
7244
 
 
7245
- AtheOS is now supported.
 
7246
 
 
7247
- the EMX runtime environment on OS/2 is now supported.
 
7248
 
 
7249
- GNU/Hurd is now supported.
 
7250
 
 
7251
Tests
 
7252
-----
 
7253
 
 
7254
- The regrtest.py script's -u option now provides a way to say "allow
 
7255
  all resources except this one."  For example, to allow everything
 
7256
  except bsddb, give the option '-uall,-bsddb'.
 
7257
 
 
7258
Windows
 
7259
-------
 
7260
 
 
7261
- The Windows distribution now ships with version 4.0.14 of the
 
7262
  Sleepycat Berkeley database library.  This should be a huge
 
7263
  improvement over the previous Berkeley DB 1.85, which had many
 
7264
  bugs.
 
7265
  XXX What are the licensing issues here?
 
7266
  XXX If a user has a database created with a previous version of
 
7267
  XXX     Python, what must they do to convert it?
 
7268
  XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
 
7269
  XXX The version # is likely to change before 2.3a1.
 
7270
 
 
7271
- The Windows distribution now ships with a Secure Sockets Library (SLL)
 
7272
   module (_ssl.pyd)
 
7273
 
 
7274
- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
 
7275
  previously shipped with Tcl/Tk 8.3.2).
 
7276
 
 
7277
- When Python is built under a Microsoft compiler, sys.version now
 
7278
  includes the compiler version number (_MSC_VER).  For example, under
 
7279
  MSVC 6, sys.version contains the substring "MSC v.1200 ".  1200 is
 
7280
  the value of _MSC_VER under MSVC 6.
 
7281
 
 
7282
- Sometimes the uninstall executable (UNWISE.EXE) vanishes.  One cause
 
7283
  of that has been fixed in the installer (disabled Wise's "delete in-
 
7284
  use files" uninstall option).
 
7285
 
 
7286
- Fixed a bug in urllib's proxy handling in Windows.  [SF bug #503031]
 
7287
 
 
7288
- The installer now installs Start menu shortcuts under (the local
 
7289
  equivalent of) "All Users" when doing an Admin install.
 
7290
 
 
7291
- file.truncate([newsize]) now works on Windows for all newsize values.
 
7292
  It used to fail if newsize didn't fit in 32 bits, reflecting a
 
7293
  limitation of MS _chsize (which is no longer used).
 
7294
 
 
7295
- os.waitpid() is now implemented for Windows, and can be used to block
 
7296
  until a specified process exits.  This is similar to, but not exactly
 
7297
  the same as, os.waitpid() on POSIX systems.  If you're waiting for
 
7298
  a specific process whose pid was obtained from one of the spawn()
 
7299
  functions, the same Python os.waitpid() code works across platforms.
 
7300
  See the docs for details.  The docs were changed to clarify that
 
7301
  spawn functions return, and waitpid requires, a process handle on
 
7302
  Windows (not the same thing as a Windows process id).
 
7303
 
 
7304
- New tempfile.TemporaryFile implementation for Windows:  this doesn't
 
7305
  need a TemporaryFileWrapper wrapper anymore, and should be immune
 
7306
  to a nasty problem:  before 2.3, if you got a temp file on Windows, it
 
7307
  got wrapped in an object whose close() method first closed the
 
7308
  underlying file, then deleted the file.  This usually worked fine.
 
7309
  However, the spawn family of functions on Windows create (at a low C
 
7310
  level) the same set of open files in the spawned process Q as were
 
7311
  open in the spawning process P.  If a temp file f was among them, then
 
7312
  doing f.close() in P first closed P's C-level file handle on f, but Q's
 
7313
  C-level file handle on f remained open, so the attempt in P to delete f
 
7314
  blew up with a "Permission denied" error (Windows doesn't allow
 
7315
  deleting open files).  This was surprising, subtle, and difficult to
 
7316
  work around.
 
7317
 
 
7318
- The os module now exports all the symbolic constants usable with the
 
7319
  low-level os.open() on Windows:  the new constants in 2.3 are
 
7320
  O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
 
7321
  The others were also available in 2.2:  O_APPEND, O_BINARY, O_CREAT,
 
7322
  O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY.  Contrary
 
7323
  to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
 
7324
  (so specify both if you want both; note that neither is useful unless
 
7325
  specified with O_CREAT too).
 
7326
 
 
7327
Mac
 
7328
----
 
7329
 
 
7330
- Mac/Relnotes is gone, the release notes are now here.
 
7331
 
 
7332
- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
 
7333
  version) now fully supports unicode strings as arguments to various file
 
7334
  system calls, eg. open(), file(), os.stat() and os.listdir().
 
7335
 
 
7336
- The current naming convention for Python on the Macintosh is that MacPython
 
7337
  refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
 
7338
  CFM-based version that runs on both OS9 and OSX.
 
7339
 
 
7340
- All MacPython-OS9 functionality is now available in an OSX unix build,
 
7341
  including the Carbon modules, the IDE, OSA support, etc. A lot of this
 
7342
  will only work correctly in a framework build, though, because you cannot
 
7343
  talk to the window manager unless your application is run from a .app
 
7344
  bundle. There is a command line tool "pythonw" that runs your script
 
7345
  with an interpreter living in such a .app bundle, this interpreter should
 
7346
  be used to run any Python script using the window manager (including
 
7347
  Tkinter or wxPython scripts).
 
7348
 
 
7349
- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
 
7350
  MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
 
7351
  are specifically for MacPython-OS9 (CFM support, preference resources, etc).
 
7352
 
 
7353
- A new utility PythonLauncher will start a Python interpreter when a .py or
 
7354
  .pyw script is double-clicked in the Finder. By default .py scripts are
 
7355
  run with a normal Python interpreter in a Terminal window and .pyw
 
7356
  files are run with a window-aware pythonw interpreter without a Terminal
 
7357
  window, but all this can be customized.
 
7358
 
 
7359
- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
 
7360
  possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
 
7361
  releases.
 
7362
 
 
7363
- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
 
7364
  line interface too.
 
7365
 
 
7366
- All the Carbon classes are now PEP253 compliant, meaning that you can
 
7367
  subclass them from Python. Most of the attributes have gone, you should
 
7368
  now use the accessor function call API, which is also what Apple's
 
7369
  documentation uses. Some attributes such as grafport.visRgn are still
 
7370
  available for convenience.
 
7371
 
 
7372
- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
 
7373
  and Folder (APIs from Folders.h). The old macfs builtin module is
 
7374
  gone, and replaced by a Python wrapper around the new modules.
 
7375
 
 
7376
- Pathname handling should now be fully consistent: MacPython-OSX always uses
 
7377
  unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
 
7378
  (also when running on Mac OS X).
 
7379
 
 
7380
- New Carbon modules Help and AH give access to the Carbon Help Manager.
 
7381
  There are hooks in the IDE to allow accessing the Python documentation
 
7382
  (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
 
7383
  See Mac/OSX/README for converting the Python documentation to a
 
7384
  Help Viewer compatible form and installing it.
 
7385
 
 
7386
- OSA support has been redesigned and the generated Python classes now
 
7387
  mirror the inheritance defined by the underlying OSA classes.
 
7388
 
 
7389
- MacPython no longer maps both \r and \n to \n on input for any text file.
 
7390
  This feature has been replaced by universal newline support (PEP278).
 
7391
 
 
7392
- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
 
7393
  mac-roman (or whatever your local Mac encoding was) but "ascii", like on
 
7394
  other platforms. If you really need sourcefiles with Mac characters in them
 
7395
  you can change this in site.py.
 
7396
 
 
7397
 
 
7398
What's New in Python 2.2 final?
 
7399
===============================
 
7400
 
 
7401
*Release date: 21-Dec-2001*
 
7402
 
 
7403
Type/class unification and new-style classes
 
7404
--------------------------------------------
 
7405
 
 
7406
- pickle.py, cPickle: allow pickling instances of new-style classes
 
7407
  with a custom metaclass.
 
7408
 
 
7409
Core and builtins
 
7410
-----------------
 
7411
 
 
7412
- weakref proxy object: when comparing, unwrap both arguments if both
 
7413
  are proxies.
 
7414
 
 
7415
Extension modules
 
7416
-----------------
 
7417
 
 
7418
- binascii.b2a_base64(): fix a potential buffer overrun when encoding
 
7419
  very short strings.
 
7420
 
 
7421
- cPickle: the obscure "fast" mode was suspected of causing stack
 
7422
  overflows on the Mac.  Hopefully fixed this by setting the recursion
 
7423
  limit much smaller.  If the limit is too low (it only affects
 
7424
  performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
 
7425
  when compiling cPickle.c (or in pyconfig.h).
 
7426
 
 
7427
Library
 
7428
-------
 
7429
 
 
7430
- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
 
7431
  close or delete time).
 
7432
 
 
7433
- rfc822.py: fixed a bug where the address '<>' was converted to None
 
7434
  instead of an empty string (also fixes the email.Utils module).
 
7435
 
 
7436
- xmlrpclib.py: version 1.0.0; uses precision for doubles.
 
7437
 
 
7438
- test suite: the pickle and cPickle tests were not executing any code
 
7439
  when run from the standard regression test.
 
7440
 
 
7441
Tools/Demos
 
7442
-----------
 
7443
 
 
7444
Build
 
7445
-----
 
7446
 
 
7447
C API
 
7448
-----
 
7449
 
 
7450
New platforms
 
7451
-------------
 
7452
 
 
7453
Tests
 
7454
-----
 
7455
 
 
7456
Windows
 
7457
-------
 
7458
 
 
7459
- distutils package: fixed broken Windows installers (bdist_wininst).
 
7460
 
 
7461
- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
 
7462
  instances are deleted at process exit time.
 
7463
 
 
7464
- socket.py: prevent mysterious warnings when socket instances are
 
7465
  deleted at process exit time.
 
7466
 
 
7467
- posixmodule.c: fix a Windows crash with stat() of a filename ending
 
7468
  in backslash.
 
7469
 
 
7470
Mac
 
7471
----
 
7472
 
 
7473
- The Carbon toolbox modules have been upgraded to Universal Headers
 
7474
  3.4, and experimental CoreGraphics and CarbonEvents modules have
 
7475
  been added.  All only for framework-enabled MacOSX.
 
7476
 
 
7477
 
 
7478
What's New in Python 2.2c1?
 
7479
===========================
 
7480
 
 
7481
*Release date: 14-Dec-2001*
 
7482
 
 
7483
Type/class unification and new-style classes
 
7484
--------------------------------------------
 
7485
 
 
7486
- Guido's tutorial introduction to the new type/class features has
 
7487
  been extensively updated.  See
 
7488
 
 
7489
      http://www.python.org/2.2/descrintro.html
 
7490
 
 
7491
  That remains the primary documentation in this area.
 
7492
 
 
7493
- Fixed a leak: instance variables declared with __slots__ were never
 
7494
  deleted!
 
7495
 
 
7496
- The "delete attribute" method of descriptor objects is called
 
7497
  __delete__, not __del__.  In previous releases, it was mistakenly
 
7498
  called __del__, which created an unfortunate overloading condition
 
7499
  with finalizers.  (The "get attribute" and "set attribute" methods
 
7500
  are still called __get__ and __set__, respectively.)
 
7501
 
 
7502
- Some subtle issues with the super built-in were fixed:
 
7503
 
 
7504
  (a) When super itself is subclassed, its __get__ method would still
 
7505
      return an instance of the base class (i.e., of super).
 
7506
 
 
7507
  (b) super(C, C()).__class__ would return C rather than super.  This
 
7508
      is confusing.  To fix this, I decided to change the semantics of
 
7509
      super so that it only applies to code attributes, not to data
 
7510
      attributes.  After all, overriding data attributes is not
 
7511
      supported anyway.
 
7512
 
 
7513
  (c) The __get__ method didn't check whether the argument was an
 
7514
      instance of the type used in creation of the super instance.
 
7515
 
 
7516
- Previously, hash() of an instance of a subclass of a mutable type
 
7517
  (list or dictionary) would return some value, rather than raising
 
7518
  TypeError.  This has been fixed.  Also, directly calling
 
7519
  dict.__hash__ and list.__hash__ now raises the same TypeError
 
7520
  (previously, these were the same as object.__hash__).
 
7521
 
 
7522
- New-style objects now support deleting their __dict__.  This is for
 
7523
  all intents and purposes equivalent to assigning a brand new empty
 
7524
  dictionary, but saves space if the object is not used further.
 
7525
 
 
7526
Core and builtins
 
7527
-----------------
 
7528
 
 
7529
- -Qnew now works as documented in PEP 238:  when -Qnew is passed on
 
7530
  the command line, all occurrences of "/" use true division instead
 
7531
  of classic division.  See the PEP for details.  Note that "all"
 
7532
  means all instances in library and 3rd-party modules, as well as in
 
7533
  your own code.  As the PEP says, -Qnew is intended for use only in
 
7534
  educational environments with control over the libraries in use.
 
7535
  Note that test_coercion.py in the standard Python test suite fails
 
7536
  under -Qnew; this is expected, and won't be repaired until true
 
7537
  division becomes the default (in the meantime, test_coercion is
 
7538
  testing the current rules).
 
7539
 
 
7540
- complex() now only allows the first argument to be a string
 
7541
  argument, and raises TypeError if either the second arg is a string
 
7542
  or if the second arg is specified when the first is a string.
 
7543
 
 
7544
Extension modules
 
7545
-----------------
 
7546
 
 
7547
- gc.get_referents was renamed to gc.get_referrers.
 
7548
 
 
7549
Library
 
7550
-------
 
7551
 
 
7552
- Functions in the os.spawn() family now release the global interpreter
 
7553
  lock around calling the platform spawn.  They should always have done
 
7554
  this, but did not before 2.2c1.  Multithreaded programs calling
 
7555
  an os.spawn function with P_WAIT will no longer block all Python threads
 
7556
  until the spawned program completes.  It's possible that some programs
 
7557
  relies on blocking, although more likely by accident than by design.
 
7558
 
 
7559
- webbrowser defaults to netscape.exe on OS/2 now.
 
7560
 
 
7561
- Tix.ResizeHandle exposes detach_widget, hide, and show.
 
7562
 
 
7563
- The charset alias windows_1252 has been added.
 
7564
 
 
7565
- types.StringTypes is a tuple containing the defined string types;
 
7566
  usually this will be (str, unicode), but if Python was compiled
 
7567
  without Unicode support it will be just (str,).
 
7568
 
 
7569
- The pulldom and minidom modules were synchronized to PyXML.
 
7570
 
 
7571
Tools/Demos
 
7572
-----------
 
7573
 
 
7574
- A new script called Tools/scripts/google.py was added, which fires
 
7575
  off a search on Google.
 
7576
 
 
7577
Build
 
7578
-----
 
7579
 
 
7580
- Note that release builds of Python should arrange to define the
 
7581
  preprocessor symbol NDEBUG on the command line (or equivalent).
 
7582
  In the 2.2 pre-release series we tried to define this by magic in
 
7583
  Python.h instead, but it proved to cause problems for extension
 
7584
  authors.  The Unix, Windows and Mac builds now all define NDEBUG in
 
7585
  release builds via cmdline (or equivalent) instead.  Ports to
 
7586
  other platforms should do likewise.
 
7587
 
 
7588
- It is no longer necessary to use --with-suffix when building on a
 
7589
  case-insensitive file system (such as Mac OS X HFS+). In the build
 
7590
  directory an extension is used, but not in the installed python.
 
7591
 
 
7592
C API
 
7593
-----
 
7594
 
 
7595
- New function PyDict_MergeFromSeq2() exposes the builtin dict
 
7596
  constructor's logic for updating a dictionary from an iterable object
 
7597
  producing key-value pairs.
 
7598
 
 
7599
- PyArg_ParseTupleAndKeywords() requires that the number of entries in
 
7600
  the keyword list equal the number of argument specifiers.  This
 
7601
  wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
 
7602
  dump core in some bad cases.  This has been repaired.  As a result,
 
7603
  PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
 
7604
  previously went unchallenged.
 
7605
 
 
7606
New platforms
 
7607
-------------
 
7608
 
 
7609
Tests
 
7610
-----
 
7611
 
 
7612
Windows
 
7613
-------
 
7614
 
 
7615
Mac
 
7616
----
 
7617
 
 
7618
- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
 
7619
  without any trailing digits.
 
7620
 
 
7621
- Changed logic for finding python home in Mac OS X framework Pythons.
 
7622
  Now sys.executable points to the executable again, in stead of to
 
7623
  the shared library. The latter is used only for locating the python
 
7624
  home.
 
7625
 
 
7626
 
 
7627
What's New in Python 2.2b2?
 
7628
===========================
 
7629
 
 
7630
*Release date: 16-Nov-2001*
 
7631
 
 
7632
Type/class unification and new-style classes
 
7633
--------------------------------------------
 
7634
 
 
7635
- Multiple inheritance mixing new-style and classic classes in the
 
7636
  list of base classes is now allowed, so this works now:
 
7637
 
 
7638
      class Classic: pass
 
7639
      class Mixed(Classic, object): pass
 
7640
 
 
7641
  The MRO (method resolution order) for each base class is respected
 
7642
  according to its kind, but the MRO for the derived class is computed
 
7643
  using new-style MRO rules if any base class is a new-style class.
 
7644
  This needs to be documented.
 
7645
 
 
7646
- The new builtin dictionary() constructor, and dictionary type, have
 
7647
  been renamed to dict.  This reflects a decade of common usage.
 
7648
 
 
7649
- dict() now accepts an iterable object producing 2-sequences.  For
 
7650
  example, dict(d.items()) == d for any dictionary d.  The argument,
 
7651
  and the elements of the argument, can be any iterable objects.
 
7652
 
 
7653
- New-style classes can now have a __del__ method, which is called
 
7654
  when the instance is deleted (just like for classic classes).
 
7655
 
 
7656
- Assignment to object.__dict__ is now possible, for objects that are
 
7657
  instances of new-style classes that have a __dict__ (unless the base
 
7658
  class forbids it).
 
7659
 
 
7660
- Methods of built-in types now properly check for keyword arguments
 
7661
  (formerly these were silently ignored).  The only built-in methods
 
7662
  that take keyword arguments are __call__, __init__ and __new__.
 
7663
 
 
7664
- The socket function has been converted to a type; see below.
 
7665
 
 
7666
Core and builtins
 
7667
-----------------
 
7668
 
 
7669
- Assignment to __debug__ raises SyntaxError at compile-time.  This
 
7670
  was promised when 2.1c1 was released as "What's New in Python 2.1c1"
 
7671
  (see below) says.
 
7672
 
 
7673
- Clarified the error messages for unsupported operands to an operator
 
7674
  (like 1 + '').
 
7675
 
 
7676
Extension modules
 
7677
-----------------
 
7678
 
 
7679
- mmap has a new keyword argument, "access", allowing a uniform way for
 
7680
  both Windows and Unix users to create read-only, write-through and
 
7681
  copy-on-write memory mappings.  This was previously possible only on
 
7682
  Unix.  A new keyword argument was required to support this in a
 
7683
  uniform way because the mmap() signatures had diverged across
 
7684
  platforms.  Thanks to Jay T Miller for repairing this!
 
7685
 
 
7686
- By default, the gc.garbage list now contains only those instances in
 
7687
  unreachable cycles that have __del__ methods; in 2.1 it contained all
 
7688
  instances in unreachable cycles.  "Instances" here has been generalized
 
7689
  to include instances of both new-style and old-style classes.
 
7690
 
 
7691
- The socket module defines a new method for socket objects,
 
7692
  sendall().  This is like send() but may make multiple calls to
 
7693
  send() until all data has been sent.  Also, the socket function has
 
7694
  been converted to a subclassable type, like list and tuple (etc.)
 
7695
  before it; socket and SocketType are now the same thing.
 
7696
 
 
7697
- Various bugfixes to the curses module.  There is now a test suite
 
7698
  for the curses module (you have to run it manually).
 
7699
 
 
7700
- binascii.b2a_base64 no longer places an arbitrary restriction of 57
 
7701
  bytes on its input.
 
7702
 
 
7703
Library
 
7704
-------
 
7705
 
 
7706
- tkFileDialog exposes a Directory class and askdirectory
 
7707
  convenience function.
 
7708
 
 
7709
- Symbolic group names in regular expressions must be unique.  For
 
7710
  example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
 
7711
  single name can't mean both "group 1" and "group 2" simultaneously.
 
7712
  Python 2.2 detects this error at regexp compilation time;
 
7713
  previously, the error went undetected, and results were
 
7714
  unpredictable.  Also in sre, the pattern.split(), pattern.sub(), and
 
7715
  pattern.subn() methods have been rewritten in C.  Also, an
 
7716
  experimental function/method finditer() has been added, which works
 
7717
  like findall() but returns an iterator.
 
7718
 
 
7719
- Tix exposes more commands through the classes DirSelectBox,
 
7720
  DirSelectDialog, ListNoteBook, Meter, CheckList, and the
 
7721
  methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
 
7722
  tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
 
7723
 
 
7724
- Traceback objects are now scanned by cyclic garbage collection, so
 
7725
  cycles created by casual use of sys.exc_info() no longer cause
 
7726
  permanent memory leaks (provided garbage collection is enabled).
 
7727
 
 
7728
- mimetypes.py has optional support for non-standard, but commonly
 
7729
  found types.  guess_type() and guess_extension() now accept an
 
7730
  optional 'strict' flag, defaulting to true, which controls whether
 
7731
  recognize non-standard types or not.  A few non-standard types we
 
7732
  know about have been added.  Also, when run as a script, there are
 
7733
  new -l and -e options.
 
7734
 
 
7735
- statcache is now deprecated.
 
7736
 
 
7737
- email.Utils.formatdate() now produces the preferred RFC 2822 style
 
7738
  dates with numeric timezones (it used to produce obsolete dates
 
7739
  hard coded to "GMT" timezone).  An optional 'localtime' flag is
 
7740
  added to produce dates in the local timezone, with daylight savings
 
7741
  time properly taken into account.
 
7742
 
 
7743
- In pickle and cPickle, instead of masking errors in load() by
 
7744
  transforming them into SystemError, we let the original exception
 
7745
  propagate out.  Also, implement support for __safe_for_unpickling__
 
7746
  in pickle, as it already was supported in cPickle.
 
7747
 
 
7748
Tools/Demos
 
7749
-----------
 
7750
 
 
7751
Build
 
7752
-----
 
7753
 
 
7754
- The dbm module is built using libdb1 if available.  The bsddb module
 
7755
  is built with libdb3 if available.
 
7756
 
 
7757
- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
 
7758
 
 
7759
C API
 
7760
-----
 
7761
 
 
7762
- New function PySequence_Fast_GET_SIZE() returns the size of a non-
 
7763
  NULL result from PySequence_Fast(), more quickly than calling
 
7764
  PySequence_Size().
 
7765
 
 
7766
- New argument unpacking function PyArg_UnpackTuple() added.
 
7767
 
 
7768
- New functions PyObject_CallFunctionObjArgs() and
 
7769
  PyObject_CallMethodObjArgs() have been added to make it more
 
7770
  convenient and efficient to call functions and methods from C.
 
7771
 
 
7772
- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
 
7773
  possible that this will propagate errors it didn't before.
 
7774
 
 
7775
- New function PyObject_CheckReadBuffer(), which returns true if its
 
7776
  argument supports the single-segment readable buffer interface.
 
7777
 
 
7778
New platforms
 
7779
-------------
 
7780
 
 
7781
- We've finally confirmed that this release builds on HP-UX 11.00,
 
7782
  *with* threads, and passes the test suite.
 
7783
 
 
7784
- Thanks to a series of patches from Michael Muller, Python may build
 
7785
  again under OS/2 Visual Age C++.
 
7786
 
 
7787
- Updated RISCOS port by Dietmar Schwertberger.
 
7788
 
 
7789
Tests
 
7790
-----
 
7791
 
 
7792
- Added a test script for the curses module.  It isn't run automatically;
 
7793
  regrtest.py must be run with '-u curses' to enable it.
 
7794
 
 
7795
Windows
 
7796
-------
 
7797
 
 
7798
Mac
 
7799
----
 
7800
 
 
7801
- PythonScript has been moved to unsupported and is slated to be
 
7802
  removed completely in the next release.
 
7803
 
 
7804
- It should now be possible to build applets that work on both OS9 and
 
7805
  OSX.
 
7806
 
 
7807
- The core is now linked with CoreServices not Carbon; as a side
 
7808
  result, default 8bit encoding on OSX is now ASCII.
 
7809
 
 
7810
- Python should now build on OSX 10.1.1
 
7811
 
 
7812
 
 
7813
What's New in Python 2.2b1?
 
7814
===========================
 
7815
 
 
7816
*Release date: 19-Oct-2001*
 
7817
 
 
7818
Type/class unification and new-style classes
 
7819
--------------------------------------------
 
7820
 
 
7821
- New-style classes are now always dynamic (except for built-in and
 
7822
  extension types).  There is no longer a performance penalty, and I
 
7823
  no longer see another reason to keep this baggage around.  One relic
 
7824
  remains: the __dict__ of a new-style class is a read-only proxy; you
 
7825
  must set the class's attribute to modify it.  As a consequence, the
 
7826
  __defined__ attribute of new-style types no longer exists, for lack
 
7827
  of need: there is once again only one __dict__ (although in the
 
7828
  future a __cache__ may be resurrected with a similar function, if I
 
7829
  can prove that it actually speeds things up).
 
7830
 
 
7831
- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
 
7832
  always returned None, even when there was a class docstring).
 
7833
 
 
7834
- doctest now finds and runs docstrings attached to new-style classes,
 
7835
  class methods, static methods, and properties.
 
7836
 
 
7837
Core and builtins
 
7838
-----------------
 
7839
 
 
7840
- A very subtle syntactical pitfall in list comprehensions was fixed.
 
7841
  For example: [a+b for a in 'abc', for b in 'def'].  The comma in
 
7842
  this example is a mistake.  Previously, this would silently let 'a'
 
7843
  iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
 
7844
  'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
 
7845
  'bf', 'cd', 'ce', 'cf'].  Now, this is flagged as a syntax error.
 
7846
  Note that [a for a in <singleton>] is a convoluted way to say
 
7847
  [<singleton>] anyway, so it's not like any expressiveness is lost.
 
7848
 
 
7849
- getattr(obj, name, default) now only catches AttributeError, as
 
7850
  documented, rather than returning the default value for all
 
7851
  exceptions (which could mask bugs in a __getattr__ hook, for
 
7852
  example).
 
7853
 
 
7854
- Weak reference objects are now part of the core and offer a C API.
 
7855
  A bug which could allow a core dump when binary operations involved
 
7856
  proxy reference has been fixed.  weakref.ReferenceError is now a
 
7857
  built-in exception.
 
7858
 
 
7859
- unicode(obj) now behaves more like str(obj), accepting arbitrary
 
7860
  objects, and calling a __unicode__ method if it exists.
 
7861
  unicode(obj, encoding) and unicode(obj, encoding, errors) still
 
7862
  require an 8-bit string or character buffer argument.
 
7863
 
 
7864
- isinstance() now allows any object as the first argument and a
 
7865
  class, a type or something with a __bases__ tuple attribute for the
 
7866
  second argument.  The second argument may also be a tuple of a
 
7867
  class, type, or something with __bases__, in which case isinstance()
 
7868
  will return true if the first argument is an instance of any of the
 
7869
  things contained in the second argument tuple.  E.g.
 
7870
 
 
7871
  isinstance(x, (A, B))
 
7872
 
 
7873
  returns true if x is an instance of A or B.
 
7874
 
 
7875
Extension modules
 
7876
-----------------
 
7877
 
 
7878
- thread.start_new_thread() now returns the thread ID (previously None).
 
7879
 
 
7880
- binascii has now two quopri support functions, a2b_qp and b2a_qp.
 
7881
 
 
7882
- readline now supports setting the startup_hook and the
 
7883
  pre_event_hook, and adds the add_history() function.
 
7884
 
 
7885
- os and posix supports chroot(), setgroups() and unsetenv() where
 
7886
  available.  The stat(), fstat(), statvfs() and fstatvfs() functions
 
7887
  now return "pseudo-sequences" -- the various fields can now be
 
7888
  accessed as attributes (e.g. os.stat("/").st_mtime) but for
 
7889
  backwards compatibility they also behave as a fixed-length sequence.
 
7890
  Some platform-specific fields (e.g. st_rdev) are only accessible as
 
7891
  attributes.
 
7892
 
 
7893
- time: localtime(), gmtime() and strptime() now return a
 
7894
  pseudo-sequence similar to the os.stat() return value, with
 
7895
  attributes like tm_year etc.
 
7896
 
 
7897
- Decompression objects in the zlib module now accept an optional
 
7898
  second parameter to decompress() that specifies the maximum amount
 
7899
  of memory to use for the uncompressed data.
 
7900
 
 
7901
- optional SSL support in the socket module now exports OpenSSL
 
7902
  functions RAND_add(), RAND_egd(), and RAND_status().  These calls
 
7903
  are useful on platforms like Solaris where OpenSSL does not
 
7904
  automatically seed its PRNG.  Also, the keyfile and certfile
 
7905
  arguments to socket.ssl() are now optional.
 
7906
 
 
7907
- posixmodule (and by extension, the os module on POSIX platforms) now
 
7908
  exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
 
7909
 
 
7910
Library
 
7911
-------
 
7912
 
 
7913
- doctest now excludes functions and classes not defined by the module
 
7914
  being tested, thanks to Tim Hochberg.
 
7915
 
 
7916
- HotShot, a new profiler implemented using a C-based callback, has
 
7917
  been added.  This substantially reduces the overhead of profiling,
 
7918
  but it is still quite preliminary.  Support modules and
 
7919
  documentation will be added in upcoming releases (before 2.2 final).
 
7920
 
 
7921
- profile now produces correct output in situations where an exception
 
7922
  raised in Python is cleared by C code (e.g. hasattr()).  This used
 
7923
  to cause wrong output, including spurious claims of recursive
 
7924
  functions and attribution of time spent to the wrong function.
 
7925
 
 
7926
  The code and documentation for the derived OldProfile and HotProfile
 
7927
  profiling classes was removed.  The code hasn't worked for years (if
 
7928
  you tried to use them, they raised exceptions).  OldProfile
 
7929
  intended to reproduce the behavior of the profiler Python used more
 
7930
  than 7 years ago, and isn't interesting anymore.  HotProfile intended
 
7931
  to provide a faster profiler (but producing less information), and
 
7932
  that's a worthy goal we intend to meet via a different approach (but
 
7933
  without losing information).
 
7934
 
 
7935
- Profile.calibrate() has a new implementation that should deliver
 
7936
  a much better system-specific calibration constant.  The constant can
 
7937
  now be specified in an instance constructor, or as a Profile class or
 
7938
  instance variable, instead of by editing profile.py's source code.
 
7939
  Calibration must still be done manually (see the docs for the profile
 
7940
  module).
 
7941
 
 
7942
  Note that Profile.calibrate() must be overridden by subclasses.
 
7943
  Improving the accuracy required exploiting detailed knowledge of
 
7944
  profiler internals; the earlier method abstracted away the details
 
7945
  and measured a simplified model instead, but consequently computed
 
7946
  a constant too small by a factor of 2 on some modern machines.
 
7947
 
 
7948
- quopri's encode and decode methods take an optional header parameter,
 
7949
  which indicates whether output is intended for the header 'Q'
 
7950
  encoding.
 
7951
 
 
7952
- The SocketServer.ThreadingMixIn class now closes the request after
 
7953
  finish_request() returns.  (Not when it errors out though.)
 
7954
 
 
7955
- The nntplib module's NNTP.body() method has grown a 'file' argument
 
7956
  to allow saving the message body to a file.
 
7957
 
 
7958
- The email package has added a class email.Parser.HeaderParser which
 
7959
  only parses headers and does not recurse into the message's body.
 
7960
  Also, the module/class MIMEAudio has been added for representing
 
7961
  audio data (contributed by Anthony Baxter).
 
7962
 
 
7963
- ftplib should be able to handle files > 2GB.
 
7964
 
 
7965
- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
 
7966
  ON, and OFF.
 
7967
 
 
7968
- xml.dom.minidom NodeList objects now support the length attribute
 
7969
  and item() method as required by the DOM specifications.
 
7970
 
 
7971
Tools/Demos
 
7972
-----------
 
7973
 
 
7974
- Demo/dns was removed.  It no longer serves any purpose; a package
 
7975
  derived from it is now maintained by Anthony Baxter, see
 
7976
  http://PyDNS.SourceForge.net.
 
7977
 
 
7978
- The freeze tool has been made more robust, and two new options have
 
7979
  been added: -X and -E.
 
7980
 
 
7981
Build
 
7982
-----
 
7983
 
 
7984
- configure will use CXX in LINKCC if CXX is used to build main() and
 
7985
  the system requires to link a C++ main using the C++ compiler.
 
7986
 
 
7987
C API
 
7988
-----
 
7989
 
 
7990
- The documentation for the tp_compare slot is updated to require that
 
7991
  the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
 
7992
  not correct.  This is not yet enforced but will be enforced in
 
7993
  Python 2.3; even later, we may use -2 to indicate errors and +2 for
 
7994
  "NotImplemented".  Right now, -1 should be used for an error return.
 
7995
 
 
7996
- PyLong_AsLongLong() now accepts int (as well as long) arguments.
 
7997
  Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
 
7998
  as long) arguments.
 
7999
 
 
8000
- PyThread_start_new_thread() now returns a long int giving the thread
 
8001
  ID, if one can be calculated; it returns -1 for error, 0 if no
 
8002
  thread ID is calculated (this is an incompatible change, but only
 
8003
  the thread module used this API).  This code has only really been
 
8004
  tested on Linux and Windows; other platforms please beware (and
 
8005
  report any bugs or strange behavior).
 
8006
 
 
8007
- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
 
8008
  input.
 
8009
 
 
8010
New platforms
 
8011
-------------
 
8012
 
 
8013
Tests
 
8014
-----
 
8015
 
 
8016
Windows
 
8017
-------
 
8018
 
 
8019
- Installer:  If you install IDLE, and don't disable file-extension
 
8020
  registration, a new "Edit with IDLE" context (right-click) menu entry
 
8021
  is created for .py and .pyw files.
 
8022
 
 
8023
- The signal module now supports SIGBREAK on Windows, thanks to Steven
 
8024
  Scott.  Note that SIGBREAK is unique to Windows.  The default SIGBREAK
 
8025
  action remains to call Win32 ExitProcess().  This can be changed via
 
8026
  signal.signal().  For example::
 
8027
 
 
8028
      # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
 
8029
      # (SIGINT) behavior.
 
8030
      import signal
 
8031
      signal.signal(signal.SIGBREAK, signal.default_int_handler)
 
8032
 
 
8033
      try:
 
8034
          while 1:
 
8035
              pass
 
8036
      except KeyboardInterrupt:
 
8037
          # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
 
8038
          # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
 
8039
          # program without the possibility for any Python-level cleanup).
 
8040
          print "Clean exit"
 
8041
 
 
8042
 
 
8043
What's New in Python 2.2a4?
 
8044
===========================
 
8045
 
 
8046
*Release date: 28-Sep-2001*
 
8047
 
 
8048
Type/class unification and new-style classes
 
8049
--------------------------------------------
 
8050
 
 
8051
- pydoc and inspect are now aware of new-style classes;
 
8052
  e.g. help(list) at the interactive prompt now shows proper
 
8053
  documentation for all operations on list objects.
 
8054
 
 
8055
- Applications using Jim Fulton's ExtensionClass module can now safely
 
8056
  be used with Python 2.2.  In particular, Zope 2.4.1 now works with
 
8057
  Python 2.2 (as well as with Python 2.1.1).  The Demo/metaclass
 
8058
  examples also work again.  It is hoped that Gtk and Boost also work
 
8059
  with 2.2a4 and beyond.  (If you can confirm this, please write
 
8060
  webmaster@python.org; if there are still problems, please open a bug
 
8061
  report on SourceForge.)
 
8062
 
 
8063
- property() now takes 4 keyword arguments:  fget, fset, fdel and doc.
 
8064
  These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
 
8065
  in the constructed property object.  fget, fset and fdel weren't
 
8066
  discoverable from Python in 2.2a3.  __doc__ is new, and allows to
 
8067
  associate a docstring with a property.
 
8068
 
 
8069
- Comparison overloading is now more completely implemented.  For
 
8070
  example, a str subclass instance can properly be compared to a str
 
8071
  instance, and it can properly overload comparison.  Ditto for most
 
8072
  other built-in object types.
 
8073
 
 
8074
- The repr() of new-style classes has changed; instead of <type
 
8075
  'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
 
8076
  *except* for built-in types, which are still rendered as <type
 
8077
  'Foo'> (to avoid upsetting existing code that might parse or
 
8078
  otherwise rely on repr() of certain type objects).
 
8079
 
 
8080
- The repr() of new-style objects is now always <Foo object at XXX>;
 
8081
  previously, it was sometimes <Foo instance at XXX>.
 
8082
 
 
8083
- For new-style classes, what was previously called __getattr__ is now
 
8084
  called __getattribute__.  This method, if defined, is called for
 
8085
  *every* attribute access.  A new __getattr__ hook more similar to the
 
8086
  one in classic classes is defined which is called only if regular
 
8087
  attribute access raises AttributeError; to catch *all* attribute
 
8088
  access, you can use __getattribute__ (for new-style classes).  If
 
8089
  both are defined, __getattribute__ is called first, and if it raises
 
8090
  AttributeError, __getattr__ is called.
 
8091
 
 
8092
- The __class__ attribute of new-style objects can be assigned to.
 
8093
  The new class must have the same C-level object layout as the old
 
8094
  class.
 
8095
 
 
8096
- The builtin file type can be subclassed now.  In the usual pattern,
 
8097
  "file" is the name of the builtin type, and file() is a new builtin
 
8098
  constructor, with the same signature as the builtin open() function.
 
8099
  file() is now the preferred way to open a file.
 
8100
 
 
8101
- Previously, __new__ would only see sequential arguments passed to
 
8102
  the type in a constructor call; __init__ would see both sequential
 
8103
  and keyword arguments.  This made no sense whatsoever any more, so
 
8104
  now both __new__ and __init__ see all arguments.
 
8105
 
 
8106
- Previously, hash() applied to an instance of a subclass of str or
 
8107
  unicode always returned 0.  This has been repaired.
 
8108
 
 
8109
- Previously, an operation on an instance of a subclass of an
 
8110
  immutable type (int, long, float, complex, tuple, str, unicode),
 
8111
  where the subtype didn't override the operation (and so the
 
8112
  operation was handled by the builtin type), could return that
 
8113
  instance instead a value of the base type.  For example, if s was of
 
8114
  a str subclass type, s[:] returned s as-is.  Now it returns a str
 
8115
  with the same value as s.
 
8116
 
 
8117
- Provisional support for pickling new-style objects has been added.
 
8118
 
 
8119
Core
 
8120
----
 
8121
 
 
8122
- file.writelines() now accepts any iterable object producing strings.
 
8123
 
 
8124
- PyUnicode_FromEncodedObject() now works very much like
 
8125
  PyObject_Str(obj) in that it tries to use __str__/tp_str
 
8126
  on the object if the object is not a string or buffer. This
 
8127
  makes unicode() behave like str() when applied to non-string/buffer
 
8128
  objects.
 
8129
 
 
8130
- PyFile_WriteObject now passes Unicode objects to the file's write
 
8131
  method. As a result, all file-like objects which may be the target
 
8132
  of a print statement must support Unicode objects, i.e. they must
 
8133
  at least convert them into ASCII strings.
 
8134
 
 
8135
- Thread scheduling on Solaris should be improved; it is no longer
 
8136
  necessary to insert a small sleep at the start of a thread in order
 
8137
  to let other runnable threads be scheduled.
 
8138
 
 
8139
Library
 
8140
-------
 
8141
 
 
8142
- StringIO.StringIO instances and cStringIO.StringIO instances support
 
8143
  read character buffer compatible objects for their .write() methods.
 
8144
  These objects are converted to strings and then handled as such
 
8145
  by the instances.
 
8146
 
 
8147
- The "email" package has been added.  This is basically a port of the
 
8148
  mimelib package <http://sf.net/projects/mimelib> with API changes
 
8149
  and some implementations updated to use iterators and generators.
 
8150
 
 
8151
- difflib.ndiff() and difflib.Differ.compare() are generators now.  This
 
8152
  restores the ability of Tools/scripts/ndiff.py to start producing output
 
8153
  before the entire comparison is complete.
 
8154
 
 
8155
- StringIO.StringIO instances and cStringIO.StringIO instances support
 
8156
  iteration just like file objects (i.e. their .readline() method is
 
8157
  called for each iteration until it returns an empty string).
 
8158
 
 
8159
- The codecs module has grown four new helper APIs to access
 
8160
  builtin codecs: getencoder(), getdecoder(), getreader(),
 
8161
  getwriter().
 
8162
 
 
8163
- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
 
8164
  simplifies writing XML RPC servers.
 
8165
 
 
8166
- os.path.realpath(): a new function that returns the absolute pathname
 
8167
  after interpretation of symbolic links.  On non-Unix systems, this
 
8168
  is an alias for os.path.abspath().
 
8169
 
 
8170
- operator.indexOf() (PySequence_Index() in the C API) now works with any
 
8171
  iterable object.
 
8172
 
 
8173
- smtplib now supports various authentication and security features of
 
8174
  the SMTP protocol through the new login() and starttls() methods.
 
8175
 
 
8176
- hmac: a new module implementing keyed hashing for message
 
8177
  authentication.
 
8178
 
 
8179
- mimetypes now recognizes more extensions and file types.  At the
 
8180
  same time, some mappings not sanctioned by IANA were removed.
 
8181
 
 
8182
- The "compiler" package has been brought up to date to the state of
 
8183
  Python 2.2 bytecode generation.  It has also been promoted from a
 
8184
  Tool to a standard library package.  (Tools/compiler still exists as
 
8185
  a sample driver.)
 
8186
 
 
8187
Build
 
8188
-----
 
8189
 
 
8190
- Large file support (LFS) is now automatic when the platform supports
 
8191
  it; no more manual configuration tweaks are needed.  On Linux, at
 
8192
  least, it's possible to have a system whose C library supports large
 
8193
  files but whose kernel doesn't; in this case, large file support is
 
8194
  still enabled but doesn't do you any good unless you upgrade your
 
8195
  kernel or share your Python executable with another system whose
 
8196
  kernel has large file support.
 
8197
 
 
8198
- The configure script now supplies plausible defaults in a
 
8199
  cross-compilation environment.  This doesn't mean that the supplied
 
8200
  values are always correct, or that cross-compilation now works
 
8201
  flawlessly -- but it's a first step (and it shuts up most of
 
8202
  autoconf's warnings about AC_TRY_RUN).
 
8203
 
 
8204
- The Unix build is now a bit less chatty, courtesy of the parser
 
8205
  generator.  The build is completely silent (except for errors) when
 
8206
  using "make -s", thanks to a -q option to setup.py.
 
8207
 
 
8208
C API
 
8209
-----
 
8210
 
 
8211
- The "structmember" API now supports some new flag bits to deny read
 
8212
  and/or write access to attributes in restricted execution mode.
 
8213
 
 
8214
New platforms
 
8215
-------------
 
8216
 
 
8217
- Compaq's iPAQ handheld, running the "familiar" Linux distribution
 
8218
  (http://familiar.handhelds.org).
 
8219
 
 
8220
Tests
 
8221
-----
 
8222
 
 
8223
- The "classic" standard tests, which work by comparing stdout to
 
8224
  an expected-output file under Lib/test/output/, no longer stop at
 
8225
  the first mismatch.  Instead the test is run to completion, and a
 
8226
  variant of ndiff-style comparison is used to report all differences.
 
8227
  This is much easier to understand than the previous style of reporting.
 
8228
 
 
8229
- The unittest-based standard tests now use regrtest's test_main()
 
8230
  convention, instead of running as a side-effect of merely being
 
8231
  imported.  This allows these tests to be run in more natural and
 
8232
  flexible ways as unittests, outside the regrtest framework.
 
8233
 
 
8234
- regrtest.py is much better integrated with unittest and doctest now,
 
8235
  especially in regard to reporting errors.
 
8236
 
 
8237
Windows
 
8238
-------
 
8239
 
 
8240
- Large file support now also works for files > 4GB, on filesystems
 
8241
  that support it (NTFS under Windows 2000).  See "What's New in
 
8242
  Python 2.2a3" for more detail.
 
8243
 
 
8244
 
 
8245
What's New in Python 2.2a3?
 
8246
===========================
 
8247
 
 
8248
*Release Date: 07-Sep-2001*
 
8249
 
 
8250
Core
 
8251
----
 
8252
 
 
8253
- Conversion of long to float now raises OverflowError if the long is too
 
8254
  big to represent as a C double.
 
8255
 
 
8256
- The 3-argument builtin pow() no longer allows a third non-None argument
 
8257
  if either of the first two arguments is a float, or if both are of
 
8258
  integer types and the second argument is negative (in which latter case
 
8259
  the arguments are converted to float, so this is really the same
 
8260
  restriction).
 
8261
 
 
8262
- The builtin dir() now returns more information, and sometimes much
 
8263
  more, generally naming all attributes of an object, and all attributes
 
8264
  reachable from the object via its class, and from its class's base
 
8265
  classes, and so on from them too.  Example:  in 2.2a2, dir([]) returned
 
8266
  an empty list.  In 2.2a3,
 
8267
 
 
8268
  >>> dir([])
 
8269
  ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
 
8270
   '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
 
8271
   '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
 
8272
   '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
 
8273
   '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
 
8274
   'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
 
8275
   'reverse', 'sort']
 
8276
 
 
8277
  dir(module) continues to return only the module's attributes, though.
 
8278
 
 
8279
- Overflowing operations on plain ints now return a long int rather
 
8280
  than raising OverflowError.  This is a partial implementation of PEP
 
8281
  237.  You can use -Wdefault::OverflowWarning to enable a warning for
 
8282
  this situation, and -Werror::OverflowWarning to revert to the old
 
8283
  OverflowError exception.
 
8284
 
 
8285
- A new command line option, -Q<arg>, is added to control run-time
 
8286
  warnings for the use of classic division.  (See PEP 238.)  Possible
 
8287
  values are -Qold, -Qwarn, -Qwarnall, and -Qnew.  The default is
 
8288
  -Qold, meaning the / operator has its classic meaning and no
 
8289
  warnings are issued.  Using -Qwarn issues a run-time warning about
 
8290
  all uses of classic division for int and long arguments; -Qwarnall
 
8291
  also warns about classic division for float and complex arguments
 
8292
  (for use with fixdiv.py).
 
8293
  [Note:  the remainder of this item (preserved below) became
 
8294
  obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
 
8295
 
 
8296
    Using -Qnew is questionable; it turns on new division by default, but
 
8297
    only in the __main__ module.  You can usefully combine -Qwarn or
 
8298
    -Qwarnall and -Qnew: this gives the __main__ module new division, and
 
8299
    warns about classic division everywhere else.
 
8300
 
 
8301
- Many built-in types can now be subclassed.  This applies to int,
 
8302
  long, float, str, unicode, and tuple.  (The types complex, list and
 
8303
  dictionary can also be subclassed; this was introduced earlier.)
 
8304
  Note that restrictions apply when subclassing immutable built-in
 
8305
  types: you can only affect the value of the instance by overloading
 
8306
  __new__.  You can add mutable attributes, and the subclass instances
 
8307
  will have a __dict__ attribute, but you cannot change the "value"
 
8308
  (as implemented by the base class) of an immutable subclass instance
 
8309
  once it is created.
 
8310
 
 
8311
- The dictionary constructor now takes an optional argument, a
 
8312
  mapping-like object, and initializes the dictionary from its
 
8313
  (key, value) pairs.
 
8314
 
 
8315
- A new built-in type, super, has been added.  This facilitates making
 
8316
  "cooperative super calls" in a multiple inheritance setting.  For an
 
8317
  explanation, see http://www.python.org/2.2/descrintro.html#cooperation
 
8318
 
 
8319
- A new built-in type, property, has been added.  This enables the
 
8320
  creation of "properties".  These are attributes implemented by
 
8321
  getter and setter functions (or only one of these for read-only or
 
8322
  write-only attributes), without the need to override __getattr__.
 
8323
  See http://www.python.org/2.2/descrintro.html#property
 
8324
 
 
8325
- The syntax of floating-point and imaginary literals has been
 
8326
  liberalized, to allow leading zeroes.  Examples of literals now
 
8327
  legal that were SyntaxErrors before:
 
8328
 
 
8329
      00.0    0e3   0100j   07.5   00000000000000000008.
 
8330
 
 
8331
- An old tokenizer bug allowed floating point literals with an incomplete
 
8332
  exponent, such as 1e and 3.1e-.  Such literals now raise SyntaxError.
 
8333
 
 
8334
Library
 
8335
-------
 
8336
 
 
8337
- telnetlib includes symbolic names for the options, and support for
 
8338
  setting an option negotiation callback. It also supports processing
 
8339
  of suboptions.
 
8340
 
 
8341
- The new C standard no longer requires that math libraries set errno to
 
8342
  ERANGE on overflow.  For platform libraries that exploit this new
 
8343
  freedom, Python's overflow-checking was wholly broken.  A new overflow-
 
8344
  checking scheme attempts to repair that, but may not be reliable on all
 
8345
  platforms (C doesn't seem to provide anything both useful and portable
 
8346
  in this area anymore).
 
8347
 
 
8348
- Asynchronous timeout actions are available through the new class
 
8349
  threading.Timer.
 
8350
 
 
8351
- math.log and math.log10 now return sensible results for even huge
 
8352
  long arguments.  For example, math.log10(10 ** 10000) ~= 10000.0.
 
8353
 
 
8354
- A new function, imp.lock_held(), returns 1 when the import lock is
 
8355
  currently held.  See the docs for the imp module.
 
8356
 
 
8357
- pickle, cPickle and marshal on 32-bit platforms can now correctly read
 
8358
  dumps containing ints written on platforms where Python ints are 8 bytes.
 
8359
  When read on a box where Python ints are 4 bytes, such values are
 
8360
  converted to Python longs.
 
8361
 
 
8362
- In restricted execution mode (using the rexec module), unmarshalling
 
8363
  code objects is no longer allowed.  This plugs a security hole.
 
8364
 
 
8365
- unittest.TestResult instances no longer store references to tracebacks
 
8366
  generated by test failures. This prevents unexpected dangling references
 
8367
  to objects that should be garbage collected between tests.
 
8368
 
 
8369
Tools
 
8370
-----
 
8371
 
 
8372
- Tools/scripts/fixdiv.py has been added which can be used to fix
 
8373
  division operators as per PEP 238.
 
8374
 
 
8375
Build
 
8376
-----
 
8377
 
 
8378
- If you are an adventurous person using Mac OS X you may want to look at
 
8379
  Mac/OSX. There is a Makefile there that will build Python as a real Mac
 
8380
  application, which can be used for experimenting with Carbon or Cocoa.
 
8381
  Discussion of this on pythonmac-sig, please.
 
8382
 
 
8383
C API
 
8384
-----
 
8385
 
 
8386
- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
 
8387
 
 
8388
- Note that PyLong_AsDouble can fail!  This has always been true, but no
 
8389
  callers checked for it.  It's more likely to fail now, because overflow
 
8390
  errors are properly detected now.  The proper way to check::
 
8391
 
 
8392
      double x = PyLong_AsDouble(some_long_object);
 
8393
      if (x == -1.0 && PyErr_Occurred()) {
 
8394
              /* The conversion failed. */
 
8395
      }
 
8396
 
 
8397
- The GC API has been changed.  Extensions that use the old API will still
 
8398
  compile but will not participate in GC.  To upgrade an extension
 
8399
  module:
 
8400
 
 
8401
    - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
 
8402
 
 
8403
    - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
 
8404
      PyObject_GC_Del to deallocate them
 
8405
 
 
8406
    - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
 
8407
      to PyObject_GC_UnTrack
 
8408
 
 
8409
    - remove PyGC_HEAD_SIZE from object size calculations
 
8410
 
 
8411
    - remove calls to PyObject_AS_GC and PyObject_FROM_GC
 
8412
 
 
8413
- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
 
8414
  These can be used safely to construct string objects from a
 
8415
  sprintf-style format string (similar to the format string supported
 
8416
  by PyErr_Format()).
 
8417
 
 
8418
New platforms
 
8419
-------------
 
8420
 
 
8421
- Stephen Hansen contributed patches sufficient to get a clean compile
 
8422
  under Borland C (Windows), but he reports problems running it and ran
 
8423
  out of time to complete the port.  Volunteers?  Expect a MemoryError
 
8424
  when importing the types module; this is probably shallow, and
 
8425
  causing later failures too.
 
8426
 
 
8427
Tests
 
8428
-----
 
8429
 
 
8430
Windows
 
8431
-------
 
8432
 
 
8433
- Large file support is now enabled on Win32 platforms as well as on
 
8434
  Win64.  This means that, for example, you can use f.tell() and f.seek()
 
8435
  to manipulate files larger than 2 gigabytes (provided you have enough
 
8436
  disk space, and are using a Windows filesystem that supports large
 
8437
  partitions).  Windows filesystem limits:  FAT has a 2GB (gigabyte)
 
8438
  filesize limit, and large file support makes no difference there.
 
8439
  FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
 
8440
  NTFS has no practical limit on file size, and files of any size can be
 
8441
  used from Python now.
 
8442
 
 
8443
- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
 
8444
  points to command.com (patch from Brian Quinlan).
 
8445
 
 
8446
 
 
8447
What's New in Python 2.2a2?
 
8448
===========================
 
8449
 
 
8450
*Release Date: 22-Aug-2001*
 
8451
 
 
8452
Build
 
8453
-----
 
8454
 
 
8455
- Tim Peters developed a brand new Windows installer using Wise 8.1,
 
8456
  generously donated to us by Wise Solutions.
 
8457
 
 
8458
- configure supports a new option --enable-unicode, with the values
 
8459
  ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
 
8460
  type and supporting code is completely removed from the interpreter.
 
8461
 
 
8462
- A new configure option --enable-framework builds a Mac OS X framework,
 
8463
  which "make frameworkinstall" will install. This provides a starting
 
8464
  point for more mac-like functionality, join pythonmac-sig@python.org
 
8465
  if you are interested in helping.
 
8466
 
 
8467
- The NeXT platform is no longer supported.
 
8468
 
 
8469
- The 'new' module is now statically linked.
 
8470
 
 
8471
Tools
 
8472
-----
 
8473
 
 
8474
- The new Tools/scripts/cleanfuture.py can be used to automatically
 
8475
  edit out obsolete future statements from Python source code.  See
 
8476
  the module docstring for details.
 
8477
 
 
8478
Tests
 
8479
-----
 
8480
 
 
8481
- regrtest.py now knows which tests are expected to be skipped on some
 
8482
  platforms, allowing to give clearer test result output.  regrtest
 
8483
  also has optional --use/-u switch to run normally disabled tests
 
8484
  which require network access or consume significant disk resources.
 
8485
 
 
8486
- Several new tests in the standard test suite, with special thanks to
 
8487
  Nick Mathewson.
 
8488
 
 
8489
Core
 
8490
----
 
8491
 
 
8492
- The floor division operator // has been added as outlined in PEP
 
8493
  238.  The / operator still provides classic division (and will until
 
8494
  Python 3.0) unless "from __future__ import division" is included, in
 
8495
  which case the / operator will provide true division.  The operator
 
8496
  module provides truediv() and floordiv() functions.  Augmented
 
8497
  assignment variants are included, as are the equivalent overloadable
 
8498
  methods and C API methods.  See the PEP for a full discussion:
 
8499
  <http://python.sf.net/peps/pep-0238.html>
 
8500
 
 
8501
- Future statements are now effective in simulated interactive shells
 
8502
  (like IDLE).  This should "just work" by magic, but read Michael
 
8503
  Hudson's "Future statements in simulated shells" PEP 264 for full
 
8504
  details:  <http://python.sf.net/peps/pep-0264.html>.
 
8505
 
 
8506
- The type/class unification (PEP 252-253) was integrated into the
 
8507
  trunk and is not so tentative any more (the exact specification of
 
8508
  some features is still tentative).  A lot of work has done on fixing
 
8509
  bugs and adding robustness and features (performance still has to
 
8510
  come a long way).
 
8511
 
 
8512
- Warnings about a mismatch in the Python API during extension import
 
8513
  now use the Python warning framework (which makes it possible to
 
8514
  write filters for these warnings).
 
8515
 
 
8516
- A function's __dict__ (aka func_dict) will now always be a
 
8517
  dictionary.  It used to be possible to delete it or set it to None,
 
8518
  but now both actions raise TypeErrors.  It is still legal to set it
 
8519
  to a dictionary object.  Getting func.__dict__ before any attributes
 
8520
  have been assigned now returns an empty dictionary instead of None.
 
8521
 
 
8522
- A new command line option, -E, was added which disables the use of
 
8523
  all environment variables, or at least those that are specifically
 
8524
  significant to Python.  Usually those have a name starting with
 
8525
  "PYTHON".  This was used to fix a problem where the tests fail if
 
8526
  the user happens to have PYTHONHOME or PYTHONPATH pointing to an
 
8527
  older distribution.
 
8528
 
 
8529
Library
 
8530
-------
 
8531
 
 
8532
- New class Differ and new functions ndiff() and restore() in difflib.py.
 
8533
  These package the algorithms used by the popular Tools/scripts/ndiff.py,
 
8534
  for programmatic reuse.
 
8535
 
 
8536
- New function xml.sax.saxutils.quoteattr():  Quote an XML attribute
 
8537
  value using the minimal quoting required for the value; more
 
8538
  reliable than using xml.sax.saxutils.escape() for attribute values.
 
8539
 
 
8540
- Readline completion support for cmd.Cmd was added.
 
8541
 
 
8542
- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
 
8543
 
 
8544
- Added function threading.BoundedSemaphore()
 
8545
 
 
8546
- Added Ka-Ping Yee's cgitb.py module.
 
8547
 
 
8548
- The 'new' module now exposes the CO_xxx flags.
 
8549
 
 
8550
- The gc module offers the get_referents function.
 
8551
 
 
8552
New platforms
 
8553
-------------
 
8554
 
 
8555
C API
 
8556
-----
 
8557
 
 
8558
- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
 
8559
  which provide a cross-platform implementations for the
 
8560
  relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
 
8561
  the standard sprintf() and vsprintf() C lib APIs, these versions
 
8562
  apply bounds checking on the used buffer which enhances protection
 
8563
  against buffer overruns.
 
8564
 
 
8565
- Unicode APIs now use name mangling to assure that mixing interpreters
 
8566
  and extensions using different Unicode widths is rendered next to
 
8567
  impossible. Trying to import an incompatible Unicode-aware extension
 
8568
  will result in an ImportError.  Unicode extensions writers must make
 
8569
  sure to check the Unicode width compatibility in their extensions by
 
8570
  using at least one of the mangled Unicode APIs in the extension.
 
8571
 
 
8572
- Two new flags METH_NOARGS and METH_O are available in method definition
 
8573
  tables to simplify implementation of methods with no arguments and a
 
8574
  single untyped argument. Calling such methods is more efficient than
 
8575
  calling corresponding METH_VARARGS methods. METH_OLDARGS is now
 
8576
  deprecated.
 
8577
 
 
8578
Windows
 
8579
-------
 
8580
 
 
8581
- "import module" now compiles module.pyw if it exists and nothing else
 
8582
  relevant is found.
 
8583
 
 
8584
 
 
8585
What's New in Python 2.2a1?
 
8586
===========================
 
8587
 
 
8588
*Release date: 18-Jul-2001*
 
8589
 
 
8590
Core
 
8591
----
 
8592
 
 
8593
- TENTATIVELY, a large amount of code implementing much of what's
 
8594
  described in PEP 252 (Making Types Look More Like Classes) and PEP
 
8595
  253 (Subtyping Built-in Types) was added.  This will be released
 
8596
  with Python 2.2a1.  Documentation will be provided separately
 
8597
  through http://www.python.org/2.2/.  The purpose of releasing this
 
8598
  with Python 2.2a1 is to test backwards compatibility.  It is
 
8599
  possible, though not likely, that a decision is made not to release
 
8600
  this code as part of 2.2 final, if any serious backwards
 
8601
  incompatibilities are found during alpha testing that cannot be
 
8602
  repaired.
 
8603
 
 
8604
- Generators were added; this is a new way to create an iterator (see
 
8605
  below) using what looks like a simple function containing one or
 
8606
  more 'yield' statements.  See PEP 255.  Since this adds a new
 
8607
  keyword to the language, this feature must be enabled by including a
 
8608
  future statement: "from __future__ import generators" (see PEP 236).
 
8609
  Generators will become a standard feature in a future release
 
8610
  (probably 2.3).  Without this future statement, 'yield' remains an
 
8611
  ordinary identifier, but a warning is issued each time it is used.
 
8612
  (These warnings currently don't conform to the warnings framework of
 
8613
  PEP 230; we intend to fix this in 2.2a2.)
 
8614
 
 
8615
- The UTF-16 codec was modified to be more RFC compliant. It will now
 
8616
  only remove BOM characters at the start of the string and then
 
8617
  only if running in native mode (UTF-16-LE and -BE won't remove a
 
8618
  leading BMO character).
 
8619
 
 
8620
- Strings now have a new method .decode() to complement the already
 
8621
  existing .encode() method. These two methods provide direct access
 
8622
  to the corresponding decoders and encoders of the registered codecs.
 
8623
 
 
8624
  To enhance the usability of the .encode() method, the special
 
8625
  casing of Unicode object return values was dropped (Unicode objects
 
8626
  were auto-magically converted to string using the default encoding).
 
8627
 
 
8628
  Both methods will now return whatever the codec in charge of the
 
8629
  requested encoding returns as object, e.g. Unicode codecs will
 
8630
  return Unicode objects when decoding is requested ("Ć¤Ć¶Ć¼".decode("latin-1")
 
8631
  will return u"Ć¤Ć¶Ć¼"). This enables codec writer to create codecs
 
8632
  for various simple to use conversions.
 
8633
 
 
8634
  New codecs were added to demonstrate these new features (the .encode()
 
8635
  and .decode() columns indicate the type of the returned objects):
 
8636
 
 
8637
  +---------+-----------+-----------+-----------------------------+
 
8638
  |Name     | .encode() | .decode() | Description                 |
 
8639
  +=========+===========+===========+=============================+
 
8640
  |uu       | string    | string    | UU codec (e.g. for email)   |
 
8641
  +---------+-----------+-----------+-----------------------------+
 
8642
  |base64   | string    | string    | base64 codec                |
 
8643
  +---------+-----------+-----------+-----------------------------+
 
8644
  |quopri   | string    | string    | quoted-printable codec      |
 
8645
  +---------+-----------+-----------+-----------------------------+
 
8646
  |zlib     | string    | string    | zlib compression            |
 
8647
  +---------+-----------+-----------+-----------------------------+
 
8648
  |hex      | string    | string    | 2-byte hex codec            |
 
8649
  +---------+-----------+-----------+-----------------------------+
 
8650
  |rot-13   | string    | Unicode   | ROT-13 Unicode charmap codec|
 
8651
  +---------+-----------+-----------+-----------------------------+
 
8652
 
 
8653
- Some operating systems now support the concept of a default Unicode
 
8654
  encoding for file system operations.  Notably, Windows supports 'mbcs'
 
8655
  as the default.  The Macintosh will also adopt this concept in the medium
 
8656
  term, although the default encoding for that platform will be other than
 
8657
  'mbcs'.
 
8658
 
 
8659
  On operating system that support non-ASCII filenames, it is common for
 
8660
  functions that return filenames (such as os.listdir()) to return Python
 
8661
  string objects pre-encoded using the default file system encoding for
 
8662
  the platform.  As this encoding is likely to be different from Python's
 
8663
  default encoding, converting this name to a Unicode object before passing
 
8664
  it back to the Operating System would result in a Unicode error, as Python
 
8665
  would attempt to use its default encoding (generally ASCII) rather than
 
8666
  the default encoding for the file system.
 
8667
 
 
8668
  In general, this change simply removes surprises when working with
 
8669
  Unicode and the file system, making these operations work as you expect,
 
8670
  increasing the transparency of Unicode objects in this context.
 
8671
  See [????] for more details, including examples.
 
8672
 
 
8673
- Float (and complex) literals in source code were evaluated to full
 
8674
  precision only when running from a .py file; the same code loaded from a
 
8675
  .pyc (or .pyo) file could suffer numeric differences starting at about the
 
8676
  12th significant decimal digit.  For example, on a machine with IEEE-754
 
8677
  floating arithmetic,
 
8678
 
 
8679
      x = 9007199254740992.0
 
8680
      print long(x)
 
8681
 
 
8682
  printed 9007199254740992 if run directly from .py, but 9007199254740000
 
8683
  if from a compiled (.pyc or .pyo) file.  This was due to marshal using
 
8684
  str(float) instead of repr(float) when building code objects.  marshal
 
8685
  now uses repr(float) instead, which should reproduce floats to full
 
8686
  machine precision (assuming the platform C float<->string I/O conversion
 
8687
  functions are of good quality).
 
8688
 
 
8689
  This may cause floating-point results to change in some cases, and
 
8690
  usually for the better, but may also cause numerically unstable
 
8691
  algorithms to break.
 
8692
 
 
8693
- The implementation of dicts suffers fewer collisions, which has speed
 
8694
  benefits.  However, the order in which dict entries appear in dict.keys(),
 
8695
  dict.values() and dict.items() may differ from previous releases for a
 
8696
  given dict.  Nothing is defined about this order, so no program should
 
8697
  rely on it.  Nevertheless, it's easy to write test cases that rely on the
 
8698
  order by accident, typically because of printing the str() or repr() of a
 
8699
  dict to an "expected results" file.  See Lib/test/test_support.py's new
 
8700
  sortdict(dict) function for a simple way to display a dict in sorted
 
8701
  order.
 
8702
 
 
8703
- Many other small changes to dicts were made, resulting in faster
 
8704
  operation along the most common code paths.
 
8705
 
 
8706
- Dictionary objects now support the "in" operator: "x in dict" means
 
8707
  the same as dict.has_key(x).
 
8708
 
 
8709
- The update() method of dictionaries now accepts generic mapping
 
8710
  objects.  Specifically the argument object must support the .keys()
 
8711
  and __getitem__() methods.  This allows you to say, for example,
 
8712
  {}.update(UserDict())
 
8713
 
 
8714
- Iterators were added; this is a generalized way of providing values
 
8715
  to a for loop.  See PEP 234.  There's a new built-in function iter()
 
8716
  to return an iterator.  There's a new protocol to get the next value
 
8717
  from an iterator using the next() method (in Python) or the
 
8718
  tp_iternext slot (in C).  There's a new protocol to get iterators
 
8719
  using the __iter__() method (in Python) or the tp_iter slot (in C).
 
8720
  Iterating (i.e. a for loop) over a dictionary generates its keys.
 
8721
  Iterating over a file generates its lines.
 
8722
 
 
8723
- The following functions were generalized to work nicely with iterator
 
8724
  arguments::
 
8725
 
 
8726
    map(), filter(), reduce(), zip()
 
8727
    list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
 
8728
    max(), min()
 
8729
    join() method of strings
 
8730
    extend() method of lists
 
8731
    'x in y' and 'x not in y' (PySequence_Contains() in C API)
 
8732
    operator.countOf() (PySequence_Count() in C API)
 
8733
    right-hand side of assignment statements with multiple targets, such as ::
 
8734
        x, y, z = some_iterable_object_returning_exactly_3_values
 
8735
 
 
8736
- Accessing module attributes is significantly faster (for example,
 
8737
  random.random or os.path or yourPythonModule.yourAttribute).
 
8738
 
 
8739
- Comparing dictionary objects via == and != is faster, and now works even
 
8740
  if the keys and values don't support comparisons other than ==.
 
8741
 
 
8742
- Comparing dictionaries in ways other than == and != is slower:  there were
 
8743
  insecurities in the dict comparison implementation that could cause Python
 
8744
  to crash if the element comparison routines for the dict keys and/or
 
8745
  values mutated the dicts.  Making the code bulletproof slowed it down.
 
8746
 
 
8747
- Collisions in dicts are resolved via a new approach, which can help
 
8748
  dramatically in bad cases.  For example, looking up every key in a dict
 
8749
  d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
 
8750
  faster now.  Thanks to Christian Tismer for pointing out the cause and
 
8751
  the nature of an effective cure (last December! better late than never).
 
8752
 
 
8753
- repr() is much faster for large containers (dict, list, tuple).
 
8754
 
 
8755
 
 
8756
Library
 
8757
-------
 
8758
 
 
8759
- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
 
8760
  were added to the string module.  These a locale-independent
 
8761
  constants, unlike letters, lowercase, and uppercase.  These are now
 
8762
  use in appropriate locations in the standard library.
 
8763
 
 
8764
- The flags used in dlopen calls can now be configured using
 
8765
  sys.setdlopenflags and queried using sys.getdlopenflags.
 
8766
 
 
8767
- Fredrik Lundh's xmlrpclib is now a standard library module.  This
 
8768
  provides full client-side XML-RPC support.  In addition,
 
8769
  Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
 
8770
  one asyncore-based).  Thanks to Eric Raymond for the documentation.
 
8771
 
 
8772
- The xrange() object is simplified: it no longer supports slicing,
 
8773
  repetition, comparisons, efficient 'in' checking, the tolist()
 
8774
  method, or the start, stop and step attributes.  See PEP 260.
 
8775
 
 
8776
- A new function fnmatch.filter to filter lists of file names was added.
 
8777
 
 
8778
- calendar.py uses month and day names based on the current locale.
 
8779
 
 
8780
- strop is now *really* obsolete (this was announced before with 1.6),
 
8781
  and issues DeprecationWarning when used (except for the four items
 
8782
  that are still imported into string.py).
 
8783
 
 
8784
- Cookie.py now sorts key+value pairs by key in output strings.
 
8785
 
 
8786
- pprint.isrecursive(object) didn't correctly identify recursive objects.
 
8787
  Now it does.
 
8788
 
 
8789
- pprint functions now much faster for large containers (tuple, list, dict).
 
8790
 
 
8791
- New 'q' and 'Q' format codes in the struct module, corresponding to C
 
8792
  types "long long" and "unsigned long long" (on Windows, __int64).  In
 
8793
  native mode, these can be used only when the platform C compiler supports
 
8794
  these types (when HAVE_LONG_LONG is #define'd by the Python config
 
8795
  process), and then they inherit the sizes and alignments of the C types.
 
8796
  In standard mode, 'q' and 'Q' are supported on all platforms, and are
 
8797
  8-byte integral types.
 
8798
 
 
8799
- The site module installs a new built-in function 'help' that invokes
 
8800
  pydoc.help.  It must be invoked as 'help()'; when invoked as 'help',
 
8801
  it displays a message reminding the user to use 'help()' or
 
8802
  'help(object)'.
 
8803
 
 
8804
Tests
 
8805
-----
 
8806
 
 
8807
- New test_mutants.py runs dict comparisons where the key and value
 
8808
  comparison operators mutate the dicts randomly during comparison.  This
 
8809
  rapidly causes Python to crash under earlier releases (not for the faint
 
8810
  of heart:  it can also cause Win9x to freeze or reboot!).
 
8811
 
 
8812
- New test_pprint.py verifies that pprint.isrecursive() and
 
8813
  pprint.isreadable() return sensible results.  Also verifies that simple
 
8814
  cases produce correct output.
 
8815
 
 
8816
C API
 
8817
-----
 
8818
 
 
8819
- Removed the unused last_is_sticky argument from the internal
 
8820
  _PyTuple_Resize().  If this affects you, you were cheating.
 
8821
 
 
8822
What's New in Python 2.1 (final)?
 
8823
=================================
 
8824
 
 
8825
We only changed a few things since the last release candidate, all in
 
8826
Python library code:
 
8827
 
 
8828
- A bug in the locale module was fixed that affected locales which
 
8829
  define no grouping for numeric formatting.
 
8830
 
 
8831
- A few bugs in the weakref module's implementations of weak
 
8832
  dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
 
8833
  and the test suite was updated to check for these bugs.
 
8834
 
 
8835
- An old bug in the os.path.walk() function (introduced in Python
 
8836
  2.0!) was fixed: a non-existent file would cause an exception
 
8837
  instead of being ignored.
 
8838
 
 
8839
- Fixed a few bugs in the new symtable module found by Neil Norwitz's
 
8840
  PyChecker.
 
8841
 
 
8842
 
 
8843
What's New in Python 2.1c2?
 
8844
===========================
 
8845
 
 
8846
A flurry of small changes, and one showstopper fixed in the nick of
 
8847
time made it necessary to release another release candidate.  The list
 
8848
here is the *complete* list of patches (except version updates):
 
8849
 
 
8850
Core
 
8851
 
 
8852
- Tim discovered a nasty bug in the dictionary code, caused by
 
8853
  PyDict_Next() calling dict_resize(), and the GC code's use of
 
8854
  PyDict_Next() violating an assumption in dict_items().  This was
 
8855
  fixed with considerable amounts of band-aid, but the net effect is a
 
8856
  saner and more robust implementation.
 
8857
 
 
8858
- Made a bunch of symbols static that were accidentally global.
 
8859
 
 
8860
Build and Ports
 
8861
 
 
8862
- The setup.py script didn't check for a new enough version of zlib
 
8863
  (1.1.3 is needed).  Now it does.
 
8864
 
 
8865
- Changed "make clean" target to also remove shared libraries.
 
8866
 
 
8867
- Added a more general warning about the SGI Irix optimizer to README.
 
8868
 
 
8869
Library
 
8870
 
 
8871
- Fix a bug in urllib.basejoin("http://host", "../file.html") which
 
8872
  omitted the slash between host and file.html.
 
8873
 
 
8874
- The mailbox module's _Mailbox class contained a completely broken
 
8875
  and undocumented seek() method.  Ripped it out.
 
8876
 
 
8877
- Fixed a bunch of typos in various library modules (urllib2, smtpd,
 
8878
  sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
 
8879
 
 
8880
- Fixed a few last-minute bugs in unittest.
 
8881
 
 
8882
Extensions
 
8883
 
 
8884
- Reverted the patch to the OpenSSL code in socketmodule.c to support
 
8885
  RAND_status() and the EGD, and the subsequent patch that tried to
 
8886
  fix it for pre-0.9.5 versions; the problem with the patch is that on
 
8887
  some systems it issues a warning whenever socket is imported, and
 
8888
  that's unacceptable.
 
8889
 
 
8890
Tests
 
8891
 
 
8892
- Fixed the pickle tests to work with "import test.test_pickle".
 
8893
 
 
8894
- Tweaked test_locale.py to actually run the test Windows.
 
8895
 
 
8896
- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
 
8897
  not "wb" (which is not a valid mode at all).
 
8898
 
 
8899
- Fix pstats browser crashes.  Import readline if it exists to make
 
8900
  the user interface nicer.
 
8901
 
 
8902
- Add "import thread" to the top of test modules that import the
 
8903
  threading module (test_asynchat and test_threadedtempfile).  This
 
8904
  prevents test failures caused by a broken threading module resulting
 
8905
  from a previously caught failed import.
 
8906
 
 
8907
- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
 
8908
  needed on some platforms (e.g. Solaris 8) when the tests are run
 
8909
  twice in succession.
 
8910
 
 
8911
- Skip rather than fail test_sunaudiodev if no audio device is found.
 
8912
 
 
8913
 
 
8914
What's New in Python 2.1c1?
 
8915
===========================
 
8916
 
 
8917
This list was significantly updated when 2.1c2 was released; the 2.1c1
 
8918
release didn't mention most changes that were actually part of 2.1c1:
 
8919
 
 
8920
Legal
 
8921
 
 
8922
- Copyright was assigned to the Python Software Foundation (PSF) and a
 
8923
  PSF license (very similar to the CNRI license) was added.
 
8924
 
 
8925
- The CNRI copyright notice was updated to include 2001.
 
8926
 
 
8927
Core
 
8928
 
 
8929
- After a public outcry, assignment to __debug__ is no longer illegal;
 
8930
  instead, a warning is issued.  It will become illegal in 2.2.
 
8931
 
 
8932
- Fixed a core dump with "%#x" % 0, and changed the semantics so that
 
8933
  "%#x" now always prepends "0x", even if the value is zero.
 
8934
 
 
8935
- Fixed some nits in the bytecode compiler.
 
8936
 
 
8937
- Fixed core dumps when calling certain kinds of non-functions.
 
8938
 
 
8939
- Fixed various core dumps caused by reference count bugs.
 
8940
 
 
8941
Build and Ports
 
8942
 
 
8943
- Use INSTALL_SCRIPT to install script files.
 
8944
 
 
8945
- New port: SCO Unixware 7, by Billy G. Allie.
 
8946
 
 
8947
- Updated RISCOS port.
 
8948
 
 
8949
- Updated BeOS port and notes.
 
8950
 
 
8951
- Various other porting problems resolved.
 
8952
 
 
8953
Library
 
8954
 
 
8955
- The TERMIOS and SOCKET modules are now truly obsolete and
 
8956
  unnecessary.  Their symbols are incorporated in the termios and
 
8957
  socket modules.
 
8958
 
 
8959
- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
 
8960
  better tests for pickling.
 
8961
 
 
8962
- threading: make Condition.wait() robust against KeyboardInterrupt.
 
8963
 
 
8964
- zipfile: add support to zipfile to support opening an archive
 
8965
  represented by an open file rather than a file name.  Fix bug where
 
8966
  the archive was not properly closed.  Fixed a bug in this bugfix
 
8967
  where flush() was called for a read-only file.
 
8968
 
 
8969
- imputil: added an uninstall() method to the ImportManager.
 
8970
 
 
8971
- Canvas: fixed bugs in lower() and tkraise() methods.
 
8972
 
 
8973
- SocketServer: API change (added overridable close_request() method)
 
8974
  so that the TCP server can explicitly close the request.
 
8975
 
 
8976
- pstats: Eric Raymond added a simple interactive statistics browser,
 
8977
  invoked when the module is run as a script.
 
8978
 
 
8979
- locale: fixed a problem in format().
 
8980
 
 
8981
- webbrowser: made it work when the BROWSER environment variable has a
 
8982
  value like "/usr/bin/netscape".  Made it auto-detect Konqueror for
 
8983
  KDE 2.  Fixed some other nits.
 
8984
 
 
8985
- unittest: changes to allow using a different exception than
 
8986
  AssertionError, and added a few more function aliases.  Some other
 
8987
  small changes.
 
8988
 
 
8989
- urllib, urllib2: fixed redirect problems and a coupleof other nits.
 
8990
 
 
8991
- asynchat: fixed a critical bug in asynchat that slipped through the
 
8992
  2.1b2 release.  Fixed another rare bug.
 
8993
 
 
8994
- Fix some unqualified except: clauses (always a bad code example).
 
8995
 
 
8996
XML
 
8997
 
 
8998
- pyexpat: new API get_version_string().
 
8999
 
 
9000
- Fixed some minidom bugs.
 
9001
 
 
9002
Extensions
 
9003
 
 
9004
- Fixed a core dump in _weakref.  Removed the weakref.mapping()
 
9005
  function (it adds nothing to the API).
 
9006
 
 
9007
- Rationalized the use of header files in the readline module, to make
 
9008
  it compile (albeit with some warnings) with the very recent readline
 
9009
  4.2, without breaking for earlier versions.
 
9010
 
 
9011
- Hopefully fixed a buffering problem in linuxaudiodev.
 
9012
 
 
9013
- Attempted a fix to make the OpenSSL support in the socket module
 
9014
  work again with pre-0.9.5 versions of OpenSSL.
 
9015
 
 
9016
Tests
 
9017
 
 
9018
- Added a test case for asynchat and asyncore.
 
9019
 
 
9020
- Removed coupling between tests where one test failing could break
 
9021
  another.
 
9022
 
 
9023
Tools
 
9024
 
 
9025
- Ping added an interactive help browser to pydoc, fixed some nits
 
9026
  in the rest of the pydoc code, and added some features to his
 
9027
  inspect module.
 
9028
 
 
9029
- An updated python-mode.el version 4.1 which integrates Ken
 
9030
  Manheimer's pdbtrack.el.  This makes debugging Python code via pdb
 
9031
  much nicer in XEmacs and Emacs.  When stepping through your program
 
9032
  with pdb, in either the shell window or the *Python* window, the
 
9033
  source file and line will be tracked by an arrow.  Very cool!
 
9034
 
 
9035
- IDLE: syntax warnings in interactive mode are changed into errors.
 
9036
 
 
9037
- Some improvements to Tools/webchecker (ignore some more URL types,
 
9038
  follow some more links).
 
9039
 
 
9040
- Brought the Tools/compiler package up to date.
 
9041
 
 
9042
 
 
9043
What's New in Python 2.1 beta 2?
 
9044
================================
 
9045
 
 
9046
(Unlisted are many fixed bugs, more documentation, etc.)
 
9047
 
 
9048
Core language, builtins, and interpreter
 
9049
 
 
9050
- The nested scopes work (enabled by "from __future__ import
 
9051
  nested_scopes") is completed; in particular, the future now extends
 
9052
  into code executed through exec, eval() and execfile(), and into the
 
9053
  interactive interpreter.
 
9054
 
 
9055
- When calling a base class method (e.g. BaseClass.__init__(self)),
 
9056
  this is now allowed even if self is not strictly spoken a class
 
9057
  instance (e.g. when using metaclasses or the Don Beaudry hook).
 
9058
 
 
9059
- Slice objects are now comparable but not hashable; this prevents
 
9060
  dict[:] from being accepted but meaningless.
 
9061
 
 
9062
- Complex division is now calculated using less braindead algorithms.
 
9063
  This doesn't change semantics except it's more likely to give useful
 
9064
  results in extreme cases.  Complex repr() now uses full precision
 
9065
  like float repr().
 
9066
 
 
9067
- sgmllib.py now calls handle_decl() for simple <!...> declarations.
 
9068
 
 
9069
- It is illegal to assign to the name __debug__, which is set when the
 
9070
  interpreter starts.  It is effectively a compile-time constant.
 
9071
 
 
9072
- A warning will be issued if a global statement for a variable
 
9073
  follows a use or assignment of that variable.
 
9074
 
 
9075
Standard library
 
9076
 
 
9077
- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
 
9078
  inspired by JUnit), is now part of the standard library.  You now
 
9079
  have a choice of two testing frameworks: unittest requires you to
 
9080
  write testcases as separate code, doctest gathers them from
 
9081
  docstrings.  Both approaches have their advantages and
 
9082
  disadvantages.
 
9083
 
 
9084
- A new module Tix was added, which wraps the Tix extension library
 
9085
  for Tk.  With that module, it is not necessary to statically link
 
9086
  Tix with _tkinter, since Tix will be loaded with Tcl's "package
 
9087
  require" command.  See Demo/tix/.
 
9088
 
 
9089
- tzparse.py is now obsolete.
 
9090
 
 
9091
- In gzip.py, the seek() and tell() methods are removed -- they were
 
9092
  non-functional anyway, and it's better if callers can test for their
 
9093
  existence with hasattr().
 
9094
 
 
9095
Python/C API
 
9096
 
 
9097
- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
 
9098
  that's already in the dictionary during a PyDict_Next() iteration.
 
9099
  This used to fail occasionally when a dictionary resize operation
 
9100
  could be triggered that would rehash all the keys.  All other
 
9101
  modifications to the dictionary are still off-limits during a
 
9102
  PyDict_Next() iteration!
 
9103
 
 
9104
- New extended APIs related to passing compiler variables around.
 
9105
 
 
9106
- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
 
9107
  implement isinstance() and issubclass().
 
9108
 
 
9109
- Py_BuildValue() now has a "D" conversion to create a Python complex
 
9110
  number from a Py_complex C value.
 
9111
 
 
9112
- Extensions types which support weak references must now set the
 
9113
  field allocated for the weak reference machinery to NULL themselves;
 
9114
  this is done to avoid the cost of checking each object for having a
 
9115
  weakly referencable type in PyObject_INIT(), since most types are
 
9116
  not weakly referencable.
 
9117
 
 
9118
- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
 
9119
  free variables and cell variables to and from the frame's f_locals.
 
9120
 
 
9121
- Variants of several functions defined in pythonrun.h have been added
 
9122
  to support the nested_scopes future statement.  The variants all end
 
9123
  in Flags and take an extra argument, a PyCompilerFlags *; examples:
 
9124
  PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags().  These
 
9125
  variants may be removed in Python 2.2, when nested scopes are
 
9126
  mandatory.
 
9127
 
 
9128
Distutils
 
9129
 
 
9130
- the sdist command now writes a PKG-INFO file, as described in PEP 241,
 
9131
  into the release tree.
 
9132
 
 
9133
- several enhancements to the bdist_wininst command from Thomas Heller
 
9134
  (an uninstaller, more customization of the installer's display)
 
9135
 
 
9136
- from Jack Jansen: added Mac-specific code to generate a dialog for
 
9137
  users to specify the command-line (because providing a command-line with
 
9138
  MacPython is awkward).  Jack also made various fixes for the Mac
 
9139
  and the Metrowerks compiler.
 
9140
 
 
9141
- added 'platforms' and 'keywords' to the set of metadata that can be
 
9142
  specified for a distribution.
 
9143
 
 
9144
- applied patches from Jason Tishler to make the compiler class work with
 
9145
  Cygwin.
 
9146
 
 
9147
 
 
9148
What's New in Python 2.1 beta 1?
 
9149
================================
 
9150
 
 
9151
Core language, builtins, and interpreter
 
9152
 
 
9153
- Following an outcry from the community about the amount of code
 
9154
  broken by the nested scopes feature introduced in 2.1a2, we decided
 
9155
  to make this feature optional, and to wait until Python 2.2 (or at
 
9156
  least 6 months) to make it standard.  The option can be enabled on a
 
9157
  per-module basis by adding "from __future__ import nested_scopes" at
 
9158
  the beginning of a module (before any other statements, but after
 
9159
  comments and an optional docstring).  See PEP 236 (Back to the
 
9160
  __future__) for a description of the __future__ statement.  PEP 227
 
9161
  (Statically Nested Scopes) has been updated to reflect this change,
 
9162
  and to clarify the semantics in a number of endcases.
 
9163
 
 
9164
- The nested scopes code, when enabled, has been hardened, and most
 
9165
  bugs and memory leaks in it have been fixed.
 
9166
 
 
9167
- Compile-time warnings are now generated for a number of conditions
 
9168
  that will break or change in meaning when nested scopes are enabled:
 
9169
 
 
9170
  - Using "from...import *" or "exec" without in-clause in a function
 
9171
    scope that also defines a lambda or nested function with one or
 
9172
    more free (non-local) variables.  The presence of the import* or
 
9173
    bare exec makes it impossible for the compiler to determine the
 
9174
    exact set of local variables in the outer scope, which makes it
 
9175
    impossible to determine the bindings for free variables in the
 
9176
    inner scope.  To avoid the warning about import *, change it into
 
9177
    an import of explicitly name object, or move the import* statement
 
9178
    to the global scope; to avoid the warning about bare exec, use
 
9179
    exec...in... (a good idea anyway -- there's a possibility that
 
9180
    bare exec will be deprecated in the future).
 
9181
 
 
9182
  - Use of a global variable in a nested scope with the same name as a
 
9183
    local variable in a surrounding scope.  This will change in
 
9184
    meaning with nested scopes: the name in the inner scope will
 
9185
    reference the variable in the outer scope rather than the global
 
9186
    of the same name.  To avoid the warning, either rename the outer
 
9187
    variable, or use a global statement in the inner function.
 
9188
 
 
9189
- An optional object allocator has been included.  This allocator is
 
9190
  optimized for Python objects and should be faster and use less memory
 
9191
  than the standard system allocator.  It is not enabled by default
 
9192
  because of possible thread safety problems.  The allocator is only
 
9193
  protected by the Python interpreter lock and it is possible that some
 
9194
  extension modules require a thread safe allocator.  The object
 
9195
  allocator can be enabled by providing the "--with-pymalloc" option to
 
9196
  configure.
 
9197
 
 
9198
Standard library
 
9199
 
 
9200
- pyexpat now detects the expat version if expat.h defines it. A
 
9201
  number of additional handlers are provided, which are only available
 
9202
  since expat 1.95. In addition, the methods SetParamEntityParsing and
 
9203
  GetInputContext of Parser objects are available with 1.95.x
 
9204
  only. Parser objects now provide the ordered_attributes and
 
9205
  specified_attributes attributes. A new module expat.model was added,
 
9206
  which offers a number of additional constants if 1.95.x is used.
 
9207
 
 
9208
- xml.dom offers the new functions registerDOMImplementation and
 
9209
  getDOMImplementation.
 
9210
 
 
9211
- xml.dom.minidom offers a toprettyxml method. A number of DOM
 
9212
  conformance issues have been resolved. In particular, Element now
 
9213
  has an hasAttributes method, and the handling of namespaces was
 
9214
  improved.
 
9215
 
 
9216
- Ka-Ping Yee contributed two new modules: inspect.py, a module for
 
9217
  getting information about live Python code, and pydoc.py, a module
 
9218
  for interactively converting docstrings to HTML or text.
 
9219
  Tools/scripts/pydoc, which is now automatically installed into
 
9220
  <prefix>/bin, uses pydoc.py to display documentation; try running
 
9221
  "pydoc -h" for instructions.  "pydoc -g" pops up a small GUI that
 
9222
  lets you browse the module docstrings using a web browser.
 
9223
 
 
9224
- New library module difflib.py, primarily packaging the SequenceMatcher
 
9225
  class at the heart of the popular ndiff.py file-comparison tool.
 
9226
 
 
9227
- doctest.py (a framework for verifying Python code examples in docstrings)
 
9228
  is now part of the std library.
 
9229
 
 
9230
Windows changes
 
9231
 
 
9232
- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
 
9233
  small GUI that lets you browse the module docstrings using your
 
9234
  default web browser.
 
9235
 
 
9236
- Import is now case-sensitive.  PEP 235 (Import on Case-Insensitive
 
9237
  Platforms) is implemented.  See
 
9238
 
 
9239
      http://python.sourceforge.net/peps/pep-0235.html
 
9240
 
 
9241
  for full details, especially the "Current Lower-Left Semantics" section.
 
9242
  The new Windows import rules are simpler than before:
 
9243
 
 
9244
  A. If the PYTHONCASEOK environment variable exists, same as
 
9245
     before:  silently accept the first case-insensitive match of any
 
9246
     kind; raise ImportError if none found.
 
9247
 
 
9248
  B. Else search sys.path for the first case-sensitive match; raise
 
9249
     ImportError if none found.
 
9250
 
 
9251
  The same rules have been implemented on other platforms with case-
 
9252
  insensitive but case-preserving filesystems too (including Cygwin, and
 
9253
  several flavors of Macintosh operating systems).
 
9254
 
 
9255
- winsound module:  Under Win9x, winsound.Beep() now attempts to simulate
 
9256
  what it's supposed to do (and does do under NT and 2000) via direct
 
9257
  port manipulation.  It's unknown whether this will work on all systems,
 
9258
  but it does work on my Win98SE systems now and was known to be useless on
 
9259
  all Win9x systems before.
 
9260
 
 
9261
- Build:  Subproject _test (effectively) renamed to _testcapi.
 
9262
 
 
9263
New platforms
 
9264
 
 
9265
- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
 
9266
  Thanks to Steven Majewski!
 
9267
 
 
9268
- 2.1 should compile and run out of the box on Cygwin.  Thanks to Jason
 
9269
  Tishler!
 
9270
 
 
9271
- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
 
9272
  Schwertberger!  See RISCOS/README for more information -- it seems
 
9273
  that because of the bizarre filename conventions on RISCOS, no port
 
9274
  to that platform is easy.
 
9275
 
 
9276
 
 
9277
What's New in Python 2.1 alpha 2?
 
9278
=================================
 
9279
 
 
9280
Core language, builtins, and interpreter
 
9281
 
 
9282
- Scopes nest.  If a name is used in a function or class, but is not
 
9283
  local, the definition in the nearest enclosing function scope will
 
9284
  be used.  One consequence of this change is that lambda statements
 
9285
  could reference variables in the namespaces where the lambda is
 
9286
  defined.  In some unusual cases, this change will break code.
 
9287
 
 
9288
  In all previous version of Python, names were resolved in exactly
 
9289
  three namespaces -- the local namespace, the global namespace, and
 
9290
  the builtin namespace.  According to this old definition, if a
 
9291
  function A is defined within a function B, the names bound in B are
 
9292
  not visible in A.  The new rules make names bound in B visible in A,
 
9293
  unless A contains a name binding that hides the binding in B.
 
9294
 
 
9295
  Section 4.1 of the reference manual describes the new scoping rules
 
9296
  in detail.  The test script in Lib/test/test_scope.py demonstrates
 
9297
  some of the effects of the change.
 
9298
 
 
9299
  The new rules will cause existing code to break if it defines nested
 
9300
  functions where an outer function has local variables with the same
 
9301
  name as globals or builtins used by the inner function.  Example:
 
9302
 
 
9303
    def munge(str):
 
9304
        def helper(x):
 
9305
            return str(x)
 
9306
        if type(str) != type(''):
 
9307
            str = helper(str)
 
9308
        return str.strip()
 
9309
 
 
9310
  Under the old rules, the name str in helper() is bound to the
 
9311
  builtin function str().  Under the new rules, it will be bound to
 
9312
  the argument named str and an error will occur when helper() is
 
9313
  called.
 
9314
 
 
9315
- The compiler will report a SyntaxError if "from ... import *" occurs
 
9316
  in a function or class scope.  The language reference has documented
 
9317
  that this case is illegal, but the compiler never checked for it.
 
9318
  The recent introduction of nested scope makes the meaning of this
 
9319
  form of name binding ambiguous.  In a future release, the compiler
 
9320
  may allow this form when there is no possibility of ambiguity.
 
9321
 
 
9322
- repr(string) is easier to read, now using hex escapes instead of octal,
 
9323
  and using \t, \n and \r instead of \011, \012 and \015 (respectively):
 
9324
 
 
9325
  >>> "\texample \r\n" + chr(0) + chr(255)
 
9326
  '\texample \r\n\x00\xff'         # in 2.1
 
9327
  '\011example \015\012\000\377'   # in 2.0
 
9328
 
 
9329
- Functions are now compared and hashed by identity, not by value, since
 
9330
  the func_code attribute is writable.
 
9331
 
 
9332
- Weak references (PEP 205) have been added.  This involves a few
 
9333
  changes in the core, an extension module (_weakref), and a Python
 
9334
  module (weakref).  The weakref module is the public interface.  It
 
9335
  includes support for "explicit" weak references, proxy objects, and
 
9336
  mappings with weakly held values.
 
9337
 
 
9338
- A 'continue' statement can now appear in a try block within the body
 
9339
  of a loop.  It is still not possible to use continue in a finally
 
9340
  clause.
 
9341
 
 
9342
Standard library
 
9343
 
 
9344
- mailbox.py now has a new class, PortableUnixMailbox which is
 
9345
  identical to UnixMailbox but uses a more portable scheme for
 
9346
  determining From_ separators.  Also, the constructors for all the
 
9347
  classes in this module have a new optional `factory' argument, which
 
9348
  is a callable used when new message classes must be instantiated by
 
9349
  the next() method.
 
9350
 
 
9351
- random.py is now self-contained, and offers all the functionality of
 
9352
  the now-deprecated whrandom.py.  See the docs for details.  random.py
 
9353
  also supports new functions getstate() and setstate(), for saving
 
9354
  and restoring the internal state of the generator; and jumpahead(n),
 
9355
  for quickly forcing the internal state to be the same as if n calls to
 
9356
  random() had been made.  The latter is particularly useful for multi-
 
9357
  threaded programs, creating one instance of the random.Random() class for
 
9358
  each thread, then using .jumpahead() to force each instance to use a
 
9359
  non-overlapping segment of the full period.
 
9360
 
 
9361
- random.py's seed() function is new.  For bit-for-bit compatibility with
 
9362
  prior releases, use the whseed function instead.  The new seed function
 
9363
  addresses two problems:  (1) The old function couldn't produce more than
 
9364
  about 2**24 distinct internal states; the new one about 2**45 (the best
 
9365
  that can be done in the Wichmann-Hill generator).  (2) The old function
 
9366
  sometimes produced identical internal states when passed distinct
 
9367
  integers, and there was no simple way to predict when that would happen;
 
9368
  the new one guarantees to produce distinct internal states for all
 
9369
  arguments in [0, 27814431486576L).
 
9370
 
 
9371
- The socket module now supports raw packets on Linux.  The socket
 
9372
  family is AF_PACKET.
 
9373
 
 
9374
- test_capi.py is a start at running tests of the Python C API.  The tests
 
9375
  are implemented by the new Modules/_testmodule.c.
 
9376
 
 
9377
- A new extension module, _symtable, provides provisional access to the
 
9378
  internal symbol table used by the Python compiler.  A higher-level
 
9379
  interface will be added on top of _symtable in a future release.
 
9380
 
 
9381
- Removed the obsolete soundex module.
 
9382
 
 
9383
- xml.dom.minidom now uses the standard DOM exceptions. Node supports
 
9384
  the isSameNode method; NamedNodeMap the get method.
 
9385
 
 
9386
- xml.sax.expatreader supports the lexical handler property; it
 
9387
  generates comment, startCDATA, and endCDATA events.
 
9388
 
 
9389
Windows changes
 
9390
 
 
9391
- Build procedure:  the zlib project is built in a different way that
 
9392
  ensures the zlib header files used can no longer get out of synch with
 
9393
  the zlib binary used.  See PCbuild\readme.txt for details.  Your old
 
9394
  zlib-related directories can be deleted; you'll need to download fresh
 
9395
  source for zlib and unpack it into a new directory.
 
9396
 
 
9397
- Build:  New subproject _test for the benefit of test_capi.py (see above).
 
9398
 
 
9399
- Build:  New subproject _symtable, for new DLL _symtable.pyd (a nascent
 
9400
  interface to some Python compiler internals).
 
9401
 
 
9402
- Build:  Subproject ucnhash is gone, since the code was folded into the
 
9403
  unicodedata subproject.
 
9404
 
 
9405
What's New in Python 2.1 alpha 1?
 
9406
=================================
 
9407
 
 
9408
Core language, builtins, and interpreter
 
9409
 
 
9410
- There is a new Unicode companion to the PyObject_Str() API
 
9411
  called PyObject_Unicode(). It behaves in the same way as the
 
9412
  former, but assures that the returned value is an Unicode object
 
9413
  (applying the usual coercion if necessary).
 
9414
 
 
9415
- The comparison operators support "rich comparison overloading" (PEP
 
9416
  207).  C extension types can provide a rich comparison function in
 
9417
  the new tp_richcompare slot in the type object.  The cmp() function
 
9418
  and the C function PyObject_Compare() first try the new rich
 
9419
  comparison operators before trying the old 3-way comparison.  There
 
9420
  is also a new C API PyObject_RichCompare() (which also falls back on
 
9421
  the old 3-way comparison, but does not constrain the outcome of the
 
9422
  rich comparison to a Boolean result).
 
9423
 
 
9424
  The rich comparison function takes two objects (at least one of
 
9425
  which is guaranteed to have the type that provided the function) and
 
9426
  an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
 
9427
  Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
 
9428
  object, which may be NotImplemented (in which case the tp_compare
 
9429
  slot function is used as a fallback, if defined).
 
9430
 
 
9431
  Classes can overload individual comparison operators by defining one
 
9432
  or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
 
9433
  __ge__.  There are no explicit "reflected argument" versions of
 
9434
  these; instead, __lt__ and __gt__ are each other's reflection,
 
9435
  likewise for__le__ and __ge__; __eq__ and __ne__ are their own
 
9436
  reflection (similar at the C level).  No other implications are
 
9437
  made; in particular, Python does not assume that == is the Boolean
 
9438
  inverse of !=, or that < is the Boolean inverse of >=.  This makes
 
9439
  it possible to define types with partial orderings.
 
9440
 
 
9441
  Classes or types that want to implement (in)equality tests but not
 
9442
  the ordering operators (i.e. unordered types) should implement ==
 
9443
  and !=, and raise an error for the ordering operators.
 
9444
 
 
9445
  It is possible to define types whose rich comparison results are not
 
9446
  Boolean; e.g. a matrix type might want to return a matrix of bits
 
9447
  for A < B, giving elementwise comparisons.  Such types should ensure
 
9448
  that any interpretation of their value in a Boolean context raises
 
9449
  an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
 
9450
  at the C level) to always raise an exception.
 
9451
 
 
9452
- Complex numbers use rich comparisons to define == and != but raise
 
9453
  an exception for <, <=, > and >=.  Unfortunately, this also means
 
9454
  that cmp() of two complex numbers raises an exception when the two
 
9455
  numbers differ.  Since it is not mathematically meaningful to compare
 
9456
  complex numbers except for equality, I hope that this doesn't break
 
9457
  too much code.
 
9458
 
 
9459
- The outcome of comparing non-numeric objects of different types is
 
9460
  not defined by the language, other than that it's arbitrary but
 
9461
  consistent (see the Reference Manual).  An implementation detail changed
 
9462
  in 2.1a1 such that None now compares less than any other object.  Code
 
9463
  relying on this new behavior (like code that relied on the previous
 
9464
  behavior) does so at its own risk.
 
9465
 
 
9466
- Functions and methods now support getting and setting arbitrarily
 
9467
  named attributes (PEP 232).  Functions have a new __dict__
 
9468
  (a.k.a. func_dict) which hold the function attributes.  Methods get
 
9469
  and set attributes on their underlying im_func.  It is a TypeError
 
9470
  to set an attribute on a bound method.
 
9471
 
 
9472
- The xrange() object implementation has been improved so that
 
9473
  xrange(sys.maxint) can be used on 64-bit platforms.  There's still a
 
9474
  limitation that in this case len(xrange(sys.maxint)) can't be
 
9475
  calculated, but the common idiom "for i in xrange(sys.maxint)" will
 
9476
  work fine as long as the index i doesn't actually reach 2**31.
 
9477
  (Python uses regular ints for sequence and string indices; fixing
 
9478
  that is much more work.)
 
9479
 
 
9480
- Two changes to from...import:
 
9481
 
 
9482
  1) "from M import X" now works even if (after loading module M)
 
9483
     sys.modules['M'] is not a real module; it's basically a getattr()
 
9484
     operation with AttributeError exceptions changed into ImportError.
 
9485
 
 
9486
  2) "from M import *" now looks for M.__all__ to decide which names to
 
9487
     import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
 
9488
     filters out names starting with '_' as before.  Whether or not
 
9489
     __all__ exists, there's no restriction on the type of M.
 
9490
 
 
9491
- File objects have a new method, xreadlines().  This is the fastest
 
9492
  way to iterate over all lines in a file:
 
9493
 
 
9494
  for line in file.xreadlines():
 
9495
      ...do something to line...
 
9496
 
 
9497
  See the xreadlines module (mentioned below) for how to do this for
 
9498
  other file-like objects.
 
9499
 
 
9500
- Even if you don't use file.xreadlines(), you may expect a speedup on
 
9501
  line-by-line input.  The file.readline() method has been optimized
 
9502
  quite a bit in platform-specific ways:  on systems (like Linux) that
 
9503
  support flockfile(), getc_unlocked(), and funlockfile(), those are
 
9504
  used by default.  On systems (like Windows) without getc_unlocked(),
 
9505
  a complicated (but still thread-safe) method using fgets() is used by
 
9506
  default.
 
9507
 
 
9508
  You can force use of the fgets() method by #define'ing
 
9509
  USE_FGETS_IN_GETLINE at build time (it may be faster than
 
9510
  getc_unlocked()).
 
9511
 
 
9512
  You can force fgets() not to be used by #define'ing
 
9513
  DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
 
9514
  test_bufio.py fails -- and let us know if it does!).
 
9515
 
 
9516
- In addition, the fileinput module, while still slower than the other
 
9517
  methods on most platforms, has been sped up too, by using
 
9518
  file.readlines(sizehint).
 
9519
 
 
9520
- Support for run-time warnings has been added, including a new
 
9521
  command line option (-W) to specify the disposition of warnings.
 
9522
  See the description of the warnings module below.
 
9523
 
 
9524
- Extensive changes have been made to the coercion code.  This mostly
 
9525
  affects extension modules (which can now implement mixed-type
 
9526
  numerical operators without having to use coercion), but
 
9527
  occasionally, in boundary cases the coercion semantics have changed
 
9528
  subtly.  Since this was a terrible gray area of the language, this
 
9529
  is considered an improvement.  Also note that __rcmp__ is no longer
 
9530
  supported -- instead of calling __rcmp__, __cmp__ is called with
 
9531
  reflected arguments.
 
9532
 
 
9533
- In connection with the coercion changes, a new built-in singleton
 
9534
  object, NotImplemented is defined.  This can be returned for
 
9535
  operations that wish to indicate they are not implemented for a
 
9536
  particular combination of arguments.  From C, this is
 
9537
  Py_NotImplemented.
 
9538
 
 
9539
- The interpreter accepts now bytecode files on the command line even
 
9540
  if they do not have a .pyc or .pyo extension. On Linux, after executing
 
9541
 
 
9542
import imp,sys,string
 
9543
magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
 
9544
reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
 
9545
open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
 
9546
 
 
9547
  any byte code file can be used as an executable (i.e. as an argument
 
9548
  to execve(2)).
 
9549
 
 
9550
- %[xXo] formats of negative Python longs now produce a sign
 
9551
  character.  In 1.6 and earlier, they never produced a sign,
 
9552
  and raised an error if the value of the long was too large
 
9553
  to fit in a Python int.  In 2.0, they produced a sign if and
 
9554
  only if too large to fit in an int.  This was inconsistent
 
9555
  across platforms (because the size of an int varies across
 
9556
  platforms), and inconsistent with hex() and oct().  Example:
 
9557
 
 
9558
  >>> "%x" % -0x42L
 
9559
  '-42'      # in 2.1
 
9560
  'ffffffbe' # in 2.0 and before, on 32-bit machines
 
9561
  >>> hex(-0x42L)
 
9562
  '-0x42L'   # in all versions of Python
 
9563
 
 
9564
  The behavior of %d formats for negative Python longs remains
 
9565
  the same as in 2.0 (although in 1.6 and before, they raised
 
9566
  an error if the long didn't fit in a Python int).
 
9567
 
 
9568
  %u formats don't make sense for Python longs, but are allowed
 
9569
  and treated the same as %d in 2.1.  In 2.0, a negative long
 
9570
  formatted via %u produced a sign if and only if too large to
 
9571
  fit in an int.  In 1.6 and earlier, a negative long formatted
 
9572
  via %u raised an error if it was too big to fit in an int.
 
9573
 
 
9574
- Dictionary objects have an odd new method, popitem().  This removes
 
9575
  an arbitrary item from the dictionary and returns it (in the form of
 
9576
  a (key, value) pair).  This can be useful for algorithms that use a
 
9577
  dictionary as a bag of "to do" items and repeatedly need to pick one
 
9578
  item.  Such algorithms normally end up running in quadratic time;
 
9579
  using popitem() they can usually be made to run in linear time.
 
9580
 
 
9581
Standard library
 
9582
 
 
9583
- In the time module, the time argument to the functions strftime,
 
9584
  localtime, gmtime, asctime and ctime is now optional, defaulting to
 
9585
  the current time (in the local timezone).
 
9586
 
 
9587
- The ftplib module now defaults to passive mode, which is deemed a
 
9588
  more useful default given that clients are often inside firewalls
 
9589
  these days.  Note that this could break if ftplib is used to connect
 
9590
  to a *server* that is inside a firewall, from outside; this is
 
9591
  expected to be a very rare situation.  To fix that, you can call
 
9592
  ftp.set_pasv(0).
 
9593
 
 
9594
- The module site now treats .pth files not only for path configuration,
 
9595
  but also supports extensions to the initialization code: Lines starting
 
9596
  with import are executed.
 
9597
 
 
9598
- There's a new module, warnings, which implements a mechanism for
 
9599
  issuing and filtering warnings.  There are some new built-in
 
9600
  exceptions that serve as warning categories, and a new command line
 
9601
  option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
 
9602
  turns warnings into errors).  warnings.warn(message[, category])
 
9603
  issues a warning message; this can also be called from C as
 
9604
  PyErr_Warn(category, message).
 
9605
 
 
9606
- A new module xreadlines was added.  This exports a single factory
 
9607
  function, xreadlines().  The intention is that this code is the
 
9608
  absolutely fastest way to iterate over all lines in an open
 
9609
  file(-like) object:
 
9610
 
 
9611
  import xreadlines
 
9612
  for line in xreadlines.xreadlines(file):
 
9613
      ...do something to line...
 
9614
 
 
9615
  This is equivalent to the previous the speed record holder using
 
9616
  file.readlines(sizehint).  Note that if file is a real file object
 
9617
  (as opposed to a file-like object), this is equivalent:
 
9618
 
 
9619
  for line in file.xreadlines():
 
9620
      ...do something to line...
 
9621
 
 
9622
- The bisect module has new functions bisect_left, insort_left,
 
9623
  bisect_right and insort_right.  The old names bisect and insort
 
9624
  are now aliases for bisect_right and insort_right.  XXX_right
 
9625
  and XXX_left methods differ in what happens when the new element
 
9626
  compares equal to one or more elements already in the list:  the
 
9627
  XXX_left methods insert to the left, the XXX_right methods to the
 
9628
  right.  Code that doesn't care where equal elements end up should
 
9629
  continue to use the old, short names ("bisect" and "insort").
 
9630
 
 
9631
- The new curses.panel module wraps the panel library that forms part
 
9632
  of SYSV curses and ncurses.  Contributed by Thomas Gellekum.
 
9633
 
 
9634
- The SocketServer module now sets the allow_reuse_address flag by
 
9635
  default in the TCPServer class.
 
9636
 
 
9637
- A new function, sys._getframe(), returns the stack frame pointer of
 
9638
  the caller.  This is intended only as a building block for
 
9639
  higher-level mechanisms such as string interpolation.
 
9640
 
 
9641
- The pyexpat module supports a number of new handlers, which are
 
9642
  available only in expat 1.2. If invocation of a callback fails, it
 
9643
  will report an additional frame in the traceback. Parser objects
 
9644
  participate now in garbage collection. If expat reports an unknown
 
9645
  encoding, pyexpat will try to use a Python codec; that works only
 
9646
  for single-byte charsets. The parser type objects is exposed as
 
9647
  XMLParserObject.
 
9648
 
 
9649
- xml.dom now offers standard definitions for symbolic node type and
 
9650
  exception code constants, and a hierarchy of DOM exceptions. minidom
 
9651
  was adjusted to use them.
 
9652
 
 
9653
- The conformance of xml.dom.minidom to the DOM specification was
 
9654
  improved. It detects a number of additional error cases; the
 
9655
  previous/next relationship works even when the tree is modified;
 
9656
  Node supports the normalize() method; NamedNodeMap, DocumentType and
 
9657
  DOMImplementation classes were added; Element supports the
 
9658
  hasAttribute and hasAttributeNS methods; and Text supports the splitText
 
9659
  method.
 
9660
 
 
9661
Build issues
 
9662
 
 
9663
- For Unix (and Unix-compatible) builds, configuration and building of
 
9664
  extension modules is now greatly automated.  Rather than having to
 
9665
  edit the Modules/Setup file to indicate which modules should be
 
9666
  built and where their include files and libraries are, a
 
9667
  distutils-based setup.py script now takes care of building most
 
9668
  extension modules.  All extension modules built this way are built
 
9669
  as shared libraries.  Only a few modules that must be linked
 
9670
  statically are still listed in the Setup file; you won't need to
 
9671
  edit their configuration.
 
9672
 
 
9673
- Python should now build out of the box on Cygwin.  If it doesn't,
 
9674
  mail to Jason Tishler (jlt63 at users.sourceforge.net).
 
9675
 
 
9676
- Python now always uses its own (renamed) implementation of getopt()
 
9677
  -- there's too much variation among C library getopt()
 
9678
  implementations.
 
9679
 
 
9680
- C++ compilers are better supported; the CXX macro is always set to a
 
9681
  C++ compiler if one is found.
 
9682
 
 
9683
Windows changes
 
9684
 
 
9685
- select module:  By default under Windows, a select() call
 
9686
  can specify no more than 64 sockets.  Python now boosts
 
9687
  this Microsoft default to 512.  If you need even more than
 
9688
  that, see the MS docs (you'll need to #define FD_SETSIZE
 
9689
  and recompile Python from source).
 
9690
 
 
9691
- Support for Windows 3.1, DOS and OS/2 is gone.  The Lib/dos-8x3
 
9692
  subdirectory is no more!
 
9693
 
 
9694
 
 
9695
What's New in Python 2.0?
 
9696
=========================
 
9697
 
 
9698
Below is a list of all relevant changes since release 1.6.  Older
 
9699
changes are in the file HISTORY.  If you are making the jump directly
 
9700
from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
 
9701
HISTORY file!  Many important changes listed there.
 
9702
 
 
9703
Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
 
9704
the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
 
9705
http://www.amk.ca/python/2.0/.
 
9706
 
 
9707
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
 
9708
 
 
9709
======================================================================
 
9710
 
 
9711
What's new in 2.0 (since release candidate 1)?
 
9712
==============================================
 
9713
 
 
9714
Standard library
 
9715
 
 
9716
- The copy_reg module was modified to clarify its intended use: to
 
9717
  register pickle support for extension types, not for classes.
 
9718
  pickle() will raise a TypeError if it is passed a class.
 
9719
 
 
9720
- Fixed a bug in gettext's "normalize and expand" code that prevented
 
9721
  it from finding an existing .mo file.
 
9722
 
 
9723
- Restored support for HTTP/0.9 servers in httplib.
 
9724
 
 
9725
- The math module was changed to stop raising OverflowError in case of
 
9726
  underflow, and return 0 instead in underflow cases.  Whether Python
 
9727
  used to raise OverflowError in case of underflow was platform-
 
9728
  dependent (it did when the platform math library set errno to ERANGE
 
9729
  on underflow).
 
9730
 
 
9731
- Fixed a bug in StringIO that occurred when the file position was not
 
9732
  at the end of the file and write() was called with enough data to
 
9733
  extend past the end of the file.
 
9734
 
 
9735
- Fixed a bug that caused Tkinter error messages to get lost on
 
9736
  Windows.  The bug was fixed by replacing direct use of
 
9737
  interp->result with Tcl_GetStringResult(interp).
 
9738
 
 
9739
- Fixed bug in urllib2 that caused it to fail when it received an HTTP
 
9740
  redirect response.
 
9741
 
 
9742
- Several changes were made to distutils: Some debugging code was
 
9743
  removed from util.  Fixed the installer used when an external zip
 
9744
  program (like WinZip) is not found; the source code for this
 
9745
  installer is in Misc/distutils.  check_lib() was modified to behave
 
9746
  more like AC_CHECK_LIB by add other_libraries() as a parameter.  The
 
9747
  test for whether installed modules are on sys.path was changed to
 
9748
  use both normcase() and normpath().
 
9749
 
 
9750
- Several minor bugs were fixed in the xml package (the minidom,
 
9751
  pulldom, expatreader, and saxutils modules).
 
9752
 
 
9753
- The regression test driver (regrtest.py) behavior when invoked with
 
9754
  -l changed: It now reports a count of objects that are recognized as
 
9755
  garbage but not freed by the garbage collector.
 
9756
 
 
9757
- The regression test for the math module was changed to test
 
9758
  exceptional behavior when the test is run in verbose mode.  Python
 
9759
  cannot yet guarantee consistent exception behavior across platforms,
 
9760
  so the exception part of test_math is run only in verbose mode, and
 
9761
  may fail on your platform.
 
9762
 
 
9763
Internals
 
9764
 
 
9765
- PyOS_CheckStack() has been disabled on Win64, where it caused
 
9766
  test_sre to fail.
 
9767
 
 
9768
Build issues
 
9769
 
 
9770
- Changed compiler flags, so that gcc is always invoked with -Wall and
 
9771
  -Wstrict-prototypes.  Users compiling Python with GCC should see
 
9772
  exactly one warning, except if they have passed configure the
 
9773
  --with-pydebug flag.  The expected warning is for getopt() in
 
9774
  Modules/main.c.  This warning will be fixed for Python 2.1.
 
9775
 
 
9776
- Fixed configure to add -threads argument during linking on OSF1.
 
9777
 
 
9778
Tools and other miscellany
 
9779
 
 
9780
- The compiler in Tools/compiler was updated to support the new
 
9781
  language features introduced in 2.0: extended print statement, list
 
9782
  comprehensions, and augmented assignments.  The new compiler should
 
9783
  also be backwards compatible with Python 1.5.2; the compiler will
 
9784
  always generate code for the version of the interpreter it runs
 
9785
  under.
 
9786
 
 
9787
What's new in 2.0 release candidate 1 (since beta 2)?
 
9788
=====================================================
 
9789
 
 
9790
What is release candidate 1?
 
9791
 
 
9792
We believe that release candidate 1 will fix all known bugs that we
 
9793
intend to fix for the 2.0 final release.  This release should be a bit
 
9794
more stable than the previous betas.  We would like to see even more
 
9795
widespread testing before the final release, so we are producing this
 
9796
release candidate.  The final release will be exactly the same unless
 
9797
any show-stopping (or brown bag) bugs are found by testers of the
 
9798
release candidate.
 
9799
 
 
9800
All the changes since the last beta release are bug fixes or changes
 
9801
to support building Python for specific platforms.
 
9802
 
 
9803
Core language, builtins, and interpreter
 
9804
 
 
9805
- A bug that caused crashes when __coerce__ was used with augmented
 
9806
  assignment, e.g. +=, was fixed.
 
9807
 
 
9808
- Raise ZeroDivisionError when raising zero to a negative number,
 
9809
  e.g. 0.0 ** -2.0.  Note that math.pow is unrelated to the builtin
 
9810
  power operator and the result of math.pow(0.0, -2.0) will vary by
 
9811
  platform.  On Linux, it raises a ValueError.
 
9812
 
 
9813
- A bug in Unicode string interpolation was fixed that occasionally
 
9814
  caused errors with formats including "%%".  For example, the
 
9815
  following expression "%% %s" % u"abc" no longer raises a TypeError.
 
9816
 
 
9817
- Compilation of deeply nested expressions raises MemoryError instead
 
9818
  of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
 
9819
 
 
9820
- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
 
9821
  rendering them useless.  They are now written in binary mode again.
 
9822
 
 
9823
Standard library
 
9824
 
 
9825
- Keyword arguments are now accepted for most pattern and match object
 
9826
  methods in SRE, the standard regular expression engine.
 
9827
 
 
9828
- In SRE, fixed error with negative lookahead and lookbehind that
 
9829
  manifested itself as a runtime error in patterns like "(?<!abc)(def)".
 
9830
 
 
9831
- Several bugs in the Unicode handling and error handling in _tkinter
 
9832
  were fixed.
 
9833
 
 
9834
- Fix memory management errors in Merge() and Tkapp_Call() routines.
 
9835
 
 
9836
- Several changes were made to cStringIO to make it compatible with
 
9837
  the file-like object interface and with StringIO.  If operations are
 
9838
  performed on a closed object, an exception is raised.  The truncate
 
9839
  method now accepts a position argument and readline accepts a size
 
9840
  argument.
 
9841
 
 
9842
- There were many changes made to the linuxaudiodev module and its
 
9843
  test suite; as a result, a short, unexpected audio sample should now
 
9844
  play when the regression test is run.
 
9845
 
 
9846
  Note that this module is named poorly, because it should work
 
9847
  correctly on any platform that supports the Open Sound System
 
9848
  (OSS).
 
9849
 
 
9850
  The module now raises exceptions when errors occur instead of
 
9851
  crashing.  It also defines the AFMT_A_LAW format (logarithmic A-law
 
9852
  audio) and defines a getptr() method that calls the
 
9853
  SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
 
9854
 
 
9855
- The library_version attribute, introduced in an earlier beta, was
 
9856
  removed because it can not be supported with early versions of the C
 
9857
  readline library, which provides no way to determine the version at
 
9858
  compile-time.
 
9859
 
 
9860
- The binascii module is now enabled on Win64.
 
9861
 
 
9862
- tokenize.py no longer suffers "recursion depth" errors when parsing
 
9863
  programs with very long string literals.
 
9864
 
 
9865
Internals
 
9866
 
 
9867
- Fixed several buffer overflow vulnerabilities in calculate_path(),
 
9868
  which is called when the interpreter starts up to determine where
 
9869
  the standard library is installed.  These vulnerabilities affect all
 
9870
  previous versions of Python and can be exploited by setting very
 
9871
  long values for PYTHONHOME or argv[0].  The risk is greatest for a
 
9872
  setuid Python script, although use of the wrapper in
 
9873
  Misc/setuid-prog.c will eliminate the vulnerability.
 
9874
 
 
9875
- Fixed garbage collection bugs in instance creation that were
 
9876
  triggered when errors occurred during initialization.  The solution,
 
9877
  applied in cPickle and in PyInstance_New(), is to call
 
9878
  PyObject_GC_Init() after the initialization of the object's
 
9879
  container attributes is complete.
 
9880
 
 
9881
- pyexpat adds definitions of PyModule_AddStringConstant and
 
9882
  PyModule_AddObject if the Python version is less than 2.0, which
 
9883
  provides compatibility with PyXML on Python 1.5.2.
 
9884
 
 
9885
- If the platform has a bogus definition for LONG_BIT (the number of
 
9886
  bits in a long), an error will be reported at compile time.
 
9887
 
 
9888
- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
 
9889
  collection crashes and possibly other, unreported crashes.
 
9890
 
 
9891
- Fixed a memory leak in _PyUnicode_Fini().
 
9892
 
 
9893
Build issues
 
9894
 
 
9895
- configure now accepts a --with-suffix option that specifies the
 
9896
  executable suffix.  This is useful for builds on Cygwin and Mac OS
 
9897
  X, for example.
 
9898
 
 
9899
- The mmap.PAGESIZE constant is now initialized using sysconf when
 
9900
  possible, which eliminates a dependency on -lucb for Reliant UNIX.
 
9901
 
 
9902
- The md5 file should now compile on all platforms.
 
9903
 
 
9904
- The select module now compiles on platforms that do not define
 
9905
  POLLRDNORM and related constants.
 
9906
 
 
9907
- Darwin (Mac OS X):  Initial support for static builds on this
 
9908
  platform.
 
9909
 
 
9910
- BeOS: A number of changes were made to the build and installation
 
9911
  process.  ar-fake now operates on a directory of object files.
 
9912
  dl_export.h is gone, and its macros now appear on the mwcc command
 
9913
  line during build on PPC BeOS.
 
9914
 
 
9915
- Platform directory in lib/python2.0 is "plat-beos5" (or
 
9916
  "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
 
9917
 
 
9918
- Cygwin: Support for shared libraries, Tkinter, and sockets.
 
9919
 
 
9920
- SunOS 4.1.4_JL: Fix test for directory existence in configure.
 
9921
 
 
9922
Tools and other miscellany
 
9923
 
 
9924
- Removed debugging prints from main used with freeze.
 
9925
 
 
9926
- IDLE auto-indent no longer crashes when it encounters Unicode
 
9927
  characters.
 
9928
 
 
9929
What's new in 2.0 beta 2 (since beta 1)?
 
9930
========================================
 
9931
 
 
9932
Core language, builtins, and interpreter
 
9933
 
 
9934
- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
 
9935
  "%d" % 2L**64 == "18446744073709551616".
 
9936
 
 
9937
- Add -h and -V command line options to print the usage message and
 
9938
  Python version number and exit immediately.
 
9939
 
 
9940
- eval() and exec accept Unicode objects as code parameters.
 
9941
 
 
9942
- getattr() and setattr() now also accept Unicode objects for the
 
9943
  attribute name, which are converted to strings using the default
 
9944
  encoding before lookup.
 
9945
 
 
9946
- Multiplication on string and Unicode now does proper bounds
 
9947
  checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
 
9948
  string is too long."
 
9949
 
 
9950
- Better error message when continue is found in try statement in a
 
9951
  loop.
 
9952
 
 
9953
 
 
9954
Standard library and extensions
 
9955
 
 
9956
- socket module: the OpenSSL code now adds support for RAND_status()
 
9957
  and EGD (Entropy Gathering Device).
 
9958
 
 
9959
- array: reverse() method of array now works.  buffer_info() now does
 
9960
  argument checking; it still takes no arguments.
 
9961
 
 
9962
- asyncore/asynchat: Included most recent version from Sam Rushing.
 
9963
 
 
9964
- cgi: Accept '&' or ';' as separator characters when parsing form data.
 
9965
 
 
9966
- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
 
9967
 
 
9968
- ConfigParser: When reading the file, options spelled in upper case
 
9969
  letters are now correctly converted to lowercase.
 
9970
 
 
9971
- copy: Copy Unicode objects atomically.
 
9972
 
 
9973
- cPickle: Fail gracefully when copy_reg can't be imported.
 
9974
 
 
9975
- cStringIO: Implemented readlines() method.
 
9976
 
 
9977
- dbm: Add get() and setdefault() methods to dbm object.  Add constant
 
9978
  `library' to module that names the library used.  Added doc strings
 
9979
  and method names to error messages.  Uses configure to determine
 
9980
  which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
 
9981
  now available options.
 
9982
 
 
9983
- distutils: Update to version 0.9.3.
 
9984
 
 
9985
- dl: Add several dl.RTLD_ constants.
 
9986
 
 
9987
- fpectl: Now supported on FreeBSD.
 
9988
 
 
9989
- gc: Add DEBUG_SAVEALL option.  When enabled all garbage objects
 
9990
  found by the collector will be saved in gc.garbage.  This is useful
 
9991
  for debugging a program that creates reference cycles.
 
9992
 
 
9993
- httplib: Three changes: Restore support for set_debuglevel feature
 
9994
  of HTTP class.  Do not close socket on zero-length response.  Do not
 
9995
  crash when server sends invalid content-length header.
 
9996
 
 
9997
- mailbox: Mailbox class conforms better to qmail specifications.
 
9998
 
 
9999
- marshal: When reading a short, sign-extend on platforms where shorts
 
10000
  are bigger than 16 bits.  When reading a long, repair the unportable
 
10001
  sign extension that was being done for 64-bit machines.  (It assumed
 
10002
  that signed right shift sign-extends.)
 
10003
 
 
10004
- operator: Add contains(), invert(), __invert__() as aliases for
 
10005
  __contains__(), inv(), and __inv__() respectively.
 
10006
 
 
10007
- os: Add support for popen2() and popen3() on all platforms where
 
10008
  fork() exists.  (popen4() is still in the works.)
 
10009
 
 
10010
- os: (Windows only:) Add startfile() function that acts like double-
 
10011
  clicking on a file in Explorer (or passing the file name to the
 
10012
  DOS "start" command).
 
10013
 
 
10014
- os.path: (Windows, DOS:) Treat trailing colon correctly in
 
10015
  os.path.join.  os.path.join("a:", "b") yields "a:b".
 
10016
 
 
10017
- pickle: Now raises ValueError when an invalid pickle that contains
 
10018
  a non-string repr where a string repr was expected.  This behavior
 
10019
  matches cPickle.
 
10020
 
 
10021
- posixfile: Remove broken __del__() method.
 
10022
 
 
10023
- py_compile: support CR+LF line terminators in source file.
 
10024
 
 
10025
- readline: Does not immediately exit when ^C is hit when readline and
 
10026
  threads are configured.  Adds definition of rl_library_version.  (The
 
10027
  latter addition requires GNU readline 2.2 or later.)
 
10028
 
 
10029
- rfc822: Domain literals returned by AddrlistClass method
 
10030
  getdomainliteral() are now properly wrapped in brackets.
 
10031
 
 
10032
- site: sys.setdefaultencoding() should only be called in case the
 
10033
  standard default encoding ("ascii") is changed. This saves quite a
 
10034
  few cycles during startup since the first call to
 
10035
  setdefaultencoding() will initialize the codec registry and the
 
10036
  encodings package.
 
10037
 
 
10038
- socket: Support for size hint in readlines() method of object returned
 
10039
  by makefile().
 
10040
 
 
10041
- sre: Added experimental expand() method to match objects.  Does not
 
10042
  use buffer interface on Unicode strings.  Does not hang if group id
 
10043
  is followed by whitespace.
 
10044
 
 
10045
- StringIO: Size hint in readlines() is now supported as documented.
 
10046
 
 
10047
- struct: Check ranges for bytes and shorts.
 
10048
 
 
10049
- urllib: Improved handling of win32 proxy settings. Fixed quote and
 
10050
  quote_plus functions so that the always encode a comma.
 
10051
 
 
10052
- Tkinter: Image objects are now guaranteed to have unique ids.  Set
 
10053
  event.delta to zero if Tk version doesn't support mousewheel.
 
10054
  Removed some debugging prints.
 
10055
 
 
10056
- UserList: now implements __contains__().
 
10057
 
 
10058
- webbrowser: On Windows, use os.startfile() instead of os.popen(),
 
10059
  which works around a bug in Norton AntiVirus 2000 that leads directly
 
10060
  to a Blue Screen freeze.
 
10061
 
 
10062
- xml: New version detection code allows PyXML to override standard
 
10063
  XML package if PyXML version is greater than 0.6.1.
 
10064
 
 
10065
- xml.dom: DOM level 1 support for basic XML.  Includes xml.dom.minidom
 
10066
  (conventional DOM), and xml.dom.pulldom, which allows building the DOM
 
10067
  tree only for nodes which are sufficiently interesting to a specific
 
10068
  application.  Does not provide the HTML-specific extensions.  Still
 
10069
  undocumented.
 
10070
 
 
10071
- xml.sax: SAX 2 support for Python, including all the handler
 
10072
  interfaces needed to process XML 1.0 compliant XML.  Some
 
10073
  documentation is already available.
 
10074
 
 
10075
- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
 
10076
  packagized XML support.
 
10077
 
 
10078
 
 
10079
C API
 
10080
 
 
10081
- Add three new convenience functions for module initialization --
 
10082
  PyModule_AddObject(), PyModule_AddIntConstant(), and
 
10083
  PyModule_AddStringConstant().
 
10084
 
 
10085
- Cleaned up definition of NULL in C source code; all definitions were
 
10086
  removed and add #error to Python.h if NULL isn't defined after
 
10087
  #include of stdio.h.
 
10088
 
 
10089
- Py_PROTO() macros that were removed in 2.0b1 have been restored for
 
10090
  backwards compatibility (at the source level) with old extensions.
 
10091
 
 
10092
- A wrapper API was added for signal() and sigaction().  Instead of
 
10093
  either function, always use PyOS_getsig() to get a signal handler
 
10094
  and PyOS_setsig() to set one.  A new convenience typedef
 
10095
  PyOS_sighandler_t is defined for the type of signal handlers.
 
10096
 
 
10097
- Add PyString_AsStringAndSize() function that provides access to the
 
10098
  internal data buffer and size of a string object -- or the default
 
10099
  encoded version of a Unicode object.
 
10100
 
 
10101
- PyString_Size() and PyString_AsString() accept Unicode objects.
 
10102
 
 
10103
- The standard header <limits.h> is now included by Python.h (if it
 
10104
  exists).  INT_MAX and LONG_MAX will always be defined, even if
 
10105
  <limits.h> is not available.
 
10106
 
 
10107
- PyFloat_FromString takes a second argument, pend, that was
 
10108
  effectively useless.  It is now officially useless but preserved for
 
10109
  backwards compatibility.  If the pend argument is not NULL, *pend is
 
10110
  set to NULL.
 
10111
 
 
10112
- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
 
10113
  for the attribute name.  See note on getattr() above.
 
10114
 
 
10115
- A few bug fixes to argument processing for Unicode.
 
10116
  PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
 
10117
  PyArg_Parse() special cases "s#" for Unicode objects; it returns a
 
10118
  pointer to the default encoded string data instead of to the raw
 
10119
  UTF-16.
 
10120
 
 
10121
- Py_BuildValue accepts B format (for bgen-generated code).
 
10122
 
 
10123
 
 
10124
Internals
 
10125
 
 
10126
- On Unix, fix code for finding Python installation directory so that
 
10127
  it works when argv[0] is a relative path.
 
10128
 
 
10129
- Added a true unicode_internal_encode() function and fixed the
 
10130
  unicode_internal_decode function() to support Unicode objects directly
 
10131
  rather than by generating a copy of the object.
 
10132
 
 
10133
- Several of the internal Unicode tables are much smaller now, and
 
10134
  the source code should be much friendlier to weaker compilers.
 
10135
 
 
10136
- In the garbage collector: Fixed bug in collection of tuples.  Fixed
 
10137
  bug that caused some instances to be removed from the container set
 
10138
  while they were still live.  Fixed parsing in gc.set_debug() for
 
10139
  platforms where sizeof(long) > sizeof(int).
 
10140
 
 
10141
- Fixed refcount problem in instance deallocation that only occurred
 
10142
  when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
 
10143
 
 
10144
- On Windows, getpythonregpath is now protected against null data in
 
10145
  registry key.
 
10146
 
 
10147
- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
 
10148
  condition.
 
10149
 
 
10150
 
 
10151
Build and platform-specific issues
 
10152
 
 
10153
- Better support of GNU Pth via --with-pth configure option.
 
10154
 
 
10155
- Python/C API now properly exposed to dynamically-loaded extension
 
10156
  modules on Reliant UNIX.
 
10157
 
 
10158
- Changes for the benefit of SunOS 4.1.4 (really!).  mmapmodule.c:
 
10159
  Don't define MS_SYNC to be zero when it is undefined.  Added missing
 
10160
  prototypes in posixmodule.c.
 
10161
 
 
10162
- Improved support for HP-UX build.  Threads should now be correctly
 
10163
  configured (on HP-UX 10.20 and 11.00).
 
10164
 
 
10165
- Fix largefile support on older NetBSD systems and OpenBSD by adding
 
10166
  define for TELL64.
 
10167
 
 
10168
 
 
10169
Tools and other miscellany
 
10170
 
 
10171
- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
 
10172
 
 
10173
- freeze: The modulefinder now works with 2.0 opcodes.
 
10174
 
 
10175
- IDLE:
 
10176
  Move hackery of sys.argv until after the Tk instance has been
 
10177
  created, which allows the application-specific Tkinter
 
10178
  initialization to be executed if present; also pass an explicit
 
10179
  className parameter to the Tk() constructor.
 
10180
 
 
10181
 
 
10182
What's new in 2.0 beta 1?
 
10183
=========================
 
10184
 
 
10185
Source Incompatibilities
 
10186
------------------------
 
10187
 
 
10188
None.  Note that 1.6 introduced several incompatibilities with 1.5.2,
 
10189
such as single-argument append(), connect() and bind(), and changes to
 
10190
str(long) and repr(float).
 
10191
 
 
10192
 
 
10193
Binary Incompatibilities
 
10194
------------------------
 
10195
 
 
10196
- Third party extensions built for Python 1.5.x or 1.6 cannot be used
 
10197
with Python 2.0; these extensions will have to be rebuilt for Python
 
10198
2.0.
 
10199
 
 
10200
- On Windows, attempting to import a third party extension built for
 
10201
Python 1.5.x or 1.6 results in an immediate crash; there's not much we
 
10202
can do about this.  Check your PYTHONPATH environment variable!
 
10203
 
 
10204
- Python bytecode files (*.pyc and *.pyo) are not compatible between
 
10205
releases.
 
10206
 
 
10207
 
 
10208
Overview of Changes Since 1.6
 
10209
-----------------------------
 
10210
 
 
10211
There are many new modules (including brand new XML support through
 
10212
the xml package, and i18n support through the gettext module); a list
 
10213
of all new modules is included below.  Lots of bugs have been fixed.
 
10214
 
 
10215
The process for making major new changes to the language has changed
 
10216
since Python 1.6.  Enhancements must now be documented by a Python
 
10217
Enhancement Proposal (PEP) before they can be accepted.
 
10218
 
 
10219
There are several important syntax enhancements, described in more
 
10220
detail below:
 
10221
 
 
10222
  - Augmented assignment, e.g. x += 1
 
10223
 
 
10224
  - List comprehensions, e.g. [x**2 for x in range(10)]
 
10225
 
 
10226
  - Extended import statement, e.g. import Module as Name
 
10227
 
 
10228
  - Extended print statement, e.g. print >> file, "Hello"
 
10229
 
 
10230
Other important changes:
 
10231
 
 
10232
  - Optional collection of cyclical garbage
 
10233
 
 
10234
Python Enhancement Proposal (PEP)
 
10235
---------------------------------
 
10236
 
 
10237
PEP stands for Python Enhancement Proposal.  A PEP is a design
 
10238
document providing information to the Python community, or describing
 
10239
a new feature for Python.  The PEP should provide a concise technical
 
10240
specification of the feature and a rationale for the feature.
 
10241
 
 
10242
We intend PEPs to be the primary mechanisms for proposing new
 
10243
features, for collecting community input on an issue, and for
 
10244
documenting the design decisions that have gone into Python.  The PEP
 
10245
author is responsible for building consensus within the community and
 
10246
documenting dissenting opinions.
 
10247
 
 
10248
The PEPs are available at http://python.sourceforge.net/peps/.
 
10249
 
 
10250
Augmented Assignment
 
10251
--------------------
 
10252
 
 
10253
This must have been the most-requested feature of the past years!
 
10254
Eleven new assignment operators were added:
 
10255
 
 
10256
    += -= *= /= %= **= <<= >>= &= ^= |=
 
10257
 
 
10258
For example,
 
10259
 
 
10260
    A += B
 
10261
 
 
10262
is similar to
 
10263
 
 
10264
    A = A + B
 
10265
 
 
10266
except that A is evaluated only once (relevant when A is something
 
10267
like dict[index].attr).
 
10268
 
 
10269
However, if A is a mutable object, A may be modified in place.  Thus,
 
10270
if A is a number or a string, A += B has the same effect as A = A+B
 
10271
(except A is only evaluated once); but if a is a list, A += B has the
 
10272
same effect as A.extend(B)!
 
10273
 
 
10274
Classes and built-in object types can override the new operators in
 
10275
order to implement the in-place behavior; the not-in-place behavior is
 
10276
used automatically as a fallback when an object doesn't implement the
 
10277
in-place behavior.  For classes, the method name is derived from the
 
10278
method name for the corresponding not-in-place operator by inserting
 
10279
an 'i' in front of the name, e.g. __iadd__ implements in-place
 
10280
__add__.
 
10281
 
 
10282
Augmented assignment was implemented by Thomas Wouters.
 
10283
 
 
10284
 
 
10285
List Comprehensions
 
10286
-------------------
 
10287
 
 
10288
This is a flexible new notation for lists whose elements are computed
 
10289
from another list (or lists).  The simplest form is:
 
10290
 
 
10291
    [<expression> for <variable> in <sequence>]
 
10292
 
 
10293
For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
 
10294
This is more efficient than a for loop with a list.append() call.
 
10295
 
 
10296
You can also add a condition:
 
10297
 
 
10298
    [<expression> for <variable> in <sequence> if <condition>]
 
10299
 
 
10300
For example, [w for w in words if w == w.lower()] would yield the list
 
10301
of words that contain no uppercase characters.  This is more efficient
 
10302
than a for loop with an if statement and a list.append() call.
 
10303
 
 
10304
You can also have nested for loops and more than one 'if' clause.  For
 
10305
example, here's a function that flattens a sequence of sequences::
 
10306
 
 
10307
    def flatten(seq):
 
10308
        return [x for subseq in seq for x in subseq]
 
10309
 
 
10310
    flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
 
10311
 
 
10312
This prints
 
10313
 
 
10314
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 
10315
 
 
10316
List comprehensions originated as a patch set from Greg Ewing; Skip
 
10317
Montanaro and Thomas Wouters also contributed.  Described by PEP 202.
 
10318
 
 
10319
 
 
10320
Extended Import Statement
 
10321
-------------------------
 
10322
 
 
10323
Many people have asked for a way to import a module under a different
 
10324
name.  This can be accomplished like this:
 
10325
 
 
10326
    import foo
 
10327
    bar = foo
 
10328
    del foo
 
10329
 
 
10330
but this common idiom gets old quickly.  A simple extension of the
 
10331
import statement now allows this to be written as follows:
 
10332
 
 
10333
    import foo as bar
 
10334
 
 
10335
There's also a variant for 'from ... import':
 
10336
 
 
10337
    from foo import bar as spam
 
10338
 
 
10339
This also works with packages; e.g. you can write this:
 
10340
 
 
10341
    import test.regrtest as regrtest
 
10342
 
 
10343
Note that 'as' is not a new keyword -- it is recognized only in this
 
10344
context (this is only possible because the syntax for the import
 
10345
statement doesn't involve expressions).
 
10346
 
 
10347
Implemented by Thomas Wouters.  Described by PEP 221.
 
10348
 
 
10349
 
 
10350
Extended Print Statement
 
10351
------------------------
 
10352
 
 
10353
Easily the most controversial new feature, this extension to the print
 
10354
statement adds an option to make the output go to a different file
 
10355
than the default sys.stdout.
 
10356
 
 
10357
For example, to write an error message to sys.stderr, you can now
 
10358
write:
 
10359
 
 
10360
    print >> sys.stderr, "Error: bad dog!"
 
10361
 
 
10362
As a special feature, if the expression used to indicate the file
 
10363
evaluates to None, the current value of sys.stdout is used.  Thus:
 
10364
 
 
10365
    print >> None, "Hello world"
 
10366
 
 
10367
is equivalent to
 
10368
 
 
10369
    print "Hello world"
 
10370
 
 
10371
Design and implementation by Barry Warsaw.  Described by PEP 214.
 
10372
 
 
10373
 
 
10374
Optional Collection of Cyclical Garbage
 
10375
---------------------------------------
 
10376
 
 
10377
Python is now equipped with a garbage collector that can hunt down
 
10378
cyclical references between Python objects.  It's no replacement for
 
10379
reference counting; in fact, it depends on the reference counts being
 
10380
correct, and decides that a set of objects belong to a cycle if all
 
10381
their reference counts can be accounted for from their references to
 
10382
each other.  This devious scheme was first proposed by Eric Tiedemann,
 
10383
and brought to implementation by Neil Schemenauer.
 
10384
 
 
10385
There's a module "gc" that lets you control some parameters of the
 
10386
garbage collection.  There's also an option to the configure script
 
10387
that lets you enable or disable the garbage collection.  In 2.0b1,
 
10388
it's on by default, so that we (hopefully) can collect decent user
 
10389
experience with this new feature.  There are some questions about its
 
10390
performance.  If it proves to be too much of a problem, we'll turn it
 
10391
off by default in the final 2.0 release.
 
10392
 
 
10393
 
 
10394
Smaller Changes
 
10395
---------------
 
10396
 
 
10397
A new function zip() was added.  zip(seq1, seq2, ...) is equivalent to
 
10398
map(None, seq1, seq2, ...) when the sequences have the same length;
 
10399
i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)].  When
 
10400
the lists are not all the same length, the shortest list wins:
 
10401
zip([1,2,3], [10,20]) returns [(1,10), (2,20)].  See PEP 201.
 
10402
 
 
10403
sys.version_info is a tuple (major, minor, micro, level, serial).
 
10404
 
 
10405
Dictionaries have an odd new method, setdefault(key, default).
 
10406
dict.setdefault(key, default) returns dict[key] if it exists; if not,
 
10407
it sets dict[key] to default and returns that value.  Thus:
 
10408
 
 
10409
    dict.setdefault(key, []).append(item)
 
10410
 
 
10411
does the same work as this common idiom:
 
10412
 
 
10413
    if not dict.has_key(key):
 
10414
        dict[key] = []
 
10415
    dict[key].append(item)
 
10416
 
 
10417
There are two new variants of SyntaxError that are raised for
 
10418
indentation-related errors: IndentationError and TabError.
 
10419
 
 
10420
Changed \x to consume exactly two hex digits; see PEP 223.  Added \U
 
10421
escape that consumes exactly eight hex digits.
 
10422
 
 
10423
The limits on the size of expressions and file in Python source code
 
10424
have been raised from 2**16 to 2**32.  Previous versions of Python
 
10425
were limited because the maximum argument size the Python VM accepted
 
10426
was 2**16.  This limited the size of object constructor expressions,
 
10427
e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files.  This
 
10428
limit was raised thanks to a patch by Charles Waldman that effectively
 
10429
fixes the problem.  It is now much more likely that you will be
 
10430
limited by available memory than by an arbitrary limit in Python.
 
10431
 
 
10432
The interpreter's maximum recursion depth can be modified by Python
 
10433
programs using sys.getrecursionlimit and sys.setrecursionlimit.  This
 
10434
limit is the maximum number of recursive calls that can be made by
 
10435
Python code.  The limit exists to prevent infinite recursion from
 
10436
overflowing the C stack and causing a core dump.  The default value is
 
10437
1000.  The maximum safe value for a particular platform can be found
 
10438
by running Misc/find_recursionlimit.py.
 
10439
 
 
10440
New Modules and Packages
 
10441
------------------------
 
10442
 
 
10443
atexit - for registering functions to be called when Python exits.
 
10444
 
 
10445
imputil - Greg Stein's alternative API for writing custom import
 
10446
hooks.
 
10447
 
 
10448
pyexpat - an interface to the Expat XML parser, contributed by Paul
 
10449
Prescod.
 
10450
 
 
10451
xml - a new package with XML support code organized (so far) in three
 
10452
subpackages: xml.dom, xml.sax, and xml.parsers.  Describing these
 
10453
would fill a volume.  There's a special feature whereby a
 
10454
user-installed package named _xmlplus overrides the standard
 
10455
xmlpackage; this is intended to give the XML SIG a hook to distribute
 
10456
backwards-compatible updates to the standard xml package.
 
10457
 
 
10458
webbrowser - a platform-independent API to launch a web browser.
 
10459
 
 
10460
 
 
10461
Changed Modules
 
10462
---------------
 
10463
 
 
10464
array -- new methods for array objects: count, extend, index, pop, and
 
10465
remove
 
10466
 
 
10467
binascii -- new functions b2a_hex and a2b_hex that convert between
 
10468
binary data and its hex representation
 
10469
 
 
10470
calendar -- Many new functions that support features including control
 
10471
over which day of the week is the first day, returning strings instead
 
10472
of printing them.  Also new symbolic constants for days of week,
 
10473
e.g. MONDAY, ..., SUNDAY.
 
10474
 
 
10475
cgi -- FieldStorage objects have a getvalue method that works like a
 
10476
dictionary's get method and returns the value attribute of the object.
 
10477
 
 
10478
ConfigParser -- The parser object has new methods has_option,
 
10479
remove_section, remove_option, set, and write.  They allow the module
 
10480
to be used for writing config files as well as reading them.
 
10481
 
 
10482
ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
 
10483
optionally support the RFC 959 REST command.
 
10484
 
 
10485
gzip -- readline and readlines now accept optional size arguments
 
10486
 
 
10487
httplib -- New interfaces and support for HTTP/1.1 by Greg Stein.  See
 
10488
the module doc strings for details.
 
10489
 
 
10490
locale -- implement getdefaultlocale for Win32 and Macintosh
 
10491
 
 
10492
marshal -- no longer dumps core when marshaling deeply nested or
 
10493
recursive data structures
 
10494
 
 
10495
os -- new functions isatty, seteuid, setegid, setreuid, setregid
 
10496
 
 
10497
os/popen2 -- popen2/popen3/popen4 support under Windows.  popen2/popen3
 
10498
support under Unix.
 
10499
 
 
10500
os/pty -- support for openpty and forkpty
 
10501
 
 
10502
os.path -- fix semantics of os.path.commonprefix
 
10503
 
 
10504
smtplib -- support for sending very long messages
 
10505
 
 
10506
socket -- new function getfqdn()
 
10507
 
 
10508
readline -- new functions to read, write and truncate history files.
 
10509
The readline section of the library reference manual contains an
 
10510
example.
 
10511
 
 
10512
select -- add interface to poll system call
 
10513
 
 
10514
shutil -- new copyfileobj function
 
10515
 
 
10516
SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
 
10517
HTTP server.
 
10518
 
 
10519
Tkinter -- optimization of function flatten
 
10520
 
 
10521
urllib -- scans environment variables for proxy configuration,
 
10522
e.g. http_proxy.
 
10523
 
 
10524
whichdb -- recognizes dumbdbm format
 
10525
 
 
10526
 
 
10527
Obsolete Modules
 
10528
----------------
 
10529
 
 
10530
None.  However note that 1.6 made a whole slew of modules obsolete:
 
10531
stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
 
10532
poly, zmod, strop, util, whatsound.
 
10533
 
 
10534
 
 
10535
Changed, New, Obsolete Tools
 
10536
----------------------------
 
10537
 
 
10538
None.
 
10539
 
 
10540
 
 
10541
C-level Changes
 
10542
---------------
 
10543
 
 
10544
Several cleanup jobs were carried out throughout the source code.
 
10545
 
 
10546
All C code was converted to ANSI C; we got rid of all uses of the
 
10547
Py_PROTO() macro, which makes the header files a lot more readable.
 
10548
 
 
10549
Most of the portability hacks were moved to a new header file,
 
10550
pyport.h; several other new header files were added and some old
 
10551
header files were removed, in an attempt to create a more rational set
 
10552
of header files.  (Few of these ever need to be included explicitly;
 
10553
they are all included by Python.h.)
 
10554
 
 
10555
Trent Mick ensured portability to 64-bit platforms, under both Linux
 
10556
and Win64, especially for the new Intel Itanium processor.  Mick also
 
10557
added large file support for Linux64 and Win64.
 
10558
 
 
10559
The C APIs to return an object's size have been update to consistently
 
10560
use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size.  In
 
10561
previous versions, the abstract interfaces used PyXXX_Length and the
 
10562
concrete interfaces used PyXXX_Size.  The old names,
 
10563
e.g. PyObject_Length, are still available for backwards compatibility
 
10564
at the API level, but are deprecated.
 
10565
 
 
10566
The PyOS_CheckStack function has been implemented on Windows by
 
10567
Fredrik Lundh.  It prevents Python from failing with a stack overflow
 
10568
on Windows.
 
10569
 
 
10570
The GC changes resulted in creation of two new slots on object,
 
10571
tp_traverse and tp_clear.  The augmented assignment changes result in
 
10572
the creation of a new slot for each in-place operator.
 
10573
 
 
10574
The GC API creates new requirements for container types implemented in
 
10575
C extension modules.  See Include/objimpl.h for details.
 
10576
 
 
10577
PyErr_Format has been updated to automatically calculate the size of
 
10578
the buffer needed to hold the formatted result string.  This change
 
10579
prevents crashes caused by programmer error.
 
10580
 
 
10581
New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
 
10582
 
 
10583
PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
 
10584
that are the same as their non-Ex counterparts except they take an
 
10585
extra flag argument that tells them to close the file when done.
 
10586
 
 
10587
XXX There were other API changes that should be fleshed out here.
 
10588
 
 
10589
 
 
10590
Windows Changes
 
10591
---------------
 
10592
 
 
10593
New popen2/popen3/peopen4 in os module (see Changed Modules above).
 
10594
 
 
10595
os.popen is much more usable on Windows 95 and 98.  See Microsoft
 
10596
Knowledge Base article Q150956.  The Win9x workaround described there
 
10597
is implemented by the new w9xpopen.exe helper in the root of your
 
10598
Python installation.  Note that Python uses this internally; it is not
 
10599
a standalone program.
 
10600
 
 
10601
Administrator privileges are no longer required to install Python
 
10602
on Windows NT or Windows 2000.  If you have administrator privileges,
 
10603
Python's registry info will be written under HKEY_LOCAL_MACHINE.
 
10604
Otherwise the installer backs off to writing Python's registry info
 
10605
under HKEY_CURRENT_USER.  The latter is sufficient for all "normal"
 
10606
uses of Python, but will prevent some advanced uses from working
 
10607
(for example, running a Python script as an NT service, or possibly
 
10608
from CGI).
 
10609
 
 
10610
[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
 
10611
installer; instead, it installs the needed Tcl/Tk files directly in the
 
10612
Python directory.  If you already have a Tcl/Tk installation, this
 
10613
wastes some disk space (about 4 Megs) but avoids problems with
 
10614
conflicting Tcl/Tk installations, and makes it much easier for Python
 
10615
to ensure that Tcl/Tk can find all its files.
 
10616
 
 
10617
[This was new in 1.6] The Windows installer now installs by default in
 
10618
\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
 
10619
 
 
10620
 
 
10621
Updates to the changes between 1.5.2 and 1.6
 
10622
--------------------------------------------
 
10623
 
 
10624
The 1.6 NEWS file can't be changed after the release is done, so here
 
10625
is some late-breaking news:
 
10626
 
 
10627
New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
 
10628
and changes to getlocale() and setlocale().
 
10629
 
 
10630
The new module is now enabled per default.
 
10631
 
 
10632
It is not true that the encodings codecs cannot be used for normal
 
10633
strings: the string.encode() (which is also present on 8-bit strings
 
10634
!) allows using them for 8-bit strings too, e.g. to convert files from
 
10635
cp1252 (Windows) to latin-1 or vice-versa.
 
10636
 
 
10637
Japanese codecs are available from Tamito KAJIYAMA:
 
10638
http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
 
10639
 
 
10640
 
 
10641
======================================================================
 
10642
 
 
10643
 
 
10644
=======================================
 
10645
==> Release 1.6 (September 5, 2000) <==
 
10646
=======================================
 
10647
 
 
10648
What's new in release 1.6?
 
10649
==========================
 
10650
 
 
10651
Below is a list of all relevant changes since release 1.5.2.
 
10652
 
 
10653
 
 
10654
Source Incompatibilities
 
10655
------------------------
 
10656
 
 
10657
Several small incompatible library changes may trip you up:
 
10658
 
 
10659
  - The append() method for lists can no longer be invoked with more
 
10660
  than one argument.  This used to append a single tuple made out of
 
10661
  all arguments, but was undocumented.  To append a tuple, use
 
10662
  e.g. l.append((a, b, c)).
 
10663
 
 
10664
  - The connect(), connect_ex() and bind() methods for sockets require
 
10665
  exactly one argument.  Previously, you could call s.connect(host,
 
10666
  port), but this was undocumented. You must now write
 
10667
  s.connect((host, port)).
 
10668
 
 
10669
  - The str() and repr() functions are now different more often.  For
 
10670
  long integers, str() no longer appends a 'L'.  Thus, str(1L) == '1',
 
10671
  which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
 
10672
  For floats, repr() now gives 17 digits of precision, to ensure no
 
10673
  precision is lost (on all current hardware).
 
10674
 
 
10675
  - The -X option is gone.  Built-in exceptions are now always
 
10676
  classes.  Many more library modules also have been converted to
 
10677
  class-based exceptions.
 
10678
 
 
10679
 
 
10680
Binary Incompatibilities
 
10681
------------------------
 
10682
 
 
10683
- Third party extensions built for Python 1.5.x cannot be used with
 
10684
Python 1.6; these extensions will have to be rebuilt for Python 1.6.
 
10685
 
 
10686
- On Windows, attempting to import a third party extension built for
 
10687
Python 1.5.x results in an immediate crash; there's not much we can do
 
10688
about this.  Check your PYTHONPATH environment variable!
 
10689
 
 
10690
 
 
10691
Overview of Changes since 1.5.2
 
10692
-------------------------------
 
10693
 
 
10694
For this overview, I have borrowed from the document "What's New in
 
10695
Python 2.0" by Andrew Kuchling and Moshe Zadka:
 
10696
http://www.amk.ca/python/2.0/ .
 
10697
 
 
10698
There are lots of new modules and lots of bugs have been fixed.  A
 
10699
list of all new modules is included below.
 
10700
 
 
10701
Probably the most pervasive change is the addition of Unicode support.
 
10702
We've added a new fundamental datatype, the Unicode string, a new
 
10703
build-in function unicode(), an numerous C APIs to deal with Unicode
 
10704
and encodings.  See the file Misc/unicode.txt for details, or
 
10705
http://starship.python.net/crew/lemburg/unicode-proposal.txt.
 
10706
 
 
10707
Two other big changes, related to the Unicode support, are the
 
10708
addition of string methods and (yet another) new regular expression
 
10709
engine.
 
10710
 
 
10711
  - String methods mean that you can now say s.lower() etc. instead of
 
10712
  importing the string module and saying string.lower(s) etc.  One
 
10713
  peculiarity is that the equivalent of string.join(sequence,
 
10714
  delimiter) is delimiter.join(sequence).  Use " ".join(sequence) for
 
10715
  the effect of string.join(sequence); to make this more readable, try
 
10716
  space=" " first.  Note that the maxsplit argument defaults in
 
10717
  split() and replace() have changed from 0 to -1.
 
10718
 
 
10719
  - The new regular expression engine, SRE by Fredrik Lundh, is fully
 
10720
  backwards compatible with the old engine, and is in fact invoked
 
10721
  using the same interface (the "re" module).  You can explicitly
 
10722
  invoke the old engine by import pre, or the SRE engine by importing
 
10723
  sre.  SRE is faster than pre, and supports Unicode (which was the
 
10724
  main reason to put effort in yet another new regular expression
 
10725
  engine -- this is at least the fourth!).
 
10726
 
 
10727
 
 
10728
Other Changes
 
10729
-------------
 
10730
 
 
10731
Other changes that won't break code but are nice to know about:
 
10732
 
 
10733
Deleting objects is now safe even for deeply nested data structures.
 
10734
 
 
10735
Long/int unifications: long integers can be used in seek() calls, as
 
10736
slice indexes.
 
10737
 
 
10738
String formatting (s % args) has a new formatting option, '%r', which
 
10739
acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
 
10740
alpha 1.)
 
10741
 
 
10742
Greg Ward's "distutils" package is included: this will make
 
10743
installing, building and distributing third party packages much
 
10744
simpler.
 
10745
 
 
10746
There's now special syntax that you can use instead of the apply()
 
10747
function.  f(*args, **kwds) is equivalent to apply(f, args, kwds).
 
10748
You can also use variations f(a1, a2, *args, **kwds) and you can leave
 
10749
one or the other out: f(*args), f(**kwds).
 
10750
 
 
10751
The built-ins int() and long() take an optional second argument to
 
10752
indicate the conversion base -- of course only if the first argument
 
10753
is a string.  This makes string.atoi() and string.atol() obsolete.
 
10754
(string.atof() was already obsolete).
 
10755
 
 
10756
When a local variable is known to the compiler but undefined when
 
10757
used, a new exception UnboundLocalError is raised.  This is a class
 
10758
derived from NameError so code catching NameError should still work.
 
10759
The purpose is to provide better diagnostics in the following example:
 
10760
  x = 1
 
10761
  def f():
 
10762
      print x
 
10763
      x = x+1
 
10764
This used to raise a NameError on the print statement, which confused
 
10765
even experienced Python programmers (especially if there are several
 
10766
hundreds of lines of code between the reference and the assignment to
 
10767
x :-).
 
10768
 
 
10769
You can now override the 'in' operator by defining a __contains__
 
10770
method.  Note that it has its arguments backwards: x in a causes
 
10771
a.__contains__(x) to be called.  That's why the name isn't __in__.
 
10772
 
 
10773
The exception AttributeError will have a more friendly error message,
 
10774
e.g.: <code>'Spam' instance has no attribute 'eggs'</code>.  This may
 
10775
<b>break code</b> that expects the message to be exactly the attribute
 
10776
name.
 
10777
 
 
10778
 
 
10779
New Modules in 1.6
 
10780
------------------
 
10781
 
 
10782
UserString - base class for deriving from the string type.
 
10783
 
 
10784
distutils - tools for distributing Python modules.
 
10785
 
 
10786
robotparser - parse a robots.txt file, for writing web spiders.
 
10787
(Moved from Tools/webchecker/.)
 
10788
 
 
10789
linuxaudiodev - audio for Linux.
 
10790
 
 
10791
mmap - treat a file as a memory buffer.  (Windows and Unix.)
 
10792
 
 
10793
sre - regular expressions (fast, supports unicode).  Currently, this
 
10794
code is very rough.  Eventually, the re module will be reimplemented
 
10795
using sre (without changes to the re API).
 
10796
 
 
10797
filecmp - supersedes the old cmp.py and dircmp.py modules.
 
10798
 
 
10799
tabnanny - check Python sources for tab-width dependance.  (Moved from
 
10800
Tools/scripts/.)
 
10801
 
 
10802
urllib2 - new and improved but incompatible version of urllib (still
 
10803
experimental).
 
10804
 
 
10805
zipfile - read and write zip archives.
 
10806
 
 
10807
codecs - support for Unicode encoders/decoders.
 
10808
 
 
10809
unicodedata - provides access to the Unicode 3.0 database.
 
10810
 
 
10811
_winreg - Windows registry access.
 
10812
 
 
10813
encodings - package which provides a large set of standard codecs --
 
10814
currently only for the new Unicode support. It has a drop-in extension
 
10815
mechanism which allows you to add new codecs by simply copying them
 
10816
into the encodings package directory. Asian codec support will
 
10817
probably be made available as separate distribution package built upon
 
10818
this technique and the new distutils package.
 
10819
 
 
10820
 
 
10821
Changed Modules
 
10822
---------------
 
10823
 
 
10824
readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
 
10825
chunk, wave, random, shelve, nntplib - minor enhancements.
 
10826
 
 
10827
socket, httplib, urllib - optional OpenSSL support (Unix only).
 
10828
 
 
10829
_tkinter - support for 8.0 up to 8.3.  Support for versions older than
 
10830
8.0 has been dropped.
 
10831
 
 
10832
string - most of this module is deprecated now that strings have
 
10833
methods.  This no longer uses the built-in strop module, but takes
 
10834
advantage of the new string methods to provide transparent support for
 
10835
both Unicode and ordinary strings.
 
10836
 
 
10837
 
 
10838
Changes on Windows
 
10839
------------------
 
10840
 
 
10841
The installer no longer runs a separate Tcl/Tk installer; instead, it
 
10842
installs the needed Tcl/Tk files directly in the Python directory.  If
 
10843
you already have a Tcl/Tk installation, this wastes some disk space
 
10844
(about 4 Megs) but avoids problems with conflincting Tcl/Tk
 
10845
installations, and makes it much easier for Python to ensure that
 
10846
Tcl/Tk can find all its files.  Note: the alpha installers don't
 
10847
include the documentation.
 
10848
 
 
10849
The Windows installer now installs by default in \Python16\ on the
 
10850
default volume, instead of \Program Files\Python-1.6\.
 
10851
 
 
10852
 
 
10853
Changed Tools
 
10854
-------------
 
10855
 
 
10856
IDLE - complete overhaul.  See the <a href="../idle/">IDLE home
 
10857
page</a> for more information.  (Python 1.6 alpha 1 will come with
 
10858
IDLE 0.6.)
 
10859
 
 
10860
Tools/i18n/pygettext.py - Python equivalent of xgettext(1).  A message
 
10861
text extraction tool used for internationalizing applications written
 
10862
in Python.
 
10863
 
 
10864
 
 
10865
Obsolete Modules
 
10866
----------------
 
10867
 
 
10868
stdwin and everything that uses it.  (Get Python 1.5.2 if you need
 
10869
it. :-)
 
10870
 
 
10871
soundex.  (Skip Montanaro has a version in Python but it won't be
 
10872
included in the Python release.)
 
10873
 
 
10874
cmp, cmpcache, dircmp.  (Replaced by filecmp.)
 
10875
 
 
10876
dump.  (Use pickle.)
 
10877
 
 
10878
find.  (Easily coded using os.walk().)
 
10879
 
 
10880
grep.  (Not very useful as a library module.)
 
10881
 
 
10882
packmail.  (No longer has any use.)
 
10883
 
 
10884
poly, zmod.  (These were poor examples at best.)
 
10885
 
 
10886
strop.  (No longer needed by the string module.)
 
10887
 
 
10888
util.  (This functionality was long ago built in elsewhere).
 
10889
 
 
10890
whatsound.  (Use sndhdr.)
 
10891
 
 
10892
 
 
10893
Detailed Changes from 1.6b1 to 1.6
 
10894
----------------------------------
 
10895
 
 
10896
- Slight changes to the CNRI license.  A copyright notice has been
 
10897
added; the requirement to indicate the nature of modifications now
 
10898
applies when making a derivative work available "to others" instead of
 
10899
just "to the public"; the version and date are updated.  The new
 
10900
license has a new handle.
 
10901
 
 
10902
- Added the Tools/compiler package.  This is a project led by Jeremy
 
10903
Hylton to write the Python bytecode generator in Python.
 
10904
 
 
10905
- The function math.rint() is removed.
 
10906
 
 
10907
- In Python.h, "#define _GNU_SOURCE 1" was added.
 
10908
 
 
10909
- Version 0.9.1 of Greg Ward's distutils is included (instead of
 
10910
version 0.9).
 
10911
 
 
10912
- A new version of SRE is included.  It is more stable, and more
 
10913
compatible with the old RE module.  Non-matching ranges are indicated
 
10914
by -1, not None.  (The documentation said None, but the PRE
 
10915
implementation used -1; changing to None would break existing code.)
 
10916
 
 
10917
- The winreg module has been renamed to _winreg.  (There are plans for
 
10918
a higher-level API called winreg, but this has not yet materialized in
 
10919
a form that is acceptable to the experts.)
 
10920
 
 
10921
- The _locale module is enabled by default.
 
10922
 
 
10923
- Fixed the configuration line for the _curses module.
 
10924
 
 
10925
- A few crashes have been fixed, notably <file>.writelines() with a
 
10926
list containing non-string objects would crash, and there were
 
10927
situations where a lost SyntaxError could dump core.
 
10928
 
 
10929
- The <list>.extend() method now accepts an arbitrary sequence
 
10930
argument.
 
10931
 
 
10932
- If __str__() or __repr__() returns a Unicode object, this is
 
10933
converted to an 8-bit string.
 
10934
 
 
10935
- Unicode string comparisons is no longer aware of UTF-16
 
10936
encoding peculiarities; it's a straight 16-bit compare.
 
10937
 
 
10938
- The Windows installer now installs the LICENSE file and no longer
 
10939
registers the Python DLL version in the registry (this is no longer
 
10940
needed).  It now uses Tcl/Tk 8.3.2.
 
10941
 
 
10942
- A few portability problems have been fixed, in particular a
 
10943
compilation error involving socklen_t.
 
10944
 
 
10945
- The PC configuration is slightly friendlier to non-Microsoft
 
10946
compilers.
 
10947
 
 
10948
 
 
10949
======================================================================
 
10950
 
 
10951
 
 
10952
======================================
 
10953
==> Release 1.5.2 (April 13, 1999) <==
 
10954
======================================
 
10955
 
 
10956
From 1.5.2c1 to 1.5.2 (final)
 
10957
=============================
 
10958
 
 
10959
Tue Apr 13 15:44:49 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
10960
 
 
10961
        * PCbuild/python15.wse: Bump version to 1.5.2 (final)
 
10962
 
 
10963
        * PCbuild/python15.dsp: Added shamodule.c
 
10964
 
 
10965
        * PC/config.c: Added sha module!
 
10966
 
 
10967
        * README, Include/patchlevel.h: Prepare for final release.
 
10968
 
 
10969
        * Misc/ACKS:
 
10970
        More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
 
10971
 
 
10972
        * Python/thread_solaris.h:
 
10973
        While I can't really test this thoroughly, Pat Knight and the Solaris
 
10974
        man pages suggest that the proper thing to do is to add THR_NEW_LWP to
 
10975
        the flags on thr_create(), and that there really isn't a downside, so
 
10976
        I'll do that.
 
10977
 
 
10978
        * Misc/ACKS:
 
10979
        Bunch of new names who helped iron out the last wrinkles of 1.5.2.
 
10980
 
 
10981
        * PC/python_nt.rc:
 
10982
        Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
 
10983
        (I can't even display this on NT, maybe Win/98 can?)
 
10984
 
 
10985
        * Lib/pstats.py:
 
10986
        Fix mysterious references to jprofile that were in the source since
 
10987
        its creation.  I'm assuming these were once valid references to "Jim
 
10988
        Roskind's profile"...
 
10989
 
 
10990
        * Lib/Attic/threading_api.py:
 
10991
        Removed; since long subsumed in Doc/lib/libthreading.tex
 
10992
 
 
10993
        * Modules/socketmodule.c:
 
10994
        Put back __osf__ support for gethostbyname_r(); the real bug was that
 
10995
        it was being used even without threads.  This of course might be an
 
10996
        all-platform problem so now we only use the _r variant when we are
 
10997
        using threads.
 
10998
 
 
10999
Mon Apr 12 22:51:20 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11000
 
 
11001
        * Modules/cPickle.c:
 
11002
        Fix accidentally reversed NULL test in load_mark().  Suggested by
 
11003
        Tamito Kajiyama.  (This caused a bug only on platforms where malloc(0)
 
11004
        returns NULL.)
 
11005
 
 
11006
        * README:
 
11007
        Add note about popen2 problem on Linux noticed by Pablo Bleyer.
 
11008
 
 
11009
        * README: Add note about -D_REENTRANT for HP-UX 10.20.
 
11010
 
 
11011
        * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
 
11012
 
 
11013
        * PC/Attic/vc40.mak, PC/readme.txt:
 
11014
        Remove all VC++ info (except VC 1.5) from readme.txt;
 
11015
        remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
 
11016
 
 
11017
        * README: Clarify PC build instructions (point to PCbuild).
 
11018
 
 
11019
        * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
 
11020
 
 
11021
        * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
 
11022
        Forgot to add this file.  CDROM device parameters.
 
11023
 
 
11024
        * Lib/gzip.py: Two different changes.
 
11025
 
 
11026
        1. Jack Jansen reports that on the Mac, the time may be negative, and
 
11027
        solves this by adding a write32u() function that writes an unsigned
 
11028
        long.
 
11029
 
 
11030
        2. On 64-bit platforms the CRC comparison fails; I've fixed this by
 
11031
        casting both values to be compared to "unsigned long" i.e. modulo
 
11032
        0x100000000L.
 
11033
 
 
11034
Sat Apr 10 18:42:02 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11035
 
 
11036
        * PC/Attic/_tkinter.def: No longer needed.
 
11037
 
 
11038
        * Misc/ACKS: Correct missed character in Andrew Dalke's name.
 
11039
 
 
11040
        * README: Add DEC Ultrix notes (from Donn Cave's email).
 
11041
 
 
11042
        * configure: The usual
 
11043
 
 
11044
        * configure.in:
 
11045
        Quote a bunch of shell variables used in test, related to long-long.
 
11046
 
 
11047
        * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
 
11048
        casts for picky compilers.
 
11049
 
 
11050
        * Modules/socketmodule.c:
 
11051
        3-arg gethostbyname_r doesn't really work on OSF/1.
 
11052
 
 
11053
        * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
 
11054
        Avoid totally empty files.
 
11055
 
 
11056
Fri Apr  9 14:56:35 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11057
 
 
11058
        * Tools/scripts/fixps.py: Use re instead of regex.
 
11059
        Don't rewrite the file in place.
 
11060
        (Reported by Andy Dustman.)
 
11061
 
 
11062
        * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
 
11063
 
 
11064
Thu Apr  8 23:13:37 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11065
 
 
11066
        * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
 
11067
        Add a variable %_TCL_% that makes it easier to switch to a different version.
 
11068
 
 
11069
 
 
11070
======================================================================
 
11071
 
 
11072
 
 
11073
From 1.5.2b2 to 1.5.2c1
 
11074
=======================
 
11075
 
 
11076
Thu Apr  8 23:13:37 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11077
 
 
11078
        * PCbuild/python15.wse:
 
11079
        Release 1.5.2c1.  Add IDLE and Uninstall to program group.
 
11080
        Don't distribute zlib.dll.  Tweak some comments.
 
11081
 
 
11082
        * PCbuild/zlib.dsp: Now using static zlib 1.1.3
 
11083
 
 
11084
        * Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
 
11085
        The usual
 
11086
 
 
11087
        * Include/patchlevel.h: Release 1.5.2c1
 
11088
 
 
11089
        * README: Release 1.5.2c1.
 
11090
 
 
11091
        * Misc/NEWS: News for the 1.5.2c1 release.
 
11092
 
 
11093
        * Lib/test/test_strftime.py:
 
11094
        On Windows, we suddenly find, strftime() may return "" for an
 
11095
        unsupported format string.  (I guess this is because the logic for
 
11096
        deciding whether to reallocate the buffer or not has been improved.)
 
11097
        This caused the test code to crash on result[0].  Fix this by assuming
 
11098
        an empty result also means the format is not supported.
 
11099
 
 
11100
        * Demo/tkinter/matt/window-creation-w-location.py:
 
11101
        This demo imported some private code from Matt.  Make it cripple along.
 
11102
 
 
11103
        * Lib/lib-tk/Tkinter.py:
 
11104
        Delete an accidentally checked-in feature that actually broke more
 
11105
        than was worth it: when deleting a canvas item, it would try to
 
11106
        automatically delete the bindings for that item.  Since there's
 
11107
        nothing that says you can't reuse the tag and still have the bindings,
 
11108
        this is not correct.  Also, it broke at least one demo
 
11109
        (Demo/tkinter/matt/rubber-band-box-demo-1.py).
 
11110
 
 
11111
        * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
 
11112
 
 
11113
Wed Apr  7 20:23:17 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11114
 
 
11115
        * Modules/zlibmodule.c:
 
11116
        Patch by Andrew Kuchling to unflush() (flush() for deflating).
 
11117
        Without this, if inflate() returned Z_BUF_ERROR asking for more output
 
11118
        space, we would report the error; now, we increase the buffer size and
 
11119
        try again, just as for Z_OK.
 
11120
 
 
11121
        * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
 
11122
 
 
11123
        * Tools/idle/ChangeLog: New change log.
 
11124
 
 
11125
        * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
 
11126
 
 
11127
        * Python/pythonrun.c:
 
11128
        Alas, get rid of the Win specific hack to ask the user to press Return
 
11129
        before exiting when an error happened.  This didn't work right when
 
11130
        Python is invoked from a daemon.
 
11131
 
 
11132
        * Tools/idle/idlever.py: Version bump awaiting impending new release.
 
11133
        (Not much has changed :-( )
 
11134
 
 
11135
        * Lib/lib-tk/Tkinter.py:
 
11136
        lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
 
11137
        so the preferred name for them is tag_lower, tag_raise
 
11138
        (similar to tag_bind, and similar to the Text widget);
 
11139
        unfortunately can't delete the old ones yet (maybe in 1.6)
 
11140
 
 
11141
        * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
 
11142
        Changes by Mark Hammond for Windows CE.  Mostly of the form
 
11143
          #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
 
11144
 
 
11145
        * Python/bltinmodule.c:
 
11146
        Remove unused variable from complex_from_string() code.
 
11147
 
 
11148
        * Include/patchlevel.h:
 
11149
        Add the possibility of a gamma release (release candidate).
 
11150
        Add '+' to string version number to indicate we're beyond b2 now.
 
11151
 
 
11152
        * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
 
11153
 
 
11154
        * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
 
11155
 
 
11156
        Per writes:
 
11157
 
 
11158
        """
 
11159
        The application where Signum Support uses smtplib needs to be able to
 
11160
        report good error messages to the user when sending email fails.  To
 
11161
        help in diagnosing problems it is useful to be able to report the
 
11162
        entire message sent by the server, not only the SMTP error code of the
 
11163
        offending command.
 
11164
 
 
11165
        A lot of the functions in sendmail.py unfortunately discards the
 
11166
        message, leaving only the code.  The enclosed patch fixes that
 
11167
        problem.
 
11168
 
 
11169
        The enclosed patch also introduces a base class for exceptions that
 
11170
        include an SMTP error code and error message, and make the code and
 
11171
        message available on separate attributes, so that surrounding code can
 
11172
        deal with them in whatever way it sees fit.  I've also added some
 
11173
        documentation to the exception classes.
 
11174
 
 
11175
        The constructor will now raise an exception if it cannot connect to
 
11176
        the SMTP server.
 
11177
 
 
11178
        The data() method will raise an SMTPDataError if it doesn't receive
 
11179
        the expected 354 code in the middle of the exchange.
 
11180
 
 
11181
        According to section 5.2.10 of RFC 1123 a smtp client must accept "any
 
11182
        text, including no text at all" after the error code.  If the response
 
11183
        of a HELO command contains no text self.helo_resp will be set to the
 
11184
        empty string ("").  The patch fixes the test in the sendmail() method
 
11185
        so that helo_resp is tested against None; if it has the empty string
 
11186
        as value the sendmail() method would invoke the helo() method again.
 
11187
 
 
11188
        The code no longer accepts a -1 reply from the ehlo() method in
 
11189
        sendmail().
 
11190
 
 
11191
        [Text about removing SMTPRecipientsRefused deleted --GvR]
 
11192
        """
 
11193
 
 
11194
        and also:
 
11195
 
 
11196
        """
 
11197
        smtplib.py appends an extra blank line to the outgoing mail if the
 
11198
        `msg' argument to the sendmail method already contains a trailing
 
11199
        newline.  This patch should fix the problem.
 
11200
        """
 
11201
 
 
11202
        The Dragon writes:
 
11203
 
 
11204
        """
 
11205
                Mostly I just re-added the SMTPRecipientsRefused exception
 
11206
        (the exeption object now has the appropriate info in it ) [Per had
 
11207
        removed this in his patch --GvR] and tweaked the behavior of the
 
11208
        sendmail method whence it throws the newly added SMTPHeloException (it
 
11209
        was closing the connection, which it shouldn't.  whatever catches the
 
11210
        exception should do that. )
 
11211
 
 
11212
                I pondered the change of the return values to tuples all around,
 
11213
        and after some thinking I decided that regularizing the return values was
 
11214
        too much of the Right Thing (tm) to not do.
 
11215
 
 
11216
                My one concern is that code expecting an integer & getting a tuple
 
11217
        may fail silently.
 
11218
 
 
11219
        (i.e. if it's doing :
 
11220
 
 
11221
              x.somemethod() >= 400:
 
11222
        expecting an integer, the expression will always be true if it gets a
 
11223
        tuple instead. )
 
11224
 
 
11225
                However, most smtplib code I've seen only really uses the
 
11226
        sendmail() method, so this wouldn't bother it.  Usually code I've seen
 
11227
        that calls the other methods usually only calls helo() and ehlo() for
 
11228
        doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
 
11229
        and thus I would think not much code uses it yet.
 
11230
        """
 
11231
 
 
11232
Tue Apr  6 19:38:18 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11233
 
 
11234
        * Lib/test/test_ntpath.py:
 
11235
        Fix the tests now that splitdrive() no longer treats UNC paths special.
 
11236
        (Some tests converted to splitunc() tests.)
 
11237
 
 
11238
        * Lib/ntpath.py:
 
11239
        Withdraw the UNC support from splitdrive().  Instead, a new function
 
11240
        splitunc() parses UNC paths.  The contributor of the UNC parsing in
 
11241
        splitdrive() doesn't like it, but I haven't heard a good reason to
 
11242
        keep it, and it causes some problems.  (I think there's a
 
11243
        philosophical problem -- to me, the split*() functions are purely
 
11244
        syntactical, and the fact that \\foo is not a valid path doesn't mean
 
11245
        that it shouldn't be considered an absolute path.)
 
11246
 
 
11247
        Also (quite separately, but strangely related to the philosophical
 
11248
        issue above) fix abspath() so that if win32api exists, it doesn't fail
 
11249
        when the path doesn't actually exist -- if GetFullPathName() fails,
 
11250
        fall back on the old strategy (join with getcwd() if necessary, and
 
11251
        then use normpath()).
 
11252
 
 
11253
        * configure.in, configure, config.h.in, acconfig.h:
 
11254
        For BeOS PowerPC.  Chris Herborth.
 
11255
 
 
11256
Mon Apr  5 21:54:14 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11257
 
 
11258
        * Modules/timemodule.c:
 
11259
        Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
 
11260
        #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
 
11261
 
 
11262
        * Misc/ACKS:
 
11263
        Bunch of new contributors, including 9 who contributed to the Docs,
 
11264
        reported by Fred.
 
11265
 
 
11266
Mon Apr  5 18:37:59 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11267
 
 
11268
        * Lib/gzip.py:
 
11269
        Oops, missed mode parameter to open().
 
11270
 
 
11271
        * Lib/gzip.py:
 
11272
        Made the default mode 'rb' instead of 'r', for better cross-platform
 
11273
        support.  (Based on comment on the documentation by Bernhard Reiter
 
11274
        <bernhard@csd.uwm.edu>).
 
11275
 
 
11276
Fri Apr  2 22:18:25 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11277
 
 
11278
        * Tools/scripts/dutree.py:
 
11279
        For reasons I dare not explain, this script should always execute
 
11280
        main() when imported (in other words, it is not usable as a module).
 
11281
 
 
11282
Thu Apr  1 15:32:30 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11283
 
 
11284
        * Lib/test/test_cpickle.py: Jonathan Giddy write:
 
11285
 
 
11286
        In test_cpickle.py, the module os got imported, but the line to remove
 
11287
        the temp file has gone missing.
 
11288
 
 
11289
Tue Mar 30 20:17:31 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11290
 
 
11291
        * Lib/BaseHTTPServer.py: Per Cederqvist writes:
 
11292
 
 
11293
        If you send something like "PUT / HTTP/1.0" to something derived from
 
11294
        BaseHTTPServer that doesn't define do_PUT, you will get a response
 
11295
        that begins like this:
 
11296
 
 
11297
                HTTP/1.0 501 Unsupported method ('do_PUT')
 
11298
                Server: SimpleHTTP/0.3 Python/1.5
 
11299
                Date: Tue, 30 Mar 1999 18:53:53 GMT
 
11300
 
 
11301
        The server should complain about 'PUT' instead of 'do_PUT'.  This
 
11302
        patch should fix the problem.
 
11303
 
 
11304
Mon Mar 29 20:33:21 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11305
 
 
11306
        * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
 
11307
 
 
11308
        """
 
11309
         - It needlessly used the makefile() method for each response that is
 
11310
           read from the SMTP server.
 
11311
 
 
11312
         - If the remote SMTP server closes the connection unexpectedly the
 
11313
           code raised an IndexError.  It now raises an SMTPServerDisconnected
 
11314
           exception instead.
 
11315
 
 
11316
         - The code now checks that all lines in a multiline response actually
 
11317
           contains an error code.
 
11318
        """
 
11319
 
 
11320
        The Dragon approves.
 
11321
 
 
11322
Mon Mar 29 20:25:40 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11323
 
 
11324
        * Lib/compileall.py:
 
11325
        When run as a script, report failures in the exit code as well.
 
11326
        Patch largely based on changes by Andrew Dalke, as discussed in the
 
11327
        distutils-sig.
 
11328
 
 
11329
Mon Mar 29 20:23:41 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11330
 
 
11331
        * Lib/urllib.py:
 
11332
        Hack so that if a 302 or 301 redirect contains a relative URL, the
 
11333
        right thing "just happens" (basejoin() with old URL).
 
11334
 
 
11335
        * Modules/cPickle.c:
 
11336
        Protection against picling to/from closed (real) file.
 
11337
        The problem was reported by Moshe Zadka.
 
11338
 
 
11339
        * Lib/test/test_cpickle.py:
 
11340
        Test protection against picling to/from closed (real) file.
 
11341
 
 
11342
        * Modules/timemodule.c: Chris Lawrence writes:
 
11343
 
 
11344
        """
 
11345
        The GNU folks, in their infinite wisdom, have decided not to implement
 
11346
        altzone in libc6; this would not be horrible, except that timezone
 
11347
        (which is implemented) includes the current DST setting (i.e. timezone
 
11348
        for Central is 18000 in summer and 21600 in winter).  So Python's
 
11349
        timezone and altzone variables aren't set correctly during DST.
 
11350
 
 
11351
        Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
 
11352
        show the "right" thing on Linux (by using the tm_gmtoff stuff
 
11353
        available in BSD, which is how the GLIBC manual claims things should
 
11354
        be done) and (b) should cope with the southern hemisphere.  In pursuit
 
11355
        of (b), I also took the liberty of renaming the "summer" and "winter"
 
11356
        variables to "july" and "jan".  This patch should also make certain
 
11357
        time calculations on Linux actually work right (like the tz-aware
 
11358
        functions in the rfc822 module).
 
11359
 
 
11360
        (It's hard to find DST that's currently being used in the southern
 
11361
        hemisphere; I tested using Africa/Windhoek.)
 
11362
        """
 
11363
 
 
11364
        * Lib/test/output/test_gzip:
 
11365
        Jonathan Giddy discovered this file was missing.
 
11366
 
 
11367
        * Modules/shamodule.c:
 
11368
        Avoid warnings from AIX compiler.  Reported by Vladimir (AIX is my
 
11369
        middlename) Marangozov, patch coded by Greg Stein.
 
11370
 
 
11371
        * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
 
11372
        At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
 
11373
 
 
11374
Sun Mar 28 17:55:32 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11375
 
 
11376
        * Tools/scripts/ndiff.py: Tim Peters writes:
 
11377
 
 
11378
        I should have waited overnight <wink/sigh>.  Nothing wrong with the one I
 
11379
        sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
 
11380
        for recreating the original files from ndiff's output.  That's attached, if
 
11381
        you're game!  Us Windows guys don't usually have a sed sitting around
 
11382
        <wink>.
 
11383
 
 
11384
Sat Mar 27 13:34:01 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11385
 
 
11386
        * Tools/scripts/ndiff.py: Tim Peters writes:
 
11387
 
 
11388
        Attached is a cleaned-up version of ndiff (added useful module
 
11389
        docstring, now echo'ed in case of cmd line mistake); added -q option
 
11390
        to suppress initial file identification lines; + other minor cleanups,
 
11391
        & a slightly faster match engine.
 
11392
 
 
11393
Fri Mar 26 22:36:00 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11394
 
 
11395
        * Tools/scripts/dutree.py:
 
11396
        During display, if EPIPE is raised, it's probably because a pager was
 
11397
        killed.  Discard the error in that case, but propogate it otherwise.
 
11398
 
 
11399
Fri Mar 26 16:20:45 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11400
 
 
11401
        * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
 
11402
        Test suite for UserList.
 
11403
 
 
11404
        * Lib/UserList.py: Use isinstance() where appropriate.
 
11405
        Reformatted with 4-space indent.
 
11406
 
 
11407
Fri Mar 26 16:11:40 1999  Barry Warsaw  <bwarsaw@eric.cnri.reston.va.us>
 
11408
 
 
11409
        * Tools/pynche/PyncheWidget.py:
 
11410
        Helpwin.__init__(): The text widget should get focus.
 
11411
 
 
11412
        * Tools/pynche/pyColorChooser.py:
 
11413
        Removed unnecessary import `from PyncheWidget import PyncheWidget'
 
11414
 
 
11415
Fri Mar 26 15:32:05 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11416
 
 
11417
        * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
 
11418
        Test suite for UserDict
 
11419
 
 
11420
        * Lib/UserDict.py: Improved a bunch of things.
 
11421
        The constructor now takes an optional dictionary.
 
11422
        Use isinstance() where appropriate.
 
11423
 
 
11424
Thu Mar 25 22:38:49 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11425
 
 
11426
        * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
 
11427
        Basic regr tests for pickle/cPickle
 
11428
 
 
11429
        * Lib/pickle.py:
 
11430
        Don't use "exec" in find_class().  It's slow, unnecessary, and (as AMK
 
11431
        points out) it doesn't work in JPython Applets.
 
11432
 
 
11433
Thu Mar 25 21:50:27 1999  Andrew Kuchling  <akuchlin@eric.cnri.reston.va.us>
 
11434
 
 
11435
        * Lib/test/test_gzip.py:
 
11436
        Added a simple test suite for gzip.  It simply opens a temp file,
 
11437
        writes a chunk of compressed data, closes it, writes another chunk, and
 
11438
        reads the contents back to verify that they are the same.
 
11439
 
 
11440
        * Lib/gzip.py:
 
11441
        Based on a suggestion from bruce@hams.com, make a trivial change to
 
11442
        allow using the 'a' flag as a mode for opening a GzipFile.  gzip
 
11443
        files, surprisingly enough, can be concatenated and then decompressed;
 
11444
        the effect is to concatenate the two chunks of data.
 
11445
 
 
11446
        If we support it on writing, it should also be supported on reading.
 
11447
        This *wasn't* trivial, and required rearranging the code in the
 
11448
        reading path, particularly the _read() method.
 
11449
 
 
11450
        Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
 
11451
        and 'Unknown compression method'
 
11452
 
 
11453
Thu Mar 25 21:25:01 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11454
 
 
11455
        * Lib/test/test_b1.py:
 
11456
        Add tests for float() and complex() with string args (Nick/Stephanie
 
11457
        Lockwood).
 
11458
 
 
11459
Thu Mar 25 21:21:08 1999  Andrew Kuchling  <akuchlin@eric.cnri.reston.va.us>
 
11460
 
 
11461
        * Modules/zlibmodule.c:
 
11462
        Add an .unused_data attribute to decompressor objects.  If .unused_data
 
11463
        is not an empty string, this means that you have arrived at the
 
11464
        end of the stream of compressed data, and the contents of .unused_data are
 
11465
        whatever follows the compressed stream.
 
11466
 
 
11467
Thu Mar 25 21:16:07 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11468
 
 
11469
        * Python/bltinmodule.c:
 
11470
        Patch by Nick and Stephanie Lockwood to implement complex() with a string
 
11471
        argument.  This closes TODO item 2.19.
 
11472
 
 
11473
Wed Mar 24 19:09:00 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11474
 
 
11475
        * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
 
11476
        Unfortunately his code breaks wcgui.py in a way that's not easy
 
11477
        to fix.  I expect that this is a temporary situation --
 
11478
        eventually Sam's changes will be merged back in.
 
11479
        (The changes add a -t option to specify exceptions to the -x
 
11480
        option, and explicit checking for #foo style fragment ids.)
 
11481
 
 
11482
        * Objects/dictobject.c:
 
11483
        Vladimir Marangozov contributed updated comments.
 
11484
 
 
11485
        * Objects/bufferobject.c: Folded long lines.
 
11486
 
 
11487
        * Lib/test/output/test_sha, Lib/test/test_sha.py:
 
11488
        Added Jeremy's test code for the sha module.
 
11489
 
 
11490
        * Modules/shamodule.c, Modules/Setup.in:
 
11491
        Added Greg Stein and Andrew Kuchling's sha module.
 
11492
        Fix comments about zlib version and URL.
 
11493
 
 
11494
        * Lib/test/test_bsddb.py: Remove the temp file when we're done.
 
11495
 
 
11496
        * Include/pythread.h: Conform to standard boilerplate.
 
11497
 
 
11498
        * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
 
11499
        Chris Herborth: the new compiler in R4.1 needs some new options to work...
 
11500
 
 
11501
        * Modules/socketmodule.c:
 
11502
        Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
 
11503
        data struct before calling gethostby{name,addr}_r(); (2) ignore the
 
11504
        3/5/6 args determinations made by the configure script and switch on
 
11505
        platform identifiers instead:
 
11506
 
 
11507
        AIX, OSF have 3 args
 
11508
        Sun, SGI have 5 args
 
11509
        Linux has 6 args
 
11510
 
 
11511
        On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
 
11512
 
 
11513
        * Modules/socketmodule.c:
 
11514
        Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
 
11515
 
 
11516
        * Lib/mailbox.py:
 
11517
        Add readlines() to _Subfile class.  Not clear who would need it, but
 
11518
        Chris Lawrence sent me a broken version; this one is a tad simpler and
 
11519
        more conforming to the standard.
 
11520
 
 
11521
Tue Mar 23 23:05:34 1999  Jeremy Hylton  <jhylton@eric.cnri.reston.va.us>
 
11522
 
 
11523
        * Lib/gzip.py: use struct instead of bit-manipulate in Python
 
11524
 
 
11525
Tue Mar 23 19:00:55 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11526
 
 
11527
        * Modules/Makefile.pre.in:
 
11528
        Add $(EXE) to various occurrences of python so it will work on Cygwin
 
11529
        with egcs (after setting EXE=.exe).  Patch by Norman Vine.
 
11530
 
 
11531
        * configure, configure.in:
 
11532
        Ack!  It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
 
11533
 
 
11534
Mon Mar 22 22:25:39 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11535
 
 
11536
        * Include/thread.h:
 
11537
        Adding thread.h -- unused but for b/w compatibility.
 
11538
        As requested by Bill Janssen.
 
11539
 
 
11540
        * configure.in, configure:
 
11541
        Add code to test for all sorts of gethostbyname_r variants,
 
11542
        donated by David Arnold.
 
11543
 
 
11544
        * config.h.in, acconfig.h:
 
11545
        Add symbols for gethostbyname_r variants (sigh).
 
11546
 
 
11547
        * Modules/socketmodule.c: Clean up pass for the previous patches.
 
11548
 
 
11549
        - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
 
11550
        glibc2.
 
11551
 
 
11552
        - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
 
11553
        don't know what code should be used.
 
11554
 
 
11555
        - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
 
11556
 
 
11557
        - Modify the gethostbyaddr() code to also hold on to the lock until
 
11558
        after it is safe to release, overlapping with the Python lock.
 
11559
 
 
11560
        (Note: I think that it could in theory be possible that Python code
 
11561
        executed while gethostbyname_lock is held could attempt to reacquire
 
11562
        the lock -- e.g. in a signal handler or destructor.  I will simply say
 
11563
        "don't do that then.")
 
11564
 
 
11565
        * Modules/socketmodule.c: Jonathan Giddy writes:
 
11566
 
 
11567
        Here's a patch to fix the race condition, which wasn't fixed by Rob's
 
11568
        patch.  It holds the gethostbyname lock until the results are copied out,
 
11569
        which means that this lock and the Python global lock are held at the same
 
11570
        time.  This shouldn't be a problem as long as the gethostbyname lock is
 
11571
        always acquired when the global lock is not held.
 
11572
 
 
11573
Mon Mar 22 19:25:30 1999  Andrew Kuchling  <akuchlin@eric.cnri.reston.va.us>
 
11574
 
 
11575
        * Modules/zlibmodule.c:
 
11576
        Fixed the flush() method of compression objects; the test for
 
11577
            the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
 
11578
            Logic cleaned up and commented.
 
11579
 
 
11580
        * Lib/test/test_zlib.py:
 
11581
        Added simple test for the flush() method of compression objects, trying the
 
11582
            different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
 
11583
 
 
11584
Mon Mar 22 15:28:08 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11585
 
 
11586
        * Lib/shlex.py:
 
11587
        Bug reported by Tobias Thelen: missing "self." in assignment target.
 
11588
 
 
11589
Fri Mar 19 21:50:11 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11590
 
 
11591
        * Modules/arraymodule.c:
 
11592
        Use an unsigned cast to avoid a warning in VC++.
 
11593
 
 
11594
        * Lib/dospath.py, Lib/ntpath.py:
 
11595
        New code for split() by Tim Peters, behaves more like posixpath.split().
 
11596
 
 
11597
        * Objects/floatobject.c:
 
11598
        Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
 
11599
        a block cannot be freed, add its free items back to the free list.
 
11600
        This is necessary to avoid leaking when Python is reinitialized later.
 
11601
 
 
11602
        * Objects/intobject.c:
 
11603
        Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
 
11604
        a block cannot be freed, add its free items back to the free list, and
 
11605
        add its valid ints back to the small_ints array if they are in range.
 
11606
        This is necessary to avoid leaking when Python is reinitialized later.
 
11607
 
 
11608
        * Lib/types.py:
 
11609
        Added BufferType, the type returned by the new builtin buffer().  Greg Stein.
 
11610
 
 
11611
        * Python/bltinmodule.c:
 
11612
        New builtin buffer() creates a derived read-only buffer from any
 
11613
        object that supports the buffer interface (e.g. strings, arrays).
 
11614
 
 
11615
        * Objects/bufferobject.c:
 
11616
        Added check for negative offset for PyBuffer_FromObject and check for
 
11617
        negative size for PyBuffer_FromMemory.  Greg Stein.
 
11618
 
 
11619
Thu Mar 18 15:10:44 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11620
 
 
11621
        * Lib/urlparse.py: Sjoerd Mullender writes:
 
11622
 
 
11623
        If a filename on Windows starts with \\, it is converted to a URL
 
11624
        which starts with ////.  If this URL is passed to urlparse.urlparse
 
11625
        you get a path that starts with // (and an empty netloc).  If you pass
 
11626
        the result back to urlparse.urlunparse, you get a URL that starts with
 
11627
        //, which is parsed differently by urlparse.urlparse.  The fix is to
 
11628
        add the (empty) netloc with accompanying slashes if the path in
 
11629
        urlunparse starts with //.  Do this for all schemes that use a netloc.
 
11630
 
 
11631
        * Lib/nturl2path.py: Sjoerd Mullender writes:
 
11632
 
 
11633
        Pathnames of files on other hosts in the same domain
 
11634
        (\\host\path\to\file) are not translated correctly to URLs and back.
 
11635
        The URL should be something like file:////host/path/to/file.
 
11636
        Note that a combination of drive letter and remote host is not
 
11637
        possible.
 
11638
 
 
11639
Wed Mar 17 22:30:10 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11640
 
 
11641
        * Lib/urlparse.py:
 
11642
        Delete non-standard-conforming code in urljoin() that would use the
 
11643
        netloc from the base url as the default netloc for the resulting url
 
11644
        even if the schemes differ.
 
11645
 
 
11646
        Once upon a time, when the web was wild, this was a valuable hack
 
11647
        because some people had a URL referencing an ftp server colocated with
 
11648
        an http server without having the host in the ftp URL (so they could
 
11649
        replicate it or change the hostname easily).
 
11650
 
 
11651
        More recently, after the file: scheme got added back to the list of
 
11652
        schemes that accept a netloc, it turns out that this caused weirdness
 
11653
        when joining an http: URL with a file: URL -- the resulting file: URL
 
11654
        would always inherit the host from the http: URL because the file:
 
11655
        scheme supports a netloc but in practice never has one.
 
11656
 
 
11657
        There are two reasons to get rid of the old, once-valuable hack,
 
11658
        instead of removing the file: scheme from the uses_netloc list.  One,
 
11659
        the RFC says that file: uses the netloc syntax, and does not endorse
 
11660
        the old hack.  Two, neither netscape 4.5 nor IE 4.0 support the old
 
11661
        hack.
 
11662
 
 
11663
        * Include/ceval.h, Include/abstract.h:
 
11664
        Add DLL level b/w compat for PySequence_In and PyEval_CallObject
 
11665
 
 
11666
Tue Mar 16 21:54:50 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11667
 
 
11668
        * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
 
11669
 
 
11670
        An attempt to execute grid_slaves with arguments (0,0) results in
 
11671
        *all* of the slaves being returned, not just the slave associated with
 
11672
        row 0, column 0.  This is because the test for arguments in the method
 
11673
        does not test to see if row (and column) does not equal None, but
 
11674
        rather just whether is evaluates to non-false.  A value of 0 fails
 
11675
        this test.
 
11676
 
 
11677
Tue Mar 16 14:17:48 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11678
 
 
11679
        * Modules/cmathmodule.c:
 
11680
        Docstring fix:  acosh() returns the hyperbolic arccosine, not the
 
11681
        hyperbolic cosine.  Problem report via David Ascher by one of his
 
11682
        students.
 
11683
 
 
11684
Mon Mar 15 21:40:59 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11685
 
 
11686
        * configure.in:
 
11687
        Should test for gethost*by*name_r, not for gethostname_r (which
 
11688
        doesn't exist and doesn't make sense).
 
11689
 
 
11690
        * Modules/socketmodule.c:
 
11691
        Patch by Rob Riggs for Linux -- glibc2 has a different argument
 
11692
        converntion for gethostbyname_r() etc. than Solaris!
 
11693
 
 
11694
        * Python/thread_pthread.h: Rob Riggs wrote:
 
11695
 
 
11696
        """
 
11697
        Spec says that on success pthread_create returns 0. It does not say
 
11698
        that an error code will be < 0. Linux glibc2 pthread_create() returns
 
11699
        ENOMEM (12) when one exceed process limits. (It looks like it should
 
11700
        return EAGAIN, but that's another story.)
 
11701
 
 
11702
        For reference, see:
 
11703
        http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
 
11704
        """
 
11705
 
 
11706
        [I have a feeling that similar bugs were fixed before; perhaps someone
 
11707
        could check that all error checks no check for != 0?]
 
11708
 
 
11709
        * Tools/bgen/bgen/bgenObjectDefinition.py:
 
11710
        New mixin class that defines cmp and hash that use
 
11711
        the ob_itself pointer.  This allows (when using the mixin)
 
11712
        different Python objects pointing to the same C object and
 
11713
        behaving well as dictionary keys.
 
11714
 
 
11715
        Or so sez Jack Jansen...
 
11716
 
 
11717
        * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
 
11718
 
 
11719
        Don't convert URLs to URLs using pathname2url.
 
11720
 
 
11721
Fri Mar 12 22:15:43 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11722
 
 
11723
        * Lib/cmd.py: Patch by Michael Scharf.  He writes:
 
11724
 
 
11725
            The module cmd requires for each do_xxx command a help_xxx
 
11726
            function. I think this is a little old fashioned.
 
11727
 
 
11728
            Here is a patch: use the docstring as help if no help_xxx
 
11729
            function can be found.
 
11730
 
 
11731
        [I'm tempted to rip out all the help_* functions from pdb, but I'll
 
11732
        resist it.  Any takers?  --Guido]
 
11733
 
 
11734
        * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
 
11735
 
 
11736
           Under Windows, python freeze.py -o hello hello.py
 
11737
           creates all the correct files in the hello subdirectory, but the
 
11738
           Makefile has the directory prefix in it for frozen_extensions.c
 
11739
           nmake fails because it tries to locate hello/frozen_extensions.c
 
11740
 
 
11741
        (His fix adds a call to os.path.basename() in the appropriate place.)
 
11742
 
 
11743
        * Objects/floatobject.c, Objects/intobject.c:
 
11744
        Vladimir has restructured his code somewhat so that the blocks are now
 
11745
        represented by an explicit structure.  (There are still too many casts
 
11746
        in the code, but that may be unavoidable.)
 
11747
 
 
11748
        Also added code so that with -vv it is very chatty about what it does.
 
11749
 
 
11750
        * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
 
11751
        Change #! line to modern usage; also chmod +x
 
11752
 
 
11753
        * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
 
11754
        Change #! line to modern usage
 
11755
 
 
11756
        * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
 
11757
 
 
11758
        The filename to URL conversion didn't properly quote special
 
11759
        characters.
 
11760
        The URL to filename didn't properly unquote special chatacters.
 
11761
 
 
11762
        * Objects/floatobject.c:
 
11763
        OK, try again.  Vladimir gave me a fix for the alignment bus error,
 
11764
        so here's his patch again.  This time it works (at least on Solaris,
 
11765
        Linux and Irix).
 
11766
 
 
11767
Thu Mar 11 23:21:23 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11768
 
 
11769
        * Tools/idle/PathBrowser.py:
 
11770
        Don't crash when sys.path contains an empty string.
 
11771
 
 
11772
        * Tools/idle/PathBrowser.py:
 
11773
        - Don't crash in the case where a superclass is a string instead of a
 
11774
        pyclbr.Class object; this can happen when the superclass is
 
11775
        unrecognizable (to pyclbr), e.g. when module renaming is used.
 
11776
 
 
11777
        - Show a watch cursor when calling pyclbr (since it may take a while
 
11778
        recursively parsing imported modules!).
 
11779
 
 
11780
Thu Mar 11 16:04:04 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11781
 
 
11782
        * Lib/mimetypes.py:
 
11783
        Added .rdf and .xsl as application/xml types.  (.rdf is for the
 
11784
        Resource Description Framework, a metadata encoding, and .xsl is for
 
11785
        the Extensible Stylesheet Language.)
 
11786
 
 
11787
Thu Mar 11 13:26:23 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11788
 
 
11789
        * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
 
11790
        Test for popen2 module, by Chris Tismer.
 
11791
 
 
11792
        * Objects/floatobject.c:
 
11793
        Alas, Vladimir's patch caused a bus error (probably double
 
11794
        alignment?), and I didn't test it.  Withdrawing it for now.
 
11795
 
 
11796
Wed Mar 10 22:55:47 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11797
 
 
11798
        * Objects/floatobject.c:
 
11799
        Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
 
11800
        floats on finalization.
 
11801
 
 
11802
        * Objects/intobject.c:
 
11803
        Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
 
11804
        integers on finalization.
 
11805
 
 
11806
        * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
 
11807
        Add PathBrowser to File module
 
11808
 
 
11809
        * Tools/idle/PathBrowser.py:
 
11810
        "Path browser" - 4 scrolled lists displaying:
 
11811
            directories on sys.path
 
11812
            modules in selected directory
 
11813
            classes in selected module
 
11814
            methods of selected class
 
11815
 
 
11816
        Sinlge clicking in a directory, module or class item updates the next
 
11817
        column with info about the selected item.  Double clicking in a
 
11818
        module, class or method item opens the file (and selects the clicked
 
11819
        item if it is a class or method).
 
11820
 
 
11821
        I guess eventually I should be using a tree widget for this, but the
 
11822
        ones I've seen don't work well enough, so for now I use the old
 
11823
        Smalltalk or NeXT style multi-column hierarchical browser.
 
11824
 
 
11825
        * Tools/idle/MultiScrolledLists.py:
 
11826
        New utility: multiple scrolled lists in parallel
 
11827
 
 
11828
        * Tools/idle/ScrolledList.py: - White background.
 
11829
        - Display "(None)" (or text of your choosing) when empty.
 
11830
        - Don't set the focus.
 
11831
 
 
11832
Tue Mar  9 19:31:21 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11833
 
 
11834
        * Lib/urllib.py:
 
11835
        open_http also had the 'data is None' test backwards.  don't call with the
 
11836
        extra argument if data is None.
 
11837
 
 
11838
        * Demo/embed/demo.c:
 
11839
        Call Py_SetProgramName() instead of redefining getprogramname(),
 
11840
        reflecting changes in the runtime around 1.5 or earlier.
 
11841
 
 
11842
        * Python/ceval.c:
 
11843
        Always test for an error return (usually NULL or -1) without setting
 
11844
        an exception.
 
11845
 
 
11846
        * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
 
11847
        He writes:
 
11848
 
 
11849
        I had an off-by-1000 error in floatsleep(),
 
11850
        and the problem with time.clock() is that it's not implemented properly
 
11851
        on QNX... ANSI says it's supposed to return _CPU_ time used by the
 
11852
        process, but on QNX it returns the amount of real time used... so I was
 
11853
        confused.
 
11854
 
 
11855
        * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
 
11856
        Test for self.returntype behaving like OSErr rather than being it.
 
11857
 
 
11858
Thu Feb 25 16:14:58 1999  Jeremy Hylton  <jhylton@eric.cnri.reston.va.us>
 
11859
 
 
11860
        * Lib/urllib.py:
 
11861
        http_error had the 'data is None' test backwards.  don't call with the
 
11862
        extra argument if data is None.
 
11863
 
 
11864
        * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
 
11865
 
 
11866
        * Lib/urllib.py: pleasing the tabnanny
 
11867
 
 
11868
Thu Feb 25 14:26:02 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11869
 
 
11870
        * Lib/colorsys.py:
 
11871
        Oops, one more "x, y, z" to convert...
 
11872
 
 
11873
        * Lib/colorsys.py:
 
11874
        Adjusted comment at the top to be less confusing, following Fredrik
 
11875
        Lundh's example.
 
11876
 
 
11877
        Converted comment to docstring.
 
11878
 
 
11879
Wed Feb 24 18:49:15 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11880
 
 
11881
        * Lib/toaiff.py:
 
11882
        Use sndhdr instead of the obsolete whatsound module.
 
11883
 
 
11884
Wed Feb 24 18:42:38 1999  Jeremy Hylton  <jhylton@eric.cnri.reston.va.us>
 
11885
 
 
11886
        * Lib/urllib.py:
 
11887
        When performing a POST request, i.e. when the second argument to
 
11888
        urlopen is used to specify form data, make sure the second argument is
 
11889
        threaded through all of the http_error_NNN calls.  This allows error
 
11890
        handlers like the redirect and authorization handlers to properly
 
11891
        re-start the connection.
 
11892
 
 
11893
Wed Feb 24 16:25:17 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11894
 
 
11895
        * Lib/mhlib.py: Patch by Lars Wirzenius:
 
11896
 
 
11897
                o the initial comment is wrong: creating messages is already
 
11898
                  implemented
 
11899
 
 
11900
                o Message.getbodytext: if the mail or it's part contains an
 
11901
                  empty content-transfer-encoding header, the code used to
 
11902
                  break; the change below treats an empty encoding value the same
 
11903
                  as the other types that do not need decoding
 
11904
 
 
11905
                o SubMessage.getbodytext was missing the decode argument; the
 
11906
                  change below adds it; I also made it unconditionally return
 
11907
                  the raw text if decoding was not desired, because my own
 
11908
                  routines needed that (and it was easier than rewriting my
 
11909
                  own routines ;-)
 
11910
 
 
11911
Wed Feb 24 00:35:43 1999  Barry Warsaw  <bwarsaw@eric.cnri.reston.va.us>
 
11912
 
 
11913
        * Python/bltinmodule.c (initerrors):
 
11914
        Make sure that the exception tuples ("base-classes" when
 
11915
        string-based exceptions are used) reflect the real class hierarchy,
 
11916
        i.e. that SystemExit derives from Exception not StandardError.
 
11917
 
 
11918
        * Lib/exceptions.py:
 
11919
        Document the correct class hierarchy for SystemExit.  It is not an
 
11920
        error and so it derives from Exception and not SystemError.  The
 
11921
        docstring was incorrect but the implementation was fine.
 
11922
 
 
11923
Tue Feb 23 23:07:51 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11924
 
 
11925
        * Lib/shutil.py:
 
11926
        Add import sys, needed by reference to sys.exc_info() in rmtree().
 
11927
        Discovered by Mitch Chapman.
 
11928
 
 
11929
        * config.h.in:
 
11930
        Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
 
11931
        disappears.  It wasn't used anywhere anyway...
 
11932
 
 
11933
        * Modules/arraymodule.c:
 
11934
        Carefully check for overflow when allocating the memory for fromfile
 
11935
        -- someone tried to pass in sys.maxint and got bitten by the bogus
 
11936
        calculations.
 
11937
 
 
11938
        * configure.in:
 
11939
        Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
 
11940
        LIBM (from --with-libm=...); this actually broke the customizability
 
11941
        offered by the latter option.  Thanks go to Clay Spence for reporting
 
11942
        this.
 
11943
 
 
11944
        * Lib/test/test_dl.py:
 
11945
        1. Print the error message (carefully) when a dl.open() fails in verbose mode.
 
11946
        2. When no test case worked, raise ImportError instead of failing.
 
11947
 
 
11948
        * Python/bltinmodule.c:
 
11949
        Patch by Tim Peters to improve the range checks for range() and
 
11950
        xrange(), especially for platforms where int and long are different
 
11951
        sizes (so sys.maxint isn't actually the theoretical limit for the
 
11952
        length of a list, but the largest C int is -- sys.maxint is the
 
11953
        largest Python int, which is actually a C long).
 
11954
 
 
11955
        * Makefile.in:
 
11956
        1. Augment the DG/UX rule so it doesn't break the BeOS build.
 
11957
        2. Add $(EXE) to various occurrences of python so it will work on
 
11958
           Cygwin with egcs (after setting EXE=.exe).  These patches by
 
11959
           Norman Vine.
 
11960
 
 
11961
        * Lib/posixfile.py:
 
11962
        According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
 
11963
        list (of bsd variants that have a different lock structure).
 
11964
 
 
11965
        * Lib/test/test_fcntl.py:
 
11966
        According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
 
11967
 
 
11968
        * Modules/timemodule.c:
 
11969
        Patch by Tadayoshi Funaba (with some changes) to be smarter about
 
11970
        guessing what happened when strftime() returns 0.  Is it buffer
 
11971
        overflow or was the result simply 0 bytes long?  (This happens for an
 
11972
        empty format string, or when the format string is a single %Z and the
 
11973
        timezone is unknown.)  if the buffer is at least 256 times as long as
 
11974
        the format, assume the latter.
 
11975
 
 
11976
Mon Feb 22 19:01:42 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
11977
 
 
11978
        * Lib/urllib.py:
 
11979
        As Des Barry points out, we need to call pathname2url(file) in two
 
11980
        calls to addinfourl() in open_file().
 
11981
 
 
11982
        * Modules/Setup.in: Document *static* -- in two places!
 
11983
 
 
11984
        * Modules/timemodule.c:
 
11985
        We don't support leap seconds, so the seconds field of a time 9-tuple
 
11986
        should be in the range [0-59].  Noted by Tadayoshi Funaba.
 
11987
 
 
11988
        * Modules/stropmodule.c:
 
11989
        In atoi(), don't use isxdigit() to test whether the last character
 
11990
        converted was a "digit" -- use isalnum().  This test is there only to
 
11991
        guard against "+" or "-" being interpreted as a valid int literal.
 
11992
        Reported by Takahiro Nakayama.
 
11993
 
 
11994
        * Lib/os.py:
 
11995
        As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
 
11996
        so they don't need to be treated specially here.
 
11997
 
 
11998
Mon Feb 22 15:38:58 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
11999
 
 
12000
        * Misc/NEWS:
 
12001
        Typo:  "apparentlt" --> "apparently"
 
12002
 
 
12003
Mon Feb 22 15:38:46 1999  Guido van Rossum  <guido@eric.cnri.reston.va.us>
 
12004
 
 
12005
        * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
 
12006
 
 
12007
        * Modules/posixmodule.c:
 
12008
        The docstring for ttyname(..) claims a second "mode" argument. The
 
12009
        actual code does not allow such an argument.  (Finn Bock.)
 
12010
 
 
12011
        * Lib/lib-old/poly.py:
 
12012
        Dang.  Even though this is obsolete code, somebody found a bug, and I
 
12013
        fix it.  Oh well.
 
12014
 
 
12015
Thu Feb 18 20:51:50 1999  Fred Drake  <fdrake@eric.cnri.reston.va.us>
 
12016
 
 
12017
        * Lib/pyclbr.py:
 
12018
        Bow to font-lock at the end of the docstring, since it throws stuff
 
12019
        off.
 
12020
 
 
12021
        Make sure the path paramter to readmodule() is a list before adding it
 
12022
        with sys.path, or the addition could fail.
 
12023
 
 
12024
 
 
12025
======================================================================
 
12026
 
 
12027
 
 
12028
From 1.5.2b1 to 1.5.2b2
 
12029
=======================
 
12030
 
 
12031
General
 
12032
-------
 
12033
 
 
12034
- Many memory leaks fixed.
 
12035
 
 
12036
- Many small bugs fixed.
 
12037
 
 
12038
- Command line option -OO (or -O -O) suppresses inclusion of doc
 
12039
strings in resulting bytecode.
 
12040
 
 
12041
Windows-specific changes
 
12042
------------------------
 
12043
 
 
12044
- New built-in module winsound provides an interface to the Win32
 
12045
PlaySound() call.
 
12046
 
 
12047
- Re-enable the audioop module in the config.c file.
 
12048
 
 
12049
- On Windows, support spawnv() and associated P_* symbols.
 
12050
 
 
12051
- Fixed the conversion of times() return values on Windows.
 
12052
 
 
12053
- Removed freeze from the installer -- it doesn't work without the
 
12054
source tree.  (See FAQ 8.11.)
 
12055
 
 
12056
- On Windows 95/98, the Tkinter module now is smart enough to find
 
12057
Tcl/Tk even when the PATH environment variable hasn't been set -- when
 
12058
the import of _tkinter fails, it searches in a standard locations,
 
12059
patches os.environ["PATH"], and tries again.  When it still fails, a
 
12060
clearer error message is produced.  This should avoid most
 
12061
installation problems with Tkinter use (e.g. in IDLE).
 
12062
 
 
12063
- The -i option doesn't make any calls to set[v]buf() for stdin --
 
12064
this apparently screwed up _kbhit() and the _tkinter main loop.
 
12065
 
 
12066
- The ntpath module (and hence, os.path on Windows) now parses out UNC
 
12067
paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
 
12068
splitdrive() will \\host\mountpoint as the drive and \dir\file as the
 
12069
path.  ** EXPERIMENTAL **
 
12070
 
 
12071
- Added a hack to the exit code so that if (1) the exit status is
 
12072
nonzero and (2) we think we have our own DOS box (i.e. we're not
 
12073
started from a command line shell), we print a message and wait for
 
12074
the user to hit a key before the DOS box is closed.
 
12075
 
 
12076
- Updated the installer to WISE 5.0g.  Added a dialog warning about
 
12077
the imminent Tcl installation.  Added a dialog to specify the program
 
12078
group name in the start menu.  Upgraded the Tcl installer to Tcl
 
12079
8.0.4.
 
12080
 
 
12081
Changes to intrinsics
 
12082
---------------------
 
12083
 
 
12084
- The repr() or str() of a module object now shows the __file__
 
12085
attribute (i.e., the file which it was loaded), or the string
 
12086
"(built-in)" if there is no __file__ attribute.
 
12087
 
 
12088
- The range() function now avoids overflow during its calculations (if
 
12089
at all possible).
 
12090
 
 
12091
- New info string sys.hexversion, which is an integer encoding the
 
12092
version in hexadecimal.  In other words, hex(sys.hexversion) ==
 
12093
0x010502b2 for Python 1.5.2b2.
 
12094
 
 
12095
New or improved ports
 
12096
---------------------
 
12097
 
 
12098
- Support for Nextstep descendants (future Mac systems).
 
12099
 
 
12100
- Improved BeOS support.
 
12101
 
 
12102
- Support dynamic loading of shared libraries on NetBSD platforms that 
 
12103
use ELF (i.e., MIPS and Alpha systems).
 
12104
 
 
12105
Configuration/build changes
 
12106
---------------------------
 
12107
 
 
12108
- The Lib/test directory is no longer included in the default module
 
12109
search path (sys.path) -- "test" has been a package ever since 1.5.
 
12110
 
 
12111
- Now using autoconf 2.13.
 
12112
 
 
12113
New library modules
 
12114
-------------------
 
12115
 
 
12116
- New library modules asyncore and asynchat: these form Sam Rushing's
 
12117
famous asynchronous socket library.  Sam has gracefully allowed me to
 
12118
incorporate these in the standard Python library.
 
12119
 
 
12120
- New module statvfs contains indexing constants for [f]statvfs()
 
12121
return tuple.
 
12122
 
 
12123
Changes to the library
 
12124
----------------------
 
12125
 
 
12126
- The wave module (platform-independent support for Windows sound
 
12127
files) has been fixed to actually make it work.
 
12128
 
 
12129
- The sunau module (platform-independent support for Sun/NeXT sound
 
12130
files) has been fixed to work across platforms.  Also, a weird
 
12131
encoding bug in the header of the audio test data file has been
 
12132
corrected.
 
12133
 
 
12134
- Fix a bug in the urllib module that occasionally tripped up
 
12135
webchecker and other ftp retrieves.
 
12136
 
 
12137
- ConfigParser's get() method now accepts an optional keyword argument
 
12138
(vars) that is substituted on top of the defaults that were setup in
 
12139
__init__.  You can now also have recusive references in your
 
12140
configuration file.
 
12141
 
 
12142
- Some improvements to the Queue module, including a put_nowait()
 
12143
module and an optional "block" second argument, to get() and put(),
 
12144
defaulting to 1.
 
12145
 
 
12146
- The updated xmllib module is once again compatible with the version
 
12147
present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
 
12148
 
 
12149
- The bdb module (base class for the debugger) now supports
 
12150
canonicalizing pathnames used in breakpoints.  The derived class must
 
12151
override the new canonical() method for this to work.  Also changed
 
12152
clear_break() to the backwards compatible old signature, and added
 
12153
clear_bpbynumber() for the new functionality.
 
12154
 
 
12155
- In sgmllib (and hence htmllib), recognize attributes even if they
 
12156
don't have space in front of them.  I.e.  '<a
 
12157
name="foo"href="bar.html">' will now have two attributes recognized.
 
12158
 
 
12159
- In the debugger (pdb), change clear syntax to support three
 
12160
alternatives: clear; clear file:line; clear bpno bpno ...
 
12161
 
 
12162
- The os.path module now pretends to be a submodule within the os
 
12163
"package", so you can do things like "from os.path import exists".
 
12164
 
 
12165
- The standard exceptions now have doc strings.
 
12166
 
 
12167
- In the smtplib module, exceptions are now classes.  Also avoid
 
12168
inserting a non-standard space after "TO" in rcpt() command.
 
12169
 
 
12170
- The rfc822 module's getaddrlist() method now uses all occurrences of
 
12171
the specified header instead of just the first.  Some other bugfixes
 
12172
too (to handle more weird addresses found in a very large test set,
 
12173
and to avoid crashes on certain invalid dates), and a small test
 
12174
module has been added.
 
12175
 
 
12176
- Fixed bug in urlparse in the common-case code for HTTP URLs; it
 
12177
would lose the query, fragment, and/or parameter information.
 
12178
 
 
12179
- The sndhdr module no longer supports whatraw() -- it depended on a
 
12180
rare extenral program.
 
12181
 
 
12182
- The UserList module/class now supports the extend() method, like
 
12183
real list objects.
 
12184
 
 
12185
- The uu module now deals better with trailing garbage generated by
 
12186
some broke uuencoders.
 
12187
 
 
12188
- The telnet module now has an my_interact() method which uses threads
 
12189
instead of select.  The interact() method uses this by default on
 
12190
Windows (where the single-threaded version doesn't work).
 
12191
 
 
12192
- Add a class to mailbox.py for dealing with qmail directory
 
12193
mailboxes.  The test code was extended to notice these being used as
 
12194
well.
 
12195
 
 
12196
Changes to extension modules
 
12197
----------------------------
 
12198
 
 
12199
- Support for the [f]statvfs() system call, where it exists.
 
12200
 
 
12201
- Fixed some bugs in cPickle where bad input could cause it to dump
 
12202
core.
 
12203
 
 
12204
- Fixed cStringIO to make the writelines() function actually work.
 
12205
 
 
12206
- Added strop.expandtabs() so string.expandtabs() is now much faster.
 
12207
 
 
12208
- Added fsync() and fdatasync(), if they appear to exist.
 
12209
 
 
12210
- Support for "long files" (64-bit seek pointers).
 
12211
 
 
12212
- Fixed a bug in the zlib module's flush() function.
 
12213
 
 
12214
- Added access() system call.  It returns 1 if access granted, 0 if
 
12215
not.
 
12216
 
 
12217
- The curses module implements an optional nlines argument to
 
12218
w.scroll().  (It then calls wscrl(win, nlines) instead of scoll(win).)
 
12219
 
 
12220
Changes to tools
 
12221
----------------
 
12222
 
 
12223
- Some changes to IDLE; see Tools/idle/NEWS.txt.
 
12224
 
 
12225
- Latest version of Misc/python-mode.el included.
 
12226
 
 
12227
Changes to Tkinter
 
12228
------------------
 
12229
 
 
12230
- Avoid tracebacks when an image is deleted after its root has been
 
12231
destroyed.
 
12232
 
 
12233
Changes to the Python/C API
 
12234
---------------------------
 
12235
 
 
12236
- When parentheses are used in a PyArg_Parse[Tuple]() call, any
 
12237
sequence is now accepted, instead of requiring a tuple.  This is in
 
12238
line with the general trend towards accepting arbitrary sequences.
 
12239
 
 
12240
- Added PyModule_GetFilename().
 
12241
 
 
12242
- In PyNumber_Power(), remove unneeded and even harmful test for float
 
12243
to the negative power (which is already and better done in
 
12244
floatobject.c).
 
12245
 
 
12246
- New version identification symbols; read patchlevel.h for info.  The
 
12247
version numbers are now exported by Python.h.
 
12248
 
 
12249
- Rolled back the API version change -- it's back to 1007!
 
12250
 
 
12251
- The frozenmain.c function calls PyInitFrozenExtensions().
 
12252
 
 
12253
- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
 
12254
INCREF.
 
12255
 
 
12256
 
 
12257
======================================================================
 
12258
 
 
12259
 
 
12260
From 1.5.2a2 to 1.5.2b1
 
12261
=======================
 
12262
 
 
12263
Changes to intrinsics
 
12264
---------------------
 
12265
 
 
12266
- New extension NotImplementedError, derived from RuntimeError.  Not
 
12267
used, but recommended use is for "abstract" methods to raise this.
 
12268
 
 
12269
- The parser will now spit out a warning or error when -t or -tt is
 
12270
used for parser input coming from a string, too.
 
12271
 
 
12272
- The code generator now inserts extra SET_LINENO opcodes when
 
12273
compiling multi-line argument lists.
 
12274
 
 
12275
- When comparing bound methods, use identity test on the objects, not
 
12276
equality test.
 
12277
 
 
12278
New or improved ports
 
12279
---------------------
 
12280
 
 
12281
- Chris Herborth has redone his BeOS port; it now works on PowerPC
 
12282
(R3/R4) and x86 (R4 only).  Threads work too in this port.
 
12283
 
 
12284
Renaming
 
12285
--------
 
12286
 
 
12287
- Thanks to Chris Herborth, the thread primitives now have proper Py*
 
12288
names in the source code (they already had those for the linker,
 
12289
through some smart macros; but the source still had the old, un-Py
 
12290
names).
 
12291
 
 
12292
Configuration/build changes
 
12293
---------------------------
 
12294
 
 
12295
- Improved support for FreeBSD/3.
 
12296
 
 
12297
- Check for pthread_detach instead of pthread_create in libc.
 
12298
 
 
12299
- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
 
12300
 
 
12301
- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
 
12302
Otherwise modules such as thread didn't get incorporated in extensions.
 
12303
 
 
12304
New library modules
 
12305
-------------------
 
12306
 
 
12307
- shlex.py by Eric Raymond provides a lexical analyzer class for
 
12308
simple shell-like syntaxes.
 
12309
 
 
12310
- netrc.py by Eric Raymond provides a parser for .netrc files.  (The
 
12311
undocumented Netrc class in ftplib.py is now obsolete.)
 
12312
 
 
12313
- codeop.py is a new module that contains the compile_command()
 
12314
function that was previously in code.py.  This is so that JPython can
 
12315
provide its own version of this function, while still sharing the
 
12316
higher-level classes in code.py.
 
12317
 
 
12318
- turtle.py is a new module for simple turtle graphics.  I'm still
 
12319
working on it; let me know if you use this to teach Python to children 
 
12320
or other novices without prior programming experience.
 
12321
 
 
12322
Obsoleted library modules
 
12323
-------------------------
 
12324
 
 
12325
- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
 
12326
their status of obsoleteness.  They don't do a particularly good job
 
12327
and don't seem particularly relevant to the Python core.
 
12328
 
 
12329
New tools
 
12330
---------
 
12331
 
 
12332
- I've added IDLE: my Integrated DeveLopment Environment for Python.
 
12333
Requires Tcl/Tk (and Tkinter).  Works on Windows and Unix (and should
 
12334
work on Macintosh, but I haven't been able to test it there; it does
 
12335
depend on new features in 1.5.2 and perhaps even new features in
 
12336
1.5.2b1, especially the new code module).  This is very much a work in
 
12337
progress.  I'd like to hear how people like it compared to PTUI (or
 
12338
any other IDE they are familiar with).
 
12339
 
 
12340
- New tools by Barry Warsaw:
 
12341
 
 
12342
  = audiopy: controls the Solaris Audio device
 
12343
  = pynche:  The PYthonically Natural Color and Hue Editor
 
12344
  = world:   Print mappings between country names and DNS country codes
 
12345
 
 
12346
New demos
 
12347
---------
 
12348
 
 
12349
- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
 
12350
song.
 
12351
 
 
12352
- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
 
12353
Tkinter.  (By Fredrik Lundh -- not by me!)
 
12354
 
 
12355
Changes to the library
 
12356
----------------------
 
12357
 
 
12358
- compileall.py now avoids recompiling .py files that haven't changed;
 
12359
it adds a -f option to force recompilation.
 
12360
 
 
12361
- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
 
12362
patches).
 
12363
 
 
12364
- nntplib.py: statparse() no longer lowercases the message-id.
 
12365
 
 
12366
- types.py: use type(__stdin__) for FileType.
 
12367
 
 
12368
- urllib.py: fix translations for filenames with "funny" characters.
 
12369
Patch by Sjoerd Mullender.  Note that if you subclass one of the
 
12370
URLopener classes, and you have copied code from the old urllib.py,
 
12371
your subclass may stop working.  A long-term solution is to provide
 
12372
more methods so that you don't have to copy code.
 
12373
 
 
12374
- cgi.py: In read_multi, allow a subclass to override the class we
 
12375
instantiate when we create a recursive instance, by setting the class
 
12376
variable 'FieldStorageClass' to the desired class.  By default, this
 
12377
is set to None, in which case we use self.__class__ (as before).
 
12378
Also, a patch by Jim Fulton to pass additional arguments to recursive
 
12379
calls to the FieldStorage constructor from its read_multi method.
 
12380
 
 
12381
- UserList.py: In __getslice__, use self.__class__ instead of
 
12382
UserList.
 
12383
 
 
12384
- In SimpleHTTPServer.py, the server specified in test() should be
 
12385
BaseHTTPServer.HTTPServer, in case the request handler should want to
 
12386
reference the two attributes added by BaseHTTPServer.server_bind.  (By
 
12387
Jeff Rush, for Bobo).  Also open the file in binary mode, so serving
 
12388
images from a Windows box might actually work.
 
12389
 
 
12390
- In CGIHTTPServer.py, the list of acceptable formats is -split-
 
12391
on spaces but -joined- on commas, resulting in double commas
 
12392
in the joined text.  (By Jeff Rush.)
 
12393
 
 
12394
- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
 
12395
new threaded versions of Unix Server classes, using the ThreadingMixIn
 
12396
class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
 
12397
 
 
12398
- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
 
12399
method do_delete(); do_clear() was meant.  By Greg Ward.
 
12400
 
 
12401
- getopt.py: accept a non-list sequence for the long options (request
 
12402
by Jack Jansen).  Because it might be a common mistake to pass a
 
12403
single string, this situation is treated separately.  Also added
 
12404
docstrings (copied from the library manual) and removed the (now
 
12405
redundant) module comments.
 
12406
 
 
12407
- tempfile.py: improvements to avoid security leaks.
 
12408
 
 
12409
- code.py: moved compile_command() to new module codeop.py.
 
12410
 
 
12411
- pickle.py: support pickle format 1.3 (binary float added).  By Jim
 
12412
Fulton. Also get rid of the undocumented obsolete Pickler dump_special
 
12413
method.
 
12414
 
 
12415
- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
 
12416
 
 
12417
- imaplib.py: fix problem with some versions of IMAP4 servers that
 
12418
choose to mix the case in their CAPABILITIES response.
 
12419
 
 
12420
- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2.  Noted
 
12421
by Fredrik Lundh.
 
12422
 
 
12423
Changes to extension modules
 
12424
----------------------------
 
12425
 
 
12426
- More doc strings for several modules were contributed by Chris
 
12427
Petrilli: math, cmath, fcntl.
 
12428
 
 
12429
- Fixed a bug in zlibmodule.c that could cause core dumps on
 
12430
decompression of rarely occurring input.
 
12431
 
 
12432
- cPickle.c: new version from Jim Fulton, with Open Source copyright
 
12433
notice.  Also, initialize self->safe_constructors early on to prevent
 
12434
crash in early dealloc.
 
12435
 
 
12436
- cStringIO.c: new version from Jim Fulton, with Open Source copyright
 
12437
notice.  Also fixed a core dump in cStringIO.c when doing seeks.
 
12438
 
 
12439
- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
 
12440
 
 
12441
- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
 
12442
modifies its argument string (bad function!), so we make a temporary
 
12443
copy.
 
12444
 
 
12445
- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
 
12446
control pseudo-device, per audio(7I).
 
12447
 
 
12448
Changes to tools
 
12449
----------------
 
12450
 
 
12451
- New, improved version of Barry Warsaw's Misc/python-mode.el (editing 
 
12452
support for Emacs).
 
12453
 
 
12454
- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
 
12455
only the names of offending files to be printed.
 
12456
 
 
12457
- freeze: when printing missing modules, also print the module they
 
12458
were imported from.
 
12459
 
 
12460
- untabify.py: patch by Detlef Lannert to implement -t option
 
12461
(set tab size).
 
12462
 
 
12463
Changes to Tkinter
 
12464
------------------
 
12465
 
 
12466
- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
 
12467
row2?
 
12468
 
 
12469
- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
 
12470
doesn't work when running in a non-threaded environment.  He added
 
12471
some #ifdefs that fix this.
 
12472
 
 
12473
Changes to the Python/C API
 
12474
---------------------------
 
12475
 
 
12476
- Bumped API version number to 1008 -- enough things have changed!
 
12477
 
 
12478
- There's a new macro, PyThreadState_GET(), which does the same work
 
12479
as PyThreadState_Get() without the overhead of a function call (it
 
12480
also avoids the error check).  The two top calling locations of
 
12481
PyThreadState_Get() have been changed to use this macro.
 
12482
 
 
12483
- All symbols intended for export from a DLL or shared library are now
 
12484
marked as such (with the DL_IMPORT() macro) in the header file that
 
12485
declares them.  This was needed for the BeOS port, and should also
 
12486
make some other ports easier.  The PC port no longer needs the file
 
12487
with exported symbols (PC/python_nt.def).  There's also a DL_EXPORT
 
12488
macro which is only used for init methods in extension modules, and
 
12489
for Py_Main().
 
12490
 
 
12491
Invisible changes to internals
 
12492
------------------------------
 
12493
 
 
12494
- Fixed a bug in new_buffersize() in fileobject.c which could
 
12495
return a buffer size that was way too large.
 
12496
 
 
12497
- Use PySys_WriteStderr instead of fprintf in most places.
 
12498
 
 
12499
- dictobject.c: remove dead code discovered by Vladimir Marangozov.
 
12500
 
 
12501
- tupleobject.c: make tuples less hungry -- an extra item was
 
12502
allocated but never used.  Tip by Vladimir Marangozov.
 
12503
 
 
12504
- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu.  (Jack
 
12505
Jansen)
 
12506
 
 
12507
- import.c: Jim Fulton fixes a reference count bug in
 
12508
PyEval_GetGlobals.
 
12509
 
 
12510
- glmodule.c: check in the changed version after running the stubber
 
12511
again -- this solves the conflict with curses over the 'clear' entry
 
12512
point much nicer.  (Jack Jansen had checked in the changes to cstubs
 
12513
eons ago, but I never regenrated glmodule.c :-( )
 
12514
 
 
12515
- frameobject.c: fix reference count bug in PyFrame_New.  Vladimir
 
12516
Marangozov.
 
12517
 
 
12518
- stropmodule.c: add a missing DECREF in an error exit.  Submitted by
 
12519
Jonathan Giddy.
 
12520
 
 
12521
 
 
12522
======================================================================
 
12523
 
 
12524
 
 
12525
From 1.5.2a1 to 1.5.2a2
 
12526
=======================
 
12527
 
 
12528
General
 
12529
-------
 
12530
 
 
12531
- It is now a syntax error to have a function argument without a
 
12532
default following one with a default.
 
12533
 
 
12534
- __file__ is now set to the .py file if it was parsed (it used to
 
12535
always be the .pyc/.pyo file).
 
12536
 
 
12537
- Don't exit with a fatal error during initialization when there's a
 
12538
problem with the exceptions.py module.
 
12539
 
 
12540
- New environment variable PYTHONOPTIMIZE can be used to set -O.
 
12541
 
 
12542
- New version of python-mode.el for Emacs.
 
12543
 
 
12544
Miscellaneous fixed bugs
 
12545
------------------------
 
12546
 
 
12547
- No longer print the (confusing) error message about stack underflow
 
12548
while compiling.
 
12549
 
 
12550
- Some threading and locking bugs fixed.
 
12551
 
 
12552
- When errno is zero, report "Error", not "Success".
 
12553
 
 
12554
Documentation
 
12555
-------------
 
12556
 
 
12557
- Documentation will be released separately.
 
12558
 
 
12559
- Doc strings added to array and md5 modules by Chris Petrilli.
 
12560
 
 
12561
Ports and build procedure
 
12562
-------------------------
 
12563
 
 
12564
- Stop installing when a move or copy fails.
 
12565
 
 
12566
- New version of the OS/2 port code by Jeff Rush.
 
12567
 
 
12568
- The makesetup script handles absolute filenames better.
 
12569
 
 
12570
- The 'new' module is now enabled by default in the Setup file.
 
12571
 
 
12572
- I *think* I've solved the problem with the Linux build blowing up
 
12573
sometimes due to a conflict between sigcheck/intrcheck and
 
12574
signalmodule.
 
12575
 
 
12576
Built-in functions
 
12577
------------------
 
12578
 
 
12579
- The second argument to apply() can now be any sequence, not just a
 
12580
tuple.
 
12581
 
 
12582
Built-in types
 
12583
--------------
 
12584
 
 
12585
- Lists have a new method: L1.extend(L2) is equivalent to the common
 
12586
idiom L1[len(L1):] = L2.
 
12587
 
 
12588
- Better error messages when a sequence is indexed with a non-integer.
 
12589
 
 
12590
- Bettter error message when calling a non-callable object (include
 
12591
the type in the message).
 
12592
 
 
12593
Python services
 
12594
---------------
 
12595
 
 
12596
- New version of cPickle.c fixes some bugs.
 
12597
 
 
12598
- pickle.py: improved instantiation error handling.
 
12599
 
 
12600
- code.py: reworked quite a bit.  New base class
 
12601
InteractiveInterpreter and derived class InteractiveConsole.  Fixed
 
12602
several problems in compile_command().
 
12603
 
 
12604
- py_compile.py: print error message and continue on syntax errors.
 
12605
Also fixed an old bug with the fstat code (it was never used).
 
12606
 
 
12607
- pyclbr.py: support submodules of packages.
 
12608
 
 
12609
String Services
 
12610
---------------
 
12611
 
 
12612
- StringIO.py: raise the right exception (ValueError) for attempted
 
12613
I/O on closed StringIO objects.
 
12614
 
 
12615
- re.py: fixed a bug in subn(), which caused .groups() to fail inside
 
12616
the replacement function called by sub().
 
12617
 
 
12618
- The struct module has a new format 'P': void * in native mode.
 
12619
 
 
12620
Generic OS Services
 
12621
-------------------
 
12622
 
 
12623
- Module time: Y2K robustness.  2-digit year acceptance depends on
 
12624
value of time.accept2dyear, initialized from env var PYTHONY2K,
 
12625
default 0.  Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
 
12626
(POSIX or X/Open recommendation).
 
12627
 
 
12628
- os.path: normpath(".//x") should return "x", not "/x".
 
12629
 
 
12630
- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
 
12631
doesn't work.
 
12632
 
 
12633
- tempfile.py: regenerate the template after a fork() call.
 
12634
 
 
12635
Optional OS Services
 
12636
--------------------
 
12637
 
 
12638
- In the signal module, disable restarting interrupted system calls
 
12639
when we have siginterrupt().
 
12640
 
 
12641
Debugger
 
12642
--------
 
12643
 
 
12644
- No longer set __args__; this feature is no longer supported and can
 
12645
affect the debugged code.
 
12646
 
 
12647
- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
 
12648
added aliases and some other useful new features, e.g. much better
 
12649
breakpoint support: temporary breakpoint, disabled breakpoints,
 
12650
breakpoints with ignore counts, and conditions; breakpoints can be set
 
12651
on a file before it is loaded.
 
12652
 
 
12653
Profiler
 
12654
--------
 
12655
 
 
12656
- Changes so that JPython can use it.  Also fix the calibration code
 
12657
so it actually works again
 
12658
.
 
12659
Internet Protocols and Support
 
12660
------------------------------
 
12661
 
 
12662
- imaplib.py: new version from Piers Lauder.
 
12663
 
 
12664
- smtplib.py: change sendmail() method to accept a single string or a
 
12665
list or strings as the destination (commom newbie mistake).
 
12666
 
 
12667
- poplib.py: LIST with a msg argument fixed.
 
12668
 
 
12669
- urlparse.py: some optimizations for common case (http).
 
12670
 
 
12671
- urllib.py: support content-length in info() for ftp protocol;
 
12672
support for a progress meter through a third argument to
 
12673
urlretrieve(); commented out gopher test (the test site is dead).
 
12674
 
 
12675
Internet Data handling
 
12676
----------------------
 
12677
 
 
12678
- sgmllib.py: support tags with - or . in their name.
 
12679
 
 
12680
- mimetypes.py: guess_type() understands 'data' URLs.
 
12681
 
 
12682
Restricted Execution
 
12683
--------------------
 
12684
 
 
12685
- The classes rexec.RModuleLoader and rexec.RModuleImporter no
 
12686
longer exist.
 
12687
 
 
12688
Tkinter
 
12689
-------
 
12690
 
 
12691
- When reporting an exception, store its info in sys.last_*.  Also,
 
12692
write all of it to stderr.
 
12693
 
 
12694
- Added NS, EW, and NSEW constants, for grid's sticky option.
 
12695
 
 
12696
- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
 
12697
 
 
12698
- Make bind variants without a sequence return a tuple of sequences
 
12699
(formerly it returned a string, which wasn't very convenient).
 
12700
 
 
12701
- Add image commands to the Text widget (these are new in Tk 8.0).
 
12702
 
 
12703
- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
 
12704
 
 
12705
- Improved the thread code (but you still can't call update() from
 
12706
another thread on Windows).
 
12707
 
 
12708
- Fixed unnecessary references to _default_root in the new dialog
 
12709
modules.
 
12710
 
 
12711
- Miscellaneous problems fixed.
 
12712
 
 
12713
 
 
12714
Windows General
 
12715
---------------
 
12716
 
 
12717
- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
 
12718
search for dependent dlls in the directory containing the .pyd.
 
12719
 
 
12720
- In debugging mode, call DebugBreak() in Py_FatalError().
 
12721
 
 
12722
Windows Installer
 
12723
-----------------
 
12724
 
 
12725
- Install zlib.dll in the DLLs directory instead of in the win32
 
12726
system directory, to avoid conflicts with other applications that have 
 
12727
their own zlib.dll.
 
12728
 
 
12729
Test Suite
 
12730
----------
 
12731
 
 
12732
- test_long.py: new test for long integers, by Tim Peters.
 
12733
 
 
12734
- regrtest.py: improved so it can be used for other test suites as
 
12735
well.
 
12736
 
 
12737
- test_strftime.py: use re to compare test results, to support legal
 
12738
variants (e.g. on Linux).
 
12739
 
 
12740
Tools and Demos
 
12741
---------------
 
12742
 
 
12743
- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
 
12744
remove/add Windows style '\r\n' line endings), untabify.py (to remove
 
12745
tabs), and rgrep.yp (reverse grep).
 
12746
 
 
12747
- Improvements to Tools/freeze/.  Each Python module is now written to
 
12748
its own C file.  This prevents some compilers or assemblers from
 
12749
blowing up on large frozen programs, and saves recompilation time if
 
12750
only a few modules are changed.  Other changes too, e.g. new command
 
12751
line options -x and -i.
 
12752
 
 
12753
- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
 
12754
 
 
12755
Python/C API
 
12756
------------
 
12757
 
 
12758
- New mechanism to support extensions of the type object while
 
12759
remaining backward compatible with extensions compiled for previous
 
12760
versions of Python 1.5.  A flags field indicates presence of certain
 
12761
fields.
 
12762
 
 
12763
- Addition to the buffer API to differentiate access to bytes and
 
12764
8-bit characters (in anticipation of Unicode characters).
 
12765
 
 
12766
- New argument parsing format t# ("text") to indicate 8-bit
 
12767
characters; s# simply means 8-bit bytes, for backwards compatibility.
 
12768
 
 
12769
- New object type, bufferobject.c is an example and can be used to
 
12770
create buffers from memory.
 
12771
 
 
12772
- Some support for 64-bit longs, including some MS platforms.
 
12773
 
 
12774
- Many calls to fprintf(stderr, ...) have been replaced with calls to
 
12775
PySys_WriteStderr(...).
 
12776
 
 
12777
- The calling context for PyOS_Readline() has changed: it must now be
 
12778
called with the interpreter lock held!  It releases the lock around
 
12779
the call to the function pointed to by PyOS_ReadlineFunctionPointer
 
12780
(default PyOS_StdioReadline()).
 
12781
 
 
12782
- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
 
12783
 
 
12784
- Renamed header file "thread.h" to "pythread.h".
 
12785
 
 
12786
- The code string of code objects may now be anything that supports the
 
12787
buffer API.
 
12788
 
 
12789
 
 
12790
======================================================================
 
12791
 
 
12792
 
 
12793
From 1.5.1 to 1.5.2a1
 
12794
=====================
 
12795
 
 
12796
General
 
12797
-------
 
12798
 
 
12799
- When searching for the library, a landmark that is a compiled module
 
12800
(string.pyc or string.pyo) is also accepted.
 
12801
 
 
12802
- When following symbolic links to the python executable, use a loop
 
12803
so that a symlink to a symlink can work.
 
12804
 
 
12805
- Added a hack so that when you type 'quit' or 'exit' at the
 
12806
interpreter, you get a friendly explanation of how to press Ctrl-D (or 
 
12807
Ctrl-Z) to exit.
 
12808
 
 
12809
- New and improved Misc/python-mode.el (Python mode for Emacs).
 
12810
 
 
12811
- Revert a new feature in Unix dynamic loading: for one or two
 
12812
revisions, modules were loaded using the RTLD_GLOBAL flag.  It turned
 
12813
out to be a bad idea.
 
12814
 
 
12815
Miscellaneous fixed bugs
 
12816
------------------------
 
12817
 
 
12818
- All patches on the patch page have been integrated.  (But much more
 
12819
has been done!)
 
12820
 
 
12821
- Several memory leaks plugged (e.g. the one for classes with a
 
12822
__getattr__ method).
 
12823
 
 
12824
- Removed the only use of calloc().  This triggered an obscure bug on
 
12825
multiprocessor Sparc Solaris 2.6.
 
12826
 
 
12827
- Fix a peculiar bug that would allow "import sys.time" to succeed
 
12828
(believing the built-in time module to be a part of the sys package).
 
12829
 
 
12830
- Fix a bug in the overflow checking when converting a Python long to
 
12831
a C long (failed to convert -2147483648L, and some other cases).
 
12832
 
 
12833
Documentation
 
12834
-------------
 
12835
 
 
12836
- Doc strings have been added to many extension modules: __builtin__,
 
12837
errno, select, signal, socket, sys, thread, time.  Also to methods of
 
12838
list objects (try [].append.__doc__).  A doc string on a type will now
 
12839
automatically be propagated to an instance if the instance has methods
 
12840
that are accessed in the usual way.
 
12841
 
 
12842
- The documentation has been expanded and the formatting improved.
 
12843
(Remember that the documentation is now unbundled and has its own
 
12844
release cycle though; see http://www.python.org/doc/.)
 
12845
 
 
12846
- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
 
12847
 
 
12848
Ports and build procedure
 
12849
-------------------------
 
12850
 
 
12851
- The BeOS port is now integrated.  Courtesy Chris Herborth.
 
12852
 
 
12853
- Symbol files for FreeBSD 2.x and 3.x have been contributed
 
12854
(Lib/plat-freebsd[23]/*).
 
12855
 
 
12856
- Support HPUX 10.20 DCE threads.
 
12857
 
 
12858
- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
 
12859
works, it won't also use -Olimit 1500 (which gives a warning for every
 
12860
file).  Also support the SGI_ABI environment variable better.
 
12861
 
 
12862
- The makesetup script now understands absolute pathnames ending in .o
 
12863
in the module -- it assumes it's a file for which we have no source.
 
12864
 
 
12865
- Other miscellaneous improvements to the configure script and
 
12866
Makefiles.
 
12867
 
 
12868
- The test suite now uses a different sound sample.
 
12869
 
 
12870
Built-in functions
 
12871
------------------
 
12872
 
 
12873
- Better checks for invalid input to int(), long(), string.atoi(),
 
12874
string.atol().  (Formerly, a sign without digits would be accepted as
 
12875
a legal ways to spell zero.)
 
12876
 
 
12877
- Changes to map() and filter() to use the length of a sequence only
 
12878
as a hint -- if an IndexError happens earlier, take that.  (Formerly,
 
12879
this was considered an error.)
 
12880
 
 
12881
- Experimental feature in getattr(): a third argument can specify a
 
12882
default (instead of raising AttributeError).
 
12883
 
 
12884
- Implement round() slightly different, so that for negative ndigits
 
12885
no additional errors happen in the last step.
 
12886
 
 
12887
- The open() function now adds the filename to the exception when it
 
12888
fails.
 
12889
 
 
12890
Built-in exceptions
 
12891
-------------------
 
12892
 
 
12893
- New standard exceptions EnvironmentError and PosixError.
 
12894
EnvironmentError is the base class for IOError and PosixError;
 
12895
PosixError is the same as os.error.  All this so that either exception
 
12896
class can be instantiated with a third argument indicating a filename.
 
12897
The built-in function open() and most os/posix functions that take a
 
12898
filename argument now use this.
 
12899
 
 
12900
Built-in types
 
12901
--------------
 
12902
 
 
12903
- List objects now have an experimental pop() method; l.pop() returns
 
12904
and removes the last item; l.pop(i) returns and removes the item at
 
12905
i.  Also, the sort() method is faster again.  Sorting is now also
 
12906
safer: it is impossible for the sorting function to modify the list
 
12907
while the sort is going on (which could cause core dumps).
 
12908
 
 
12909
- Changes to comparisons: numbers are now smaller than any other type.
 
12910
This is done to prevent the circularity where [] < 0L < 1 < [] is
 
12911
true.  As a side effect, cmp(None, 0) is now positive instead of
 
12912
negative.  This *shouldn't* affect any working code, but I've found
 
12913
that the change caused several "sleeping" bugs to become active, so
 
12914
beware!
 
12915
 
 
12916
- Instance methods may now have other callable objects than just
 
12917
Python functions as their im_func.  Use new.instancemethod() or write
 
12918
your own C code to create them; new.instancemethod() may be called
 
12919
with None for the instance to create an unbound method.
 
12920
 
 
12921
- Assignment to __name__, __dict__ or __bases__ of a class object is
 
12922
now allowed (with stringent type checks); also allow assignment to
 
12923
__getattr__ etc.  The cached values for __getattr__ etc. are
 
12924
recomputed after such assignments (but not for derived classes :-( ).
 
12925
 
 
12926
- Allow assignment to some attributes of function objects: func_code,
 
12927
func_defaults and func_doc / __doc__.  (With type checks except for
 
12928
__doc__ / func_doc .)
 
12929
 
 
12930
Python services
 
12931
---------------
 
12932
 
 
12933
- New tests (in Lib/test): reperf.py (regular expression benchmark),
 
12934
sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
 
12935
for the MimeWriter module).
 
12936
 
 
12937
- Generalized test/regrtest.py so that it is useful for testing other
 
12938
packages.
 
12939
 
 
12940
- The ihooks.py module now understands package imports.
 
12941
 
 
12942
- In code.py, add a class that subsumes Fredrik Lundh's
 
12943
PythonInterpreter class.  The interact() function now uses this.
 
12944
 
 
12945
- In rlcompleter.py, in completer(), return None instead of raising an
 
12946
IndexError when there are no more completions left.
 
12947
 
 
12948
- Fixed the marshal module to test for certain common kinds of invalid
 
12949
input.  (It's still not foolproof!)
 
12950
 
 
12951
- In the operator module, add an alias (now the preferred name)
 
12952
"contains" for "sequenceincludes".
 
12953
 
 
12954
String Services
 
12955
---------------
 
12956
 
 
12957
- In the string and strop modules, in the replace() function, treat an
 
12958
empty pattern as an error (since it's not clear what was meant!).
 
12959
 
 
12960
- Some speedups to re.py, especially the string substitution and split
 
12961
functions.  Also added new function/method findall(), to find all
 
12962
occurrences of a given substring.
 
12963
 
 
12964
- In cStringIO, add better argument type checking and support the
 
12965
readonly 'closed' attribute (like regular files).
 
12966
 
 
12967
- In the struct module, unsigned 1-2 byte sized formats no longer
 
12968
result in long integer values.
 
12969
 
 
12970
Miscellaneous services
 
12971
----------------------
 
12972
 
 
12973
- In whrandom.py, added new method and function randrange(), same as
 
12974
choice(range(start, stop, step)) but faster.  This addresses the
 
12975
problem that randint() was accidentally defined as taking an inclusive
 
12976
range.  Also, randint(a, b) is now redefined as randrange(a, b+1),
 
12977
adding extra range and type checking to its arguments!
 
12978
 
 
12979
- Add some semi-thread-safety to random.gauss() (it used to be able to 
 
12980
crash when invoked from separate threads; now the worst it can do is
 
12981
give a duplicate result occasionally).
 
12982
 
 
12983
- Some restructuring and generalization done to cmd.py.
 
12984
 
 
12985
- Major upgrade to ConfigParser.py; converted to using 're', added new 
 
12986
exceptions, support underscore in section header and option name.  No
 
12987
longer add 'name' option to every section; instead, add '__name__'.
 
12988
 
 
12989
- In getpass.py, don't use raw_input() to ask for the password -- we
 
12990
don't want it to show up in the readline history!  Also don't catch
 
12991
interrupts (the try-finally already does all necessary cleanup).
 
12992
 
 
12993
Generic OS Services
 
12994
-------------------
 
12995
 
 
12996
- New functions in os.py: makedirs(), removedirs(), renames().  New
 
12997
variable: linesep (the line separator as found in binary files,
 
12998
i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac.  Do *not* use
 
12999
this with files opened in (default) text mode; the line separator used
 
13000
will always be '\n'!
 
13001
 
 
13002
- Changes to the 'os.path' submodule of os.py: added getsize(),
 
13003
getmtime(), getatime() -- these fetch the most popular items from the
 
13004
stat return tuple.
 
13005
 
 
13006
- In the time module, add strptime(), if it exists.  (This parses a
 
13007
time according to a format -- the inverse of strftime().)  Also,
 
13008
remove the call to mktime() from strftime() -- it messed up the
 
13009
formatting of some non-local times.
 
13010
 
 
13011
- In the socket module, added a new function gethostbyname_ex().
 
13012
Also, don't use #ifdef to test for some symbols that are enums on some
 
13013
platforms (and should exist everywhere).
 
13014
 
 
13015
Optional OS Services
 
13016
--------------------
 
13017
 
 
13018
- Some fixes to gzip.py.  In particular, the readlines() method now
 
13019
returns the lines *with* trailing newline characters, like readlines()
 
13020
of regular file objects.  Also, it didn't work together with cPickle;
 
13021
fixed that.
 
13022
 
 
13023
- In whichdb.py, support byte-swapped dbhash (bsddb) files.
 
13024
 
 
13025
- In anydbm.py, look at the type of an existing database to determine
 
13026
which module to use to open it.  (The anydbm.error exception is now a
 
13027
tuple.)
 
13028
 
 
13029
Unix Services
 
13030
-------------
 
13031
 
 
13032
- In the termios module, in tcsetattr(), initialize the structure vy
 
13033
calling tcgetattr().
 
13034
 
 
13035
- Added some of the "wait status inspection" macros as functions to
 
13036
the posix module (and thus to the os module): WEXITSTATUS(),
 
13037
WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
 
13038
 
 
13039
- In the syslog module, make the default facility more intuitive
 
13040
(matching the docs).
 
13041
 
 
13042
Debugger
 
13043
--------
 
13044
 
 
13045
- In pdb.py, support for setting breaks on files/modules that haven't
 
13046
been loaded yet.
 
13047
 
 
13048
Internet Protocols and Support
 
13049
------------------------------
 
13050
 
 
13051
- Changes in urllib.py; sped up unquote() and quote().  Fixed an
 
13052
obscure bug in quote_plus().  Added urlencode(dict) -- convenience
 
13053
function for sending a POST request with urlopen().  Use the getpass
 
13054
module to ask for a password.  Rewrote the (test) main program so that
 
13055
when used as a script, it can retrieve one or more URLs to stdout.
 
13056
Use -t to run the self-test.  Made the proxy code work again.
 
13057
 
 
13058
- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
 
13059
fail when someone asks for their HEAD.  Also, for POST, set the
 
13060
default content-type to application/x-www-form-urlencoded.  Also, in
 
13061
FieldStorage.__init__(), when method='GET', always get the query
 
13062
string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
 
13063
explicitly passed in fp.
 
13064
 
 
13065
- The smtplib.py module now supports ESMTP and has improved standard
 
13066
compliance, for picky servers.
 
13067
 
 
13068
- Improved imaplib.py.
 
13069
 
 
13070
- Fixed UDP support in SocketServer.py (it never worked).
 
13071
 
 
13072
- Fixed a small bug in CGIHTTPServer.py.
 
13073
 
 
13074
Internet Data handling
 
13075
----------------------
 
13076
 
 
13077
- In rfc822.py, add a new class AddressList.  Also support a new
 
13078
overridable method, isheader().  Also add a get() method similar to
 
13079
dictionaries (and make getheader() an alias for it).  Also, be smarter
 
13080
about seekable (test whether fp.tell() works) and test for presence of
 
13081
unread() method before trying seeks.
 
13082
 
 
13083
- In sgmllib.py, restore the call to report_unbalanced() that was lost
 
13084
long ago.  Also some other improvements: handle <? processing
 
13085
instructions >, allow . and - in entity names, and allow \r\n as line
 
13086
separator.
 
13087
 
 
13088
- Some restructuring and generalization done to multifile.py; support
 
13089
a 'seekable' flag.
 
13090
 
 
13091
Restricted Execution
 
13092
--------------------
 
13093
 
 
13094
- Improvements to rexec.py: package support; support a (minimal)
 
13095
sys.exc_info().  Also made the (test) main program a bit fancier (you
 
13096
can now use it to run arbitrary Python scripts in restricted mode).
 
13097
 
 
13098
Tkinter
 
13099
-------
 
13100
 
 
13101
- On Unix, Tkinter can now safely be used from a multi-threaded
 
13102
application.  (Formerly, no threads would make progress while
 
13103
Tkinter's mainloop() was active, because it didn't release the Python
 
13104
interpreter lock.)  Unfortunately, on Windows, threads other than the
 
13105
main thread should not call update() or update_idletasks() because
 
13106
this will deadlock the application.
 
13107
 
 
13108
- An interactive interpreter that uses readline and Tkinter no longer
 
13109
uses up all available CPU time.
 
13110
 
 
13111
- Even if readline is not used, Tk windows created in an interactive
 
13112
interpreter now get continuously updated.  (This even works in Windows
 
13113
as long as you don't hit a key.)
 
13114
 
 
13115
- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
 
13116
 
 
13117
- No longer register Tcl_finalize() as a low-level exit handler.  It
 
13118
may call back into Python, and that's a bad idea.
 
13119
 
 
13120
- Allow binding of Tcl commands (given as a string).
 
13121
 
 
13122
- Some minor speedups; replace explicitly coded getint() with int() in
 
13123
most places.
 
13124
 
 
13125
- In FileDialog.py, remember the directory of the selected file, if
 
13126
given.
 
13127
 
 
13128
- Change the names of all methods in the Wm class: they are now
 
13129
wm_title(), etc.  The old names (title() etc.) are still defined as
 
13130
aliases.
 
13131
 
 
13132
- Add a new method of interpreter objects, interpaddr().  This returns
 
13133
the address of the Tcl interpreter object, as an integer.  Not very
 
13134
useful for the Python programmer, but this can be called by another C
 
13135
extension that needs to make calls into the Tcl/Tk C API and needs to
 
13136
get the address of the Tcl interpreter object.  A simple cast of the
 
13137
return value to (Tcl_Interp *) will do the trick.
 
13138
 
 
13139
Windows General
 
13140
---------------
 
13141
 
 
13142
- Don't insist on proper case for module source files if the filename
 
13143
is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
 
13144
doesn't).  This should address problems with this feature on
 
13145
oldfashioned filesystems (Novell servers?).
 
13146
 
 
13147
Windows Library
 
13148
---------------
 
13149
 
 
13150
- os.environ is now all uppercase, but accesses are case insensitive,
 
13151
and the putenv() calls made as a side effect of changing os.environ
 
13152
are case preserving.
 
13153
 
 
13154
- Removed samefile(), sameopenfile(), samestat() from os.path (aka
 
13155
ntpath.py) -- these cannot be made to work reliably (at least I
 
13156
wouldn't know how).
 
13157
 
 
13158
- Fixed os.pipe() so that it returns file descriptors acceptable to
 
13159
os.read() and os.write() (like it does on Unix), rather than Windows
 
13160
file handles.
 
13161
 
 
13162
- Added a table of WSA error codes to socket.py.
 
13163
 
 
13164
- In the select module, put the (huge) file descriptor arrays on the
 
13165
heap.
 
13166
 
 
13167
- The getpass module now raises KeyboardInterrupt when it sees ^C.
 
13168
 
 
13169
- In mailbox.py, fix tell/seek when using files opened in text mode.
 
13170
 
 
13171
- In rfc822.py, fix tell/seek when using files opened in text mode.
 
13172
 
 
13173
- In the msvcrt extension module, release the interpreter lock for
 
13174
calls that may block: _locking(), _getch(), _getche().  Also fix a
 
13175
bogus error return when open_osfhandle() doesn't have the right
 
13176
argument list.
 
13177
 
 
13178
Windows Installer
 
13179
-----------------
 
13180
 
 
13181
- The registry key used is now "1.5" instead of "1.5.x" -- so future
 
13182
versions of 1.5 and Mark Hammond's win32all installer don't need to be 
 
13183
resynchronized.
 
13184
 
 
13185
Windows Tools
 
13186
-------------
 
13187
 
 
13188
- Several improvements to freeze specifically for Windows.
 
13189
 
 
13190
Windows Build Procedure
 
13191
-----------------------
 
13192
 
 
13193
- The VC++ project files and the WISE installer have been moved to the
 
13194
PCbuild subdirectory, so they are distributed in the same subdirectory
 
13195
where they must be used.  This avoids confusion.
 
13196
 
 
13197
- New project files for Windows 3.1 port by Jim Ahlstrom.
 
13198
 
 
13199
- Got rid of the obsolete subdirectory PC/setup_nt/.
 
13200
 
 
13201
- The projects now use distinct filenames for the .exe, .dll, .lib and
 
13202
.pyd files built in debug mode (by appending "_d" to the base name,
 
13203
before the extension).  This makes it easier to switch between the two
 
13204
and get the right versions.  There's a pragma in config.h that directs
 
13205
the linker to include the appropriate .lib file (so python15.lib no
 
13206
longer needs to be explicit in your project).
 
13207
 
 
13208
- The installer now installs more files (e.g. config.h).  The idea is
 
13209
that you shouldn't need the source distribution if you want build your
 
13210
own extensions in C or C++.
 
13211
 
 
13212
Tools and Demos
 
13213
---------------
 
13214
 
 
13215
- New script nm2def.py by Marc-Andre Lemburg, to construct
 
13216
PC/python_nt.def automatically (some hand editing still required).
 
13217
 
 
13218
- New tool ndiff.py: Tim Peters' text diffing tool.
 
13219
 
 
13220
- Various and sundry improvements to the freeze script.
 
13221
 
 
13222
- The script texi2html.py (which was part of the Doc tree but is no
 
13223
longer used there) has been moved to the Tools/scripts subdirectory.
 
13224
 
 
13225
- Some generalizations in the webchecker code.  There's now a
 
13226
primnitive gui for websucker.py: wsgui.py.  (In Tools/webchecker/.)
 
13227
 
 
13228
- The ftpmirror.py script now handles symbolic links properly, and
 
13229
also files with multiple spaces in their names.
 
13230
 
 
13231
- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
 
13232
last line is both indented and lacks a newline.  This is now fixed.
 
13233
 
 
13234
Python/C API
 
13235
------------
 
13236
 
 
13237
- Added missing prototypes for PyEval_CallFunction() and
 
13238
PyEval_CallMethod().
 
13239
 
 
13240
- New macro PyList_SET_ITEM().
 
13241
 
 
13242
- New macros to access object members for PyFunction, PyCFunction
 
13243
objects.
 
13244
 
 
13245
- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
 
13246
dynamically add one or many entries to the table of built-in modules.
 
13247
 
 
13248
- New macro Py_InitModule3(name, methods, doc) which calls
 
13249
Py_InitModule4() with appropriate arguments.  (The -4 variant requires 
 
13250
you to pass an obscure version number constant which is always the same.)
 
13251
 
 
13252
- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
 
13253
sys.stdout or sys.stderr using a printf-like interface.  (Used in
 
13254
_tkinter.c, for example.)
 
13255
 
 
13256
- New APIs for conversion between Python longs and C 'long long' if
 
13257
your compiler supports it.
 
13258
 
 
13259
- PySequence_In() is now called PySequence_Contains().
 
13260
(PySequence_In() is still supported for b/w compatibility; it is
 
13261
declared obsolete because its argument order is confusing.)
 
13262
 
 
13263
- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
 
13264
*never* raise an exception -- (even if the hash() fails, simply clear
 
13265
the error).  This was necessary because there is lots of code out
 
13266
there that already assumes this.
 
13267
 
 
13268
- Changes to PySequence_Tuple() and PySequence_List() to use the
 
13269
length of a sequence only as a hint -- if an IndexError happens
 
13270
earlier, take that.  (Formerly, this was considered an error.)
 
13271
 
 
13272
- Reformatted abstract.c to give it a more familiar "look" and fixed
 
13273
many error checking bugs.
 
13274
 
 
13275
- Add NULL pointer checks to all calls of a C function through a type
 
13276
object and extensions (e.g. nb_add).
 
13277
 
 
13278
- The code that initializes sys.path now calls Py_GetPythonHome()
 
13279
instead of getenv("PYTHONHOME").  This, together with the new API
 
13280
Py_SetPythonHome(), makes it easier for embedding applications to
 
13281
change the notion of Python's "home" directory (where the libraries
 
13282
etc. are sought).
 
13283
 
 
13284
- Fixed a very old bug in the parsing of "O?" format specifiers.
 
13285
 
 
13286
 
 
13287
======================================================================
 
13288
 
 
13289
 
 
13290
========================================
 
13291
==> Release 1.5.1 (October 31, 1998) <==
 
13292
========================================
 
13293
 
 
13294
From 1.5 to 1.5.1
 
13295
=================
 
13296
 
 
13297
General
 
13298
-------
 
13299
 
 
13300
- The documentation is now unbundled.  It has also been extensively
 
13301
modified (mostly to implement a new and more uniform formatting
 
13302
style).  We figure that most people will prefer to download one of the
 
13303
preformatted documentation sets (HTML, PostScript or PDF) and that
 
13304
only a minority have a need for the LaTeX or FrameMaker sources.  Of
 
13305
course, the unbundled documentation sources still released -- just not
 
13306
in the same archive file, and perhaps not on the same date.
 
13307
 
 
13308
- All bugs noted on the errors page (and many unnoted) are fixed.  All
 
13309
new bugs take their places.
 
13310
 
 
13311
- No longer a core dump when attempting to print (or repr(), or str())
 
13312
a list or dictionary that contains an instance of itself; instead, the
 
13313
recursive entry is printed as [...] or {...}.  See Py_ReprEnter() and
 
13314
Py_ReprLeave() below.  Comparisons of such objects still go beserk,
 
13315
since this requires a different kind of fix; fortunately, this is a
 
13316
less common scenario in practice.
 
13317
 
 
13318
Syntax change
 
13319
-------------
 
13320
 
 
13321
- The raise statement can now be used without arguments, to re-raise 
 
13322
a previously set exception.  This should be used after catching an
 
13323
exception with an except clause only, either in the except clause or
 
13324
later in the same function.
 
13325
 
 
13326
Import and module handling
 
13327
--------------------------
 
13328
 
 
13329
- The implementation of import has changed to use a mutex (when
 
13330
threading is supported).  This means that when two threads
 
13331
simultaneously import the same module, the import statements are
 
13332
serialized.  Recursive imports are not affected.
 
13333
 
 
13334
- Rewrote the finalization code almost completely, to be much more
 
13335
careful with the order in which modules are destroyed.  Destructors
 
13336
will now generally be able to reference built-in names such as None
 
13337
without trouble.
 
13338
 
 
13339
- Case-insensitive platforms such as Mac and Windows require the case
 
13340
of a module's filename to match the case of the module name as
 
13341
specified in the import statement (see below).
 
13342
 
 
13343
- The code for figuring out the default path now distinguishes between
 
13344
files, modules, executable files, and directories.  When expecting a
 
13345
module, we also look for the .pyc or .pyo file.
 
13346
 
 
13347
Parser/tokenizer changes
 
13348
------------------------
 
13349
 
 
13350
- The tokenizer can now warn you when your source code mixes tabs and
 
13351
spaces for indentation in a manner that depends on how much a tab is
 
13352
worth in spaces.  Use "python -t" or "python -v" to enable this
 
13353
option.  Use "python -tt" to turn the warnings into errors.  (See also
 
13354
tabnanny.py and tabpolice.py below.)
 
13355
 
 
13356
- Return unsigned characters from tok_nextc(), so '\377' isn't
 
13357
mistaken for an EOF character.
 
13358
 
 
13359
- Fixed two pernicious bugs in the tokenizer that only affected AIX.
 
13360
One was actually a general bug that was triggered by AIX's smaller I/O
 
13361
buffer size.  The other was a bug in the AIX optimizer's loop
 
13362
unrolling code; swapping two statements made the problem go away.
 
13363
 
 
13364
Tools, demos and miscellaneous files
 
13365
------------------------------------
 
13366
 
 
13367
- There's a new version of Misc/python-mode.el (the Emacs mode for
 
13368
Python) which is much smarter about guessing the indentation style
 
13369
used in a particular file.  Lots of other cool features too!
 
13370
 
 
13371
- There are two new tools in Tools/scripts: tabnanny.py and
 
13372
tabpolice.py, implementing two different ways of checking whether a
 
13373
file uses indentation in a way that is sensitive to the interpretation
 
13374
of a tab.  The preferred module is tabnanny.py (by Tim Peters).
 
13375
 
 
13376
- Some new demo programs:
 
13377
 
 
13378
        Demo/tkinter/guido/paint.py -- Dave Mitchell
 
13379
        Demo/sockets/unixserver.py -- Piet van Oostrum
 
13380
        
 
13381
 
 
13382
- Much better freeze support.  The freeze script can now freeze
 
13383
hierarchical module names (with a corresponding change to import.c),
 
13384
and has a few extra options (e.g. to suppress freezing specific
 
13385
modules).  It also does much more on Windows NT.
 
13386
 
 
13387
- Version 1.0 of the faq wizard is included (only very small changes
 
13388
since version 0.9.0).
 
13389
 
 
13390
- New feature for the ftpmirror script: when removing local files
 
13391
(i.e., only when -r is used), do a recursive delete.
 
13392
 
 
13393
Configuring and building Python
 
13394
-------------------------------
 
13395
 
 
13396
- Get rid of the check for -linet -- recent Sequent Dynix systems don't
 
13397
need this any more and apparently it screws up their configuration.
 
13398
 
 
13399
- Some changes because gcc on SGI doesn't support '-all'.
 
13400
 
 
13401
- Changed the build rules to use $(LIBRARY) instead of
 
13402
  -L.. -lpython$(VERSION)
 
13403
since the latter trips up the SunOS 4.1.x linker (sigh).
 
13404
 
 
13405
- Fix the bug where the '# dgux is broken' comment in the Makefile
 
13406
tripped over Make on some platforms.
 
13407
 
 
13408
- Changes for AIX: install the python.exp file; properly use
 
13409
$(srcdir); the makexp_aix script now removes C++ entries of the form
 
13410
Class::method.
 
13411
 
 
13412
- Deleted some Makefile targets only used by the (long obsolete)
 
13413
gMakefile hacks.
 
13414
 
 
13415
Extension modules
 
13416
-----------------
 
13417
 
 
13418
- Performance and threading improvements to the socket and bsddb
 
13419
modules, by Christopher Lindblad of Infoseek.
 
13420
 
 
13421
- Added operator.__not__ and operator.not_.
 
13422
 
 
13423
- In the thread module, when a thread exits due to an unhandled
 
13424
exception, don't store the exception information in sys.last_*; it
 
13425
prevents proper calling of destructors of local variables.
 
13426
 
 
13427
- Fixed a number of small bugs in the cPickle module.
 
13428
 
 
13429
- Changed find() and rfind() in the strop module so that
 
13430
find("x","",2) returns -1, matching the implementation in string.py.
 
13431
 
 
13432
- In the time module, be more careful with the result of ctime(), and
 
13433
test for HAVE_MKTIME before usinmg mktime().
 
13434
 
 
13435
- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
 
13436
modules.
 
13437
 
 
13438
- Added the LOG_SYSLOG constant to the syslog module, if defined.
 
13439
 
 
13440
Standard library modules
 
13441
------------------------
 
13442
 
 
13443
- All standard library modules have been converted to an indentation
 
13444
style using either only tabs or only spaces -- never a mixture -- if
 
13445
they weren't already consistent according to tabnanny.  This means
 
13446
that the new -t option (see above) won't complain about standard
 
13447
library modules.
 
13448
 
 
13449
- New standard library modules:
 
13450
 
 
13451
        threading -- GvR and the thread-sig
 
13452
                Java style thread objects -- USE THIS!!!
 
13453
 
 
13454
        getpass -- Piers Lauder
 
13455
                simple utilities to prompt for a password and to
 
13456
                retrieve the current username
 
13457
 
 
13458
        imaplib -- Piers Lauder
 
13459
                interface for the IMAP4 protocol
 
13460
 
 
13461
        poplib -- David Ascher, Piers Lauder
 
13462
                interface for the POP3 protocol
 
13463
 
 
13464
        smtplib -- Dragon De Monsyne
 
13465
                interface for the SMTP protocol
 
13466
 
 
13467
- Some obsolete modules moved to a separate directory (Lib/lib-old)
 
13468
which is *not* in the default module search path:
 
13469
 
 
13470
        Para
 
13471
        addpack
 
13472
        codehack
 
13473
        fmt
 
13474
        lockfile
 
13475
        newdir
 
13476
        ni
 
13477
        rand
 
13478
        tb
 
13479
 
 
13480
- New version of the PCRE code (Perl Compatible Regular Expressions --
 
13481
the re module and the supporting pcre extension) by Andrew Kuchling.
 
13482
Incompatible new feature in re.sub(): the handling of escapes in the
 
13483
replacement string has changed.
 
13484
 
 
13485
- Interface change in the copy module: a __deepcopy__ method is now
 
13486
called with the memo dictionary as an argument.
 
13487
 
 
13488
- Feature change in the tokenize module: differentiate between NEWLINE
 
13489
token (an official newline) and NL token (a newline that the grammar
 
13490
ignores).
 
13491
 
 
13492
- Several bugfixes to the urllib module.  It is now truly thread-safe,
 
13493
and several bugs and a portability problem have been fixed.  New
 
13494
features, all due to Sjoerd Mullender: When creating a temporary file,
 
13495
it gives it an appropriate suffix.  Support the "data:" URL scheme.
 
13496
The open() method uses the tempcache.
 
13497
 
 
13498
- New version of the xmllib module (this time with a test suite!) by
 
13499
Sjoerd Mullender.
 
13500
 
 
13501
- Added debugging code to the telnetlib module, to be able to trace
 
13502
the actual traffic.
 
13503
 
 
13504
- In the rfc822 module, added support for deleting a header (still no
 
13505
support for adding headers, though).  Also fixed a bug where an
 
13506
illegal address would cause a crash in getrouteaddr(), fixed a
 
13507
sign reversal in mktime_tz(), and use the local timezone by default
 
13508
(the latter two due to Bill van Melle).
 
13509
 
 
13510
- The normpath() function in the dospath and ntpath modules no longer
 
13511
does case normalization -- for that, use the separate function
 
13512
normcase() (which always existed); normcase() has been sped up and
 
13513
fixed (it was the cause of a crash in Mark Hammond's installer in
 
13514
certain locales).
 
13515
 
 
13516
- New command supported by the ftplib module: rmd(); also fixed some
 
13517
minor bugs.
 
13518
 
 
13519
- The profile module now uses a different timer function by default -- 
 
13520
time.clock() is generally better than os.times().  This makes it work
 
13521
better on Windows NT, too.
 
13522
 
 
13523
- The tempfile module now recovers when os.getcwd() raises an
 
13524
exception.
 
13525
 
 
13526
- Fixed some bugs in the random module; gauss() was subtly wrong, and
 
13527
vonmisesvariate() should return a full circle.  Courtesy Mike Miller,
 
13528
Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
 
13529
 
 
13530
- Better default seed in the whrandom module, courtesy Andrew Kuchling.
 
13531
 
 
13532
- Fix slow close() in shelve module.
 
13533
 
 
13534
- The Unix mailbox class in the mailbox module is now more robust when
 
13535
a line begins with the string "From " but is definitely not the start
 
13536
of a new message.  The pattern used can be changed by overriding a
 
13537
method or class variable.
 
13538
 
 
13539
- Added a rmtree() function to the copy module.
 
13540
 
 
13541
- Fixed several typos in the pickle module.  Also fixed problems when
 
13542
unpickling in restricted execution environments.
 
13543
 
 
13544
- Added docstrings and fixed a typo in the py_compile and compileall
 
13545
modules.  At Mark Hammond's repeated request, py_compile now append a
 
13546
newline to the source if it needs one.  Both modules support an extra
 
13547
parameter to specify the purported source filename (to be used in
 
13548
error messages).
 
13549
 
 
13550
- Some performance tweaks by Jeremy Hylton to the gzip module.
 
13551
 
 
13552
- Fixed a bug in the merge order of dictionaries in the ConfigParser
 
13553
module.  Courtesy Barry Warsaw.
 
13554
 
 
13555
- In the multifile module, support the optional second parameter to
 
13556
seek() when possible.
 
13557
 
 
13558
- Several fixes to the gopherlib module by Lars Marius Garshol.  Also, 
 
13559
urlparse now correctly handles Gopher URLs with query strings.
 
13560
 
 
13561
- Fixed a tiny bug in format_exception() in the traceback module.
 
13562
Also rewrite tb_lineno() to be compatible with JPython (and not
 
13563
disturb the current exception!); by Jim Hugunin.
 
13564
 
 
13565
- The httplib module is more robust when servers send a short response 
 
13566
-- courtesy Tim O'Malley.
 
13567
 
 
13568
Tkinter and friends
 
13569
-------------------
 
13570
 
 
13571
- Various typos and bugs fixed.
 
13572
 
 
13573
- New module Tkdnd implements a drag-and-drop protocol (within one
 
13574
application only).
 
13575
 
 
13576
- The event_*() widget methods have been restructured slightly -- they
 
13577
no longer use the default root.
 
13578
 
 
13579
- The interfaces for the bind*() and unbind() widget methods have been
 
13580
redesigned; the bind*() methods now return the name of the Tcl command 
 
13581
created for the callback, and this can be passed as a optional
 
13582
argument to unbind() in order to delete the command (normally, such
 
13583
commands are automatically unbound when the widget is destroyed, but
 
13584
for some applications this isn't enough).
 
13585
 
 
13586
- Variable objects now have trace methods to interface to Tcl's
 
13587
variable tracing facilities.
 
13588
 
 
13589
- Image objects now have an optional keyword argument, 'master', to
 
13590
specify a widget (tree) to which they belong.  The image_names() and
 
13591
image_types() calls are now also widget methods.
 
13592
 
 
13593
- There's a new global call, Tkinter.NoDefaultRoot(), which disables
 
13594
all use of the default root by the Tkinter library.  This is useful to
 
13595
debug applications that are in the process of being converted from
 
13596
relying on the default root to explicit specification of the root
 
13597
widget.
 
13598
 
 
13599
- The 'exit' command is deleted from the Tcl interpreter, since it
 
13600
provided a loophole by which one could (accidentally) exit the Python
 
13601
interpreter without invoking any cleanup code.
 
13602
 
 
13603
- Tcl_Finalize() is now registered as a Python low-level exit handle,
 
13604
so Tcl will be finalized when Python exits.
 
13605
 
 
13606
The Python/C API
 
13607
----------------
 
13608
 
 
13609
- New function PyThreadState_GetDict() returns a per-thread dictionary
 
13610
intended for storing thread-local global variables.
 
13611
 
 
13612
- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
 
13613
dictionary to allow recursive container types to detect recursion in
 
13614
their repr(), str() and print implementations.
 
13615
 
 
13616
- New function PyObject_Not(x) calculates (not x) according to Python's 
 
13617
standard rules (basically, it negates the outcome PyObject_IsTrue(x).
 
13618
 
 
13619
- New function _PyModule_Clear(), which clears a module's dictionary
 
13620
carefully without removing the __builtins__ entry.  This is implied
 
13621
when a module object is deallocated (this used to clear the dictionary
 
13622
completely).
 
13623
 
 
13624
- New function PyImport_ExecCodeModuleEx(), which extends
 
13625
PyImport_ExecCodeModule() by adding an extra parameter to pass it the
 
13626
true file.
 
13627
 
 
13628
- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
 
13629
allow embedded applications to force a different value for PYTHONHOME.
 
13630
 
 
13631
- New global flag Py_FrozenFlag is set when this is a "frozen" Python
 
13632
binary; it suppresses warnings about not being able to find the
 
13633
standard library directories.
 
13634
 
 
13635
- New global flag Py_TabcheckFlag is incremented by the -t option and
 
13636
causes the tokenizer to issue warnings or errors about inconsistent
 
13637
mixing of tabs and spaces for indentation.
 
13638
 
 
13639
Miscellaneous minor changes and bug fixes
 
13640
-----------------------------------------
 
13641
 
 
13642
- Improved the error message when an attribute of an attribute-less
 
13643
object is requested -- include the name of the attribute and the type
 
13644
of the object in the message.
 
13645
 
 
13646
- Sped up int(), long(), float() a bit.
 
13647
 
 
13648
- Fixed a bug in list.sort() that would occasionally dump core.
 
13649
 
 
13650
- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
 
13651
when taken tothe real power.
 
13652
 
 
13653
- Fixed a number of bugs in the file reading code, at least one of
 
13654
which could cause a core dump on NT, and one of which would
 
13655
occasionally cause file.read() to return less than the full contents
 
13656
of the file.
 
13657
 
 
13658
- Performance hack by Vladimir Marangozov for stack frame creation.
 
13659
 
 
13660
- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
 
13661
 
 
13662
Windows 95/NT
 
13663
-------------
 
13664
 
 
13665
- The .lib files are now part of the distribution; they are collected
 
13666
in the subdirectory "libs" of the installation directory.
 
13667
 
 
13668
- The extension modules (.pyd files) are now collected in a separate
 
13669
subdirectory of the installation directory named "DLLs".
 
13670
 
 
13671
- The case of a module's filename must now match the case of the
 
13672
module name as specified in the import statement.  This is an
 
13673
experimental feature -- if it turns out to break in too many
 
13674
situations, it will be removed (or disabled by default) in the future.
 
13675
It can be disabled on a per-case basis by setting the environment
 
13676
variable PYTHONCASEOK (to any value).
 
13677
 
 
13678
 
 
13679
======================================================================
 
13680
 
 
13681
 
 
13682
=====================================
 
13683
==> Release 1.5 (January 3, 1998) <==
 
13684
=====================================
 
13685
 
 
13686
 
 
13687
From 1.5b2 to 1.5
 
13688
=================
 
13689
 
 
13690
- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
 
13691
 
 
13692
- Added doc strings to string.py, stropmodule.c, structmodule.c,
 
13693
thanks to Charles Waldman.
 
13694
 
 
13695
- Many nits fixed in the manuals, thanks to Fred Drake and many others
 
13696
(especially Rob Hooft and Andrew Kuchling).  The HTML version now uses
 
13697
HTML markup instead of inline GIF images for tables; only two images
 
13698
are left (for obsure bits of math).  The index of the HTML version has
 
13699
also been much improved.  Finally, it is once again possible to
 
13700
generate an Emacs info file from the library manual (but I don't
 
13701
commit to supporting this in future versions).
 
13702
 
 
13703
- New module: telnetlib.py (a simple telnet client library).
 
13704
 
 
13705
- New tool: Tools/versioncheck/, by Jack Jansen.
 
13706
 
 
13707
- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
 
13708
DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
 
13709
extension modules.
 
13710
 
 
13711
- Many small changes again to Tkinter.py -- mostly bugfixes and adding
 
13712
missing routines.  Thanks to Greg McFarlane for reporting a bunch of
 
13713
problems and proofreading my fixes.
 
13714
 
 
13715
- The re module and its documentation are up to date with the latest
 
13716
version released to the string-sig (Dec. 22).
 
13717
 
 
13718
- Stop test_grp.py from failing when the /etc/group file is empty
 
13719
(yes, this happens!).
 
13720
 
 
13721
- Fix bug in integer conversion (mystrtoul.c) that caused
 
13722
4294967296==0 to be true!
 
13723
 
 
13724
- The VC++ 4.2 project file should be complete again.
 
13725
 
 
13726
- In tempfile.py, use a better template on NT, and add a new optional
 
13727
argument "suffix" with default "" to specify a specific extension for
 
13728
the temporary filename (needed sometimes on NT but perhaps also handy
 
13729
elsewhere).
 
13730
 
 
13731
- Fixed some bugs in the FAQ wizard, and converted it to use re
 
13732
instead of regex.
 
13733
 
 
13734
- Fixed a mysteriously undetected error in dlmodule.c (it was using a
 
13735
totally bogus routine name to raise an exception).
 
13736
 
 
13737
- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
 
13738
 
 
13739
- Hopefully harmless changes to the build process to support shared
 
13740
libraries on DG/UX.  This adds a target to create
 
13741
libpython$(VERSION).so; however this target is *only* for DG/UX.
 
13742
 
 
13743
- Fixed a bug in the new format string error checking in getargs.c.
 
13744
 
 
13745
- A simple fix for infinite recursion when printing __builtins__:
 
13746
reset '_' to None before printing and set it to the printed variable
 
13747
*after* printing (and only when printing is successful).
 
13748
 
 
13749
- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
 
13750
parent window is not (Skip Montanaro).
 
13751
 
 
13752
- Fixed the two most annoying problems with ftp URLs in
 
13753
urllib.urlopen(); an empty file now correctly raises an error, and it
 
13754
is no longer required to explicitly close the returned "file" object
 
13755
before opening another ftp URL to the same host and directory.
 
13756
 
 
13757
 
 
13758
======================================================================
 
13759
 
 
13760
 
 
13761
From 1.5b1 to 1.5b2
 
13762
===================
 
13763
 
 
13764
- Fixed a bug in cPickle.c that caused it to crash right away because
 
13765
the version string had a different format.
 
13766
 
 
13767
- Changes in pickle.py and cPickle.c: when unpickling an instance of a
 
13768
class that doesn't define the __getinitargs__() method, the __init__()
 
13769
constructor is no longer called.  This makes a much larger group of
 
13770
classes picklable by default, but may occasionally change semantics.
 
13771
To force calling __init__() on unpickling, define a __getinitargs__()
 
13772
method.  Other changes too, in particular cPickle now handles classes
 
13773
defined in packages correctly.  The same change applies to copying
 
13774
instances with copy.py.  The cPickle.c changes and some pickle.py
 
13775
changes are courtesy Jim Fulton.
 
13776
 
 
13777
- Locale support in he "re" (Perl regular expressions) module.  Use 
 
13778
the flag re.L (or re.LOCALE) to enable locale-specific matching
 
13779
rules for \w and \b.  The in-line syntax for this flag is (?L).
 
13780
 
 
13781
- The built-in function isinstance(x, y) now also succeeds when y is
 
13782
a type object and type(x) is y.
 
13783
 
 
13784
- repr() and str() of class and instance objects now reflect the
 
13785
package/module in which the class is defined.
 
13786
 
 
13787
- Module "ni" has been removed.  (If you really need it, it's been
 
13788
renamed to "ni1".  Let me know if this causes any problems for you.
 
13789
Package authors are encouraged to write __init__.py files that
 
13790
support both ni and 1.5 package support, so the same version can be
 
13791
used with Python 1.4 as well as 1.5.)
 
13792
 
 
13793
- The thread module is now automatically included when threads are
 
13794
configured.  (You must remove it from your existing Setup file,
 
13795
since it is now in its own Setup.thread file.)
 
13796
 
 
13797
- New command line option "-x" to skip the first line of the script;
 
13798
handy to make executable scripts on non-Unix platforms.
 
13799
 
 
13800
- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags.  I
 
13801
haven't checked how this affects things, but it should make symbols
 
13802
in one shared library available to the next one.
 
13803
 
 
13804
- The Windows installer now installs in the "Program Files" folder on
 
13805
the proper volume by default.
 
13806
 
 
13807
- The Windows configuration adds a new main program, "pythonw", and
 
13808
registers a new extension, ".pyw" that invokes this.  This is a
 
13809
pstandard Python interpreter that does not pop up a console window;
 
13810
handy for pure Tkinter applications.  All output to the original
 
13811
stdout and stderr is lost; reading from the original stdin yields
 
13812
EOF.  Also, both python.exe and pythonw.exe now have a pretty icon
 
13813
(a green snake in a box, courtesy Mark Hammond).
 
13814
 
 
13815
- Lots of improvements to emacs-mode.el again.  See Barry's web page:
 
13816
http://www.python.org/ftp/emacs/pmdetails.html.
 
13817
 
 
13818
- Lots of improvements and additions to the library reference manual;
 
13819
many by Fred Drake.
 
13820
 
 
13821
- Doc strings for the following modules: rfc822.py, posixpath.py,
 
13822
ntpath.py, httplib.py.  Thanks to Mitch Chapman and Charles Waldman.
 
13823
 
 
13824
- Some more regression testing.
 
13825
 
 
13826
- An optional 4th (maxsplit) argument to strop.replace().
 
13827
 
 
13828
- Fixed handling of maxsplit in string.splitfields().
 
13829
 
 
13830
- Tweaked os.environ so it can be pickled and copied.
 
13831
 
 
13832
- The portability problems caused by indented preprocessor commands
 
13833
and C++ style comments should be gone now.
 
13834
 
 
13835
- In random.py, added Pareto and Weibull distributions.
 
13836
 
 
13837
- The crypt module is now disabled in Modules/Setup.in by default; it
 
13838
is rarely needed and causes errors on some systems where users often
 
13839
don't know how to deal with those.
 
13840
 
 
13841
- Some improvements to the _tkinter build line suggested by Case Roole.
 
13842
 
 
13843
- A full suite of platform specific files for NetBSD 1.x, submitted by 
 
13844
Anders Andersen.
 
13845
 
 
13846
- New Solaris specific header STROPTS.py.
 
13847
 
 
13848
- Moved a confusing occurrence of *shared* from the comments in
 
13849
Modules/Setup.in (people would enable this one instead of the real
 
13850
one, and get disappointing results).
 
13851
 
 
13852
- Changed the default mode for directories to be group-writable when
 
13853
the installation process creates them.
 
13854
 
 
13855
- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
 
13856
shared libraries for both.
 
13857
 
 
13858
- Support FreeBSD and NetBSD in posixfile.py.
 
13859
 
 
13860
- Support for the "event" command, new in Tk 4.2.  By Case Roole.
 
13861
 
 
13862
- Add Tix_SafeInit() support to tkappinit.c.
 
13863
 
 
13864
- Various bugs fixed in "re.py" and "pcre.c".
 
13865
 
 
13866
- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
 
13867
 
 
13868
- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
 
13869
is set.
 
13870
 
 
13871
- Provide default blocksize for retrbinary in ftplib.py (Skip
 
13872
Montanaro).
 
13873
 
 
13874
- In NT, pick the username up from different places in user.py (Jeff
 
13875
Bauer).
 
13876
 
 
13877
- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
 
13878
 
 
13879
- Many small improvements to Jeff Rush' OS/2 support.
 
13880
 
 
13881
- ospath.py is gone; it's been obsolete for so many years now...
 
13882
 
 
13883
- The reference manual is now set up to prepare better HTML (still
 
13884
using webmaker, alas).
 
13885
 
 
13886
- Add special handling to /Tools/freeze for Python modules that are
 
13887
imported implicitly by the Python runtime: 'site' and 'exceptions'.
 
13888
 
 
13889
- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
 
13890
inside <PRE>, by "Scott".
 
13891
 
 
13892
- Added ConfigParser.py, a generic parser for sectioned configuration
 
13893
files.
 
13894
 
 
13895
- In _localemodule.c, LC_MESSAGES is not always defined; put it
 
13896
between #ifdefs.
 
13897
 
 
13898
- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
 
13899
 
 
13900
- Demo/scripts/newslist.py: Fix the way the version number is gotten
 
13901
out of the RCS revision.
 
13902
 
 
13903
- PyArg_Parse[Tuple] now explicitly check for bad characters at the
 
13904
end of the format string.
 
13905
 
 
13906
- Revamped PC/example_nt to support VC++ 5.x.
 
13907
 
 
13908
- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
 
13909
after studying the GNU libg++ quicksort.  This should be much faster
 
13910
if there are lots of duplicates, and otherwise at least as good.
 
13911
 
 
13912
- Added "uue" as an alias for "uuencode" to mimetools.py.  (Hm, the
 
13913
uudecode bug where it complaints about trailing garbage is still there 
 
13914
:-( ).
 
13915
 
 
13916
- pickle.py requires integers in text mode to be in decimal notation
 
13917
(it used to accept octal and hex, even though it would only generate
 
13918
decimal numbers).
 
13919
 
 
13920
- In string.atof(), don't fail when the "re" module is unavailable.
 
13921
Plug the ensueing security leak by supplying an empty __builtins__
 
13922
directory to eval().
 
13923
 
 
13924
- A bunch of small fixes and improvements to Tkinter.py.
 
13925
 
 
13926
- Fixed a buffer overrun in PC/getpathp.c.
 
13927
 
 
13928
 
 
13929
======================================================================
 
13930
 
 
13931
 
 
13932
From 1.5a4 to 1.5b1
 
13933
===================
 
13934
 
 
13935
- The Windows NT/95 installer now includes full HTML of all manuals.
 
13936
It also has a checkbox that lets you decide whether to install the
 
13937
interpreter and library.  The WISE installer script for the installer
 
13938
is included in the source tree as PC/python15.wse, and so are the
 
13939
icons used for Python files.  The config.c file for the Windows build
 
13940
is now complete with the pcre module.
 
13941
 
 
13942
- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
 
13943
evaluated for the prompt.
 
13944
 
 
13945
- The reference manual is brought up to date (more or less -- it still
 
13946
needs work, e.g. in the area of package import).
 
13947
 
 
13948
- The icons used by latex2html are now included in the Doc
 
13949
subdirectory (mostly so that tarring up the HTML files can be fully
 
13950
automated).  A simple index.html is also added to Doc (it only works
 
13951
after you have successfully run latex2html).
 
13952
 
 
13953
- For all you would-be proselytizers out there: a new version of
 
13954
Misc/BLURB describes Python more concisely, and Misc/comparisons
 
13955
compares Python to several other languages.  Misc/BLURB.WINDOWS
 
13956
contains a blurb specifically aimed at Windows programmers (by Mark
 
13957
Hammond).
 
13958
 
 
13959
- A new version of the Python mode for Emacs is included as
 
13960
Misc/python-mode.el.  There are too many new features to list here.
 
13961
See http://www.python.org/ftp/emacs/pmdetails.html for more info.
 
13962
 
 
13963
- New module fileinput makes iterating over the lines of a list of
 
13964
files easier.  (This still needs some more thinking to make it more
 
13965
extensible.)
 
13966
 
 
13967
- There's full OS/2 support, courtesy Jeff Rush.  To build the OS/2
 
13968
version, see PC/readme.txt and PC/os2vacpp.  This is for IBM's Visual
 
13969
Age C++ compiler.  I expect that Jeff will also provide a binary
 
13970
release for this platform.
 
13971
 
 
13972
- On Linux, the configure script now uses '-Xlinker -export-dynamic'
 
13973
instead of '-rdynamic' to link the main program so that it exports its
 
13974
symbols to shared libraries it loads dynamically.  I hope this doesn't
 
13975
break on older Linux versions; it is needed for mklinux and appears to
 
13976
work on Linux 2.0.30.
 
13977
 
 
13978
- Some Tkinter resstructuring: the geometry methods that apply to a
 
13979
master are now properly usable on toplevel master widgets.  There's a
 
13980
new (internal) widget class, BaseWidget.  New, longer "official" names
 
13981
for the geometry manager methods have been added,
 
13982
e.g. "grid_columnconfigure()" instead of "columnconfigure()".  The old
 
13983
shorter names still work, and where there's ambiguity, pack wins over
 
13984
place wins over grid.  Also, the bind_class method now returns its
 
13985
value.
 
13986
 
 
13987
- New, RFC-822 conformant parsing of email addresses and address lists
 
13988
in the rfc822 module, courtesy Ben Escoto.
 
13989
 
 
13990
- New, revamped tkappinit.c with support for popular packages (PIL,
 
13991
TIX, BLT, TOGL).  For the last three, you need to execute the Tcl
 
13992
command "load {} Tix" (or Blt, or Togl) to gain access to them.
 
13993
The Modules/Setup line for the _tkinter module has been rewritten
 
13994
using the cool line-breaking feature of most Bourne shells.
 
13995
 
 
13996
- New socket method connect_ex() returns the error code from connect()
 
13997
instead of raising an exception on errors; this makes the logic
 
13998
required for asynchronous connects simpler and more efficient.
 
13999
 
 
14000
- New "locale" module with (still experimental) interface to the
 
14001
standard C library locale interface, courtesy Martin von Loewis.  This
 
14002
does not repeat my mistake in 1.5a4 of always calling
 
14003
setlocale(LC_ALL, "").  In fact, we've pretty much decided that
 
14004
Python's standard numerical formatting operations should always use
 
14005
the conventions for the C locale; the locale module contains utility
 
14006
functions to format numbers according to the user specified locale.
 
14007
(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
 
14008
"C") after locale-changing calls.)  See the library manual. (Alas, the
 
14009
promised changes to the "re" module for locale support have not been
 
14010
materialized yet.  If you care, volunteer!)
 
14011
 
 
14012
- Memory leak plugged in Py_BuildValue when building a dictionary.
 
14013
 
 
14014
- Shared modules can now live inside packages (hierarchical module
 
14015
namespaces).  No changes to the shared module itself are needed.
 
14016
 
 
14017
- Improved policy for __builtins__: this is a module in __main__ and a
 
14018
dictionary everywhere else.
 
14019
 
 
14020
- Python no longer catches SIGHUP and SIGTERM by default.  This was
 
14021
impossible to get right in the light of thread contexts.  If you want
 
14022
your program to clean up when a signal happens, use the signal module
 
14023
to set up your own signal handler.
 
14024
 
 
14025
- New Python/C API PyNumber_CoerceEx() does not return an exception
 
14026
when no coercion is possible.  This is used to fix a problem where
 
14027
comparing incompatible numbers for equality would raise an exception
 
14028
rather than return false as in Python 1.4 -- it once again will return
 
14029
false.
 
14030
 
 
14031
- The errno module is changed again -- the table of error messages
 
14032
(errorstr) is removed.  Instead, you can use os.strerror().  This
 
14033
removes redundance and a potential locale dependency.
 
14034
 
 
14035
- New module xmllib, to parse XML files.  By Sjoerd Mullender.
 
14036
 
 
14037
- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
 
14038
It resets the signal module's notion of what the current process ID
 
14039
and thread are, so that signal handlers will work after (and across)
 
14040
calls to os.fork().
 
14041
 
 
14042
- Fixed most occurrences of fatal errors due to missing thread state.
 
14043
 
 
14044
- For vgrind (a flexible source pretty printer) fans, there's a simple
 
14045
Python definition in Misc/vgrindefs, courtesy Neale Pickett.
 
14046
 
 
14047
- Fixed memory leak in exec statement.
 
14048
 
 
14049
- The test.pystone module has a new function, pystones(loops=LOOPS),
 
14050
which returns a (benchtime, stones) tuple.  The main() function now
 
14051
calls this and prints the report.
 
14052
 
 
14053
- Package directories now *require* the presence of an __init__.py (or
 
14054
__init__.pyc) file before they are considered as packages.  This is
 
14055
done to prevent accidental subdirectories with common names from
 
14056
overriding modules with the same name.
 
14057
 
 
14058
- Fixed some strange exceptions in __del__ methods in library modules
 
14059
(e.g. urllib).  This happens because the builtin names are already
 
14060
deleted by the time __del__ is called.  The solution (a hack, but it
 
14061
works) is to set some instance variables to 0 instead of None.
 
14062
 
 
14063
- The table of built-in module initializers is replaced by a pointer
 
14064
variable.  This makes it possible to switch to a different table at
 
14065
run time, e.g. when a collection of modules is loaded from a shared
 
14066
library.  (No example code of how to do this is given, but it is
 
14067
possible.)  The table is still there of course, its name prefixed with
 
14068
an underscore and used to initialize the pointer.
 
14069
 
 
14070
- The warning about a thread still having a frame now only happens in
 
14071
verbose mode.
 
14072
 
 
14073
- Change the signal finialization so that it also resets the signal
 
14074
handlers.  After this has been called, our signal handlers are no
 
14075
longer active!
 
14076
 
 
14077
- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
 
14078
literals.  There's now also a test fort this module.
 
14079
 
 
14080
- The copy module now also uses __dict__.update(state) instead of
 
14081
going through individual attribute assignments, for class instances
 
14082
without a __setstate__ method.
 
14083
 
 
14084
- New module reconvert translates old-style (regex module) regular
 
14085
expressions to new-style (re module, Perl-style) regular expressions.
 
14086
 
 
14087
- Most modules that used to use the regex module now use the re
 
14088
module.  The grep module has a new pgrep() function which uses
 
14089
Perl-style regular expressions.
 
14090
 
 
14091
- The (very old, backwards compatibility) regexp.py module has been
 
14092
deleted.
 
14093
 
 
14094
- Restricted execution (rexec): added the pcre module (support for the
 
14095
re module) to the list of trusted extension modules.
 
14096
 
 
14097
- New version of Jim Fulton's CObject object type, adds
 
14098
PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
 
14099
 
 
14100
- Some patches to Lee Busby's fpectl mods that accidentally didn't
 
14101
make it into 1.5a4.
 
14102
 
 
14103
- In the string module, add an optional 4th argument to count(),
 
14104
matching find() etc.
 
14105
 
 
14106
- Patch for the nntplib module by Charles Waldman to add optional user
 
14107
and password arguments to NNTP.__init__(), for nntp servers that need
 
14108
them.
 
14109
 
 
14110
- The str() function for class objects now returns
 
14111
"modulename.classname" instead of returning the same as repr().
 
14112
 
 
14113
- The parsing of \xXX escapes no longer relies on sscanf().
 
14114
 
 
14115
- The "sharedmodules" subdirectory of the installation is renamed to
 
14116
"lib-dynload".  (You may have to edit your Modules/Setup file to fix
 
14117
this in an existing installation!)
 
14118
 
 
14119
- Fixed Don Beaudry's mess-up with the OPT test in the configure
 
14120
script.  Certain SGI platforms will still issue a warning for each
 
14121
compile; there's not much I can do about this since the compiler's
 
14122
exit status doesn't indicate that I was using an obsolete option.
 
14123
 
 
14124
- Fixed Barry's mess-up with {}.get(), and added test cases for it.
 
14125
 
 
14126
- Shared libraries didn't quite work under AIX because of the change
 
14127
in status of the GNU readline interface.  Fix due to by Vladimir
 
14128
Marangozov.
 
14129
 
 
14130
 
 
14131
======================================================================
 
14132
 
 
14133
 
 
14134
From 1.5a3 to 1.5a4
 
14135
===================
 
14136
 
 
14137
- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
 
14138
feature; better install instructions; removed faqmain.py (which was an
 
14139
older version).
 
14140
 
 
14141
- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
 
14142
about the treatment of lines starting with '.'.  Added a minimal test
 
14143
function.
 
14144
 
 
14145
- struct module: ignore most whitespace in format strings.
 
14146
 
 
14147
- urllib.py: close the socket and temp file in URLopener.retrieve() so
 
14148
that multiple retrievals using the same connection work.
 
14149
 
 
14150
- All standard exceptions are now classes by default; use -X to make
 
14151
them strings (for backward compatibility only).
 
14152
 
 
14153
- There's a new standard exception hierarchy, defined in the standard
 
14154
library module exceptions.py (which you never need to import
 
14155
explicitly).  See
 
14156
http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
 
14157
more info.
 
14158
 
 
14159
- Three new C API functions:
 
14160
 
 
14161
  - int PyErr_GivenExceptionMatches(obj1, obj2)
 
14162
 
 
14163
    Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
 
14164
    instance of type obj2, or of a class derived from obj2
 
14165
 
 
14166
  - int PyErr_ExceptionMatches(obj)
 
14167
 
 
14168
    Higher level wrapper around PyErr_GivenExceptionMatches() which uses
 
14169
    PyErr_Occurred() as obj1.  This will be the more commonly called
 
14170
    function.
 
14171
 
 
14172
  - void PyErr_NormalizeException(typeptr, valptr, tbptr)
 
14173
 
 
14174
    Normalizes exceptions, and places the normalized values in the
 
14175
    arguments.  If type is not a class, this does nothing.  If type is a
 
14176
    class, then it makes sure that value is an instance of the class by:
 
14177
 
 
14178
    1. if instance is of the type, or a class derived from type, it does
 
14179
       nothing.
 
14180
 
 
14181
    2. otherwise it instantiates the class, using the value as an
 
14182
       argument.  If value is None, it uses an empty arg tuple, and if
 
14183
       the value is a tuple, it uses just that.
 
14184
 
 
14185
- Another new C API function: PyErr_NewException() creates a new
 
14186
exception class derived from Exception; when -X is given, it creates a
 
14187
new string exception.
 
14188
 
 
14189
- core interpreter: remove the distinction between tuple and list
 
14190
unpacking; allow an arbitrary sequence on the right hand side of any
 
14191
unpack instruction.  (UNPACK_LIST and UNPACK_TUPLE now do the same
 
14192
thing, which should really be called UNPACK_SEQUENCE.)
 
14193
 
 
14194
- classes: Allow assignments to an instance's __dict__ or __class__,
 
14195
so you can change ivars (including shared ivars -- shock horror) and
 
14196
change classes dynamically.  Also make the check on read-only
 
14197
attributes of classes less draconic -- only the specials names
 
14198
__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
 
14199
assigned.
 
14200
 
 
14201
- Two new built-in functions: issubclass() and isinstance().  Both
 
14202
take classes as their second arguments.  The former takes a class as
 
14203
the first argument and returns true iff first is second, or is a
 
14204
subclass of second.  The latter takes any object as the first argument
 
14205
and returns true iff first is an instance of the second, or any
 
14206
subclass of second.
 
14207
 
 
14208
- configure: Added configuration tests for presence of alarm(),
 
14209
pause(), and getpwent().
 
14210
 
 
14211
- Doc/Makefile: changed latex2html targets.
 
14212
 
 
14213
- classes: Reverse the search order for the Don Beaudry hook so that
 
14214
the first class with an applicable hook wins.  Makes more sense.
 
14215
 
 
14216
- Changed the checks made in Py_Initialize() and Py_Finalize().  It is
 
14217
now legal to call these more than once.  The first call to
 
14218
Py_Initialize() initializes, the first call to Py_Finalize()
 
14219
finalizes.  There's also a new API, Py_IsInitalized() which checks
 
14220
whether we are already initialized (in case you want to leave things
 
14221
as they were).
 
14222
 
 
14223
- Completely disable the declarations for malloc(), realloc() and
 
14224
free().  Any 90's C compiler has these in header files, and the tests
 
14225
to decide whether to suppress the declarations kept failing on some
 
14226
platforms.
 
14227
 
 
14228
- *Before* (instead of after) signalmodule.o is added, remove both
 
14229
intrcheck.o and sigcheck.o.  This should get rid of warnings in ar or
 
14230
ld on various systems.
 
14231
 
 
14232
- Added reop to PC/config.c
 
14233
 
 
14234
- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
 
14235
Removed outdated HP-UX comments from README.  Added Cray T3E comments.
 
14236
 
 
14237
- Various renames of statically defined functions that had name
 
14238
conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
 
14239
roundup (sys/types.h).
 
14240
 
 
14241
- urllib.py: Interpret three slashes in file: URL as local file (for
 
14242
Netscape on Windows/Mac).
 
14243
 
 
14244
- copy.py: Make sure the objects returned by __getinitargs__() are
 
14245
kept alive (in the memo) to avoid a certain kind of nasty crash.  (Not
 
14246
easily reproducable because it requires a later call to
 
14247
__getinitargs__() to return a tuple that happens to be allocated at
 
14248
the same address.)
 
14249
 
 
14250
- Added definition of AR to toplevel Makefile.  Renamed @buildno temp
 
14251
file to buildno1.
 
14252
 
 
14253
- Moved Include/assert.h to Parser/assert.h, which seems to be the
 
14254
only place where it's needed.
 
14255
 
 
14256
- Tweaked the dictionary lookup code again for some more speed
 
14257
(Vladimir Marangozov).
 
14258
 
 
14259
- NT build: Changed the way python15.lib is included in the other
 
14260
projects.  Per Mark Hammond's suggestion, add it to the extra libs in
 
14261
Settings instead of to the project's source files.
 
14262
 
 
14263
- regrtest.py: Change default verbosity so that there are only three
 
14264
levels left: -q, default and -v.  In default mode, the name of each
 
14265
test is now printed.  -v is the same as the old -vv.  -q is more quiet
 
14266
than the old default mode.
 
14267
 
 
14268
- Removed the old FAQ from the distribution.  You now have to get it
 
14269
from the web!
 
14270
 
 
14271
- Removed the PC/make_nt.in file from the distribution; it is no
 
14272
longer needed.
 
14273
 
 
14274
- Changed the build sequence so that shared modules are built last.
 
14275
This fixes things for AIX and doesn't hurt elsewhere.
 
14276
 
 
14277
- Improved test for GNU MP v1 in mpzmodule.c
 
14278
 
 
14279
- fileobject.c: ftell() on Linux discards all buffered data; changed
 
14280
read() code to use lseek() instead to get the same effect
 
14281
 
 
14282
- configure.in, configure, importdl.c: NeXT sharedlib fixes
 
14283
 
 
14284
- tupleobject.c: PyTuple_SetItem asserts refcnt==1
 
14285
 
 
14286
- resource.c: Different strategy regarding whether to declare
 
14287
getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
 
14288
conflicting decls in its headers.  Choice: only declare the return
 
14289
type, not the argument prototype, and not on Linux.
 
14290
 
 
14291
- importdl.c, configure*: set sharedlib extensions properly for NeXT
 
14292
 
 
14293
- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
 
14294
fixed; moved addition of PURIFY to LINKCC to configure
 
14295
 
 
14296
- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
 
14297
added to shup up various compilers.
 
14298
 
 
14299
- _tkinter.c: removed buggy mac #ifndef
 
14300
 
 
14301
- Doc: various Mac documentation changes, added docs for 'ic' module
 
14302
 
 
14303
- PC/make_nt.in: deleted
 
14304
 
 
14305
- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
 
14306
"")
 
14307
 
 
14308
- test_rotor.py: print b -> print `b`
 
14309
 
 
14310
- Tkinter.py: (tagOrId) -> (tagOrId,)
 
14311
 
 
14312
- Tkinter.py: the Tk class now also has a configure() method and
 
14313
friends (they have been moved to the Misc class to accomplish this).
 
14314
 
 
14315
- dict.get(key[, default]) returns dict[key] if it exists, or default
 
14316
if it doesn't.  The default defaults to None.  This is quicker for
 
14317
some applications than using either has_key() or try:...except
 
14318
KeyError:....
 
14319
 
 
14320
- Tools/webchecker/: some small changes to webchecker.py; added
 
14321
websucker.py (a simple web site mirroring script).
 
14322
 
 
14323
- Dictionary objects now have a get() method (also in UserDict.py).
 
14324
dict.get(key, default) returns dict[key] if it exists and default
 
14325
otherwise; default defaults to None.
 
14326
 
 
14327
- Tools/scripts/logmerge.py: print the author, too.
 
14328
 
 
14329
- Changes to import: support for "import a.b.c" is now built in.  See
 
14330
http://grail.cnri.reston.va.us/python/essays/packages.html
 
14331
for more info.  Most important deviations from "ni.py": __init__.py is
 
14332
executed in the package's namespace instead of as a submodule; and
 
14333
there's no support for "__" or "__domain__".  Note that "ni.py" is not
 
14334
changed to match this -- it is simply declared obsolete (while at the
 
14335
same time, it is documented...:-( ).
 
14336
Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
 
14337
for an example implementation of hierarchical module import written in
 
14338
Python).
 
14339
 
 
14340
- More changes to import: the site.py module is now imported by
 
14341
default when Python is initialized; use -S to disable it.  The site.py
 
14342
module extends the path with several more directories: site-packages
 
14343
inside the lib/python1.5/ directory, site-python in the lib/
 
14344
directory, and pathnames mentioned in *.pth files found in either of
 
14345
those directories.  See
 
14346
http://grail.cnri.reston.va.us/python/essays/packages.html
 
14347
for more info.
 
14348
 
 
14349
- Changes to standard library subdirectory names: those subdirectories
 
14350
that are not packages have been renamed with a hypen in their name,
 
14351
e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
 
14352
The test suite is now a package -- to run a test, you must now use
 
14353
"import test.test_foo".
 
14354
 
 
14355
- A completely new re.py module is provided (thanks to Andrew
 
14356
Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
 
14357
"pcre" re compiler and engine.  For a while, the "old" re.py (which
 
14358
was new in 1.5a3!) will be kept around as re1.py.  The "old" regex
 
14359
module and underlying parser and engine are still present -- while
 
14360
regex is now officially obsolete, it will probably take several major
 
14361
release cycles before it can be removed.
 
14362
 
 
14363
- The posix module now has a strerror() function which translates an
 
14364
error code to a string.
 
14365
 
 
14366
- The emacs.py module (which was long obsolete) has been removed.
 
14367
 
 
14368
- The universal makefile Misc/Makefile.pre.in now features an
 
14369
"install" target.  By default, installed shared libraries go into
 
14370
$exec_prefix/lib/python$VERSION/site-packages/.
 
14371
 
 
14372
- The install-sh script is installed with the other configuration
 
14373
specific files (in the config/ subdirectory).
 
14374
 
 
14375
- It turns out whatsound.py and sndhdr.py were identical modules.
 
14376
Since there's also an imghdr.py file, I propose to make sndhdr.py the
 
14377
official one.  For compatibility, whatsound.py imports * from
 
14378
sndhdr.py.
 
14379
 
 
14380
- Class objects have a new attribute, __module__, giving the name of
 
14381
the module in which they were declared.  This is useful for pickle and
 
14382
for printing the full name of a class exception.
 
14383
 
 
14384
- Many extension modules no longer issue a fatal error when their
 
14385
initialization fails; the importing code now checks whether an error
 
14386
occurred during module initialization, and correctly propagates the
 
14387
exception to the import statement.
 
14388
 
 
14389
- Most extension modules now raise class-based exceptions (except when
 
14390
-X is used).
 
14391
 
 
14392
- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
 
14393
thread state -- just don't manipulate the lock if it isn't there.
 
14394
 
 
14395
- Fixed a bug in Python/getopt.c that made it do the wrong thing when
 
14396
an option was a single '-'.  Thanks to Andrew Kuchling.
 
14397
 
 
14398
- New module mimetypes.py will guess a MIME type from a filename's
 
14399
extension.
 
14400
 
 
14401
- Windows: the DLL version is now settable via a resource rather than
 
14402
being hardcoded.  This can be used for "branding" a binary Python
 
14403
distribution.
 
14404
 
 
14405
- urllib.py is now threadsafe -- it now uses re instead of regex, and
 
14406
sys.exc_info() instead of sys.exc_{type,value}.
 
14407
 
 
14408
- Many other library modules that used to use
 
14409
sys.exc_{type,value,traceback} are now more thread-safe by virtue of
 
14410
using sys.exc_info().
 
14411
 
 
14412
- The functions in popen2 have an optional buffer size parameter.
 
14413
Also, the command argument can now be either a string (passed to the
 
14414
shell) or a list of arguments (passed directly to execv).
 
14415
 
 
14416
- Alas, the thread support for _tkinter released with 1.5a3 didn't
 
14417
work.  It's been rewritten.  The bad news is that it now requires a
 
14418
modified version of a file in the standard Tcl distribution, which you
 
14419
must compile with a -I option pointing to the standard Tcl source
 
14420
tree.  For this reason, the thread support is disabled by default.
 
14421
 
 
14422
- The errno extension module adds two tables: errorcode maps errno
 
14423
numbers to errno names (e.g. EINTR), and errorstr maps them to
 
14424
message strings.  (The latter is redundant because the new call
 
14425
posix.strerror() now does the same, but alla...)  (Marc-Andre Lemburg)
 
14426
 
 
14427
- The readline extension module now provides some interfaces to
 
14428
internal readline routines that make it possible to write a completer
 
14429
in Python.  An example completer, rlcompleter.py, is provided.
 
14430
 
 
14431
        When completing a simple identifier, it completes keywords,
 
14432
        built-ins and globals in __main__; when completing
 
14433
        NAME.NAME..., it evaluates (!) the expression up to the last
 
14434
        dot and completes its attributes.
 
14435
 
 
14436
        It's very cool to do "import string" type "string.", hit the
 
14437
        completion key (twice), and see the list of names defined by
 
14438
        the string module!
 
14439
 
 
14440
        Tip: to use the tab key as the completion key, call
 
14441
 
 
14442
            readline.parse_and_bind("tab: complete")
 
14443
 
 
14444
- The traceback.py module has a new function tb_lineno() by Marc-Andre
 
14445
Lemburg which extracts the line number from the linenumber table in
 
14446
the code object.  Apparently the traceback object doesn't contains the
 
14447
right linenumber when -O is used.  Rather than guessing whether -O is
 
14448
on or off, the module itself uses tb_lineno() unconditionally.
 
14449
 
 
14450
- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
 
14451
to tag_bind() so it works again.
 
14452
 
 
14453
- The pystone script is now a standard library module.  Example use:
 
14454
"import test.pystone; test.pystone.main()".
 
14455
 
 
14456
- The import of the readline module in interactive mode is now also
 
14457
attempted when -i is specified.  (Yes, I know, giving in to Marc-Andre
 
14458
Lemburg, who asked for this. :-)
 
14459
 
 
14460
- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
 
14461
Mullender, to be closer to the standard.  This fixes the getaddr()
 
14462
method.  Unfortunately, getaddrlist() is as broken as ever, since it
 
14463
splits on commas without regard for RFC 822 quoting conventions.
 
14464
 
 
14465
- pprint.py: correctly emit trailing "," in singleton tuples.
 
14466
 
 
14467
- _tkinter.c: export names for its type objects, TkappType and
 
14468
TkttType.
 
14469
 
 
14470
- pickle.py: use __module__ when defined; fix a particularly hard to
 
14471
reproduce bug that confuses the memo when temporary objects are
 
14472
returned by custom pickling interfaces; and a semantic change: when
 
14473
unpickling the instance variables of an instance, use
 
14474
inst.__dict__.update(value) instead of a for loop with setattr() over
 
14475
the value.keys().  This is more consistent (the pickling doesn't use
 
14476
getattr() either but pickles inst.__dict__) and avoids problems with
 
14477
instances that have a __setattr__ hook.  But it *is* a semantic change
 
14478
(because the setattr hook is no longer used).  So beware!
 
14479
 
 
14480
- config.h is now installed (at last) in
 
14481
$exec_prefix/include/python1.5/.  For most sites, this means that it
 
14482
is actually in $prefix/include/python1.5/, with all the other Python
 
14483
include files, since $prefix and $exec_prefix are the same by
 
14484
default.
 
14485
 
 
14486
- The imp module now supports parts of the functionality to implement
 
14487
import of hierarchical module names.  It now supports find_module()
 
14488
and load_module() for all types of modules.  Docstrings have been
 
14489
added for those functions in the built-in imp module that are still
 
14490
relevant (some old interfaces are obsolete).  For a sample
 
14491
implementation of hierarchical module import in Python, see the new
 
14492
library module knee.py.
 
14493
 
 
14494
- The % operator on string objects now allows arbitrary nested parens
 
14495
in a %(...)X style format.  (Brad Howes)
 
14496
 
 
14497
- Reverse the order in which Setup and Setup.local are passed to the
 
14498
makesetup script.  This allows variable definitions in Setup.local to
 
14499
override definitions in Setup.  (But you'll still have to edit Setup
 
14500
if you want to disable modules that are enabled by default, or if such
 
14501
modules need non-standard options.)
 
14502
 
 
14503
- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
 
14504
is like PyImport_ImporModule(name) but receives the globals and locals
 
14505
dict and the fromlist arguments as well.  (The name is a char*; the
 
14506
others are PyObject*s).
 
14507
 
 
14508
- The 'p' format in the struct extension module alloded to above is
 
14509
new in 1.5a4.
 
14510
 
 
14511
- The types.py module now uses try-except in a few places to make it
 
14512
more likely that it can be imported in restricted mode.  Some type
 
14513
names are undefined in that case, e.g. CodeType (inaccessible),
 
14514
FileType (not always accessible), and TracebackType and FrameType
 
14515
(inaccessible).
 
14516
 
 
14517
- In urllib.py: added separate administration of temporary files
 
14518
created y URLopener.retrieve() so cleanup() can properly remove them.
 
14519
The old code removed everything in tempcache which was a bad idea if
 
14520
the user had passed a non-temp file into it.  Also, in basejoin(),
 
14521
interpret relative paths starting in "../".  This is necessary if the
 
14522
server uses symbolic links.
 
14523
 
 
14524
- The Windows build procedure and project files are now based on
 
14525
Microsoft Visual C++ 5.x.  The build now takes place in the PCbuild
 
14526
directory.  It is much more robust, and properly builds separate Debug
 
14527
and Release versions.  (The installer will be added shortly.)
 
14528
 
 
14529
- Added casts and changed some return types in regexpr.c to avoid
 
14530
compiler warnings or errors on some platforms.
 
14531
 
 
14532
- The AIX build tools for shared libraries now supports VPATH.  (Donn
 
14533
Cave)
 
14534
 
 
14535
- By default, disable the "portable" multimedia modules audioop,
 
14536
imageop, and rgbimg, since they don't work on 64-bit platforms.
 
14537
 
 
14538
- Fixed a nasty bug in cStringIO.c when code was actually using the
 
14539
close() method (the destructors would try to free certain fields a
 
14540
second time).
 
14541
 
 
14542
- For those who think they need it, there's a "user.py" module.  This
 
14543
is *not* imported by default, but can be imported to run user-specific
 
14544
setup commands, ~/.pythonrc.py.
 
14545
 
 
14546
- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
 
14547
Vladimir Marangozov, and others.
 
14548
 
 
14549
- Added os.altsep; this is '/' on DOS/Windows, and None on systems
 
14550
with a sane filename syntax.
 
14551
 
 
14552
- os.py: Write out the dynamic OS choice, to avoid exec statements.
 
14553
Adding support for a new OS is now a bit more work, but I bet that
 
14554
'dos' or 'nt' will cover most situations...
 
14555
 
 
14556
- The obsolete exception AccessError is now really gone.
 
14557
 
 
14558
- Tools/faqwiz/: New installation instructions show how to maintain
 
14559
multiple FAQs.  Removed bootstrap script from end of faqwiz.py module.
 
14560
Added instructions to bootstrap script, too.  Version bumped to 0.8.1.
 
14561
Added <html>...</html> feature suggested by Skip Montanaro.  Added
 
14562
leading text for Roulette, default to 'Hit Reload ...'.  Fix typo in
 
14563
default SRCDIR.
 
14564
 
 
14565
- Documentation for the relatively new modules "keyword" and "symbol"
 
14566
has been added (to the end of the section on the parser extension
 
14567
module).
 
14568
 
 
14569
- In module bisect.py, but functions have two optional argument 'lo'
 
14570
and 'hi' which allow you to specify a subsequence of the array to
 
14571
operate on.
 
14572
 
 
14573
- In ftplib.py, changed most methods to return their status (even when
 
14574
it is always "200 OK") rather than swallowing it.
 
14575
 
 
14576
- main() now calls setlocale(LC_ALL, ""), if setlocale() and
 
14577
<locale.h> are defined.
 
14578
 
 
14579
- Changes to configure.in, the configure script, and both
 
14580
Makefile.pre.in files, to support SGI's SGI_ABI platform selection
 
14581
environment variable.
 
14582
 
 
14583
 
 
14584
======================================================================
 
14585
 
 
14586
 
 
14587
From 1.4 to 1.5a3
 
14588
=================
 
14589
 
 
14590
Security
 
14591
--------
 
14592
 
 
14593
- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
 
14594
please use the new version.  The old version has a huge security leak.
 
14595
 
 
14596
Miscellaneous
 
14597
-------------
 
14598
 
 
14599
- Because of various (small) incompatible changes in the Python
 
14600
bytecode interpreter, the magic number for .pyc files has changed
 
14601
again.
 
14602
 
 
14603
- The default module search path is now much saner.  Both on Unix and
 
14604
Windows, it is essentially derived from the path to the executable
 
14605
(which can be overridden by setting the environment variable
 
14606
$PYTHONHOME).  The value of $PYTHONPATH on Windows is now inserted in
 
14607
front of the default path, like in Unix (instead of overriding the
 
14608
default path).  On Windows, the directory containing the executable is
 
14609
added to the end of the path.
 
14610
 
 
14611
- A new version of python-mode.el for Emacs has been included.  Also,
 
14612
a new file ccpy-style.el has been added to configure Emacs cc-mode for
 
14613
the preferred style in Python C sources.
 
14614
 
 
14615
- On Unix, when using sys.argv[0] to insert the script directory in
 
14616
front of sys.path, expand a symbolic link.  You can now install a
 
14617
program in a private directory and have a symbolic link to it in a
 
14618
public bin directory, and it will put the private directory in the
 
14619
module search path.  Note that the symlink is expanded in sys.path[0]
 
14620
but not in sys.argv[0], so you can still tell the name by which you
 
14621
were invoked.
 
14622
 
 
14623
- It is now recommended to use ``#!/usr/bin/env python'' instead of
 
14624
``#!/usr/local/bin/python'' at the start of executable scripts, except
 
14625
for CGI scripts.  It has been determined that the use of /usr/bin/env
 
14626
is more portable than that of /usr/local/bin/python -- scripts almost
 
14627
never have to be edited when the Python interpreter lives in a
 
14628
non-standard place.  Note that this doesn't work for CGI scripts since
 
14629
the python executable often doesn't live in the HTTP server's default
 
14630
search path.
 
14631
 
 
14632
- The silly -s command line option and the corresponding
 
14633
PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
 
14634
flag in the Python/C API) are gone.
 
14635
 
 
14636
- Most problems on 64-bit platforms should now be fixed.  Andrew
 
14637
Kuchling helped.  Some uncommon extension modules are still not
 
14638
clean (image and audio ops?).
 
14639
 
 
14640
- Fixed a bug where multiple anonymous tuple arguments would be mixed up
 
14641
when using the debugger or profiler (reported by Just van Rossum).
 
14642
The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
 
14643
would print the wrong value when run under the debugger or profiler.
 
14644
 
 
14645
- The hacks that the dictionary implementation used to speed up
 
14646
repeated lookups of the same C string were removed; these were a
 
14647
source of subtle problems and don't seem to serve much of a purpose
 
14648
any longer.
 
14649
 
 
14650
- All traces of support for the long dead access statement have been
 
14651
removed from the sources.
 
14652
 
 
14653
- Plugged the two-byte memory leak in the tokenizer when reading an
 
14654
interactive EOF.
 
14655
 
 
14656
- There's a -O option to the interpreter that removes SET_LINENO
 
14657
instructions and assert statements (see below); it uses and produces
 
14658
.pyo files instead of .pyc files.  The speedup is only a few percent
 
14659
in most cases.  The line numbers are still available in the .pyo file,
 
14660
as a separate table (which is also available in .pyc files).  However,
 
14661
the removal of the SET_LINENO instructions means that the debugger
 
14662
(pdb) can't set breakpoints on lines in -O mode.  The traceback module
 
14663
contains a function to extract a line number from the code object
 
14664
referenced in a traceback object.  In the future it should be possible
 
14665
to write external bytecode optimizers that create better optimized
 
14666
.pyo files, and there should be more control over optimization;
 
14667
consider the -O option a "teaser".  Without -O, the assert statement
 
14668
actually generates code that first checks __debug__; if this variable
 
14669
is false, the assertion is not checked.  __debug__ is a built-in
 
14670
variable whose value is initialized to track the -O flag (it's true
 
14671
iff -O is not specified).  With -O, no code is generated for assert
 
14672
statements, nor for code of the form ``if __debug__: <something>''.
 
14673
Sorry, no further constant folding happens.
 
14674
 
 
14675
 
 
14676
Performance
 
14677
-----------
 
14678
 
 
14679
- It's much faster (almost twice for pystone.py -- see
 
14680
Tools/scripts).  See the entry on string interning below.
 
14681
 
 
14682
- Some speedup by using separate free lists for method objects (both
 
14683
the C and the Python variety) and for floating point numbers.
 
14684
 
 
14685
- Big speedup by allocating frame objects with a single malloc() call.
 
14686
The Python/C API for frames is changed (you shouldn't be using this
 
14687
anyway).
 
14688
 
 
14689
- Significant speedup by inlining some common opcodes for common operand 
 
14690
types (e.g.  i+i, i-i, and list[i]).  Fredrik Lundh.
 
14691
 
 
14692
- Small speedup by reordering the method tables of some common
 
14693
objects (e.g. list.append is now first).
 
14694
 
 
14695
- Big optimization to the read() method of file objects.  A read()
 
14696
without arguments now attempts to use fstat to allocate a buffer of
 
14697
the right size; for pipes and sockets, it will fall back to doubling
 
14698
the buffer size.  While that the improvement is real on all systems,
 
14699
it is most dramatic on Windows.
 
14700
 
 
14701
 
 
14702
Documentation
 
14703
-------------
 
14704
 
 
14705
- Many new pieces of library documentation were contributed, mostly by
 
14706
Andrew Kuchling.  Even cmath is now documented!  There's also a
 
14707
chapter of the library manual, "libundoc.tex", which provides a
 
14708
listing of all undocumented modules, plus their status (e.g. internal,
 
14709
obsolete, or in need of documentation).  Also contributions by Sue
 
14710
Williams, Skip Montanaro, and some module authors who succumbed to
 
14711
pressure to document their own contributed modules :-).  Note that
 
14712
printing the documentation now kills fewer trees -- the margins have
 
14713
been reduced.
 
14714
 
 
14715
- I have started documenting the Python/C API. Unfortunately this project 
 
14716
hasn't been completed yet.  It will be complete before the final release of 
 
14717
Python 1.5, though.  At the moment, it's better to read the LaTeX source 
 
14718
than to attempt to run it through LaTeX and print the resulting dvi file.
 
14719
 
 
14720
- The posix module (and hence os.py) now has doc strings!  Thanks to Neil 
 
14721
Schemenauer.  I received a few other contributions of doc strings.  In most 
 
14722
other places, doc strings are still wishful thinking...
 
14723
 
 
14724
 
 
14725
Language changes
 
14726
----------------
 
14727
 
 
14728
- Private variables with leading double underscore are now a permanent 
 
14729
feature of the language.  (These were experimental in release 1.4.  I have 
 
14730
favorable experience using them; I can't label them "experimental" 
 
14731
forever.)
 
14732
 
 
14733
- There's new string literal syntax for "raw strings".  Prefixing a string 
 
14734
literal with the letter r (or R) disables all escape processing in the 
 
14735
string; for example, r'\n' is a two-character string consisting of a 
 
14736
backslash followed by the letter n.  This combines with all forms of string 
 
14737
quotes; it is actually useful for triple quoted doc strings which might 
 
14738
contain references to \n or \t.  An embedded quote prefixed with a 
 
14739
backslash does not terminate the string, but the backslash is still 
 
14740
included in the string; for example, r'\'' is a two-character string 
 
14741
consisting of a backslash and a quote.  (Raw strings are also 
 
14742
affectionately known as Robin strings, after their inventor, Robin 
 
14743
Friedrich.)
 
14744
 
 
14745
- There's a simple assert statement, and a new exception
 
14746
AssertionError.  For example, ``assert foo > 0'' is equivalent to ``if
 
14747
not foo > 0: raise AssertionError''.  Sorry, the text of the asserted
 
14748
condition is not available; it would be too complicated to generate
 
14749
code for this (since the code is generated from a parse tree).
 
14750
However, the text is displayed as part of the traceback!
 
14751
 
 
14752
- The raise statement has a new feature: when using "raise SomeClass,
 
14753
somevalue" where somevalue is not an instance of SomeClass, it
 
14754
instantiates SomeClass(somevalue).  In 1.5a4, if somevalue is an
 
14755
instance of a *derived* class of SomeClass, the exception class raised
 
14756
is set to somevalue.__class__, and SomeClass is ignored after that.
 
14757
 
 
14758
- Duplicate keyword arguments are now detected at compile time;
 
14759
f(a=1,a=2) is now a syntax error.
 
14760
 
 
14761
 
 
14762
Changes to builtin features
 
14763
---------------------------
 
14764
 
 
14765
- There's a new exception FloatingPointError (used only by Lee Busby's
 
14766
patches to catch floating point exceptions, at the moment).
 
14767
 
 
14768
- The obsolete exception ConflictError (presumably used by the long
 
14769
obsolete access statement) has been deleted.
 
14770
 
 
14771
- There's a new function sys.exc_info() which returns the tuple 
 
14772
(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
 
14773
 
 
14774
- There's a new variable sys.executable, pointing to the executable file 
 
14775
for the Python interpreter.
 
14776
 
 
14777
- The sort() methods for lists no longer uses the C library qsort(); I
 
14778
wrote my own quicksort implementation, with lots of help (in the form
 
14779
of a kind of competition) from Tim Peters.  This solves a bug in
 
14780
dictionary comparisons on some Solaris versions when Python is built
 
14781
with threads, and makes sorting lists even faster.
 
14782
 
 
14783
- The semantics of comparing two dictionaries have changed, to make
 
14784
comparison of unequal dictionaries faster.  A shorter dictionary is
 
14785
always considered smaller than a larger dictionary.  For dictionaries
 
14786
of the same size, the smallest differing element determines the
 
14787
outcome (which yields the same results as before in this case, without
 
14788
explicit sorting).  Thanks to Aaron Watters for suggesting something
 
14789
like this.
 
14790
 
 
14791
- The semantics of try-except have changed subtly so that calling a
 
14792
function in an exception handler that itself raises and catches an
 
14793
exception no longer overwrites the sys.exc_* variables.  This also
 
14794
alleviates the problem that objects referenced in a stack frame that
 
14795
caught an exception are kept alive until another exception is caught
 
14796
-- the sys.exc_* variables are restored to their previous value when
 
14797
returning from a function that caught an exception.
 
14798
 
 
14799
- There's a new "buffer" interface.  Certain objects (e.g. strings and
 
14800
arrays) now support the "buffer" protocol.  Buffer objects are acceptable 
 
14801
whenever formerly a string was required for a write operation; mutable 
 
14802
buffer objects can be the target of a read operation using the call
 
14803
f.readinto(buffer).  A cool feature is that regular expression matching now 
 
14804
also work on array objects.  Contribution by Jack Jansen.  (Needs 
 
14805
documentation.)
 
14806
 
 
14807
- String interning: dictionary lookups are faster when the lookup
 
14808
string object is the same object as the key in the dictionary, not
 
14809
just a string with the same value.  This is done by having a pool of
 
14810
"interned" strings.  Most names generated by the interpreter are now
 
14811
automatically interned, and there's a new built-in function intern(s)
 
14812
that returns the interned version of a string.  Interned strings are
 
14813
not a different object type, and interning is totally optional, but by
 
14814
interning most keys a speedup of about 15% was obtained for the
 
14815
pystone benchmark.
 
14816
 
 
14817
- Dictionary objects have several new methods; clear() and copy() have
 
14818
the obvious semantics, while update(d) merges the contents of another
 
14819
dictionary d into this one, overriding existing keys.  The dictionary
 
14820
implementation file is now called dictobject.c rather than the
 
14821
confusing mappingobject.c.
 
14822
 
 
14823
- The intrinsic function dir() is much smarter; it looks in __dict__,
 
14824
__members__ and __methods__.
 
14825
 
 
14826
- The intrinsic functions int(), long() and float() can now take a
 
14827
string argument and then do the same thing as string.atoi(),
 
14828
string.atol(), and string.atof().  No second 'base' argument is
 
14829
allowed, and complex() does not take a string (nobody cared enough).
 
14830
 
 
14831
- When a module is deleted, its globals are now deleted in two phases.
 
14832
In the first phase, all variables whose name begins with exactly one
 
14833
underscore are replaced by None; in the second phase, all variables
 
14834
are deleted.  This makes it possible to have global objects whose
 
14835
destructors depend on other globals.  The deletion order within each
 
14836
phase is still random.
 
14837
 
 
14838
- It is no longer an error for a function to be called without a
 
14839
global variable __builtins__ -- an empty directory will be provided
 
14840
by default.
 
14841
 
 
14842
- Guido's corollary to the "Don Beaudry hook": it is now possible to
 
14843
do metaprogramming by using an instance as a base class.  Not for the
 
14844
faint of heart; and undocumented as yet, but basically if a base class
 
14845
is an instance, its class will be instantiated to create the new
 
14846
class.  Jim Fulton will love it -- it also works with instances of his
 
14847
"extension classes", since it is triggered by the presence of a
 
14848
__class__ attribute on the purported base class.  See
 
14849
Demo/metaclasses/index.html for an explanation and see that directory
 
14850
for examples.
 
14851
 
 
14852
- Another change is that the Don Beaudry hook is now invoked when
 
14853
*any* base class is special.  (Up to 1.5a3, the *last* special base
 
14854
class is used; in 1.5a4, the more rational choice of the *first*
 
14855
special base class is used.)
 
14856
 
 
14857
- New optional parameter to the readlines() method of file objects.
 
14858
This indicates the number of bytes to read (the actual number of bytes
 
14859
read will be somewhat larger due to buffering reading until the end of
 
14860
the line).  Some optimizations have also been made to speed it up (but
 
14861
not as much as read()).
 
14862
 
 
14863
- Complex numbers no longer have the ".conj" pseudo attribute; use
 
14864
z.conjugate() instead, or complex(z.real, -z.imag).  Complex numbers
 
14865
now *do* support the __members__ and __methods__ special attributes.
 
14866
 
 
14867
- The complex() function now looks for a __complex__() method on class
 
14868
instances before giving up.
 
14869
 
 
14870
- Long integers now support arbitrary shift counts, so you can now
 
14871
write 1L<<1000000, memory permitting.  (Python 1.4 reports "outrageous
 
14872
shift count for this.)
 
14873
 
 
14874
- The hex() and oct() functions have been changed so that for regular
 
14875
integers, they never emit a minus sign.  For example, on a 32-bit
 
14876
machine, oct(-1) now returns '037777777777' and hex(-1) returns
 
14877
'0xffffffff'.  While this may seem inconsistent, it is much more
 
14878
useful.  (For long integers, a minus sign is used as before, to fit
 
14879
the result in memory :-)
 
14880
 
 
14881
- The hash() function computes better hashes for several data types,
 
14882
including strings, floating point numbers, and complex numbers.
 
14883
 
 
14884
 
 
14885
New extension modules
 
14886
---------------------
 
14887
 
 
14888
- New extension modules cStringIO.c and cPickle.c, written by Jim
 
14889
Fulton and other folks at Digital Creations.  These are much more
 
14890
efficient than their Python counterparts StringIO.py and pickle.py,
 
14891
but don't support subclassing.  cPickle.c clocks up to 1000 times
 
14892
faster than pickle.py; cStringIO.c's improvement is less dramatic but
 
14893
still significant.
 
14894
 
 
14895
- New extension module zlibmodule.c, interfacing to the free zlib
 
14896
library (gzip compatible compression).  There's also a module gzip.py
 
14897
which provides a higher level interface.  Written by Andrew Kuchling
 
14898
and Jeremy Hylton.
 
14899
 
 
14900
- New module readline; see the "miscellaneous" section above.
 
14901
 
 
14902
- New Unix extension module resource.c, by Jeremy Hylton, provides
 
14903
access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
 
14904
related symbolic constants.
 
14905
 
 
14906
- New extension puremodule.c, by Barry Warsaw, which interfaces to the
 
14907
Purify(TM) C API.  See also the file Misc/PURIFY.README.  It is also
 
14908
possible to enable Purify by simply setting the PURIFY Makefile
 
14909
variable in the Modules/Setup file.
 
14910
 
 
14911
 
 
14912
Changes in extension modules
 
14913
----------------------------
 
14914
 
 
14915
- The struct extension module has several new features to control byte
 
14916
order and word size.  It supports reading and writing IEEE floats even
 
14917
on platforms where this is not the native format.  It uses uppercase
 
14918
format codes for unsigned integers of various sizes (always using
 
14919
Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
 
14920
and 'p' for "Pascal strings" (with a leading length byte, included in
 
14921
the size; blame Hannu Krosing; new in 1.5a4).  A prefix '>' forces
 
14922
big-endian data and '<' forces little-endian data; these also select
 
14923
standard data sizes and disable automatic alignment (use pad bytes as
 
14924
needed).
 
14925
 
 
14926
- The array module supports uppercase format codes for unsigned data
 
14927
formats (like the struct module).
 
14928
 
 
14929
- The fcntl extension module now exports the needed symbolic
 
14930
constants.  (Formerly these were in FCNTL.py which was not available
 
14931
or correct for all platforms.)
 
14932
 
 
14933
- The extension modules dbm, gdbm and bsddb now check that the
 
14934
database is still open before making any new calls.
 
14935
 
 
14936
- The dbhash module is no more.  Use bsddb instead.  (There's a third
 
14937
party interface for the BSD 2.x code somewhere on the web; support for
 
14938
bsddb will be deprecated.)
 
14939
 
 
14940
- The gdbm module now supports a sync() method.
 
14941
 
 
14942
- The socket module now has some new functions: getprotobyname(), and
 
14943
the set {ntoh,hton}{s,l}().
 
14944
 
 
14945
- Various modules now export their type object: socket.SocketType,
 
14946
array.ArrayType.
 
14947
 
 
14948
- The socket module's accept() method now returns unknown addresses as
 
14949
a tuple rather than raising an exception.  (This can happen in
 
14950
promiscuous mode.)  Theres' also a new function getprotobyname().
 
14951
 
 
14952
- The pthread support for the thread module now works on most platforms.
 
14953
 
 
14954
- STDWIN is now officially obsolete.  Support for it will eventually
 
14955
be removed from the distribution.
 
14956
 
 
14957
- The binascii extension module is now hopefully fully debugged.
 
14958
(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
 
14959
received.)
 
14960
 
 
14961
- audioop.c: added a ratecv() function; better handling of overflow in
 
14962
add().
 
14963
 
 
14964
- posixmodule.c: now exports the O_* flags (O_APPEND etc.).  On
 
14965
Windows, also O_TEXT and O_BINARY.  The 'error' variable (the
 
14966
exception is raises) is renamed -- its string value is now "os.error",
 
14967
so newbies don't believe they have to import posix (or nt) to catch
 
14968
it when they see os.error reported as posix.error.  The execve()
 
14969
function now accepts any mapping object for the environment.
 
14970
 
 
14971
- A new version of the al (audio library) module for SGI was
 
14972
contributed by Sjoerd Mullender.
 
14973
 
 
14974
- The regex module has a new function get_syntax() which retrieves the
 
14975
syntax setting set by set_syntax().  The code was also sanitized,
 
14976
removing worries about unclean error handling.  See also below for its
 
14977
successor, re.py.
 
14978
 
 
14979
- The "new" module (which creates new objects of various types) once
 
14980
again has a fully functioning new.function() method.  Dangerous as
 
14981
ever!  Also, new.code() has several new arguments.
 
14982
 
 
14983
- A problem has been fixed in the rotor module: on systems with signed
 
14984
characters, rotor-encoded data was not portable when the key contained
 
14985
8-bit characters.  Also, setkey() now requires its argument rather
 
14986
than having broken code to default it.
 
14987
 
 
14988
- The sys.builtin_module_names variable is now a tuple.  Another new
 
14989
variables in sys is sys.executable (the full path to the Python
 
14990
binary, if known).
 
14991
 
 
14992
- The specs for time.strftime() have undergone some revisions.  It
 
14993
appears that not all format characters are supported in the same way
 
14994
on all platforms.  Rather than reimplement it, we note these
 
14995
differences in the documentation, and emphasize the shared set of
 
14996
features.  There's also a thorough test set (that occasionally finds
 
14997
problems in the C library implementation, e.g. on some Linuxes),
 
14998
thanks to Skip Montanaro.
 
14999
 
 
15000
- The nis module seems broken when used with NIS+; unfortunately
 
15001
nobody knows how to fix it.  It should still work with old NIS.
 
15002
 
 
15003
 
 
15004
New library modules
 
15005
-------------------
 
15006
 
 
15007
- New (still experimental) Perl-style regular expression module,
 
15008
re.py, which uses a new interface for matching as well as a new
 
15009
syntax; the new interface avoids the thread-unsafety of the regex
 
15010
interface.  This comes with a helper extension reopmodule.c and vastly
 
15011
rewritten regexpr.c.  Most work on this was done by Jeffrey Ollie, Tim
 
15012
Peters, and Andrew Kuchling.  See the documentation libre.tex.  In
 
15013
1.5, the old regex module is still fully supported; in the future, it
 
15014
will become obsolete.
 
15015
 
 
15016
- New module gzip.py; see zlib above.
 
15017
 
 
15018
- New module keyword.py exports knowledge about Python's built-in
 
15019
keywords.  (New version by Ka-Ping Yee.)
 
15020
 
 
15021
- New module pprint.py (with documentation) which supports
 
15022
pretty-printing of lists, tuples, & dictionaries recursively.  By Fred
 
15023
Drake.
 
15024
 
 
15025
- New module code.py.  The function code.compile_command() can
 
15026
determine whether an interactively entered command is complete or not,
 
15027
distinguishing incomplete from invalid input.  (XXX Unfortunately,
 
15028
this seems broken at this moment, and I don't have the time to fix
 
15029
it.  It's probably better to add an explicit interface to the parser
 
15030
for this.)
 
15031
 
 
15032
- There is now a library module xdrlib.py which can read and write the
 
15033
XDR data format as used by Sun RPC, for example.  It uses the struct
 
15034
module.
 
15035
 
 
15036
 
 
15037
Changes in library modules
 
15038
--------------------------
 
15039
 
 
15040
- Module codehack.py is now completely obsolete.
 
15041
 
 
15042
- The pickle.py module has been updated to make it compatible with the
 
15043
new binary format that cPickle.c produces.  By default it produces the
 
15044
old all-ASCII format compatible with the old pickle.py, still much
 
15045
faster than pickle.py; it will read both formats automatically.  A few
 
15046
other updates have been made.
 
15047
 
 
15048
- A new helper module, copy_reg.py, is provided to register extensions
 
15049
to the pickling code.
 
15050
 
 
15051
- Revamped module tokenize.py is much more accurate and has an
 
15052
interface that makes it a breeze to write code to colorize Python
 
15053
source code.  Contributed by Ka-Ping Yee.
 
15054
 
 
15055
- In ihooks.py, ModuleLoader.load_module() now closes the file under
 
15056
all circumstances.
 
15057
 
 
15058
- The tempfile.py module has a new class, TemporaryFile, which creates
 
15059
an open temporary file that will be deleted automatically when
 
15060
closed.  This works on Windows and MacOS as well as on Unix.  (Jim
 
15061
Fulton.)
 
15062
 
 
15063
- Changes to the cgi.py module: Most imports are now done at the
 
15064
top of the module, which provides a speedup when using ni (Jim
 
15065
Fulton).  The problem with file upload to a Windows platform is solved
 
15066
by using the new tempfile.TemporaryFile class; temporary files are now
 
15067
always opened in binary mode (Jim Fulton).  The cgi.escape() function
 
15068
now takes an optional flag argument that quotes '"' to '&quot;'.  It
 
15069
is now possible to invoke cgi.py from a command line script, to test
 
15070
cgi scripts more easily outside an http server.  There's an optional
 
15071
limit to the size of uploads to POST (Skip Montanaro).  Added a
 
15072
'strict_parsing' option to all parsing functions (Jim Fulton).  The
 
15073
function parse_qs() now uses urllib.unquote() on the name as well as
 
15074
the value of fields (Clarence Gardner).  The FieldStorage class now
 
15075
has a __len__() method.
 
15076
 
 
15077
- httplib.py: the socket object is no longer closed; all HTTP/1.*
 
15078
responses are now accepted; and it is now thread-safe (by not using
 
15079
the regex module).
 
15080
 
 
15081
- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
 
15082
 
 
15083
- The popen2.py module is now rewritten using a class, which makes
 
15084
access to the standard error stream and the process id of the
 
15085
subprocess possible.
 
15086
 
 
15087
- Added timezone support to the rfc822.py module, in the form of a
 
15088
getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
 
15089
Also added recognition of some non-standard date formats, by Lars
 
15090
Wirzenius, and RFC 850 dates (Chris Lawrence).
 
15091
 
 
15092
- mhlib.py: various enhancements, including almost compatible parsing
 
15093
of message sequence specifiers without invoking a subprocess.  Also
 
15094
added a createmessage() method by Lars Wirzenius.
 
15095
 
 
15096
- The StringIO.StringIO class now supports readline(nbytes).  (Lars 
 
15097
Wirzenius.)  (Of course, you should be using cStringIO for performance.)
 
15098
 
 
15099
- UserDict.py supports the new dictionary methods as well.
 
15100
 
 
15101
- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
 
15102
speed it up, and replace 0 seed values by 1 to avoid degeneration.
 
15103
A bug was fixed in the test for invalid arguments.
 
15104
 
 
15105
- Module ftplib.py: added support for parsing a .netrc file (Fred
 
15106
Drake).  Also added an ntransfercmd() method to the FTP class, which
 
15107
allows access to the expected size of a transfer when available, and a
 
15108
parse150() function to the module which parses the corresponding 150
 
15109
response.
 
15110
 
 
15111
- urllib.py: the ftp cache is now limited to 10 entries.  Added
 
15112
quote_plus() and unquote_plus() functions which are like quote() and
 
15113
unquote() but also replace spaces with '+' or vice versa, for
 
15114
encoding/decoding CGI form arguments.  Catch all errors from the ftp
 
15115
module.  HTTP requests now add the Host: header line.  The proxy
 
15116
variable names are now mapped to lower case, for Windows.  The
 
15117
spliturl() function no longer erroneously throws away all data past
 
15118
the first newline.  The basejoin() function now intereprets "../"
 
15119
correctly.  I *believe* that the problems with "exception raised in
 
15120
__del__" under certain circumstances have been fixed (mostly by
 
15121
changes elsewher in the interpreter).
 
15122
 
 
15123
- In urlparse.py, there is a cache for results in urlparse.urlparse();
 
15124
its size limit is set to 20.  Also, new URL schemes shttp, https, and
 
15125
snews are "supported".
 
15126
 
 
15127
- shelve.py: use cPickle and cStringIO when available.  Also added
 
15128
a sync() method, which calls the database's sync() method if there is
 
15129
one.
 
15130
 
 
15131
- The mimetools.py module now uses the available Python modules for
 
15132
decoding quoted-printable, uuencode and base64 formats, rather than
 
15133
creating a subprocess.
 
15134
 
 
15135
- The python debugger (pdb.py, and its base class bdb.py) now support
 
15136
conditional breakpoints.  See the docs.
 
15137
 
 
15138
- The modules base64.py, uu.py and quopri.py can now be used as simple
 
15139
command line utilities.
 
15140
 
 
15141
- Various small fixes to the nntplib.py module that I can't bother to
 
15142
document in detail.
 
15143
 
 
15144
- Sjoerd Mullender's mimify.py module now supports base64 encoding and 
 
15145
includes functions to handle the funny encoding you sometimes see in mail 
 
15146
headers.  It is now documented.
 
15147
 
 
15148
- mailbox.py: Added BabylMailbox.  Improved the way the mailbox is
 
15149
gotten from the environment.
 
15150
 
 
15151
- Many more modules now correctly open files in binary mode when this
 
15152
is necessary on non-Unix platforms.
 
15153
 
 
15154
- The copying functions in the undocumented module shutil.py are
 
15155
smarter.
 
15156
 
 
15157
- The Writer classes in the formatter.py module now have a flush()
 
15158
method.
 
15159
 
 
15160
- The sgmllib.py module accepts hyphens and periods in the middle of
 
15161
attribute names.  While this is against the SGML standard, there is
 
15162
some HTML out there that uses this...
 
15163
 
 
15164
- The interface for the Python bytecode disassembler module, dis.py,
 
15165
has been enhanced quite a bit.  There's now one main function,
 
15166
dis.dis(), which takes almost any kind of object (function, module,
 
15167
class, instance, method, code object) and disassembles it; without
 
15168
arguments it disassembles the last frame of the last traceback.  The
 
15169
other functions have changed slightly, too.
 
15170
 
 
15171
- The imghdr.py module recognizes new image types: BMP, PNG.
 
15172
 
 
15173
- The string.py module has a new function replace(str, old, new,
 
15174
[maxsplit]) which does substring replacements.  It is actually
 
15175
implemented in C in the strop module.  The functions [r]find() an
 
15176
[r]index() have an optional 4th argument indicating the end of the
 
15177
substring to search, alsoo implemented by their strop counterparts.
 
15178
(Remember, never import strop -- import string uses strop when
 
15179
available with zero overhead.)
 
15180
 
 
15181
- The string.join() function now accepts any sequence argument, not
 
15182
just lists and tuples.
 
15183
 
 
15184
- The string.maketrans() requires its first two arguments to be
 
15185
present.  The old version didn't require them, but there's not much
 
15186
point without them, and the documentation suggests that they are
 
15187
required, so we fixed the code to match the documentation.
 
15188
 
 
15189
- The regsub.py module has a function clear_cache(), which clears its
 
15190
internal cache of compiled regular expressions.  Also, the cache now
 
15191
takes the current syntax setting into account.  (However, this module
 
15192
is now obsolete -- use the sub() or subn() functions or methods in the
 
15193
re module.)
 
15194
 
 
15195
- The undocumented module Complex.py has been removed, now that Python
 
15196
has built-in complex numbers.  A similar module remains as
 
15197
Demo/classes/Complex.py, as an example.
 
15198
 
 
15199
 
 
15200
Changes to the build process
 
15201
----------------------------
 
15202
 
 
15203
- The way GNU readline is configured is totally different.  The
 
15204
--with-readline configure option is gone.  It is now an extension
 
15205
module, which may be loaded dynamically.  You must enable it (and
 
15206
specify the correct libraries to link with) in the Modules/Setup file.
 
15207
Importing the module installs some hooks which enable command line
 
15208
editing.  When the interpreter shell is invoked interactively, it
 
15209
attempts to import the readline module; when this fails, the default
 
15210
input mechanism is used.  The hook variables are PyOS_InputHook and
 
15211
PyOS_ReadlineFunctionPointer.  (Code contributed by Lee Busby, with
 
15212
ideas from William Magro.)
 
15213
 
 
15214
- New build procedure: a single library, libpython1.5.a, is now built,
 
15215
which contains absolutely everything except for a one-line main()
 
15216
program (which calls Py_Main(argc, argv) to start the interpreter
 
15217
shell).  This makes life much simpler for applications that need to
 
15218
embed Python.  The serial number of the build is now included in the
 
15219
version string (sys.version).
 
15220
 
 
15221
- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
 
15222
emits a single warning any more when compiling Python.
 
15223
 
 
15224
- A number of new Makefile variables have been added for special
 
15225
situations, e.g. LDLAST is appended to the link command.  These are
 
15226
used by editing the Makefile or passing them on the make command
 
15227
line.
 
15228
 
 
15229
- A set of patches from Lee Busby has been integrated that make it
 
15230
possible to catch floating point exceptions.  Use the configure option
 
15231
--with-fpectl to enable the patches; the extension modules fpectl and
 
15232
fpetest provide control to enable/disable and test the feature,
 
15233
respectively.
 
15234
 
 
15235
- The support for shared libraries under AIX is now simpler and more
 
15236
robust.  Thanks to Vladimir Marangozov for revamping his own patches!
 
15237
 
 
15238
- The Modules/makesetup script now reads a file Setup.local as well as
 
15239
a file Setup.  Most changes to the Setup script can be done by editing
 
15240
Setup.local instead, which makes it easier to carry a particular setup
 
15241
over from one release to the next.
 
15242
 
 
15243
- The Modules/makesetup script now copies any "include" lines it
 
15244
encounters verbatim into the output Makefile.  It also recognizes .cxx
 
15245
and .cpp as C++ source files.
 
15246
 
 
15247
- The configure script is smarter about C compiler options; e.g. with
 
15248
gcc it uses -O2 and -g when possible, and on some other platforms it
 
15249
uses -Olimit 1500 to avoid a warning from the optimizer about the main
 
15250
loop in ceval.c (which has more than 1000 basic blocks).
 
15251
 
 
15252
- The configure script now detects whether malloc(0) returns a NULL
 
15253
pointer or a valid block (of length zero).  This avoids the nonsense
 
15254
of always adding one byte to all malloc() arguments on most platforms.
 
15255
 
 
15256
- The configure script has a new option, --with-dec-threads, to enable
 
15257
DEC threads on DEC Alpha platforms.  Also, --with-threads is now an
 
15258
alias for --with-thread (this was the Most Common Typo in configure
 
15259
arguments).
 
15260
 
 
15261
- Many changes in Doc/Makefile; amongst others, latex2html is now used
 
15262
to generate HTML from all latex documents.
 
15263
 
 
15264
 
 
15265
Change to the Python/C API
 
15266
--------------------------
 
15267
 
 
15268
- Because some interfaces have changed, the PYTHON_API macro has been
 
15269
bumped.  Most extensions built for the old API version will still run,
 
15270
but I can't guarantee this.  Python prints a warning message on
 
15271
version mismatches; it dumps core when the version mismatch causes a
 
15272
serious problem :-)
 
15273
 
 
15274
- I've completed the Grand Renaming, with the help of Roger Masse and
 
15275
Barry Warsaw.  This makes reading or debugging the code much easier.
 
15276
Many other unrelated code reorganizations have also been carried out.
 
15277
The allobjects.h header file is gone; instead, you would have to
 
15278
include Python.h followed by rename2.h.  But you're better off running
 
15279
Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
 
15280
the rename2.h; it will disappear in the next release.
 
15281
 
 
15282
- Various and sundry small bugs in the "abstract" interfaces have been
 
15283
fixed.  Thanks to all the (involuntary) testers of the Python 1.4
 
15284
version!  Some new functions have been added, e.g. PySequence_List(o),
 
15285
equivalent to list(o) in Python.
 
15286
 
 
15287
- New API functions PyLong_FromUnsignedLong() and
 
15288
PyLong_AsUnsignedLong().
 
15289
 
 
15290
- The API functions in the file cgensupport.c are no longer
 
15291
supported.  This file has been moved to Modules and is only ever
 
15292
compiled when the SGI specific 'gl' module is built.
 
15293
 
 
15294
- PyObject_Compare() can now raise an exception.  Check with
 
15295
PyErr_Occurred().  The comparison function in an object type may also
 
15296
raise an exception.
 
15297
 
 
15298
- The slice interface uses an upper bound of INT_MAX when no explicit
 
15299
upper bound is given (e.x. for a[1:]).  It used to ask the object for
 
15300
its length and do the calculations.
 
15301
 
 
15302
- Support for multiple independent interpreters.  See Doc/api.tex,
 
15303
functions Py_NewInterpreter() and Py_EndInterpreter().  Since the
 
15304
documentation is incomplete, also see the new Demo/pysvr example
 
15305
(which shows how to use these in a threaded application) and the
 
15306
source code.
 
15307
 
 
15308
- There is now a Py_Finalize() function which "de-initializes"
 
15309
Python.  It is possible to completely restart the interpreter
 
15310
repeatedly by calling Py_Finalize() followed by Py_Initialize().  A
 
15311
change of functionality in Py_Initialize() means that it is now a
 
15312
fatal error to call it while the interpreter is already initialized.
 
15313
The old, half-hearted Py_Cleanup() routine is gone.  Use of Py_Exit()
 
15314
is deprecated (it is nothing more than Py_Finalize() followed by
 
15315
exit()).
 
15316
 
 
15317
- There are no known memory leaks left.  While Py_Finalize() doesn't
 
15318
free *all* allocated memory (some of it is hard to track down),
 
15319
repeated calls to Py_Finalize() and Py_Initialize() do not create
 
15320
unaccessible heap blocks.
 
15321
 
 
15322
- There is now explicit per-thread state.  (Inspired by, but not the
 
15323
same as, Greg Stein's free threading patches.)
 
15324
 
 
15325
- There is now better support for threading C applications.  There are
 
15326
now explicit APIs to manipulate the interpreter lock.  Read the source
 
15327
or the Demo/pysvr example; the new functions are
 
15328
PyEval_{Acquire,Release}{Lock,Thread}().
 
15329
 
 
15330
- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
 
15331
with other libraries' DEBUG macros.  Likewise for any other test
 
15332
macros that didn't yet start with Py_.
 
15333
 
 
15334
- New wrappers around malloc() and friends: Py_Malloc() etc. call
 
15335
malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
 
15336
just malloc().  Use of these wrappers could be essential if multiple
 
15337
memory allocators exist (e.g. when using certain DLL setups under
 
15338
Windows).  (Idea by Jim Fulton.)
 
15339
 
 
15340
- New C API PyImport_Import() which uses whatever __import__() hook
 
15341
that is installed for the current execution environment.  By Jim
 
15342
Fulton.
 
15343
 
 
15344
- It is now possible for an extension module's init function to fail
 
15345
non-fatally, by calling one of the PyErr_* functions and returning.
 
15346
 
 
15347
- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
 
15348
argument to the proper type, like the similar PyString macros already
 
15349
did.  (Suggestion by Marc-Andre Lemburg.)  Similar for PyList_GET_SIZE
 
15350
and PyList_GET_ITEM.
 
15351
 
 
15352
- Some of the Py_Get* function, like Py_GetVersion() (but not yet
 
15353
Py_GetPath()) are now declared as returning a const char *.  (More
 
15354
should follow.)
 
15355
 
 
15356
- Changed the run-time library to check for exceptions after object
 
15357
comparisons.  PyObject_Compare() can now return an exception; use
 
15358
PyErr_Occurred() to check (there is *no* special return value).
 
15359
 
 
15360
- PyFile_WriteString() and Py_Flushline() now return error indicators
 
15361
instead of clearing exceptions.  This fixes an obscure bug where using
 
15362
these would clear a pending exception, discovered by Just van Rossum.
 
15363
 
 
15364
- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
 
15365
an argument list including keyword arguments.  Contributed by Geoff
 
15366
Philbrick.
 
15367
 
 
15368
- PyArg_GetInt() is gone.
 
15369
 
 
15370
- It's no longer necessary to include graminit.h when calling one of
 
15371
the extended parser API functions.  The three public grammar start
 
15372
symbols are now in Python.h as Py_single_input, Py_file_input, and
 
15373
Py_eval_input.
 
15374
 
 
15375
- The CObject interface has a new function,
 
15376
PyCObject_Import(module, name).  It calls PyCObject_AsVoidPtr()
 
15377
on the object referenced by "module.name".
 
15378
 
 
15379
 
 
15380
Tkinter
 
15381
-------
 
15382
 
 
15383
- On popular demand, _tkinter once again installs a hook for readline
 
15384
that processes certain Tk events while waiting for the user to type
 
15385
(using PyOS_InputHook).
 
15386
 
 
15387
- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
 
15388
caused by command definitions referencing widget objects beyond their
 
15389
lifetime.
 
15390
 
 
15391
- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
 
15392
tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
 
15393
with the new Tk dialog scripts, and provide more "native platform"
 
15394
style file selection dialog boxes on some platforms.  Contributed by
 
15395
Fredrik Lundh.
 
15396
 
 
15397
- Tkinter.py: when the first Tk object is destroyed, it sets the
 
15398
hiddel global _default_root to None, so that when another Tk object is
 
15399
created it becomes the new default root.  Other miscellaneous
 
15400
changes and fixes.
 
15401
 
 
15402
- The Image class now has a configure method.
 
15403
 
 
15404
- Added a bunch of new winfo options to Tkinter.py; we should now be
 
15405
up to date with Tk 4.2.  The new winfo options supported are:
 
15406
mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
 
15407
visualsavailable.
 
15408
 
 
15409
- The broken bind() method on Canvas objects defined in the Canvas.py
 
15410
module has been fixed.  The CanvasItem and Group classes now also have
 
15411
an unbind() method.
 
15412
 
 
15413
- The problem with Tkinter.py falling back to trying to import
 
15414
"tkinter" when "_tkinter" is not found has been fixed -- it no longer
 
15415
tries "tkinter", ever.  This makes diagnosing the problem "_tkinter
 
15416
not configured" much easier and will hopefully reduce the newsgroup
 
15417
traffic on this topic.
 
15418
 
 
15419
- The ScrolledText module once again supports the 'cnf' parameter, to
 
15420
be compatible with the examples in Mark Lutz' book (I know, I know,
 
15421
too late...)
 
15422
 
 
15423
- The _tkinter.c extension module has been revamped.  It now support
 
15424
Tk versions 4.1 through 8.0; support for 4.0 has been dropped.  It
 
15425
works well under Windows and Mac (with the latest Tk ports to those
 
15426
platforms).  It also supports threading -- it is safe for one
 
15427
(Python-created) thread to be blocked in _tkinter.mainloop() while
 
15428
other threads modify widgets.  To make the changes visible, those
 
15429
threads must use update_idletasks()method.  (The patch for threading
 
15430
in 1.5a3 was broken; in 1.5a4, it is back in a different version,
 
15431
which requires access to the Tcl sources to get it to work -- hence it
 
15432
is disabled by default.)
 
15433
 
 
15434
- A bug in _tkinter.c has been fixed, where Split() with a string
 
15435
containing an unmatched '"' could cause an exception or core dump.
 
15436
 
 
15437
- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
 
15438
CreateFileHandler, so _tkinter.createfilehandler is not available on
 
15439
those platforms when using Tk 8.0 or later.  I will have to rethink
 
15440
how to interface with Tcl's lower-level event mechanism, or with its
 
15441
channels (which are like Python's file-like objects).  Jack Jansen has
 
15442
provided a fix for the Mac, so createfilehandler *is* actually
 
15443
supported there; maybe I can adapt his fix for Windows.
 
15444
 
 
15445
 
 
15446
Tools and Demos
 
15447
---------------
 
15448
 
 
15449
- A new regression test suite is provided, which tests most of the
 
15450
standard and built-in modules.  The regression test is run by invoking
 
15451
the script Lib/test/regrtest.py.  Barry Warsaw wrote the test harnass;
 
15452
he and Roger Masse contributed most of the new tests.
 
15453
 
 
15454
- New tool: faqwiz -- the CGI script that is used to maintain the
 
15455
Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py).  In
 
15456
Tools/faqwiz.
 
15457
 
 
15458
- New tool: webchecker -- a simple extensible web robot that, when
 
15459
aimed at a web server, checks that server for dead links.  Available
 
15460
are a command line utility as well as a Tkinter based GUI version.  In
 
15461
Tools/webchecker.  A simplified version of this program is dissected
 
15462
in my article in O'Reilly's WWW Journal, the issue on Scripting
 
15463
Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
 
15464
Includes a parser for robots.txt files by Skip Montanaro.
 
15465
 
 
15466
- New small tools: cvsfiles.py (prints a list of all files under CVS
 
15467
n a particular directory tree), treesync.py (a rather Guido-specific
 
15468
script to synchronize two source trees, one on Windows NT, the other
 
15469
one on Unix under CVS but accessible from the NT box), and logmerge.py
 
15470
(sort a collection of RCS or CVS logs by date).  In Tools/scripts.
 
15471
 
 
15472
- The freeze script now also works under Windows (NT).  Another
 
15473
feature allows the -p option to be pointed at the Python source tree
 
15474
instead of the installation prefix.  This was loosely based on part of
 
15475
xfreeze by Sam Rushing and Bill Tutt.
 
15476
 
 
15477
- New examples (Demo/extend) that show how to use the generic
 
15478
extension makefile (Misc/Makefile.pre.in).
 
15479
 
 
15480
- Tools/scripts/h2py.py now supports C++ comments.
 
15481
 
 
15482
- Tools/scripts/pystone.py script is upgraded to version 1.1; there
 
15483
was a bug in version 1.0 (distributed with Python 1.4) that leaked
 
15484
memory.  Also, in 1.1, the LOOPS variable is incremented to 10000.
 
15485
 
 
15486
- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
 
15487
 
 
15488
 
 
15489
Windows (NT and 95)
 
15490
-------------------
 
15491
 
 
15492
- New project files for Developer Studio (Visual C++) 5.0 for Windows
 
15493
NT (the old VC++ 4.2 Makefile is also still supported, but will
 
15494
eventually be withdrawn due to its bulkiness).
 
15495
 
 
15496
- See the note on the new module search path in the "Miscellaneous" section 
 
15497
above.
 
15498
 
 
15499
- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
 
15500
basically withdrawn.  If it still works for you, you're lucky.
 
15501
 
 
15502
- There's a new extension module, msvcrt.c, which provides various 
 
15503
low-level operations defined in the Microsoft Visual C++ Runtime Library.  
 
15504
These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and 
 
15505
console I/O functions like kbhit(), getch() and putch().
 
15506
 
 
15507
- The -u option not only sets the standard I/O streams to unbuffered
 
15508
status, but also sets them in binary mode.  (This can also be done
 
15509
using msvcrt.setmode(), by the way.)
 
15510
 
 
15511
- The, sys.prefix and sys.exec_prefix variables point to the directory 
 
15512
where Python is installed, or to the top of the source tree, if it was run 
 
15513
from there.
 
15514
 
 
15515
- The various os.path modules (posixpath, ntpath, macpath) now support
 
15516
passing more than two arguments to the join() function, so
 
15517
os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
 
15518
c)).
 
15519
 
 
15520
- The ntpath module (normally used as os.path) supports ~ to $HOME 
 
15521
expansion in expanduser().
 
15522
 
 
15523
- The freeze tool now works on Windows.
 
15524
 
 
15525
- See also the Tkinter category for a sad note on
 
15526
_tkinter.createfilehandler().
 
15527
 
 
15528
- The truncate() method for file objects now works on Windows.
 
15529
 
 
15530
- Py_Initialize() is no longer called when the DLL is loaded.  You
 
15531
must call it yourself.
 
15532
 
 
15533
- The time module's clock() function now has good precision through
 
15534
the use of the Win32 API QueryPerformanceCounter().
 
15535
 
 
15536
- Mark Hammond will release Python 1.5 versions of PythonWin and his
 
15537
other Windows specific code: the win32api extensions, COM/ActiveX
 
15538
support, and the MFC interface.
 
15539
 
 
15540
 
 
15541
Mac
 
15542
---
 
15543
 
 
15544
- As always, the Macintosh port will be done by Jack Jansen.  He will
 
15545
make a separate announcement for the Mac specific source code and the
 
15546
binary distribution(s) when these are ready.
 
15547
 
 
15548
 
 
15549
======================================================================
 
15550
 
 
15551
 
 
15552
=====================================
 
15553
==> Release 1.4 (October 25 1996) <==
 
15554
=====================================
 
15555
 
 
15556
(Starting in reverse chronological order:)
 
15557
 
 
15558
- Changed disclaimer notice.
 
15559
 
 
15560
- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
 
15561
default to the user's login shell.
 
15562
 
 
15563
- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
 
15564
widget, and bogus bspace() function.
 
15565
 
 
15566
- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
 
15567
paragraph.
 
15568
 
 
15569
- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
 
15570
subprojects, and to remove the (broken) experimental NumPy
 
15571
subprojects.
 
15572
 
 
15573
- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
 
15574
(where os.stat() returns mtimes as floats.)
 
15575
- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
 
15576
fix POST in CGIHTTPServer.py.
 
15577
 
 
15578
- Version 2.83 of Misc/python-mode.el for Emacs is included.
 
15579
 
 
15580
- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
 
15581
group starting immediately after a group tag.
 
15582
 
 
15583
- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
 
15584
 
 
15585
- In Objects/stringobject.c, fixed the compare function to do the
 
15586
first char comparison in unsigned mode, for consistency with the way
 
15587
other characters are compared by memcmp().
 
15588
 
 
15589
- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
 
15590
 
 
15591
- In Lib/urllib.py, fix another case where openedurl wasn't set.
 
15592
 
 
15593
(XXX Sorry, the rest is in totally random order.  No time to fix it.)
 
15594
 
 
15595
- SyntaxError exceptions detected during code generation
 
15596
(e.g. assignment to an expression) now include a line number.
 
15597
 
 
15598
- Don't leave trailing / or \ in script directory inserted in front of
 
15599
sys.path.
 
15600
 
 
15601
- Added a note to Tools/scripts/classfix.py abouts its historical
 
15602
importance.
 
15603
 
 
15604
- Added Misc/Makefile.pre.in, a universal Makefile for extensions
 
15605
built outside the distribution.
 
15606
 
 
15607
- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
 
15608
 
 
15609
- Install shared modules with mode 555 (needed for performance on some
 
15610
platforms).
 
15611
 
 
15612
- Some changes to standard library modules to avoid calling append()
 
15613
with more than one argument -- while supported, this should be
 
15614
outlawed, and I don't want to set a bad example.
 
15615
 
 
15616
- bdb.py (and hence pdb.py) supports calling run() with a code object
 
15617
instead of a code string.
 
15618
 
 
15619
- Fixed an embarrassing bug cgi.py which prevented correct uploading
 
15620
of binary files from Netscape (which doesn't distinguish between
 
15621
binary and text files).  Also added dormant logging support, which
 
15622
makes it easier to debug the cgi module itself.
 
15623
 
 
15624
- Added default writer to constructor of NullFormatter class.
 
15625
 
 
15626
- Use binary mode for socket.makefile() calls in ftplib.py.
 
15627
 
 
15628
- The ihooks module no longer "installs" itself upon import -- this
 
15629
was an experimental feature that helped ironing out some bugs but that
 
15630
slowed down code that imported it without the need to install it
 
15631
(e.g. the rexec module).  Also close the file in some cases and add
 
15632
the __file__ attribute to loaded modules.
 
15633
 
 
15634
- The test program for mailbox.py is now more useful.
 
15635
 
 
15636
- Added getparamnames() to Message class in mimetools.py -- it returns
 
15637
the names of parameters to the content-type header.
 
15638
 
 
15639
- Fixed a typo in ni that broke the loop stripping "__." from names.
 
15640
 
 
15641
- Fix sys.path[0] for scripts run via pdb.py's new main program.
 
15642
 
 
15643
- profile.py can now also run a script, like pdb.
 
15644
 
 
15645
- Fix a small bug in pyclbr -- don't add names starting with _ when
 
15646
emulating from ... import *.
 
15647
 
 
15648
- Fixed a series of embarrassing typos in rexec's handling of standard
 
15649
I/O redirection.  Added some more "safe" built-in modules: cmath,
 
15650
errno, operator.
 
15651
 
 
15652
- Fixed embarrassing typo in shelve.py.
 
15653
 
 
15654
- Added SliceType and EllipsisType to types.py.
 
15655
 
 
15656
- In urllib.py, added handling for error 301 (same as 302); added
 
15657
geturl() method to get the URL after redirection.
 
15658
 
 
15659
- Fixed embarrassing typo in xdrlib.py.  Also fixed typo in Setup.in
 
15660
for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
 
15661
 
 
15662
- Fixed bsddbmodule.c to add binary mode indicator on platforms that
 
15663
have it.  This should make it working on Windows NT.
 
15664
 
 
15665
- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
 
15666
whatever applies.  Also rationalized some other tests for various MS
 
15667
platforms.
 
15668
 
 
15669
- Added the sources for the NT installer script used for Python
 
15670
1.4beta3.  Not tested with this release, but better than nothing.
 
15671
 
 
15672
- A compromise in pickle's defenses against Trojan horses: a
 
15673
user-defined function is now okay where a class is expected.  A
 
15674
built-in function is not okay, to prevent pickling something that
 
15675
will execute os.system("rm -f *") when unpickling.
 
15676
 
 
15677
- dis.py will print the name of local variables referenced by local
 
15678
load/store/delete instructions.
 
15679
 
 
15680
- Improved portability of SimpleHTTPServer module to non-Unix
 
15681
platform.
 
15682
 
 
15683
- The thread.h interface adds an extra argument to down_sema().  This
 
15684
only affects other C code that uses thread.c; the Python thread module
 
15685
doesn't use semaphores (which aren't provided on all platforms where
 
15686
Python threads are supported).  Note: on NT, this change is not
 
15687
implemented.
 
15688
 
 
15689
- Fixed some typos in abstract.h; corrected signature of
 
15690
PyNumber_Coerce, added PyMapping_DelItem.  Also fixed a bug in
 
15691
abstract.c's PyObject_CallMethod().
 
15692
 
 
15693
- apply(classname, (), {}) now works even if the class has no
 
15694
__init__() method.
 
15695
 
 
15696
- Implemented complex remainder and divmod() (these would dump core!).
 
15697
Conversion of complex numbers to int, long int or float now raises an
 
15698
exception, since there is no meaningful way to do it without losing
 
15699
information.
 
15700
 
 
15701
- Fixed bug in built-in complex() function which gave the wrong result
 
15702
for two real arguments.
 
15703
 
 
15704
- Change the hash algorithm for strings -- the multiplier is now
 
15705
1000003 instead of 3, which gives better spread for short strings.
 
15706
 
 
15707
- New default path for Windows NT, the registry structure now supports
 
15708
default paths for different install packages.  (Mark Hammond -- the
 
15709
next PythonWin release will use this.)
 
15710
 
 
15711
- Added more symbols to the python_nt.def file.
 
15712
 
 
15713
- When using GNU readline, set rl_readline_name to "python".
 
15714
 
 
15715
- The Ellipses built-in name has been renamed to Ellipsis -- this is
 
15716
the correct singular form.  Thanks to Ka-Ping Yee, who saved us from
 
15717
eternal embarrassment.
 
15718
 
 
15719
- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
 
15720
Ellipsis name change.
 
15721
 
 
15722
- Updated the library reference manual.  Added documentation of
 
15723
restricted mode (rexec, Bastion) and the formatter module (for use
 
15724
with the htmllib module).  Fixed the documentation of htmllib
 
15725
(finally).
 
15726
 
 
15727
- The reference manual is now maintained in FrameMaker.
 
15728
 
 
15729
- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
 
15730
 
 
15731
- Slight improvements to Doc/Makefile.
 
15732
 
 
15733
- Added fcntl.lockf(). This should be used for Unix file locking
 
15734
instead of the posixfile module; lockf() is more portable.
 
15735
 
 
15736
- The getopt module now supports long option names, thanks to Lars
 
15737
Wizenius.
 
15738
 
 
15739
- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
 
15740
and Nils Fischbeck.
 
15741
 
 
15742
- Use more bits of time.time() in whrandom's default seed().
 
15743
 
 
15744
- Performance hack for regex module's regs attribute.
 
15745
 
 
15746
- Don't close already closed socket in socket module.
 
15747
 
 
15748
- Correctly handle separators containing embedded nulls in
 
15749
strop.split, strop.find and strop.rfind.  Also added more detail to
 
15750
error message for strop.atoi and friends.
 
15751
 
 
15752
- Moved fallback definition for hypot() to Python/hypot.c.
 
15753
 
 
15754
- Added fallback definition for strdup, in Python/strdup.c.
 
15755
 
 
15756
- Fixed some bugs where a function would return 0 to indicate an error
 
15757
where it should return -1.
 
15758
 
 
15759
- Test for error returned by time.localtime(), and rationalized its MS
 
15760
tests.
 
15761
 
 
15762
- Added Modules/Setup.local file, which is processed after Setup.
 
15763
 
 
15764
- Corrected bug in toplevel Makefile.in -- execution of regen script
 
15765
would not use the right PATH and PYTHONPATH.
 
15766
 
 
15767
- Various and sundry NeXT configuration changes (sigh).
 
15768
 
 
15769
- Support systems where libreadline needs neither termcap nor curses.
 
15770
 
 
15771
- Improved ld_so_aix script and python.exp file (for AIX).
 
15772
 
 
15773
- More stringent test for working <stdarg.h> in configure script.
 
15774
 
 
15775
- Removed Demo/www subdirectory -- it was totally out of date.
 
15776
 
 
15777
- Improved demos and docs for Fred Drake's parser module; fixed one
 
15778
typo in the module itself.
 
15779
 
 
15780
 
 
15781
=========================================
 
15782
==> Release 1.4beta3 (August 26 1996) <==
 
15783
=========================================
 
15784
 
 
15785
 
 
15786
(XXX This is less readable that it should.  I promise to restructure
 
15787
it for the final 1.4 release.)
 
15788
 
 
15789
 
 
15790
What's new in 1.4beta3 (since beta2)?
 
15791
-------------------------------------
 
15792
 
 
15793
- Name mangling to implement a simple form of class-private variables.
 
15794
A name of the form "__spam" can't easily be used outside the class.
 
15795
(This was added in 1.4beta3, but left out of the 1.4beta3 release
 
15796
message.)
 
15797
 
 
15798
- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
 
15799
handled correctly when using a proxy server.
 
15800
 
 
15801
- In ntpath.normpath(): don't truncate to 8+3 format.
 
15802
 
 
15803
- In mimetools.choose_boundary(): don't die when getuid() or getpid()
 
15804
aren't defined.
 
15805
 
 
15806
- Module urllib: some optimizations to (un)quoting.
 
15807
 
 
15808
- New module MimeWriter for writing MIME documents.
 
15809
 
 
15810
- More changes to formatter module.
 
15811
 
 
15812
- The freeze script works once again and is much more robust (using
 
15813
sys.prefix etc.).  It also supports a -o option to specify an
 
15814
output directory.
 
15815
 
 
15816
- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
 
15817
 
 
15818
- The Doc/Makefile targets have been reorganized somewhat to remove the 
 
15819
insistence on always generating PostScript.
 
15820
 
 
15821
- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
 
15822
 
 
15823
- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing 
 
15824
name conflict on the Mac.
 
15825
 
 
15826
- Linking a module compiled with a different setting for Py_TRACE_REFS now 
 
15827
generates a linker error rather than a core dump.
 
15828
 
 
15829
- The cgi module has a new convenience function print_exception(), which 
 
15830
formats a python exception using HTML.  It also fixes a bug in the 
 
15831
compatibility code and adds a dubious feature which makes it possible to 
 
15832
have two query strings, one in the URL and one in the POST data.
 
15833
 
 
15834
- A subtle change in the unpickling of class instances makes it possible 
 
15835
to unpickle in restricted execution mode, where the __dict__ attribute is 
 
15836
not available (but setattr() is).
 
15837
 
 
15838
- Documentation for os.path.splitext() (== posixpath.splitext()) has been 
 
15839
cleared up.  It splits at the *last* dot.
 
15840
 
 
15841
- posixfile locking is now also correctly supported on AIX.
 
15842
 
 
15843
- The tempfile module once again honors an initial setting of tmpdir.  It 
 
15844
now works on Windows, too.
 
15845
 
 
15846
- The traceback module has some new functions to extract, format and print 
 
15847
the active stack.
 
15848
 
 
15849
- Some translation functions in the urllib module have been made a little 
 
15850
less sluggish.
 
15851
 
 
15852
- The addtag_* methods for Canvas widgets in Tkinter as well as in the 
 
15853
separate Canvas class have been fixed so they actually do something 
 
15854
meaningful.
 
15855
 
 
15856
- A tiny _test() function has been added to Tkinter.py.
 
15857
 
 
15858
- A generic Makefile for dynamically loaded modules is provided in the Misc 
 
15859
subdirectory (Misc/gMakefile).
 
15860
 
 
15861
- A new version of python-mode.el for Emacs is provided.  See
 
15862
http://www.python.org/ftp/emacs/pmdetails.html for details.  The
 
15863
separate file pyimenu.el is no longer needed, imenu support is folded
 
15864
into python-mode.el.
 
15865
 
 
15866
- The configure script can finally correctly find the readline library in a 
 
15867
non-standard location.  The LDFLAGS variable is passed on the Makefiles 
 
15868
from the configure script.
 
15869
 
 
15870
- Shared libraries are now installed as programs (i.e. with executable 
 
15871
permission).  This is required on HP-UX and won't hurt on other systems.
 
15872
 
 
15873
- The objc.c module is no longer part of the distribution.  Objective-C 
 
15874
support may become available as contributed software on the ftp site.
 
15875
 
 
15876
- The sybase module is no longer part of the distribution.  A much
 
15877
improved sybase module is available as contributed software from the
 
15878
ftp site.
 
15879
 
 
15880
- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and 
 
15881
Mac (don't use unpatched Tcl/Tk!).  The default line in the Setup.in file 
 
15882
now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
 
15883
 
 
15884
- In Setup, you can now write "*shared*" instead of "*noconfig*", and you 
 
15885
can use *.so and *.sl as shared libraries.
 
15886
 
 
15887
- Some more fidgeting for AIX shared libraries.
 
15888
 
 
15889
- The mpz module is now compatible with GMP 2.x.  (Not tested by me.)
 
15890
(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
 
15891
available from the contrib directory on the ftp site.)
 
15892
 
 
15893
- A warning is written to sys.stderr when a __del__ method raises an 
 
15894
exception (formerly, such exceptions were completely ignored).
 
15895
 
 
15896
- The configure script now defines HAVE_OLD_CPP if the C preprocessor is 
 
15897
incapable of ANSI style token concatenation and stringification.
 
15898
 
 
15899
- All source files (except a few platform specific modules) are once again 
 
15900
compatible with K&R C compilers as well as ANSI compilers.  In particular,
 
15901
ANSI-isms have been removed or made conditional in complexobject.c, 
 
15902
getargs.c and operator.c.
 
15903
 
 
15904
- The abstract object API has three new functions, PyObject_DelItem, 
 
15905
PySequence_DelItem, and PySequence_DelSlice.
 
15906
 
 
15907
- The operator module has new functions delitem and delslice, and the 
 
15908
functions "or" and "and" are renamed to "or_" and "and_" (since "or" and 
 
15909
"and" are reserved words).  ("__or__" and "__and__" are unchanged.)
 
15910
 
 
15911
- The environment module is no longer supported; putenv() is now a function 
 
15912
in posixmodule (also under NT).
 
15913
 
 
15914
- Error in filter(<function>, "") has been fixed.
 
15915
 
 
15916
- Unrecognized keyword arguments raise TypeError, not KeyError.
 
15917
 
 
15918
- Better portability, fewer bugs and memory leaks, fewer compiler warnings, 
 
15919
some more documentation.
 
15920
 
 
15921
- Bug in float power boundary case (0.0 to the negative integer power) 
 
15922
fixed.
 
15923
 
 
15924
- The test of negative number to the float power has been moved from the 
 
15925
built-in pow() functin to floatobject.c (so complex numbers can yield the 
 
15926
correct result).
 
15927
 
 
15928
- The bug introduced in beta2 where shared libraries loaded (using 
 
15929
dlopen()) from the current directory would fail, has been fixed.
 
15930
 
 
15931
- Modules imported as shared libraries now also have a __file__ attribute, 
 
15932
giving the filename from which they were loaded.  The only modules without 
 
15933
a __file__ attribute now are built-in modules.
 
15934
 
 
15935
- On the Mac, dynamically loaded modules can end in either ".slb" or 
 
15936
".<platform>.slb" where <platform> is either "CFM68K" or "ppc".  The ".slb" 
 
15937
extension should only be used for "fat" binaries.
 
15938
 
 
15939
- C API addition: marshal.c now supports 
 
15940
PyMarshal_WriteObjectToString(object).
 
15941
 
 
15942
- C API addition: getargs.c now supports
 
15943
PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
 
15944
to parse keyword arguments.
 
15945
 
 
15946
- The PC versioning scheme (sys.winver) has changed once again.  the 
 
15947
version number is now "<digit>.<digit>.<digit>.<apiversion>", where the 
 
15948
first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4, 
 
15949
"1.4.1" for Python 1.4.1 -- the beta level is not included) and 
 
15950
<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
 
15951
 
 
15952
- h2py.py accepts whitespace before the # in CPP directives
 
15953
 
 
15954
- On Solaris 2.5, it should now be possible to use either Posix threads or 
 
15955
Solaris threads (XXX: how do you select which is used???).  (Note: the 
 
15956
Python pthreads interface doesn't fully support semaphores yet -- anyone 
 
15957
care to fix this?)
 
15958
 
 
15959
- Thread support should now work on AIX, using either DCE threads or 
 
15960
pthreads.
 
15961
 
 
15962
- New file Demo/sockets/unicast.py
 
15963
 
 
15964
- Working Mac port, with CFM68K support, with Tk 4.1 support (though not 
 
15965
both) (XXX)
 
15966
 
 
15967
- New project setup for PC port, now compatible with PythonWin, with 
 
15968
_tkinter and NumPy support (XXX)
 
15969
 
 
15970
- New module site.py (XXX)
 
15971
 
 
15972
- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
 
15973
 
 
15974
- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
 
15975
 
 
15976
- regen script fixed (XXX)
 
15977
 
 
15978
- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
 
15979
 
 
15980
- testall now also tests math module (XXX)
 
15981
 
 
15982
- string.atoi c.s. now raise an exception for an empty input string.
 
15983
 
 
15984
- At last, it is no longer necessary to define HAVE_CONFIG_H in order to 
 
15985
have config.h included at various places.
 
15986
 
 
15987
- Unrecognized keyword arguments now raise TypeError rather than KeyError.
 
15988
 
 
15989
- The makesetup script recognizes files with extension .so or .sl as
 
15990
(shared) libraries.
 
15991
 
 
15992
- 'access' is no longer a reserved word, and all code related to its 
 
15993
implementation is gone (or at least #ifdef'ed out).  This should make 
 
15994
Python a little speedier too!
 
15995
 
 
15996
- Performance enhancements suggested by Sjoerd Mullender.  This includes 
 
15997
the introduction of two new optional function pointers in type object, 
 
15998
getattro and setattro, which are like getattr and setattr but take a 
 
15999
string object instead of a C string pointer.
 
16000
 
 
16001
- New operations in string module: lstrip(s) and rstrip(s) strip whitespace 
 
16002
only on the left or only on the right, A new optional third argument to 
 
16003
split() specifies the maximum number of separators honored (so 
 
16004
splitfields(s, sep, n) returns a list of at most n+1 elements).  (Since 
 
16005
1.3, splitfields(s, None) is totally equivalent to split(s).)
 
16006
string.capwords() has an optional second argument specifying the 
 
16007
separator (which is passed to split()).
 
16008
 
 
16009
- regsub.split() has the same addition as string.split().  regsub.splitx(s, 
 
16010
sep, maxsep) implements the functionality that was regsub.split(s, 1) in 
 
16011
1.4beta2 (return a list containing the delimiters as well as the words).
 
16012
 
 
16013
- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
 
16014
 
 
16015
- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
 
16016
argument to _tkinter.create() to set Tcl's argv0 variable, so X
 
16017
resources use the right resource class again.
 
16018
 
 
16019
- Add #undef fabs to Modules/mathmodule.c for macintosh.
 
16020
 
 
16021
- Added some macro renames for AIX in Modules/operator.c.
 
16022
 
 
16023
- Removed spurious 'E' from Doc/liberrno.tex.
 
16024
 
 
16025
- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
 
16026
Misc/gMakefile and new version of Misc/python-mode.el.
 
16027
 
 
16028
- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
 
16029
NameError).
 
16030
 
 
16031
- Added missing "from types import *" to Lib/tkinter/Canvas.py.
 
16032
 
 
16033
- Added hint about using default args for __init__ to pickle docs.
 
16034
 
 
16035
- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
 
16036
PySequence_Length.
 
16037
 
 
16038
- Some improvements to Doc/texi2html.py.
 
16039
 
 
16040
- In Python/import.c, Cast unsigned char * in struct _frozen to char *
 
16041
in calls to rds_object().
 
16042
 
 
16043
- In doc/ref4.tex, added note about scope of lambda bodies.
 
16044
 
 
16045
What's new in 1.4beta2 (since beta1)?
 
16046
-------------------------------------
 
16047
 
 
16048
- Portability bug in the md5.h header solved.
 
16049
 
 
16050
- The PC build procedure now really works, and sets sys.platform to a
 
16051
meaningful value (a few things were botched in beta 1).  Lib/dos_8x3
 
16052
is now a standard part of the distribution (alas).
 
16053
 
 
16054
- More improvements to the installation procedure.  Typing "make install" 
 
16055
now inserts the version number in the pathnames of almost everything 
 
16056
installed, and creates the machine dependent modules (FCNTL.py etc.) if not 
 
16057
supplied by the distribution.  (XXX There's still a problem with the latter 
 
16058
because the "regen" script requires that Python is installed.  Some manual 
 
16059
intervention may still be required.) (This has been fixed in 1.4beta3.)
 
16060
 
 
16061
- New modules: errno, operator (XXX).
 
16062
 
 
16063
- Changes for use with Numerical Python: builtin function slice() and
 
16064
Ellipses object, and corresponding syntax:
 
16065
 
 
16066
        x[lo:hi:stride]         ==      x[slice(lo, hi, stride)]
 
16067
        x[a, ..., z]            ==      x[(a, Ellipses, z)]
 
16068
 
 
16069
- New documentation for errno and cgi modules.
 
16070
 
 
16071
- The directory containing the script passed to the interpreter is
 
16072
inserted in from of sys.path; "." is no longer a default path
 
16073
component.
 
16074
 
 
16075
- Optional third string argument to string.translate() specifies
 
16076
characters to delete.  New function string.maketrans() creates a
 
16077
translation table for translate() or for regex.compile().
 
16078
 
 
16079
- Module posix (and hence module os under Unix) now supports putenv().
 
16080
Moreover, module os is enhanced so that if putenv() is supported,
 
16081
assignments to os.environ entries make the appropriate putenv() call.
 
16082
(XXX the putenv() implementation can leak a small amount of memory per
 
16083
call.)
 
16084
 
 
16085
- pdb.py can now be invoked from the command line to debug a script:
 
16086
python pdb.py <script> <arg> ...
 
16087
 
 
16088
- Much improved parseaddr() in rfc822.
 
16089
 
 
16090
- In cgi.py, you can now pass an alternative value for environ to
 
16091
nearly all functions.
 
16092
 
 
16093
- You can now assign to instance variables whose name begins and ends
 
16094
with '__'.
 
16095
 
 
16096
- New version of Fred Drake's parser module and associates (token,
 
16097
symbol, AST).
 
16098
 
 
16099
- New PYTHON_API_VERSION value and .pyc file magic number (again!).
 
16100
 
 
16101
- The "complex" internal structure type is now called "Py_complex" to
 
16102
avoid name conflicts.
 
16103
 
 
16104
- Numerous small bugs fixed.
 
16105
 
 
16106
- Slight pickle speedups.
 
16107
 
 
16108
- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
 
16109
 
 
16110
- NeXT portability mods by Bill Bumgarner integrated.
 
16111
 
 
16112
- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
 
16113
converted to new naming style.
 
16114
 
 
16115
 
 
16116
What's new in 1.4beta1 (since 1.3)?
 
16117
-----------------------------------
 
16118
 
 
16119
- Added sys.platform and sys.exec_platform for Bill Janssen.
 
16120
 
 
16121
- Installation has been completely overhauled.  "make install" now installs 
 
16122
everything, not just the python binary.  Installation uses the install-sh 
 
16123
script (borrowed from X11) to install each file.
 
16124
 
 
16125
- New functions in the posix module: mkfifo, plock, remove (== unlink),
 
16126
and ftruncate.  More functions are also available under NT.
 
16127
 
 
16128
- New function in the fcntl module: flock.
 
16129
 
 
16130
- Shared library support for FreeBSD.
 
16131
 
 
16132
- The --with-readline option can now be used without a DIRECTORY argument, 
 
16133
for systems where libreadline.* is in one of the standard places.  It is 
 
16134
also possible for it to be a shared library.
 
16135
 
 
16136
- The extension tkinter has been renamed to _tkinter, to avoid confusion 
 
16137
with Tkinter.py oncase insensitive file systems.  It now supports Tk 4.1 as 
 
16138
well as 4.0.
 
16139
 
 
16140
- Author's change of address from CWI in Amsterdam, The Netherlands, to 
 
16141
CNRI in Reston, VA, USA.
 
16142
 
 
16143
- The math.hypot() function is now always available (if it isn't found in 
 
16144
the C math library, Python provides its own implementation).
 
16145
 
 
16146
- The latex documentation is now compatible with latex2e, thanks to David 
 
16147
Ascher.
 
16148
 
 
16149
- The expression x**y is now equivalent to pow(x, y).
 
16150
 
 
16151
- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
 
16152
 
 
16153
- Complex numbers are now supported.  Imaginary constants are written with 
 
16154
a 'j' or 'J' prefix, general complex numbers can be formed by adding a real 
 
16155
part to an imaginary part, like 3+4j.  Complex numbers are always stored in 
 
16156
floating point form, so this is equivalent to 3.0+4.0j.  It is also 
 
16157
possible to create complex numbers with the new built-in function 
 
16158
complex(re, [im]).  For the footprint-conscious, complex number support can 
 
16159
be disabled by defining the symbol WITHOUT_COMPLEX.
 
16160
 
 
16161
- New built-in function list() is the long-awaited counterpart of tuple().
 
16162
 
 
16163
- There's a new "cmath" module which provides the same functions as the 
 
16164
"math" library but with complex arguments and results.  (There are very 
 
16165
good reasons why math.sqrt(-1) still raises an exception -- you have to use 
 
16166
cmath.sqrt(-1) to get 1j for an answer.)
 
16167
 
 
16168
- The Python.h header file (which is really the same as allobjects.h except 
 
16169
it disables support for old style names) now includes several more files, 
 
16170
so you have to have fewer #include statements in the average extension.
 
16171
 
 
16172
- The NDEBUG symbol is no longer used.  Code that used to be dependent on 
 
16173
the presence of NDEBUG is now present on the absence of DEBUG.  TRACE_REFS 
 
16174
and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG, 
 
16175
respectively.  At long last, the source actually compiles and links without 
 
16176
errors when this symbol is defined.
 
16177
 
 
16178
- Several symbols that didn't follow the new naming scheme have been 
 
16179
renamed (usually by adding to rename2.h) to use a Py or _Py prefix.  There 
 
16180
are no external symbols left without a Py or _Py prefix, not even those 
 
16181
defined by sources that were incorporated from elsewhere (regexpr.c, 
 
16182
md5c.c).  (Macros are a different story...)
 
16183
 
 
16184
- There are now typedefs for the structures defined in config.c and 
 
16185
frozen.c.
 
16186
 
 
16187
- New PYTHON_API_VERSION value and .pyc file magic number.
 
16188
 
 
16189
- New module Bastion.  (XXX)
 
16190
 
 
16191
- Improved performance of StringIO module.
 
16192
 
 
16193
- UserList module now supports + and * operators.
 
16194
 
 
16195
- The binhex and binascii modules now actually work.
 
16196
 
 
16197
- The cgi module has been almost totally rewritten and documented.
 
16198
It now supports file upload and a new data type to handle forms more 
 
16199
flexibly.
 
16200
 
 
16201
- The formatter module (for use with htmllib) has been overhauled (again).
 
16202
 
 
16203
- The ftplib module now supports passive mode and has doc strings.
 
16204
 
 
16205
- In (ideally) all places where binary files are read or written, the file 
 
16206
is now correctly opened in binary mode ('rb' or 'wb') so the code will work 
 
16207
on Mac or PC.
 
16208
 
 
16209
- Dummy versions of os.path.expandvars() and expanduser() are now provided 
 
16210
on non-Unix platforms.
 
16211
 
 
16212
- Module urllib now has two new functions url2pathname and pathname2url 
 
16213
which turn local filenames into "file:..." URLs using the same rules as 
 
16214
Netscape (why be different).  it also supports urlretrieve() with a 
 
16215
pathname parameter, and honors the proxy environment variables (http_proxy 
 
16216
etc.).  The URL parsing has been improved somewhat, too.
 
16217
 
 
16218
- Micro improvements to urlparse.  Added urlparse.urldefrag() which 
 
16219
removes a trailing ``#fragment'' if any.
 
16220
 
 
16221
- The mailbox module now supports MH style message delimiters as well.
 
16222
 
 
16223
- The mhlib module contains some new functionality: setcontext() to set the 
 
16224
current folder and parsesequence() to parse a sequence as commonly passed 
 
16225
to MH commands (e.g. 1-10 or last:5).
 
16226
 
 
16227
- New module mimify for conversion to and from MIME format of email 
 
16228
messages.
 
16229
 
 
16230
- Module ni now automatically installs itself when first imported -- this 
 
16231
is against the normal rule that modules should define classes and functions 
 
16232
but not invoke them, but appears more useful in the case that two 
 
16233
different, independent modules want to use ni's features.
 
16234
 
 
16235
- Some small performance enhancements in module pickle.
 
16236
 
 
16237
- Small interface change to the profile.run*() family of functions -- more 
 
16238
sensible handling of return values.
 
16239
 
 
16240
- The officially registered Mac creator for Python files is 'Pyth'.  This 
 
16241
replaces 'PYTH' which was used before but never registered.
 
16242
 
 
16243
- Added regsub.capwords().  (XXX)
 
16244
 
 
16245
- Added string.capwords(), string.capitalize() and string.translate().  
 
16246
(XXX)
 
16247
 
 
16248
- Fixed an interface bug in the rexec module: it was impossible to pass a 
 
16249
hooks instance to the RExec class.  rexec now also supports the dynamic 
 
16250
loading of modules from shared libraries.  Some other interfaces have been 
 
16251
added too.
 
16252
 
 
16253
- Module rfc822 now caches the headers in a dictionary for more efficient 
 
16254
lookup.
 
16255
 
 
16256
- The sgmllib module now understands a limited number of SGML "shorthands" 
 
16257
like <A/.../ for <A>...</A>.  (It's not clear that this was a good idea...)
 
16258
 
 
16259
- The tempfile module actually tries a number of different places to find a 
 
16260
usable temporary directory.  (This was prompted by certain Linux 
 
16261
installations that appear to be missing a /usr/tmp directory.) [A bug in 
 
16262
the implementation that would ignore a pre-existing tmpdir global has been 
 
16263
fixed in beta3.]
 
16264
 
 
16265
- Much improved and enhanved FileDialog module for Tkinter.
 
16266
 
 
16267
- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as 
 
16268
well as Tk 4.1).
 
16269
 
 
16270
- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and 
 
16271
s.dup().  Sockets now work correctly on Windows.  On Windows, the built-in 
 
16272
extension is called _socket and a wrapper module win/socket.py provides 
 
16273
"makefile()" and "dup()" functionality.  On Windows, the select module 
 
16274
works only with socket objects.
 
16275
 
 
16276
- Bugs in bsddb module fixed (e.g. missing default argument values).
 
16277
 
 
16278
- The curses extension now includes <ncurses.h> when available.
 
16279
 
 
16280
- The gdbm module now supports opening databases in "fast" mode by 
 
16281
specifying 'f' as the second character or the mode string.
 
16282
 
 
16283
- new variables sys.prefix and sys.exec_prefix pass corresponding 
 
16284
configuration options / Makefile variables to the Python programmer.
 
16285
 
 
16286
- The ``new'' module now supports creating new user-defined classes as well 
 
16287
as instances thereof.
 
16288
 
 
16289
- The soundex module now sports get_soundex() to get the soundex value for an 
 
16290
arbitrary string (formerly it would only do soundex-based string 
 
16291
comparison) as well as doc strings.
 
16292
 
 
16293
- New object type "cobject" to safely wrap void pointers for passing them 
 
16294
between various extension modules.
 
16295
 
 
16296
- More efficient computation of float**smallint.
 
16297
 
 
16298
- The mysterious bug whereby "x.x" (two occurrences of the same 
 
16299
one-character name) typed from the commandline would sometimes fail 
 
16300
mysteriously.
 
16301
 
 
16302
- The initialization of the readline function can now be invoked by a C 
 
16303
extension through PyOS_ReadlineInit().
 
16304
 
 
16305
- There's now an externally visible pointer PyImport_FrozenModules which 
 
16306
can be changed by an embedding application.
 
16307
 
 
16308
- The argument parsing functions now support a new format character 'D' to 
 
16309
specify complex numbers.
 
16310
 
 
16311
- Various memory leaks plugged and bugs fixed.
 
16312
 
 
16313
- Improved support for posix threads (now that real implementations are 
 
16314
beginning to apepar).  Still no fully functioning semaphores.
 
16315
 
 
16316
- Some various and sundry improvements and new entries in the Tools 
 
16317
directory.
 
16318
 
 
16319
 
 
16320
=====================================
 
16321
==> Release 1.3 (13 October 1995) <==
 
16322
=====================================
 
16323
 
 
16324
Major change
 
16325
============
 
16326
 
 
16327
Two words: Keyword Arguments.  See the first section of Chapter 12 of
 
16328
the Tutorial.
 
16329
 
 
16330
(The rest of this file is textually the same as the remaining sections
 
16331
of that chapter.)
 
16332
 
 
16333
 
 
16334
Changes to the WWW and Internet tools
 
16335
=====================================
 
16336
 
 
16337
The "htmllib" module has been rewritten in an incompatible fashion.
 
16338
The new version is considerably more complete (HTML 2.0 except forms,
 
16339
but including all ISO-8859-1 entity definitions), and easy to use.
 
16340
Small changes to "sgmllib" have also been made, to better match the
 
16341
tokenization of HTML as recognized by other web tools.
 
16342
 
 
16343
A new module "formatter" has been added, for use with the new
 
16344
"htmllib" module.
 
16345
 
 
16346
The "urllib"and "httplib" modules have been changed somewhat to allow
 
16347
overriding unknown URL types and to support authentication.  They now
 
16348
use "mimetools.Message" instead of "rfc822.Message" to parse headers.
 
16349
The "endrequest()" method has been removed from the HTTP class since
 
16350
it breaks the interaction with some servers.
 
16351
 
 
16352
The "rfc822.Message" class has been changed to allow a flag to be
 
16353
passed in that says that the file is unseekable.
 
16354
 
 
16355
The "ftplib" module has been fixed to be (hopefully) more robust on
 
16356
Linux.
 
16357
 
 
16358
Several new operations that are optionally supported by servers have
 
16359
been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
 
16360
 
 
16361
Other Language Changes
 
16362
======================
 
16363
 
 
16364
The "raise" statement now takes an optional argument which specifies
 
16365
the traceback to be used when printing the exception's stack trace.
 
16366
This must be a traceback object, such as found in "sys.exc_traceback".
 
16367
When omitted or given as "None", the old behavior (to generate a stack
 
16368
trace entry for the current stack frame) is used.
 
16369
 
 
16370
The tokenizer is now more tolerant of alien whitespace.  Control-L in
 
16371
the leading whitespace of a line resets the column number to zero,
 
16372
while Control-R just before the end of the line is ignored.
 
16373
 
 
16374
Changes to Built-in Operations
 
16375
==============================
 
16376
 
 
16377
For file objects, "f.read(0)" and "f.readline(0)" now return an empty
 
16378
string rather than reading an unlimited number of bytes.  For the
 
16379
latter, omit the argument altogether or pass a negative value.
 
16380
 
 
16381
A new system variable, "sys.platform", has been added.  It specifies
 
16382
the current platform, e.g. "sunos5" or "linux1".
 
16383
 
 
16384
The built-in functions "input()" and "raw_input()" now use the GNU
 
16385
readline library when it has been configured (formerly, only
 
16386
interactive input to the interpreter itself was read using GNU
 
16387
readline).  The GNU readline library provides elaborate line editing
 
16388
and history.  The Python debugger ("pdb") is the first beneficiary of
 
16389
this change.
 
16390
 
 
16391
Two new built-in functions, "globals()" and "locals()", provide access
 
16392
to dictionaries containming current global and local variables,
 
16393
respectively.  (These augment rather than replace "vars()", which
 
16394
returns the current local variables when called without an argument,
 
16395
and a module's global variables when called with an argument of type
 
16396
module.)
 
16397
 
 
16398
The built-in function "compile()" now takes a third possible value for
 
16399
the kind of code to be compiled: specifying "'single'" generates code
 
16400
for a single interactive statement, which prints the output of
 
16401
expression statements that evaluate to something else than "None".
 
16402
 
 
16403
Library Changes
 
16404
===============
 
16405
 
 
16406
There are new module "ni" and "ihooks" that support importing modules
 
16407
with hierarchical names such as "A.B.C".  This is enabled by writing
 
16408
"import ni; ni.ni()" at the very top of the main program.  These
 
16409
modules are amply documented in the Python source.
 
16410
 
 
16411
The module "rexec" has been rewritten (incompatibly) to define a class
 
16412
and to use "ihooks".
 
16413
 
 
16414
The "string.split()" and "string.splitfields()" functions are now the
 
16415
same function (the presence or absence of the second argument
 
16416
determines which operation is invoked); similar for "string.join()"
 
16417
and "string.joinfields()".
 
16418
 
 
16419
The "Tkinter" module and its helper "Dialog" have been revamped to use
 
16420
keyword arguments.  Tk 4.0 is now the standard.  A new module
 
16421
"FileDialog" has been added which implements standard file selection
 
16422
dialogs.
 
16423
 
 
16424
The optional built-in modules "dbm" and "gdbm" are more coordinated
 
16425
--- their "open()" functions now take the same values for their "flag"
 
16426
argument, and the "flag" and "mode" argument have default values (to
 
16427
open the database for reading only, and to create the database with
 
16428
mode "0666" minuse the umask, respectively).  The memory leaks have
 
16429
finally been fixed.
 
16430
 
 
16431
A new dbm-like module, "bsddb", has been added, which uses the BSD DB
 
16432
package's hash method.
 
16433
 
 
16434
A portable (though slow) dbm-clone, implemented in Python, has been
 
16435
added for systems where none of the above is provided.  It is aptly
 
16436
dubbed "dumbdbm".
 
16437
 
 
16438
The module "anydbm" provides a unified interface to "bsddb", "gdbm",
 
16439
"dbm", and "dumbdbm", choosing the first one available.
 
16440
 
 
16441
A new extension module, "binascii", provides a variety of operations
 
16442
for conversion of text-encoded binary data.
 
16443
 
 
16444
There are three new or rewritten companion modules implemented in
 
16445
Python that can encode and decode the most common such formats: "uu"
 
16446
(uuencode), "base64" and "binhex".
 
16447
 
 
16448
A module to handle the MIME encoding quoted-printable has also been
 
16449
added: "quopri".
 
16450
 
 
16451
The parser module (which provides an interface to the Python parser's
 
16452
abstract syntax trees) has been rewritten (incompatibly) by Fred
 
16453
Drake.  It now lets you change the parse tree and compile the result!
 
16454
 
 
16455
The \code{syslog} module has been upgraded and documented.
 
16456
 
 
16457
Other Changes
 
16458
=============
 
16459
 
 
16460
The dynamic module loader recognizes the fact that different filenames
 
16461
point to the same shared library and loads the library only once, so
 
16462
you can have a single shared library that defines multiple modules.
 
16463
(SunOS / SVR4 style shared libraries only.)
 
16464
 
 
16465
Jim Fulton's ``abstract object interface'' has been incorporated into
 
16466
the run-time API.  For more detailes, read the files
 
16467
"Include/abstract.h" and "Objects/abstract.c".
 
16468
 
 
16469
The Macintosh version is much more robust now.
 
16470
 
 
16471
Numerous things I have forgotten or that are so obscure no-one will
 
16472
notice them anyway :-)
 
16473
 
 
16474
 
 
16475
===================================
 
16476
==> Release 1.2 (13 April 1995) <==
 
16477
===================================
 
16478
 
 
16479
- Changes to Misc/python-mode.el:
 
16480
  - Wrapping and indentation within triple quote strings should work
 
16481
    properly now.
 
16482
  - `Standard' bug reporting mechanism (use C-c C-b)
 
16483
  - py-mark-block was moved to C-c C-m
 
16484
  - C-c C-v shows you the python-mode version
 
16485
  - a basic python-font-lock-keywords has been added for Emacs 19
 
16486
    font-lock colorizations.
 
16487
  - proper interaction with pending-del and del-sel modes.
 
16488
  - New py-electric-colon (:) command for improved outdenting.  Also
 
16489
    py-indent-line (TAB) should handle outdented lines better.
 
16490
  - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
 
16491
 
 
16492
- The Library Reference has been restructured, and many new and
 
16493
existing modules are now documented, in particular the debugger and
 
16494
the profiler, as well as the persistency and the WWW/Internet support
 
16495
modules.
 
16496
 
 
16497
- All known bugs have been fixed.  For example the pow(2,2,3L) bug on
 
16498
Linux has been fixed.  Also the re-entrancy problems with __del__ have
 
16499
been fixed.
 
16500
 
 
16501
- All known memory leaks have been fixed.
 
16502
 
 
16503
- Phase 2 of the Great Renaming has been executed.  The header files
 
16504
now use the new names (PyObject instead of object, etc.).  The linker
 
16505
also sees the new names.  Most source files still use the old names,
 
16506
by virtue of the rename2.h header file.  If you include Python.h, you
 
16507
only see the new names.  Dynamically linked modules have to be
 
16508
recompiled.  (Phase 3, fixing the rest of the sources, will be
 
16509
executed gradually with the release later versions.)
 
16510
 
 
16511
- The hooks for implementing "safe-python" (better called "restricted
 
16512
execution") are in place.  Specifically, the import statement is
 
16513
implemented by calling the built-in function __import__, and the
 
16514
built-in names used in a particular scope are taken from the
 
16515
dictionary __builtins__ in that scope's global dictionary.  See also
 
16516
the new (unsupported, undocumented) module rexec.py.
 
16517
 
 
16518
- The import statement now supports the syntax "import a.b.c" and
 
16519
"from a.b.c import name".  No officially supported implementation
 
16520
exists, but one can be prototyped by replacing the built-in __import__
 
16521
function.  A proposal by Ken Manheimer is provided as newimp.py.
 
16522
 
 
16523
- All machinery used by the import statement (or the built-in
 
16524
__import__ function) is now exposed through the new built-in module
 
16525
"imp" (see the library reference manual).  All dynamic loading
 
16526
machinery is moved to the new file importdl.c.
 
16527
 
 
16528
- Persistent storage is supported through the use of the modules
 
16529
"pickle" and "shelve" (implemented in Python).  There's also a "copy"
 
16530
module implementing deepcopy and normal (shallow) copy operations.
 
16531
See the library reference manual.
 
16532
 
 
16533
- Documentation strings for many objects types are accessible through
 
16534
the __doc__ attribute.  Modules, classes and functions support special
 
16535
syntax to initialize the __doc__ attribute: if the first statement
 
16536
consists of just a string literal, that string literal becomes the
 
16537
value of the __doc__ attribute.  The default __doc__ attribute is
 
16538
None.  Documentation strings are also supported for built-in
 
16539
functions, types and modules; however this feature hasn't been widely
 
16540
used yet.  See the 'new' module for an example.  (Basically, the type
 
16541
object's tp_doc field contains the doc string for the type, and the
 
16542
4th member of the methodlist structure contains the doc string for the
 
16543
method.)
 
16544
 
 
16545
- The __coerce__ and __cmp__ methods for user-defined classes once
 
16546
again work as expected.  As an example, there's a new standard class
 
16547
Complex in the library.
 
16548
 
 
16549
- The functions posix.popen() and posix.fdopen() now have an optional
 
16550
third argument to specify the buffer size, and default their second
 
16551
(mode) argument to 'r' -- in analogy to the builtin open() function.
 
16552
The same applies to posixfile.open() and the socket method makefile().
 
16553
 
 
16554
- The thread.exit_thread() function now raises SystemExit so that
 
16555
'finally' clauses are honored and a memory leak is plugged.
 
16556
 
 
16557
- Improved X11 and Motif support, by Sjoerd Mullender.  This extension
 
16558
is being maintained and distributed separately.
 
16559
 
 
16560
- Improved support for the Apple Macintosh, in part by Jack Jansen,
 
16561
e.g. interfaces to (a few) resource mananger functions, get/set file
 
16562
type and creator, gestalt, sound manager, speech manager, MacTCP, comm
 
16563
toolbox, and the think C console library.  This is being maintained
 
16564
and distributed separately.
 
16565
 
 
16566
- Improved version for Windows NT, by Mark Hammond.  This is being
 
16567
maintained and distributed separately.
 
16568
 
 
16569
- Used autoconf 2.0 to generate the configure script.  Adapted
 
16570
configure.in to use the new features in autoconf 2.0.
 
16571
 
 
16572
- It now builds on the NeXT without intervention, even on the 3.3
 
16573
Sparc pre-release.
 
16574
 
 
16575
- Characters passed to isspace() and friends are masked to nonnegative
 
16576
values.
 
16577
 
 
16578
- Correctly compute pow(-3.0, 3).
 
16579
 
 
16580
- Fix portability problems with getopt (configure now checks for a
 
16581
non-GNU getopt).
 
16582
 
 
16583
- Don't add frozenmain.o to libPython.a.
 
16584
 
 
16585
- Exceptions can now be classes.  ALl built-in exceptions are still
 
16586
string objects, but this will change in the future.
 
16587
 
 
16588
- The socket module exports a long list of socket related symbols.
 
16589
(More built-in modules will export their symbolic constants instead of
 
16590
relying on a separately generated Python module.)
 
16591
 
 
16592
- When a module object is deleted, it clears out its own dictionary.
 
16593
This fixes a circularity in the references between functions and
 
16594
their global dictionary.
 
16595
 
 
16596
- Changed the error handling by [new]getargs() e.g. for "O&".
 
16597
 
 
16598
- Dynamic loading of modules using shared libraries is supported for
 
16599
several new platforms.
 
16600
 
 
16601
- Support "O&", "[...]" and "{...}" in mkvalue().
 
16602
 
 
16603
- Extension to findmethod(): findmethodinchain() (where a chain is a
 
16604
linked list of methodlist arrays).  The calling interface for
 
16605
findmethod() has changed: it now gets a pointer to the (static!)
 
16606
methodlist structure rather than just to the function name -- this
 
16607
saves copying flags etc. into the (short-lived) method object.
 
16608
 
 
16609
- The callable() function is now public.
 
16610
 
 
16611
- Object types can define a few new operations by setting function
 
16612
pointers in the type object structure: tp_call defines how an object
 
16613
is called, and tp_str defines how an object's str() is computed.
 
16614
 
 
16615
 
 
16616
===================================
 
16617
==> Release 1.1.1 (10 Nov 1994) <==
 
16618
===================================
 
16619
 
 
16620
This is a pure bugfix release again.  See the ChangeLog file for details.
 
16621
 
 
16622
One exception: a few new features were added to tkinter.
 
16623
 
 
16624
 
 
16625
=================================
 
16626
==> Release 1.1 (11 Oct 1994) <==
 
16627
=================================
 
16628
 
 
16629
This release adds several new features, improved configuration and
 
16630
portability, and fixes more bugs than I can list here (including some
 
16631
memory leaks).
 
16632
 
 
16633
The source compiles and runs out of the box on more platforms than
 
16634
ever -- including Windows NT.  Makefiles or projects for a variety of
 
16635
non-UNIX platforms are provided.
 
16636
 
 
16637
APOLOGY: some new features are badly documented or not at all.  I had
 
16638
the choice -- postpone the new release indefinitely, or release it
 
16639
now, with working code but some undocumented areas.  The problem with
 
16640
postponing the release is that people continue to suffer from existing
 
16641
bugs, and send me patches based on the previous release -- which I
 
16642
can't apply directly because my own source has changed.  Also, some
 
16643
new modules (like signal) have been ready for release for quite some
 
16644
time, and people are anxiously waiting for them.  In the case of
 
16645
signal, the interface is simple enough to figure out without
 
16646
documentation (if you're anxious enough :-).  In this case it was not
 
16647
simple to release the module on its own, since it relies on many small
 
16648
patches elsewhere in the source.
 
16649
 
 
16650
For most new Python modules, the source code contains comments that
 
16651
explain how to use them.  Documentation for the Tk interface, written
 
16652
by Matt Conway, is available as tkinter-doc.tar.gz from the Python
 
16653
home and mirror ftp sites (see Misc/FAQ for ftp addresses).  For the
 
16654
new operator overloading facilities, have a look at Demo/classes:
 
16655
Complex.py and Rat.py show how to implement a numeric type without and
 
16656
with __coerce__ method.  Also have a look at the end of the Tutorial
 
16657
document (Doc/tut.tex).  If you're still confused: use the newsgroup
 
16658
or mailing list.
 
16659
 
 
16660
 
 
16661
New language features:
 
16662
 
 
16663
    - More flexible operator overloading for user-defined classes
 
16664
    (INCOMPATIBLE WITH PREVIOUS VERSIONS!)  See end of tutorial.
 
16665
 
 
16666
    - Classes can define methods named __getattr__, __setattr__ and
 
16667
    __delattr__ to trap attribute accesses.  See end of tutorial.
 
16668
 
 
16669
    - Classes can define method __call__ so instances can be called
 
16670
    directly.  See end of tutorial.
 
16671
 
 
16672
 
 
16673
New support facilities:
 
16674
 
 
16675
    - The Makefiles (for the base interpreter as well as for extensions)
 
16676
    now support creating dynamically loadable modules if the platform
 
16677
    supports shared libraries.
 
16678
 
 
16679
    - Passing the interpreter a .pyc file as script argument will execute
 
16680
    the code in that file.  (On the Mac such files can be double-clicked!)
 
16681
 
 
16682
    - New Freeze script, to create independently distributable "binaries"
 
16683
    of Python programs -- look in Demo/freeze
 
16684
 
 
16685
    - Improved h2py script (in Demo/scripts) follows #includes and
 
16686
    supports macros with one argument
 
16687
 
 
16688
    - New module compileall generates .pyc files for all modules in a
 
16689
    directory (tree) without also executing them
 
16690
 
 
16691
    - Threads should work on more platforms
 
16692
 
 
16693
 
 
16694
New built-in modules:
 
16695
 
 
16696
    - tkinter (support for Tcl's Tk widget set) is now part of the base
 
16697
    distribution
 
16698
 
 
16699
    - signal allows catching or ignoring UNIX signals (unfortunately still
 
16700
    undocumented -- any taker?)
 
16701
 
 
16702
    - termios provides portable access to POSIX tty settings
 
16703
 
 
16704
    - curses provides an interface to the System V curses library
 
16705
 
 
16706
    - syslog provides an interface to the (BSD?) syslog daemon
 
16707
 
 
16708
    - 'new' provides interfaces to create new built-in object types
 
16709
    (e.g. modules and functions)
 
16710
 
 
16711
    - sybase provides an interface to SYBASE database
 
16712
 
 
16713
 
 
16714
New/obsolete built-in methods:
 
16715
 
 
16716
    - callable(x) tests whether x can be called
 
16717
 
 
16718
    - sockets now have a setblocking() method
 
16719
 
 
16720
    - sockets no longer have an allowbroadcast() method
 
16721
 
 
16722
    - socket methods send() and sendto() return byte count
 
16723
 
 
16724
 
 
16725
New standard library modules:
 
16726
 
 
16727
    - types.py defines standard names for built-in types, e.g. StringType
 
16728
 
 
16729
    - urlparse.py parses URLs according to the latest Internet draft
 
16730
 
 
16731
    - uu.py does uuencode/uudecode (not the fastest in the world, but
 
16732
    quicker than installing uuencode on a non-UNIX machine :-)
 
16733
 
 
16734
    - New, faster and more powerful profile module.py
 
16735
 
 
16736
    - mhlib.py provides interface to MH folders and messages
 
16737
 
 
16738
 
 
16739
New facilities for extension writers (unfortunately still
 
16740
undocumented):
 
16741
 
 
16742
    - newgetargs() supports optional arguments and improved error messages
 
16743
 
 
16744
    - O!, O& O? formats for getargs allow more versatile type checking of
 
16745
    non-standard types
 
16746
 
 
16747
    - can register pending asynchronous callback, to be called the next
 
16748
    time the Python VM begins a new instruction (Py_AddPendingCall)
 
16749
 
 
16750
    - can register cleanup routines to be called when Python exits
 
16751
    (Py_AtExit)
 
16752
 
 
16753
    - makesetup script understands C++ files in Setup file (use file.C
 
16754
    or file.cc)
 
16755
 
 
16756
    - Make variable OPT is passed on to sub-Makefiles
 
16757
 
 
16758
    - An init<module>() routine may signal an error by not entering
 
16759
    the module in the module table and raising an exception instead
 
16760
 
 
16761
    - For long module names, instead of foobarbletchmodule.c you can
 
16762
    use foobarbletch.c
 
16763
 
 
16764
    - getintvalue() and getfloatvalue() try to convert any object
 
16765
    instead of requiring an "intobject" or "floatobject"
 
16766
 
 
16767
    - All the [new]getargs() formats that retrieve an integer value
 
16768
    will now also work if a float is passed
 
16769
 
 
16770
    - C function listtuple() converts list to tuple, fast
 
16771
 
 
16772
    - You should now call sigcheck() instead of intrcheck();
 
16773
    sigcheck() also sets an exception when it returns nonzero
 
16774
 
 
16775
 
 
16776
====================================
 
16777
==> Release 1.0.3 (14 July 1994) <==
 
16778
====================================
 
16779
 
 
16780
This release consists entirely of bug fixes to the C sources; see the
 
16781
head of ../ChangeLog for a complete list.  Most important bugs fixed:
 
16782
 
 
16783
- Sometimes the format operator (string%expr) would drop the last
 
16784
character of the format string
 
16785
 
 
16786
- Tokenizer looped when last line did not end in \n
 
16787
 
 
16788
- Bug when triple-quoted string ended in quote plus newline
 
16789
 
 
16790
- Typo in socketmodule (listen) (== instead of =)
 
16791
 
 
16792
- typing vars() at the >>> prompt would cause recursive output
 
16793
 
 
16794
 
 
16795
==================================
 
16796
==> Release 1.0.2 (4 May 1994) <==
 
16797
==================================
 
16798
 
 
16799
Overview of the most visible changes.  Bug fixes are not listed.  See
 
16800
also ChangeLog.
 
16801
 
 
16802
Tokens
 
16803
------
 
16804
 
 
16805
* String literals follow Standard C rules: they may be continued on
 
16806
the next line using a backslash; adjacent literals are concatenated
 
16807
at compile time.
 
16808
 
 
16809
* A new kind of string literals, surrounded by triple quotes (""" or
 
16810
'''), can be continued on the next line without a backslash.
 
16811
 
 
16812
Syntax
 
16813
------
 
16814
 
 
16815
* Function arguments may have a default value, e.g. def f(a, b=1);
 
16816
defaults are evaluated at function definition time.  This also applies
 
16817
to lambda.
 
16818
 
 
16819
* The try-except statement has an optional else clause, which is
 
16820
executed when no exception occurs in the try clause.
 
16821
 
 
16822
Interpreter
 
16823
-----------
 
16824
 
 
16825
* The result of a statement-level expression is no longer printed,
 
16826
except_ for expressions entered interactively.  Consequently, the -k
 
16827
command line option is gone.
 
16828
 
 
16829
* The result of the last printed interactive expression is assigned to
 
16830
the variable '_'.
 
16831
 
 
16832
* Access to implicit global variables has been speeded up by removing
 
16833
an always-failing dictionary lookup in the dictionary of local
 
16834
variables (mod suggested by Steve Makewski and Tim Peters).
 
16835
 
 
16836
* There is a new command line option, -u, to force stdout and stderr
 
16837
to be unbuffered.
 
16838
 
 
16839
* Incorporated Steve Majewski's mods to import.c for dynamic loading
 
16840
under AIX.
 
16841
 
 
16842
* Fewer chances of dumping core when trying to reload or re-import
 
16843
static built-in, dynamically loaded built-in, or frozen modules.
 
16844
 
 
16845
* Loops over sequences now don't ask for the sequence's length when
 
16846
they start, but try to access items 0, 1, 2, and so on until they hit
 
16847
an IndexError.  This makes it possible to create classes that generate
 
16848
infinite or indefinite sequences a la Steve Majewski.  This affects
 
16849
for loops, the (not) in operator, and the built-in functions filter(),
 
16850
map(), max(), min(), reduce().
 
16851
 
 
16852
Changed Built-in operations
 
16853
---------------------------
 
16854
 
 
16855
* The '%' operator on strings (printf-style formatting) supports a new
 
16856
feature (adapted from a patch by Donald Beaudry) to allow
 
16857
'%(<key>)<format>' % {...} to take values from a dictionary by name
 
16858
instead of from a tuple by position (see also the new function
 
16859
vars()).
 
16860
 
 
16861
* The '%s' formatting operator is changed to accept any type and
 
16862
convert it to a string using str().
 
16863
 
 
16864
* Dictionaries with more than 20,000 entries can now be created
 
16865
(thanks to Steve Kirsch).
 
16866
 
 
16867
New Built-in Functions
 
16868
----------------------
 
16869
 
 
16870
* vars() returns a dictionary containing the local variables; vars(m)
 
16871
returns a dictionary containing the variables of module m.  Note:
 
16872
dir(x) is now equivalent to vars(x).keys().
 
16873
 
 
16874
Changed Built-in Functions
 
16875
--------------------------
 
16876
 
 
16877
* open() has an optional third argument to specify the buffer size: 0
 
16878
for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
 
16879
for default.
 
16880
 
 
16881
* open()'s second argument is now optional; it defaults to "r".
 
16882
 
 
16883
* apply() now checks that its second argument is indeed a tuple.
 
16884
 
 
16885
New Built-in Modules
 
16886
--------------------
 
16887
 
 
16888
Changed Built-in Modules
 
16889
------------------------
 
16890
 
 
16891
The thread module no longer supports exit_prog().
 
16892
 
 
16893
New Python Modules
 
16894
------------------
 
16895
 
 
16896
* Module addpack contains a standard interface to modify sys.path to
 
16897
find optional packages (groups of related modules).
 
16898
 
 
16899
* Module urllib contains a number of functions to access
 
16900
World-Wide-Web files specified by their URL.
 
16901
 
 
16902
* Module httplib implements the client side of the HTTP protocol used
 
16903
by World-Wide-Web servers.
 
16904
 
 
16905
* Module gopherlib implements the client side of the Gopher protocol.
 
16906
 
 
16907
* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
 
16908
style mailbox files.
 
16909
 
 
16910
* Module random contains various random distributions, e.g. gauss().
 
16911
 
 
16912
* Module lockfile locks and unlocks open files using fcntl (inspired
 
16913
by a similar module by Andy Bensky).
 
16914
 
 
16915
* Module ntpath (by Jaap Vermeulen) implements path operations for
 
16916
Windows/NT.
 
16917
 
 
16918
* Module test_thread (in Lib/test) contains a small test set for the
 
16919
thread module.
 
16920
 
 
16921
Changed Python Modules
 
16922
----------------------
 
16923
 
 
16924
* The string module's expandvars() function is now documented and is
 
16925
implemented in Python (using regular expressions) instead of forking
 
16926
off a shell process.
 
16927
 
 
16928
* Module rfc822 now supports accessing the header fields using the
 
16929
mapping/dictionary interface, e.g. h['subject'].
 
16930
 
 
16931
* Module pdb now makes it possible to set a break on a function
 
16932
(syntax: break <expression>, where <expression> yields a function
 
16933
object).
 
16934
 
 
16935
Changed Demos
 
16936
-------------
 
16937
 
 
16938
* The Demo/scripts/freeze.py script is working again (thanks to Jaap
 
16939
Vermeulen).
 
16940
 
 
16941
New Demos
 
16942
---------
 
16943
 
 
16944
* Demo/threads/Generator.py is a proposed interface for restartable
 
16945
functions a la Tim Peters.
 
16946
 
 
16947
* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
 
16948
directory full of HTML pages which between them contain links to all
 
16949
the newsgroups available on your server.
 
16950
 
 
16951
* Demo/dns contains a DNS (Domain Name Server) client.
 
16952
 
 
16953
* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
 
16954
nice enhanced Python shell!!!).
 
16955
 
 
16956
* Demo/turing contains a Turing machine by Amrit Prem.
 
16957
 
 
16958
Documentation
 
16959
-------------
 
16960
 
 
16961
* Documented new language features mentioned above (but not all new
 
16962
modules).
 
16963
 
 
16964
* Added a chapter to the Tutorial describing recent additions to
 
16965
Python.
 
16966
 
 
16967
* Clarified some sentences in the reference manual,
 
16968
e.g. break/continue, local/global scope, slice assignment.
 
16969
 
 
16970
Source Structure
 
16971
----------------
 
16972
 
 
16973
* Moved Include/tokenizer.h to Parser/tokenizer.h.
 
16974
 
 
16975
* Added Python/getopt.c for systems that don't have it.
 
16976
 
 
16977
Emacs mode
 
16978
----------
 
16979
 
 
16980
* Indentation of continuated lines is done more intelligently;
 
16981
consequently the variable py-continuation-offset is gone.
 
16982
 
 
16983
 
 
16984
========================================
 
16985
==> Release 1.0.1 (15 February 1994) <==
 
16986
========================================
 
16987
 
 
16988
* Many portability fixes should make it painless to build Python on
 
16989
several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
 
16990
 
 
16991
* Fixed test for <stdarg.h> -- this broke on some platforms.
 
16992
 
 
16993
* Fixed test for shared library dynalic loading -- this broke on SunOS
 
16994
4.x using the GNU loader.
 
16995
 
 
16996
* Changed order and number of SVR4 networking libraries (it is now
 
16997
-lsocket -linet -lnsl, if these libraries exist).
 
16998
 
 
16999
* Installing the build intermediate stages with "make libainstall" now
 
17000
also installs config.c.in, Setup and makesetup, which are used by the
 
17001
new Extensions mechanism.
 
17002
 
 
17003
* Improved README file contains more hints and new troubleshooting
 
17004
section.
 
17005
 
 
17006
* The built-in module strop now defines fast versions of three more
 
17007
functions of the standard string module: atoi(), atol() and atof().
 
17008
The strop versions of atoi() and atol() support an optional second
 
17009
argument to specify the base (default 10).  NOTE: you don't have to
 
17010
explicitly import strop to use the faster versions -- the string
 
17011
module contains code to let versions from stop override the default
 
17012
versions.
 
17013
 
 
17014
* There is now a working Lib/dospath.py for those who use Python under
 
17015
DOS (or Windows).  Thanks, Jaap!
 
17016
 
 
17017
* There is now a working Modules/dosmodule.c for DOS (or Windows)
 
17018
system calls.
 
17019
 
 
17020
* Lib.os.py has been reorganized (making it ready for more operating
 
17021
systems).
 
17022
 
 
17023
* Lib/ospath.py is now obsolete (use os.path instead).
 
17024
 
 
17025
* Many fixes to the tutorial to make it match Python 1.0.  Thanks,
 
17026
Tim!
 
17027
 
 
17028
* Fixed Doc/Makefile, Doc/README and various scripts there.
 
17029
 
 
17030
* Added missing description of fdopen to Doc/libposix.tex.
 
17031
 
 
17032
* Made cleanup() global, for the benefit of embedded applications.
 
17033
 
 
17034
* Added parsing of addresses and dates to Lib/rfc822.py.
 
17035
 
 
17036
* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
 
17037
them usable at all.
 
17038
 
 
17039
* New module Lib/wave.py reads RIFF (*.wav) audio files.
 
17040
 
 
17041
* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
 
17042
belongs.
 
17043
 
 
17044
* New options and comments for Modules/makesetup (used by new
 
17045
Extension mechanism).
 
17046
 
 
17047
* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
 
17048
and elsewhere.
 
17049
 
 
17050
* Fixed coredump in filter(None, 'abcdefg').
 
17051
 
 
17052
 
 
17053
=======================================
 
17054
==> Release 1.0.0 (26 January 1994) <==
 
17055
=======================================
 
17056
 
 
17057
As is traditional, so many things have changed that I can't pretend to
 
17058
be complete in these release notes, but I'll try anyway :-)
 
17059
 
 
17060
Note that the very last section is labeled "remaining bugs".
 
17061
 
 
17062
 
 
17063
Source organization and build process
 
17064
-------------------------------------
 
17065
 
 
17066
* The sources have finally been split: instead of a single src
 
17067
subdirectory there are now separate directories Include, Parser,
 
17068
Grammar, Objects, Python and Modules.  Other directories also start
 
17069
with a capital letter: Misc, Doc, Lib, Demo.
 
17070
 
 
17071
* A few extensions (notably Amoeba and X support) have been moved to a
 
17072
separate subtree Extensions, which is no longer in the core
 
17073
distribution, but separately ftp'able as extensions.tar.Z.  (The
 
17074
distribution contains a placeholder Ext-dummy with a description of
 
17075
the Extensions subtree as well as the most recent versions of the
 
17076
scripts used there.)
 
17077
 
 
17078
* A few large specialized demos (SGI video and www) have been
 
17079
moved to a separate subdirectory Demo2, which is no longer in the core
 
17080
distribution, but separately ftp'able as demo2.tar.Z.
 
17081
 
 
17082
* Parts of the standard library have been moved to subdirectories:
 
17083
there are now standard subdirectories stdwin, test, sgi and sun4.
 
17084
 
 
17085
* The configuration process has radically changed: I now use GNU
 
17086
autoconf.  This makes it much easier to build on new Unix flavors, as
 
17087
well as fully supporting VPATH (if your Make has it).  The scripts
 
17088
Configure.py and Addmodule.sh are no longer needed.  Many source files
 
17089
have been adapted in order to work with the symbols that the configure
 
17090
script generated by autoconf defines (or not); the resulting source is
 
17091
much more portable to different C compilers and operating systems,
 
17092
even non Unix systems (a Mac port was done in an afternoon).  See the
 
17093
toplevel README file for a description of the new build process.
 
17094
 
 
17095
* GNU readline (a slightly newer version) is now a subdirectory of the
 
17096
Python toplevel.  It is still not automatically configured (being
 
17097
totally autoconf-unaware :-).  One problem has been solved: typing
 
17098
Control-C to a readline prompt will now work.  The distribution no
 
17099
longer contains a "super-level" directory (above the python toplevel
 
17100
directory), and dl, dl-dld and GNU dld are no longer part of the
 
17101
Python distribution (you can still ftp them from
 
17102
ftp.cwi.nl:/pub/dynload).
 
17103
 
 
17104
* The DOS functions have been taken out of posixmodule.c and moved
 
17105
into a separate file dosmodule.c.
 
17106
 
 
17107
* There's now a separate file version.c which contains nothing but
 
17108
the version number.
 
17109
 
 
17110
* The actual main program is now contained in config.c (unless NO_MAIN
 
17111
is defined); pythonmain.c now contains a function realmain() which is
 
17112
called from config.c's main().
 
17113
 
 
17114
* All files needed to use the built-in module md5 are now contained in
 
17115
the distribution.  The module has been cleaned up considerably.
 
17116
 
 
17117
 
 
17118
Documentation
 
17119
-------------
 
17120
 
 
17121
* The library manual has been split into many more small latex files,
 
17122
so it is easier to edit Doc/lib.tex file to create a custom library
 
17123
manual, describing only those modules supported on your system.  (This
 
17124
is not automated though.)
 
17125
 
 
17126
* A fourth manual has been added, titled "Extending and Embedding the
 
17127
Python Interpreter" (Doc/ext.tex), which collects information about
 
17128
the interpreter which was previously spread over several files in the
 
17129
misc subdirectory.
 
17130
 
 
17131
* The entire documentation is now also available on-line for those who
 
17132
have a WWW browser (e.g. NCSA Mosaic).  Point your browser to the URL
 
17133
"http://www.cwi.nl/~guido/Python.html".
 
17134
 
 
17135
 
 
17136
Syntax
 
17137
------
 
17138
 
 
17139
* Strings may now be enclosed in double quotes as well as in single
 
17140
quotes.  There is no difference in interpretation.  The repr() of
 
17141
string objects will use double quotes if the string contains a single
 
17142
quote and no double quotes.  Thanks to Amrit Prem for these changes!
 
17143
 
 
17144
* There is a new keyword 'exec'.  This replaces the exec() built-in
 
17145
function.  If a function contains an exec statement, local variable
 
17146
optimization is not performed for that particular function, thus
 
17147
making assignment to local variables in exec statements less
 
17148
confusing.  (As a consequence, os.exec and python.exec have been
 
17149
renamed to execv.)
 
17150
 
 
17151
* There is a new keyword 'lambda'.  An expression of the form
 
17152
 
 
17153
        lambda <parameters> : <expression>
 
17154
 
 
17155
yields an anonymous function.  This is really only syntactic sugar;
 
17156
you can just as well define a local function using
 
17157
 
 
17158
        def some_temporary_name(<parameters>): return <expression>
 
17159
 
 
17160
Lambda expressions are particularly useful in combination with map(),
 
17161
filter() and reduce(), described below.  Thanks to Amrit Prem for
 
17162
submitting this code (as well as map(), filter(), reduce() and
 
17163
xrange())!
 
17164
 
 
17165
 
 
17166
Built-in functions
 
17167
------------------
 
17168
 
 
17169
* The built-in module containing the built-in functions is called
 
17170
__builtin__ instead of builtin.
 
17171
 
 
17172
* New built-in functions map(), filter() and reduce() perform standard
 
17173
functional programming operations (though not lazily):
 
17174
 
 
17175
- map(f, seq) returns a new sequence whose items are the items from
 
17176
seq with f() applied to them.
 
17177
 
 
17178
- filter(f, seq) returns a subsequence of seq consisting of those
 
17179
items for which f() is true.
 
17180
 
 
17181
- reduce(f, seq, initial) returns a value computed as follows:
 
17182
        acc = initial
 
17183
        for item in seq: acc = f(acc, item)
 
17184
        return acc
 
17185
 
 
17186
* New function xrange() creates a "range object".  Its arguments are
 
17187
the same as those of range(), and when used in a for loop a range
 
17188
objects also behaves identical.  The advantage of xrange() over
 
17189
range() is that its representation (if the range contains many
 
17190
elements) is much more compact than that of range().  The disadvantage
 
17191
is that the result cannot be used to initialize a list object or for
 
17192
the "Python idiom" [RED, GREEN, BLUE] = range(3).  On some modern
 
17193
architectures, benchmarks have shown that "for i in range(...): ..."
 
17194
actually executes *faster* than "for i in xrange(...): ...", but on
 
17195
memory starved machines like PCs running DOS range(100000) may be just
 
17196
too big to be represented at all...
 
17197
 
 
17198
* Built-in function exec() has been replaced by the exec statement --
 
17199
see above.
 
17200
 
 
17201
 
 
17202
The interpreter
 
17203
---------------
 
17204
 
 
17205
* Syntax errors are now not printed to stderr by the parser, but
 
17206
rather the offending line and other relevant information are packed up
 
17207
in the SyntaxError exception argument.  When the main loop catches a
 
17208
SyntaxError exception it will print the error in the same format as
 
17209
previously, but at the proper position in the stack traceback.
 
17210
 
 
17211
* You can now set a maximum to the number of traceback entries
 
17212
printed by assigning to sys.tracebacklimit.  The default is 1000.
 
17213
 
 
17214
* The version number in .pyc files has changed yet again.
 
17215
 
 
17216
* It is now possible to have a .pyc file without a corresponding .py
 
17217
file.  (Warning: this may break existing installations if you have an
 
17218
old .pyc file lingering around somewhere on your module search path
 
17219
without a corresponding .py file, when there is a .py file for a
 
17220
module of the same name further down the path -- the new interpreter
 
17221
will find the first .pyc file and complain about it, while the old
 
17222
interpreter would ignore it and use the .py file further down.)
 
17223
 
 
17224
* The list sys.builtin_module_names is now sorted and also contains
 
17225
the names of a few hardwired built-in modules (sys, __main__ and
 
17226
__builtin__).
 
17227
 
 
17228
* A module can now find its own name by accessing the global variable
 
17229
__name__.  Assigning to this variable essentially renames the module
 
17230
(it should also be stored under a different key in sys.modules).
 
17231
A neat hack follows from this: a module that wants to execute a main
 
17232
program when called as a script no longer needs to compare
 
17233
sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
 
17234
 
 
17235
* When an object is printed by the print statement, its implementation
 
17236
of str() is used.  This means that classes can define __str__(self) to
 
17237
direct how their instances are printed.  This is different from
 
17238
__repr__(self), which should define an unambigous string
 
17239
representation of the instance.  (If __str__() is not defined, it
 
17240
defaults to __repr__().)
 
17241
 
 
17242
* Functions and code objects can now be compared meaningfully.
 
17243
 
 
17244
* On systems supporting SunOS or SVR4 style shared libraries, dynamic
 
17245
loading of modules using shared libraries is automatically configured.
 
17246
Thanks to Bill Jansen and Denis Severson for contributing this change!
 
17247
 
 
17248
 
 
17249
Built-in objects
 
17250
----------------
 
17251
 
 
17252
* File objects have acquired a new method writelines() which is the
 
17253
reverse of readlines().  (It does not actually write lines, just a
 
17254
list of strings, but the symmetry makes the choice of name OK.)
 
17255
 
 
17256
 
 
17257
Built-in modules
 
17258
----------------
 
17259
 
 
17260
* Socket objects no longer support the avail() method.  Use the select
 
17261
module instead, or use this function to replace it:
 
17262
 
 
17263
        def avail(f):
 
17264
                import select
 
17265
                return f in select.select([f], [], [], 0)[0]
 
17266
 
 
17267
* Initialization of stdwin is done differently.  It actually modifies
 
17268
sys.argv (taking out the options the X version of stdwin recognizes)
 
17269
the first time it is imported.
 
17270
 
 
17271
* A new built-in module parser provides a rudimentary interface to the
 
17272
python parser.  Corresponding standard library modules token and symbol
 
17273
defines the numeric values of tokens and non-terminal symbols.
 
17274
 
 
17275
* The posix module has aquired new functions setuid(), setgid(),
 
17276
execve(), and exec() has been renamed to execv().
 
17277
 
 
17278
* The array module is extended with 8-byte object swaps, the 'i'
 
17279
format character, and a reverse() method.  The read() and write()
 
17280
methods are renamed to fromfile() and tofile().
 
17281
 
 
17282
* The rotor module has freed of portability bugs.  This introduces a
 
17283
backward compatibility problem: strings encoded with the old rotor
 
17284
module can't be decoded by the new version.
 
17285
 
 
17286
* For select.select(), a timeout (4th) argument of None means the same
 
17287
as leaving the timeout argument out.
 
17288
 
 
17289
* Module strop (and hence standard library module string) has aquired
 
17290
a new function: rindex().  Thanks to Amrit Prem!
 
17291
 
 
17292
* Module regex defines a new function symcomp() which uses an extended
 
17293
regular expression syntax: parenthesized subexpressions may be labeled
 
17294
using the form "\(<labelname>...\)", and the group() method can return
 
17295
sub-expressions by name.  Thanks to Tracy Tims for these changes!
 
17296
 
 
17297
* Multiple threads are now supported on Solaris 2.  Thanks to Sjoerd
 
17298
Mullender!
 
17299
 
 
17300
 
 
17301
Standard library modules
 
17302
------------------------
 
17303
 
 
17304
* The library is now split in several subdirectories: all stuff using
 
17305
stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
 
17306
is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
 
17307
test modules are in Lib/test.  The default module search path will
 
17308
include all relevant subdirectories by default.
 
17309
 
 
17310
* Module os now knows about trying to import dos.  It defines
 
17311
functions execl(), execle(), execlp() and execvp().
 
17312
 
 
17313
* New module dospath (should be attacked by a DOS hacker though).
 
17314
 
 
17315
* All modules defining classes now define __init__() constructors
 
17316
instead of init() methods.  THIS IS AN INCOMPATIBLE CHANGE!
 
17317
 
 
17318
* Some minor changes and bugfixes module ftplib (mostly Steve
 
17319
Majewski's suggestions); the debug() method is renamed to
 
17320
set_debuglevel().
 
17321
 
 
17322
* Some new test modules (not run automatically by testall though):
 
17323
test_audioop, test_md5, test_rgbimg, test_select.
 
17324
 
 
17325
* Module string now defines rindex() and rfind() in analogy of index()
 
17326
and find().  It also defines atof() and atol() (and corresponding
 
17327
exceptions) in analogy to atoi().
 
17328
 
 
17329
* Added help() functions to modules profile and pdb.
 
17330
 
 
17331
* The wdb debugger (now in Lib/stdwin) now shows class or instance
 
17332
variables on a double click.  Thanks to Sjoerd Mullender!
 
17333
 
 
17334
* The (undocumented) module lambda has gone -- you couldn't import it
 
17335
any more, and it was basically more a demo than a library module...
 
17336
 
 
17337
 
 
17338
Multimedia extensions
 
17339
---------------------
 
17340
 
 
17341
* The optional built-in modules audioop and imageop are now standard
 
17342
parts of the interpreter.  Thanks to Sjoerd Mullender and Jack Jansen
 
17343
for contributing this code!
 
17344
 
 
17345
* There's a new operation in audioop: minmax().
 
17346
 
 
17347
* There's a new built-in module called rgbimg which supports portable
 
17348
efficient reading of SGI RCG image files.  Thanks also to Paul
 
17349
Haeberli for the original code!  (Who will contribute a GIF reader?)
 
17350
 
 
17351
* The module aifc is gone -- you should now always use aifc, which has
 
17352
received a facelift.
 
17353
 
 
17354
* There's a new module sunau., for reading Sun (and NeXT) audio files.
 
17355
 
 
17356
* There's a new module audiodev which provides a uniform interface to
 
17357
(SGI Indigo and Sun Sparc) audio hardware.
 
17358
 
 
17359
* There's a new module sndhdr which recognizes various sound files by
 
17360
looking in their header and checking for various magic words.
 
17361
 
 
17362
 
 
17363
Optimizations
 
17364
-------------
 
17365
 
 
17366
* Most optimizations below can be configured by compile-time flags.
 
17367
Thanks to Sjoerd Mullender for submitting these optimizations!
 
17368
 
 
17369
* Small integers (default -1..99) are shared -- i.e. if two different
 
17370
functions compute the same value it is possible (but not
 
17371
guaranteed!!!) that they return the same *object*.  Python programs
 
17372
can detect this but should *never* rely on it.
 
17373
 
 
17374
* Empty tuples (which all compare equal) are shared in the same
 
17375
manner.
 
17376
 
 
17377
* Tuples of size up to 20 (default) are put in separate free lists
 
17378
when deallocated.
 
17379
 
 
17380
* There is a compile-time option to cache a string's hash function,
 
17381
but this appeared to have a negligeable effect, and as it costs 4
 
17382
bytes per string it is disabled by default.
 
17383
 
 
17384
 
 
17385
Embedding Python
 
17386
----------------
 
17387
 
 
17388
* The initialization interface has been simplified somewhat.  You now
 
17389
only call "initall()" to initialize the interpreter.
 
17390
 
 
17391
* The previously announced renaming of externally visible identifiers
 
17392
has not been carried out.  It will happen in a later release.  Sorry.
 
17393
 
 
17394
 
 
17395
Miscellaneous bugs that have been fixed
 
17396
---------------------------------------
 
17397
 
 
17398
* All known portability bugs.
 
17399
 
 
17400
* Version 0.9.9 dumped core in <listobject>.sort() which has been
 
17401
fixed.  Thanks to Jaap Vermeulen for fixing this and posting the fix
 
17402
on the mailing list while I was away!
 
17403
 
 
17404
* Core dump on a format string ending in '%', e.g. in the expression
 
17405
'%' % None.
 
17406
 
 
17407
* The array module yielded a bogus result for concatenation (a+b would
 
17408
yield a+a).
 
17409
 
 
17410
* Some serious memory leaks in strop.split() and strop.splitfields().
 
17411
 
 
17412
* Several problems with the nis module.
 
17413
 
 
17414
* Subtle problem when copying a class method from another class
 
17415
through assignment (the method could not be called).
 
17416
 
 
17417
 
 
17418
Remaining bugs
 
17419
--------------
 
17420
 
 
17421
* One problem with 64-bit machines remains -- since .pyc files are
 
17422
portable and use only 4 bytes to represent an integer object, 64-bit
 
17423
integer literals are silently truncated when written into a .pyc file.
 
17424
Work-around: use eval('123456789101112').
 
17425
 
 
17426
* The freeze script doesn't work any more.  A new and more portable
 
17427
one can probably be cooked up using tricks from Extensions/mkext.py.
 
17428
 
 
17429
* The dos support hasn't been tested yet.  (Really Soon Now we should
 
17430
have a PC with a working C compiler!)
 
17431
 
 
17432
 
 
17433
===================================
 
17434
==> Release 0.9.9 (29 Jul 1993) <==
 
17435
===================================
 
17436
 
 
17437
I *believe* these are the main user-visible changes in this release,
 
17438
but there may be others.  SGI users may scan the {src,lib}/ChangeLog
 
17439
files for improvements of some SGI specific modules, e.g. aifc and
 
17440
cl.  Developers of extension modules should also read src/ChangeLog.
 
17441
 
 
17442
 
 
17443
Naming of C symbols used by the Python interpreter
 
17444
--------------------------------------------------
 
17445
 
 
17446
* This is the last release using the current naming conventions.  New
 
17447
naming conventions are explained in the file misc/NAMING.
 
17448
Summarizing, all externally visible symbols get (at least) a "Py"
 
17449
prefix, and most functions are renamed to the standard form
 
17450
PyModule_FunctionName.
 
17451
 
 
17452
* Writers of extensions are urged to start using the new naming
 
17453
conventions.  The next release will use the new naming conventions
 
17454
throughout (it will also have a different source directory
 
17455
structure).
 
17456
 
 
17457
* As a result of the preliminary work for the great renaming, many
 
17458
functions that were accidentally global have been made static.
 
17459
 
 
17460
 
 
17461
BETA X11 support
 
17462
----------------
 
17463
 
 
17464
* There are now modules interfacing to the X11 Toolkit Intrinsics, the
 
17465
Athena widgets, and the Motif 1.1 widget set.  These are not yet
 
17466
documented except through the examples and README file in the demo/x11
 
17467
directory.  It is expected that this interface will be replaced by a
 
17468
more powerful and correct one in the future, which may or may not be
 
17469
backward compatible.  In other words, this part of the code is at most
 
17470
BETA level software!  (Note: the rest of Python is rock solid as ever!)
 
17471
 
 
17472
* I understand that the above may be a bit of a disappointment,
 
17473
however my current schedule does not allow me to change this situation
 
17474
before putting the release out of the door.  By releasing it
 
17475
undocumented and buggy, at least some of the (working!) demo programs,
 
17476
like itr (my Internet Talk Radio browser) become available to a larger
 
17477
audience.
 
17478
 
 
17479
* There are also modules interfacing to SGI's "Glx" widget (a GL
 
17480
window wrapped in a widget) and to NCSA's "HTML" widget (which can
 
17481
format HyperText Markup Language, the document format used by the
 
17482
World Wide Web).
 
17483
 
 
17484
* I've experienced some problems when building the X11 support.  In
 
17485
particular, the Xm and Xaw widget sets don't go together, and it
 
17486
appears that using X11R5 is better than using X11R4.  Also the threads
 
17487
module and its link time options may spoil things.  My own strategy is
 
17488
to build two Python binaries: one for use with X11 and one without
 
17489
it, which can contain a richer set of built-in modules.  Don't even
 
17490
*think* of loading the X11 modules dynamically...
 
17491
 
 
17492
 
 
17493
Environmental changes
 
17494
---------------------
 
17495
 
 
17496
* Compiled files (*.pyc files) created by this Python version are
 
17497
incompatible with those created by the previous version.  Both
 
17498
versions detect this and silently create a correct version, but it
 
17499
means that it is not a good idea to use the same library directory for
 
17500
an old and a new interpreter, since they will start to "fight" over
 
17501
the *.pyc files...
 
17502
 
 
17503
* When a stack trace is printed, the exception is printed last instead
 
17504
of first.  This means that if the beginning of the stack trace
 
17505
scrolled out of your window you can still see what exception caused
 
17506
it.
 
17507
 
 
17508
* Sometimes interrupting a Python operation does not work because it
 
17509
hangs in a blocking system call.  You can now kill the interpreter by
 
17510
interrupting it three times.  The second time you interrupt it, a
 
17511
message will be printed telling you that the third interrupt will kill
 
17512
the interpreter.  The "sys.exitfunc" feature still makes limited
 
17513
clean-up possible in this case.
 
17514
 
 
17515
 
 
17516
Changes to the command line interface
 
17517
-------------------------------------
 
17518
 
 
17519
* The python usage message is now much more informative.
 
17520
 
 
17521
* New option -i enters interactive mode after executing a script --
 
17522
useful for debugging.
 
17523
 
 
17524
* New option -k raises an exception when an expression statement
 
17525
yields a value other than None.
 
17526
 
 
17527
* For each option there is now also a corresponding environment
 
17528
variable.
 
17529
 
 
17530
 
 
17531
Using Python as an embedded language
 
17532
------------------------------------
 
17533
 
 
17534
* The distribution now contains (some) documentation on the use of
 
17535
Python as an "embedded language" in other applications, as well as a
 
17536
simple example.  See the file misc/EMBEDDING and the directory embed/.
 
17537
 
 
17538
 
 
17539
Speed improvements
 
17540
------------------
 
17541
 
 
17542
* Function local variables are now generally stored in an array and
 
17543
accessed using an integer indexing operation, instead of through a
 
17544
dictionary lookup.  (This compensates the somewhat slower dictionary
 
17545
lookup caused by the generalization of the dictionary module.)
 
17546
 
 
17547
 
 
17548
Changes to the syntax
 
17549
---------------------
 
17550
 
 
17551
* Continuation lines can now *sometimes* be written without a
 
17552
backslash: if the continuation is contained within nesting (), [] or
 
17553
{} brackets the \ may be omitted.  There's a much improved
 
17554
python-mode.el in the misc directory which knows about this as well.
 
17555
 
 
17556
* You can no longer use an empty set of parentheses to define a class
 
17557
without base classes.  That is, you no longer write this:
 
17558
 
 
17559
        class Foo(): # syntax error
 
17560
                ...
 
17561
 
 
17562
You must write this instead:
 
17563
 
 
17564
        class Foo:
 
17565
                ...
 
17566
 
 
17567
This was already the preferred syntax in release 0.9.8 but many
 
17568
people seemed not to have picked it up.  There's a Python script that
 
17569
fixes old code: demo/scripts/classfix.py.
 
17570
 
 
17571
* There's a new reserved word: "access".  The syntax and semantics are
 
17572
still subject of of research and debate (as well as undocumented), but
 
17573
the parser knows about the keyword so you must not use it as a
 
17574
variable, function, or attribute name.
 
17575
 
 
17576
 
 
17577
Changes to the semantics of the language proper
 
17578
-----------------------------------------------
 
17579
 
 
17580
* The following compatibility hack is removed: if a function was
 
17581
defined with two or more arguments, and called with a single argument
 
17582
that was a tuple with just as many arguments, the items of this tuple
 
17583
would be used as the arguments.  This is no longer supported.
 
17584
 
 
17585
 
 
17586
Changes to the semantics of classes and instances
 
17587
-------------------------------------------------
 
17588
 
 
17589
* Class variables are now also accessible as instance variables for
 
17590
reading (assignment creates an instance variable which overrides the
 
17591
class variable of the same name though).
 
17592
 
 
17593
* If a class attribute is a user-defined function, a new kind of
 
17594
object is returned: an "unbound method".  This contains a pointer to
 
17595
the class and can only be called with a first argument which is a
 
17596
member of that class (or a derived class).
 
17597
 
 
17598
* If a class defines a method __init__(self, arg1, ...) then this
 
17599
method is called when a class instance is created by the classname()
 
17600
construct.  Arguments passed to classname() are passed to the
 
17601
__init__() method.  The __init__() methods of base classes are not
 
17602
automatically called; the derived __init__() method must call these if
 
17603
necessary (this was done so the derived __init__() method can choose
 
17604
the call order and arguments for the base __init__() methods).
 
17605
 
 
17606
* If a class defines a method __del__(self) then this method is called
 
17607
when an instance of the class is about to be destroyed.  This makes it
 
17608
possible to implement clean-up of external resources attached to the
 
17609
instance.  As with __init__(), the __del__() methods of base classes
 
17610
are not automatically called.  If __del__ manages to store a reference
 
17611
to the object somewhere, its destruction is postponed; when the object
 
17612
is again about to be destroyed its __del__() method will be called
 
17613
again.
 
17614
 
 
17615
* Classes may define a method __hash__(self) to allow their instances
 
17616
to be used as dictionary keys.  This must return a 32-bit integer.
 
17617
 
 
17618
 
 
17619
Minor improvements
 
17620
------------------
 
17621
 
 
17622
* Function and class objects now know their name (the name given in
 
17623
the 'def' or 'class' statement that created them).
 
17624
 
 
17625
* Class instances now know their class name.
 
17626
 
 
17627
 
 
17628
Additions to built-in operations
 
17629
--------------------------------
 
17630
 
 
17631
* The % operator with a string left argument implements formatting
 
17632
similar to sprintf() in C.  The right argument is either a single
 
17633
value or a tuple of values.  All features of Standard C sprintf() are
 
17634
supported except %p.
 
17635
 
 
17636
* Dictionaries now support almost any key type, instead of just
 
17637
strings.  (The key type must be an immutable type or must be a class
 
17638
instance where the class defines a method __hash__(), in order to
 
17639
avoid losing track of keys whose value may change.)
 
17640
 
 
17641
* Built-in methods are now compared properly: when comparing x.meth1
 
17642
and y.meth2, if x is equal to y and the methods are defined by the
 
17643
same function, x.meth1 compares equal to y.meth2.
 
17644
 
 
17645
 
 
17646
Additions to built-in functions
 
17647
-------------------------------
 
17648
 
 
17649
* str(x) returns a string version of its argument.  If the argument is
 
17650
a string it is returned unchanged, otherwise it returns `x`.
 
17651
 
 
17652
* repr(x) returns the same as `x`.  (Some users found it easier to
 
17653
have this as a function.)
 
17654
 
 
17655
* round(x) returns the floating point number x rounded to an whole
 
17656
number, represented as a floating point number.  round(x, n) returns x
 
17657
rounded to n digits.
 
17658
 
 
17659
* hasattr(x, name) returns true when x has an attribute with the given
 
17660
name.
 
17661
 
 
17662
* hash(x) returns a hash code (32-bit integer) of an arbitrary
 
17663
immutable object's value.
 
17664
 
 
17665
* id(x) returns a unique identifier (32-bit integer) of an arbitrary
 
17666
object.
 
17667
 
 
17668
* compile() compiles a string to a Python code object.
 
17669
 
 
17670
* exec() and eval() now support execution of code objects.
 
17671
 
 
17672
 
 
17673
Changes to the documented part of the library (standard modules)
 
17674
----------------------------------------------------------------
 
17675
 
 
17676
* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
 
17677
the border case '/foo/..' returns '/' instead of ''.
 
17678
 
 
17679
* A new function string.find() is added with similar semantics to
 
17680
string.index(); however when it does not find the given substring it
 
17681
returns -1 instead of raising string.index_error.
 
17682
 
 
17683
 
 
17684
Changes to built-in modules
 
17685
---------------------------
 
17686
 
 
17687
* New optional module 'array' implements operations on sequences of
 
17688
integers or floating point numbers of a particular size.  This is
 
17689
useful to manipulate large numerical arrays or to read and write
 
17690
binary files consisting of numerical data.
 
17691
 
 
17692
* Regular expression objects created by module regex now support a new
 
17693
method named group(), which returns one or more \(...\) groups by number.
 
17694
The number of groups is increased from 10 to 100.
 
17695
 
 
17696
* Function compile() in module regex now supports an optional mapping
 
17697
argument; a variable casefold is added to the module which can be used
 
17698
as a standard uppercase to lowercase mapping.
 
17699
 
 
17700
* Module time now supports many routines that are defined in the
 
17701
Standard C time interface (<time.h>): gmtime(), localtime(),
 
17702
asctime(), ctime(), mktime(), as well as these variables (taken from
 
17703
System V): timezone, altzone, daylight and tzname.  (The corresponding
 
17704
functions in the undocumented module calendar have been removed; the
 
17705
undocumented and unfinished module tzparse is now obsolete and will
 
17706
disappear in a future release.)
 
17707
 
 
17708
* Module strop (the fast built-in version of standard module string)
 
17709
now uses C's definition of whitespace instead of fixing it to space,
 
17710
tab and newline; in practice this usually means that vertical tab,
 
17711
form feed and return are now also considered whitespace.  It exports
 
17712
the string of characters that are considered whitespace as well as the
 
17713
characters that are considered lowercase or uppercase.
 
17714
 
 
17715
* Module sys now defines the variable builtin_module_names, a list of
 
17716
names of modules built into the current interpreter (including not
 
17717
yet imported, but excluding two special modules that always have to be
 
17718
defined -- sys and builtin).
 
17719
 
 
17720
* Objects created by module sunaudiodev now also support flush() and
 
17721
close() methods.
 
17722
 
 
17723
* Socket objects created by module socket now support an optional
 
17724
flags argument for their methods sendto() and recvfrom().
 
17725
 
 
17726
* Module marshal now supports dumping to and loading from strings,
 
17727
through the functions dumps() and loads().
 
17728
 
 
17729
* Module stdwin now supports some new functionality.  You may have to
 
17730
ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
 
17731
 
 
17732
 
 
17733
Bugs fixed
 
17734
----------
 
17735
 
 
17736
* Fixed comparison of negative long integers.
 
17737
 
 
17738
* The tokenizer no longer botches input lines longer than BUFSIZ.
 
17739
 
 
17740
* Fixed several severe memory leaks in module select.
 
17741
 
 
17742
* Fixed memory leaks in modules socket and sv.
 
17743
 
 
17744
* Fixed memory leak in divmod() for long integers.
 
17745
 
 
17746
* Problems with definition of floatsleep() on Suns fixed.
 
17747
 
 
17748
* Many portability bugs fixed (and undoubtedly new ones added :-).
 
17749
 
 
17750
 
 
17751
Changes to the build procedure
 
17752
------------------------------
 
17753
 
 
17754
* The Makefile supports some new targets: "make default" and "make
 
17755
all".  Both are by normally equivalent to "make python".
 
17756
 
 
17757
* The Makefile no longer uses $> since it's not supported by all
 
17758
versions of Make.
 
17759
 
 
17760
* The header files now all contain #ifdef constructs designed to make
 
17761
it safe to include the same header file twice, as well as support for
 
17762
inclusion from C++ programs (automatic extern "C" { ... } added).
 
17763
 
 
17764
 
 
17765
Freezing Python scripts
 
17766
-----------------------
 
17767
 
 
17768
* There is now some support for "freezing" a Python script as a
 
17769
stand-alone executable binary file.  See the script
 
17770
demo/scripts/freeze.py.  It will require some site-specific tailoring
 
17771
of the script to get this working, but is quite worthwhile if you write
 
17772
Python code for other who may not have built and installed Python.
 
17773
 
 
17774
 
 
17775
MS-DOS
 
17776
------
 
17777
 
 
17778
* A new MS-DOS port has been done, using MSC 6.0 (I believe).  Thanks,
 
17779
Marcel van der Peijl!  This requires fewer compatibility hacks in
 
17780
posixmodule.c.  The executable is not yet available but will be soon
 
17781
(check the mailing list).
 
17782
 
 
17783
* The default PYTHONPATH has changed.
 
17784
 
 
17785
 
 
17786
Changes for developers of extension modules
 
17787
-------------------------------------------
 
17788
 
 
17789
* Read src/ChangeLog for full details.
 
17790
 
 
17791
 
 
17792
SGI specific changes
 
17793
--------------------
 
17794
 
 
17795
* Read src/ChangeLog for full details.
 
17796
 
 
17797
 
 
17798
==================================
 
17799
==> Release 0.9.8 (9 Jan 1993) <==
 
17800
==================================
 
17801
 
 
17802
I claim no completeness here, but I've tried my best to scan the log
 
17803
files throughout my source tree for interesting bits of news.  A more
 
17804
complete account of the changes is to be found in the various
 
17805
ChangeLog files. See also "News for release 0.9.7beta" below if you're
 
17806
still using release 0.9.6, and the file HISTORY if you have an even
 
17807
older release.
 
17808
 
 
17809
        --Guido
 
17810
 
 
17811
 
 
17812
Changes to the language proper
 
17813
------------------------------
 
17814
 
 
17815
There's only one big change: the conformance checking for function
 
17816
argument lists (of user-defined functions only) is stricter.  Earlier,
 
17817
you could get away with the following:
 
17818
 
 
17819
        (a) define a function of one argument and call it with any
 
17820
            number of arguments; if the actual argument count wasn't
 
17821
            one, the function would receive a tuple containing the
 
17822
            arguments arguments (an empty tuple if there were none).
 
17823
 
 
17824
        (b) define a function of two arguments, and call it with more
 
17825
            than two arguments; if there were more than two arguments,
 
17826
            the second argument would be passed as a tuple containing
 
17827
            the second and further actual arguments.
 
17828
 
 
17829
(Note that an argument (formal or actual) that is a tuple is counted as
 
17830
one; these rules don't apply inside such tuples, only at the top level
 
17831
of the argument list.)
 
17832
 
 
17833
Case (a) was needed to accommodate variable-length argument lists;
 
17834
there is now an explicit "varargs" feature (precede the last argument
 
17835
with a '*').  Case (b) was needed for compatibility with old class
 
17836
definitions: up to release 0.9.4 a method with more than one argument
 
17837
had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
 
17838
Version 0.9.6 provide better ways to handle both casees, bot provided
 
17839
backward compatibility; version 0.9.8 retracts the compatibility hacks
 
17840
since they also cause confusing behavior if a function is called with
 
17841
the wrong number of arguments.
 
17842
 
 
17843
There's a script that helps converting classes that still rely on (b),
 
17844
provided their methods' first argument is called "self":
 
17845
demo/scripts/methfix.py.
 
17846
 
 
17847
If this change breaks lots of code you have developed locally, try
 
17848
#defining COMPAT_HACKS in ceval.c.
 
17849
 
 
17850
(There's a third compatibility hack, which is the reverse of (a): if a
 
17851
function is defined with two or more arguments, and called with a
 
17852
single argument that is a tuple with just as many arguments, the items
 
17853
of this tuple will be used as the arguments.  Although this can (and
 
17854
should!) be done using the built-in function apply() instead, it isn't
 
17855
withdrawn yet.)
 
17856
 
 
17857
 
 
17858
One minor change: comparing instance methods works like expected, so
 
17859
that if x is an instance of a user-defined class and has a method m,
 
17860
then (x.m==x.m) yields 1.
 
17861
 
 
17862
 
 
17863
The following was already present in 0.9.7beta, but not explicitly
 
17864
mentioned in the NEWS file: user-defined classes can now define types
 
17865
that behave in almost allrespects like numbers.  See
 
17866
demo/classes/Rat.py for a simple example.
 
17867
 
 
17868
 
 
17869
Changes to the build process
 
17870
----------------------------
 
17871
 
 
17872
The Configure.py script and the Makefile has been made somewhat more
 
17873
bullet-proof, after reports of (minor) trouble on certain platforms.
 
17874
 
 
17875
There is now a script to patch Makefile and config.c to add a new
 
17876
optional built-in module: Addmodule.sh.  Read the script before using!
 
17877
 
 
17878
Useing Addmodule.sh, all optional modules can now be configured at
 
17879
compile time using Configure.py, so there are no modules left that
 
17880
require dynamic loading.
 
17881
 
 
17882
The Makefile has been fixed to make it easier to use with the VPATH
 
17883
feature of some Make versions (e.g. SunOS).
 
17884
 
 
17885
 
 
17886
Changes affecting portability
 
17887
-----------------------------
 
17888
 
 
17889
Several minor portability problems have been solved, e.g. "malloc.h"
 
17890
has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
 
17891
the system now tolerates malloc(0) returning 0.
 
17892
 
 
17893
For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
 
17894
distributed with Python.  This solves several minor problems, in
 
17895
particular scripts invoked using #! can now use dynamic loading.
 
17896
 
 
17897
 
 
17898
Changes to the interpreter interface
 
17899
------------------------------------
 
17900
 
 
17901
On popular demand, there's finally a "profile" feature for interactive
 
17902
use of the interpreter.  If the environment variable $PYTHONSTARTUP is
 
17903
set to the name of an existing file, Python statements in this file
 
17904
are executed when the interpreter is started in interactive mode.
 
17905
 
 
17906
There is a new clean-up mechanism, complementing try...finally: if you
 
17907
assign a function object to sys.exitfunc, it will be called when
 
17908
Python exits or receives a SIGTERM or SIGHUP signal.
 
17909
 
 
17910
The interpreter is now generally assumed to live in
 
17911
/usr/local/bin/python (as opposed to /usr/local/python).  The script
 
17912
demo/scripts/fixps.py will update old scripts in place (you can easily
 
17913
modify it to do other similar changes).
 
17914
 
 
17915
Most I/O that uses sys.stdin/stdout/stderr will now use any object
 
17916
assigned to those names as long as the object supports readline() or
 
17917
write() methods.
 
17918
 
 
17919
The parser stack has been increased to 500 to accommodate more
 
17920
complicated expressions (7 levels used to be the practical maximum,
 
17921
it's now about 38).
 
17922
 
 
17923
The limit on the size of the *run-time* stack has completely been
 
17924
removed -- this means that tuple or list displays can contain any
 
17925
number of elements (formerly more than 50 would crash the
 
17926
interpreter). 
 
17927
 
 
17928
 
 
17929
Changes to existing built-in functions and methods
 
17930
--------------------------------------------------
 
17931
 
 
17932
The built-in functions int(), long(), float(), oct() and hex() now
 
17933
also apply to class instalces that define corresponding methods
 
17934
(__int__ etc.).
 
17935
 
 
17936
 
 
17937
New built-in functions
 
17938
----------------------
 
17939
 
 
17940
The new functions str() and repr() convert any object to a string.
 
17941
The function repr(x) is in all respects equivalent to `x` -- some
 
17942
people prefer a function for this.  The function str(x) does the same
 
17943
except if x is already a string -- then it returns x unchanged
 
17944
(repr(x) adds quotes and escapes "funny" characters as octal escapes).
 
17945
 
 
17946
The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
 
17947
 
 
17948
 
 
17949
Changes to general built-in modules
 
17950
-----------------------------------
 
17951
 
 
17952
The time module's functions are more general: time() returns a
 
17953
floating point number and sleep() accepts one.  Their accuracies
 
17954
depends on the precision of the system clock.  Millisleep is no longer
 
17955
needed (although it still exists for now), but millitimer is still
 
17956
needed since on some systems wall clock time is only available with
 
17957
seconds precision, while a source of more precise time exists that
 
17958
isn't synchronized with the wall clock.  (On UNIX systems that support
 
17959
the BSD gettimeofday() function, time.time() is as time.millitimer().)
 
17960
 
 
17961
The string representation of a file object now includes an address:
 
17962
'<file 'filename', mode 'r' at #######>' where ###### is a hex number
 
17963
(the object's address) to make it unique.
 
17964
 
 
17965
New functions added to posix: nice(), setpgrp(), and if your system
 
17966
supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
 
17967
 
 
17968
Improvements to the socket module: socket objects have new methods
 
17969
getpeername() and getsockname(), and the {get,set}sockopt methods can
 
17970
now get/set any kind of option using strings built with the new struct
 
17971
module.  And there's a new function fromfd() which creates a socket
 
17972
object given a file descriptor (useful for servers started by inetd,
 
17973
which have a socket connected to stdin and stdout).
 
17974
 
 
17975
 
 
17976
Changes to SGI-specific built-in modules
 
17977
----------------------------------------
 
17978
 
 
17979
The FORMS library interface (fl) now requires FORMS 2.1a.  Some new
 
17980
functions have been added and some bugs have been fixed.
 
17981
 
 
17982
Additions to al (audio library interface): added getname(),
 
17983
getdefault() and getminmax().
 
17984
 
 
17985
The gl modules doesn't call "foreground()" when initialized (this
 
17986
caused some problems) like it dit in 0.9.7beta (but not before).
 
17987
There's a new gl function 'gversion() which returns a version string.
 
17988
 
 
17989
The interface to sv (Indigo video interface) has totally changed.
 
17990
(Sorry, still no documentation, but see the examples in
 
17991
demo/sgi/{sv,video}.)
 
17992
 
 
17993
 
 
17994
Changes to standard library modules
 
17995
-----------------------------------
 
17996
 
 
17997
Most functions in module string are now much faster: they're actually
 
17998
implemented in C.  The module containing the C versions is called
 
17999
"strop" but you should still import "string" since strop doesn't
 
18000
provide all the interfaces defined in string (and strop may be renamed
 
18001
to string when it is complete in a future release).
 
18002
 
 
18003
string.index() now accepts an optional third argument giving an index
 
18004
where to start searching in the first argument, so you can find second
 
18005
and further occurrences (this is similar to the regular expression
 
18006
functions in regex).
 
18007
 
 
18008
The definition of what string.splitfields(anything, '') should return
 
18009
is changed for the last time: it returns a singleton list containing
 
18010
its whole first argument unchanged.  This is compatible with
 
18011
regsub.split() which also ignores empty delimiter matches.
 
18012
 
 
18013
posixpath, macpath: added dirname() and normpath() (and basename() to
 
18014
macpath).
 
18015
 
 
18016
The mainloop module (for use with stdwin) can now demultiplex input
 
18017
from other sources, as long as they can be polled with select().
 
18018
 
 
18019
 
 
18020
New built-in modules
 
18021
--------------------
 
18022
 
 
18023
Module struct defines functions to pack/unpack values to/from strings
 
18024
representing binary values in native byte order.
 
18025
 
 
18026
Module strop implements C versions of many functions from string (see
 
18027
above).
 
18028
 
 
18029
Optional module fcntl defines interfaces to fcntl() and ioctl() --
 
18030
UNIX only.  (Not yet properly documented -- see however src/fcntl.doc.)
 
18031
 
 
18032
Optional module mpz defines an interface to an altaernative long
 
18033
integer implementation, the GNU MPZ library.
 
18034
 
 
18035
Optional module md5 uses the GNU MPZ library to calculate MD5
 
18036
signatures of strings.
 
18037
 
 
18038
There are also optional new modules specific to SGI machines: imageop
 
18039
defines some simple operations to images represented as strings; sv
 
18040
interfaces to the Indigo video board; cl interfaces to the (yet
 
18041
unreleased) compression library.
 
18042
 
 
18043
 
 
18044
New standard library modules
 
18045
----------------------------
 
18046
 
 
18047
(Unfortunately the following modules are not all documented; read the
 
18048
sources to find out more about them!)
 
18049
 
 
18050
autotest: run testall without showing any output unless it differs
 
18051
from the expected output
 
18052
 
 
18053
bisect: use bisection to insert or find an item in a sorted list
 
18054
 
 
18055
colorsys: defines conversions between various color systems (e.g. RGB
 
18056
<-> YUV)
 
18057
 
 
18058
nntplib: a client interface to NNTP servers
 
18059
 
 
18060
pipes: utility to construct pipeline from templates, e.g. for
 
18061
conversion from one file format to another using several utilities.
 
18062
 
 
18063
regsub: contains three functions that are more or less compatible with
 
18064
awk functions of the same name: sub() and gsub() do string
 
18065
substitution, split() splits a string using a regular expression to
 
18066
define how separators are define.
 
18067
 
 
18068
test_types: test operations on the built-in types of Python
 
18069
 
 
18070
toaiff: convert various audio file formats to AIFF format
 
18071
 
 
18072
tzparse: parse the TZ environment parameter (this may be less general
 
18073
than it could be, let me know if you fix it).
 
18074
 
 
18075
(Note that the obsolete module "path" no longer exists.)
 
18076
 
 
18077
 
 
18078
New SGI-specific library modules
 
18079
--------------------------------
 
18080
 
 
18081
CL: constants for use with the built-in compression library interface (cl)
 
18082
 
 
18083
Queue: a multi-producer, multi-consumer queue class implemented for
 
18084
use with the built-in thread module
 
18085
 
 
18086
SOCKET: constants for use with built-in module socket, e.g. to set/get
 
18087
socket options.  This is SGI-specific because the constants to be
 
18088
passed are system-dependent.  You can generate a version for your own
 
18089
system by running the script demo/scripts/h2py.py with
 
18090
/usr/include/sys/socket.h as input.
 
18091
 
 
18092
cddb: interface to the database used by the CD player
 
18093
 
 
18094
torgb: convert various image file types to rgb format (requires pbmplus)
 
18095
 
 
18096
 
 
18097
New demos
 
18098
---------
 
18099
 
 
18100
There's an experimental interface to define Sun RPC clients and
 
18101
servers in demo/rpc.
 
18102
 
 
18103
There's a collection of interfaces to WWW, WAIS and Gopher (both
 
18104
Python classes and program providing a user interface) in demo/www.
 
18105
This includes a program texi2html.py which converts texinfo files to
 
18106
HTML files (the format used hy WWW).
 
18107
 
 
18108
The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
 
18109
 
 
18110
For SGI systems, there's a whole collection of programs and classes
 
18111
that make use of the Indigo video board in demo/sgi/{sv,video}.  This
 
18112
represents a significant amount of work that we're giving away!
 
18113
 
 
18114
There are demos "rsa" and "md5test" that exercise the mpz and md5
 
18115
modules, respectively.  The rsa demo is a complete implementation of
 
18116
the RSA public-key cryptosystem!
 
18117
 
 
18118
A bunch of games and examples submitted by Stoffel Erasmus have been
 
18119
included in demo/stoffel.
 
18120
 
 
18121
There are miscellaneous new files in some existing demo
 
18122
subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
 
18123
sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
 
18124
 
 
18125
There are also many minor changes to existing files, but I'm too lazy
 
18126
to run a diff and note the differences -- you can do this yourself if
 
18127
you save the old distribution's demos.  One highlight: the
 
18128
stdwin/python.py demo is much improved!
 
18129
 
 
18130
 
 
18131
Changes to the documentation
 
18132
----------------------------
 
18133
 
 
18134
The LaTeX source for the library uses different macros to enable it to
 
18135
be converted to texinfo, and from there to INFO or HTML format so it
 
18136
can be browsed as a hypertext.  The net result is that you can now
 
18137
read the Python library documentation in Emacs info mode!
 
18138
 
 
18139
 
 
18140
Changes to the source code that affect C extension writers
 
18141
----------------------------------------------------------
 
18142
 
 
18143
The function strdup() no longer exists (it was used only in one places
 
18144
and is somewhat of a a portability problem sice some systems have the
 
18145
same function in their C library.
 
18146
 
 
18147
The functions NEW() and RENEW() allocate one spare byte to guard
 
18148
against a NULL return from malloc(0) being taken for an error, but
 
18149
this should not be relied upon.
 
18150
 
 
18151
 
 
18152
=========================
 
18153
==> Release 0.9.7beta <==
 
18154
=========================
 
18155
 
 
18156
 
 
18157
Changes to the language proper
 
18158
------------------------------
 
18159
 
 
18160
User-defined classes can now implement operations invoked through
 
18161
special syntax, such as x[i] or `x` by defining methods named
 
18162
__getitem__(self, i) or __repr__(self), etc.
 
18163
 
 
18164
 
 
18165
Changes to the build process
 
18166
----------------------------
 
18167
 
 
18168
Instead of extensive manual editing of the Makefile to select
 
18169
compile-time options, you can now run a Configure.py script.
 
18170
The Makefile as distributed builds a minimal interpreter sufficient to
 
18171
run Configure.py.  See also misc/BUILD
 
18172
 
 
18173
The Makefile now includes more "utility" targets, e.g. install and
 
18174
tags/TAGS
 
18175
 
 
18176
Using the provided strtod.c and strtol.c are now separate options, as
 
18177
on the Sun the provided strtod.c dumps core :-(
 
18178
 
 
18179
The regex module is now an option chosen by the Makefile, since some
 
18180
(old) C compilers choke on regexpr.c
 
18181
 
 
18182
 
 
18183
Changes affecting portability
 
18184
-----------------------------
 
18185
 
 
18186
You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
 
18187
interface
 
18188
 
 
18189
Dynamic loading is now supported for Sun (and other non-COFF systems)
 
18190
throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
 
18191
DL is out, 1.4)
 
18192
 
 
18193
The system-dependent code for the use of the select() system call is
 
18194
moved to one file: myselect.h
 
18195
 
 
18196
Thanks to Jaap Vermeulen, the code should now port cleanly to the
 
18197
SEQUENT
 
18198
 
 
18199
 
 
18200
Changes to the interpreter interface
 
18201
------------------------------------
 
18202
 
 
18203
The interpretation of $PYTHONPATH in the environment is different: it
 
18204
is inserted in front of the default path instead of overriding it
 
18205
 
 
18206
 
 
18207
Changes to existing built-in functions and methods
 
18208
--------------------------------------------------
 
18209
 
 
18210
List objects now support an optional argument to their sort() method,
 
18211
which is a comparison function similar to qsort(3) in C
 
18212
 
 
18213
File objects now have a method fileno(), used by the new select module
 
18214
(see below)
 
18215
 
 
18216
 
 
18217
New built-in function
 
18218
---------------------
 
18219
 
 
18220
coerce(x, y): take two numbers and return a tuple containing them
 
18221
both converted to a common type
 
18222
 
 
18223
 
 
18224
Changes to built-in modules
 
18225
---------------------------
 
18226
 
 
18227
sys: fixed core dumps in settrace() and setprofile()
 
18228
 
 
18229
socket: added socket methods setsockopt() and getsockopt(); and
 
18230
fileno(), used by the new select module (see below)
 
18231
 
 
18232
stdwin: added fileno() == connectionnumber(), in support of new module
 
18233
select (see below)
 
18234
 
 
18235
posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
 
18236
 
 
18237
gl: added qgetfd()
 
18238
 
 
18239
fl: added several new functions, fixed several obscure bugs, adapted
 
18240
to FORMS 2.1
 
18241
 
 
18242
 
 
18243
Changes to standard modules
 
18244
---------------------------
 
18245
 
 
18246
posixpath: changed implementation of ismount()
 
18247
 
 
18248
string: atoi() no longer mistakes leading zero for octal number
 
18249
 
 
18250
...
 
18251
 
 
18252
 
 
18253
New built-in modules
 
18254
--------------------
 
18255
 
 
18256
Modules marked "dynamic only" are not configured at compile time but
 
18257
can be loaded dynamically.  You need to turn on the DL or DLD option in
 
18258
the Makefile for support dynamic loading of modules (this requires
 
18259
external code).
 
18260
 
 
18261
select: interfaces to the BSD select() system call
 
18262
 
 
18263
dbm: interfaces to the (new) dbm library (dynamic only)
 
18264
 
 
18265
nis: interfaces to some NIS functions (aka yellow pages)
 
18266
 
 
18267
thread: limited form of multiple threads (sgi only)
 
18268
 
 
18269
audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
 
18270
coding (dynamic only)
 
18271
 
 
18272
cd: interface to Indigo SCSI CDROM player audio library (sgi only)
 
18273
 
 
18274
jpeg: read files in JPEG format (dynamic only, sgi only; needs
 
18275
external code)
 
18276
 
 
18277
imgfile: read SGI image files (dynamic only, sgi only)
 
18278
 
 
18279
sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
 
18280
 
 
18281
sv: interface to Indigo video library (sgi only)
 
18282
 
 
18283
pc: a minimal set of MS-DOS interfaces (MS-DOS only)
 
18284
 
 
18285
rotor: encryption, by Lance Ellinghouse (dynamic only)
 
18286
 
 
18287
 
 
18288
New standard modules
 
18289
--------------------
 
18290
 
 
18291
Not all these modules are documented.  Read the source:
 
18292
lib/<modulename>.py.  Sometimes a file lib/<modulename>.doc contains
 
18293
additional documentation.
 
18294
 
 
18295
imghdr: recognizes image file headers
 
18296
 
 
18297
sndhdr: recognizes sound file headers
 
18298
 
 
18299
profile: print run-time statistics of Python code
 
18300
 
 
18301
readcd, cdplayer: companion modules for built-in module cd (sgi only)
 
18302
 
 
18303
emacs: interface to Emacs using py-connect.el (see below).
 
18304
 
 
18305
SOCKET: symbolic constant definitions for socket options
 
18306
 
 
18307
SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
 
18308
 
 
18309
SV: symbolic constat definitions for sv (sgi only)
 
18310
 
 
18311
CD: symbolic constat definitions for cd (sgi only)
 
18312
 
 
18313
 
 
18314
New demos
 
18315
---------
 
18316
 
 
18317
scripts/pp.py: execute Python as a filter with a Perl-like command
 
18318
line interface
 
18319
 
 
18320
classes/: examples using the new class features
 
18321
 
 
18322
threads/: examples using the new thread module
 
18323
 
 
18324
sgi/cd/: examples using the new cd module
 
18325
 
 
18326
 
 
18327
Changes to the documentation
 
18328
----------------------------
 
18329
 
 
18330
The last-minute syntax changes of release 0.9.6 are now reflected
 
18331
everywhere in the manuals
 
18332
 
 
18333
The reference manual has a new section (3.2) on implementing new kinds
 
18334
of numbers, sequences or mappings with user classes
 
18335
 
 
18336
Classes are now treated extensively in the tutorial (chapter 9)
 
18337
 
 
18338
Slightly restructured the system-dependent chapters of the library
 
18339
manual
 
18340
 
 
18341
The file misc/EXTENDING incorporates documentation for mkvalue() and
 
18342
a new section on error handling
 
18343
 
 
18344
The files misc/CLASSES and misc/ERRORS are no longer necessary
 
18345
 
 
18346
The doc/Makefile now creates PostScript files automatically
 
18347
 
 
18348
 
 
18349
Miscellaneous changes
 
18350
---------------------
 
18351
 
 
18352
Incorporated Tim Peters' changes to python-mode.el, it's now version
 
18353
1.06
 
18354
 
 
18355
A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
 
18356
program running in an Emacs buffer execute Emacs lisp code.  The
 
18357
necessary Python code is in lib/emacs.py.  The Emacs code is
 
18358
misc/py-connect.el (it needs some external Emacs lisp code)
 
18359
 
 
18360
 
 
18361
Changes to the source code that affect C extension writers
 
18362
----------------------------------------------------------
 
18363
 
 
18364
New service function mkvalue() to construct a Python object from C
 
18365
values according to a "format" string a la getargs()
 
18366
 
 
18367
Most functions from pythonmain.c moved to new pythonrun.c which is
 
18368
in libpython.a.  This should make embedded versions of Python easier
 
18369
 
 
18370
ceval.h is split in eval.h (which needs compile.h and only declares
 
18371
eval_code) and ceval.h (which doesn't need compile.hand declares the
 
18372
rest)
 
18373
 
 
18374
ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
 
18375
improve the parallellism of multi-threaded programs by letting other
 
18376
Python code run when a blocking system call or something similar is
 
18377
made)
 
18378
 
 
18379
In structmember.[ch], new member types BYTE, CHAR and unsigned
 
18380
variants have been added
 
18381
 
 
18382
New file xxmodule.c is a template for new extension modules.
 
18383
 
 
18384
 
 
18385
==================================
 
18386
==> Release 0.9.6 (6 Apr 1992) <==
 
18387
==================================
 
18388
 
 
18389
Misc news in 0.9.6:
 
18390
- Restructured the misc subdirectory
 
18391
- Reference manual completed, library manual much extended (with indexes!)
 
18392
- the GNU Readline library is now distributed standard with Python
 
18393
- the script "../demo/scripts/classfix.py" fixes Python modules using old
 
18394
  class syntax
 
18395
- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
 
18396
- Because of the GNU copyleft business I am not using the GNU regular
 
18397
  expression implementation but a free re-implementation by Tatu Ylonen
 
18398
  that recently appeared in comp.sources.misc (Bravo, Tatu!)
 
18399
 
 
18400
New features in 0.9.6:
 
18401
- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
 
18402
- New module 'os' supplants modules 'mac' and 'posix' for most cases;
 
18403
  module 'path' is replaced by 'os.path'
 
18404
- os.path.split() return value differs from that of old path.split()
 
18405
- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
 
18406
  currently being handled
 
18407
- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
 
18408
  exception
 
18409
- New function string.expandtabs() expands tabs in a string
 
18410
- Added times() interface to posix (user & sys time of process & children)
 
18411
- Added uname() interface to posix (returns OS type, hostname, etc.)
 
18412
- New built-in function execfile() is like exec() but from a file
 
18413
- Functions exec() and eval() are less picky about whitespace/newlines
 
18414
- New built-in functions getattr() and setattr() access arbitrary attributes
 
18415
- More generic argument handling in built-in functions (see "./EXTENDING")
 
18416
- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
 
18417
- Division and modulo for long and plain integers with negative operands
 
18418
  have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
 
18419
  as a-(a/b)*b.  So now the outcome of divmod(a,b) is the same as
 
18420
  (a/b, a%b) for integers.  For floats, % is also changed, but of course
 
18421
  / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
 
18422
- A function with explicit variable-length argument list can be declared
 
18423
  like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
 
18424
- Code tracing and profiling features have been added, and two source
 
18425
  code debuggers are provided in the library (pdb.py, tty-oriented,
 
18426
  and wdb, window-oriented); you can now step through Python programs!
 
18427
  See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
 
18428
- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
 
18429
  a script that fixes old Python modules
 
18430
- Plain integer right shift now uses sign extension
 
18431
- Long integer shift/mask operations now simulate 2's complement
 
18432
  to give more useful results for negative operands
 
18433
- Changed/added range checks for long/plain integer shifts
 
18434
- Options found after "-c command" are now passed to the command in sys.argv
 
18435
  (note subtle incompatiblity with "python -c command -- -options"!)
 
18436
- Module stdwin is better protected against touching objects after they've
 
18437
  been closed; menus can now also be closed explicitly
 
18438
- Stdwin now uses its own exception (stdwin.error)
 
18439
 
 
18440
New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
 
18441
- dictionary objects can now be compared properly; e.g., {}=={} is true
 
18442
- new exception SystemExit causes termination if not caught;
 
18443
  it is raised by sys.exit() so that 'finally' clauses can clean up,
 
18444
  and it may even be caught.  It does work interactively!
 
18445
- new module "regex" implements GNU Emacs style regular expressions;
 
18446
  module "regexp" is rewritten in Python for backward compatibility
 
18447
- formal parameter lists may contain trailing commas
 
18448
 
 
18449
Bugs fixed in 0.9.6:
 
18450
- assigning to or deleting a list item with a negative index dumped core
 
18451
- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
 
18452
 
 
18453
Bugs fixed in 0.9.5:
 
18454
- masking operations involving negative long integers gave wrong results
 
18455
 
 
18456
 
 
18457
===================================
 
18458
==> Release 0.9.4 (24 Dec 1991) <==
 
18459
===================================
 
18460
 
 
18461
- new function argument handling (see below)
 
18462
- built-in apply(func, args) means func(args[0], args[1], ...)
 
18463
- new, more refined exceptions
 
18464
- new exception string values (NameError = 'NameError' etc.)
 
18465
- better checking for math exceptions
 
18466
- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
 
18467
- fixed list assignment bug: "a[1:1] = a" now works correctly
 
18468
- new class syntax, without extraneous parentheses
 
18469
- new 'global' statement to assign global variables from within a function
 
18470
 
 
18471
 
 
18472
New class syntax
 
18473
----------------
 
18474
 
 
18475
You can now declare a base class as follows:
 
18476
 
 
18477
        class B:                        # Was: class B():
 
18478
                def some_method(self): ...
 
18479
                ...
 
18480
 
 
18481
and a derived class thusly:
 
18482
 
 
18483
        class D(B):                     # Was: class D() = B():
 
18484
                def another_method(self, arg): ...
 
18485
 
 
18486
Multiple inheritance looks like this:
 
18487
 
 
18488
        class M(B, D):                  # Was: class M() = B(), D():
 
18489
                def this_or_that_method(self, arg): ...
 
18490
 
 
18491
The old syntax is still accepted by Python 0.9.4, but will disappear
 
18492
in Python 1.0 (to be posted to comp.sources).
 
18493
 
 
18494
 
 
18495
New 'global' statement
 
18496
----------------------
 
18497
 
 
18498
Every now and then you have a global variable in a module that you
 
18499
want to change from within a function in that module -- say, a count
 
18500
of calls to a function, or an option flag, etc.  Until now this was
 
18501
not directly possible.  While several kludges are known that
 
18502
circumvent the problem, and often the need for a global variable can
 
18503
be avoided by rewriting the module as a class, this does not always
 
18504
lead to clearer code.
 
18505
 
 
18506
The 'global' statement solves this dilemma.  Its occurrence in a
 
18507
function body means that, for the duration of that function, the
 
18508
names listed there refer to global variables.  For instance:
 
18509
 
 
18510
        total = 0.0
 
18511
        count = 0
 
18512
 
 
18513
        def add_to_total(amount):
 
18514
                global total, count
 
18515
                total = total + amount
 
18516
                count = count + 1
 
18517
 
 
18518
'global' must be repeated in each function where it is needed.  The
 
18519
names listed in a 'global' statement must not be used in the function
 
18520
before the statement is reached.
 
18521
 
 
18522
Remember that you don't need to use 'global' if you only want to *use*
 
18523
a global variable in a function; nor do you need ot for assignments to
 
18524
parts of global variables (e.g., list or dictionary items or
 
18525
attributes of class instances).  This has not changed; in fact
 
18526
assignment to part of a global variable was the standard workaround.
 
18527
 
 
18528
 
 
18529
New exceptions
 
18530
--------------
 
18531
 
 
18532
Several new exceptions have been defined, to distinguish more clearly
 
18533
between different types of errors.
 
18534
 
 
18535
name                    meaning                                 was
 
18536
 
 
18537
AttributeError          reference to non-existing attribute     NameError
 
18538
IOError                 unexpected I/O error                    RuntimeError
 
18539
ImportError             import of non-existing module or name   NameError
 
18540
IndexError              invalid string, tuple or list index     RuntimeError
 
18541
KeyError                key not in dictionary                   RuntimeError
 
18542
OverflowError           numeric overflow                        RuntimeError
 
18543
SyntaxError             invalid syntax                          RuntimeError
 
18544
ValueError              invalid argument value                  RuntimeError
 
18545
ZeroDivisionError       division by zero                        RuntimeError
 
18546
 
 
18547
The string value of each exception is now its name -- this makes it
 
18548
easier to experimentally find out which operations raise which
 
18549
exceptions; e.g.:
 
18550
 
 
18551
        >>> KeyboardInterrupt
 
18552
        'KeyboardInterrupt'
 
18553
        >>>
 
18554
 
 
18555
 
 
18556
New argument passing semantics
 
18557
------------------------------
 
18558
 
 
18559
Off-line discussions with Steve Majewski and Daniel LaLiberte have
 
18560
convinced me that Python's parameter mechanism could be changed in a
 
18561
way that made both of them happy (I hope), kept me happy, fixed a
 
18562
number of outstanding problems, and, given some backward compatibility
 
18563
provisions, would only break a very small amount of existing code --
 
18564
probably all mine anyway.  In fact I suspect that most Python users
 
18565
will hardly notice the difference.  And yet it has cost me at least
 
18566
one sleepless night to decide to make the change...
 
18567
 
 
18568
Philosophically, the change is quite radical (to me, anyway): a
 
18569
function is no longer called with either zero or one argument, which
 
18570
is a tuple if there appear to be more arguments.  Every function now
 
18571
has an argument list containing 0, 1 or more arguments.  This list is
 
18572
always implemented as a tuple, and it is a (run-time) error if a
 
18573
function is called with a different number of arguments than expected.
 
18574
 
 
18575
What's the difference? you may ask.  The answer is, very little unless
 
18576
you want to write variadic functions -- functions that may be called
 
18577
with a variable number of arguments.  Formerly, you could write a
 
18578
function that accepted one or more arguments with little trouble, but
 
18579
writing a function that could be called with either 0 or 1 argument
 
18580
(or more) was next to impossible.  This is now a piece of cake: you
 
18581
can simply declare an argument that receives the entire argument
 
18582
tuple, and check its length -- it will be of size 0 if there are no
 
18583
arguments.
 
18584
 
 
18585
Another anomaly of the old system was the way multi-argument methods
 
18586
(in classes) had to be declared, e.g.:
 
18587
 
 
18588
        class Point():
 
18589
                def init(self, (x, y, color)): ...
 
18590
                def setcolor(self, color): ...
 
18591
                dev moveto(self, (x, y)): ...
 
18592
                def draw(self): ...
 
18593
 
 
18594
Using the new scheme there is no need to enclose the method arguments
 
18595
in an extra set of parentheses, so the above class could become:
 
18596
 
 
18597
        class Point:
 
18598
                def init(self, x, y, color): ...
 
18599
                def setcolor(self, color): ...
 
18600
                dev moveto(self, x, y): ...
 
18601
                def draw(self): ...
 
18602
 
 
18603
That is, the equivalence rule between methods and functions has
 
18604
changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
 
18605
while formerly it was equivalent to Point.moveto(p,(x,y)).
 
18606
 
 
18607
A special backward compatibility rule makes that the old version also
 
18608
still works: whenever a function with exactly two arguments (at the top
 
18609
level) is called with more than two arguments, the second and further
 
18610
arguments are packed into a tuple and passed as the second argument.
 
18611
This rule is invoked independently of whether the function is actually a
 
18612
method, so there is a slight chance that some erroneous calls of
 
18613
functions expecting two arguments with more than that number of
 
18614
arguments go undetected at first -- when the function tries to use the
 
18615
second argument it may find it is a tuple instead of what was expected.
 
18616
Note that this rule will be removed from future versions of the
 
18617
language; it is a backward compatibility provision *only*.
 
18618
 
 
18619
Two other rules and a new built-in function handle conversion between
 
18620
tuples and argument lists:
 
18621
 
 
18622
Rule (a): when a function with more than one argument is called with a
 
18623
single argument that is a tuple of the right size, the tuple's items
 
18624
are used as arguments.
 
18625
 
 
18626
Rule (b): when a function with exactly one argument receives no
 
18627
arguments or more than one, that one argument will receive a tuple
 
18628
containing the arguments (the tuple will be empty if there were no
 
18629
arguments).
 
18630
 
 
18631
 
 
18632
A new built-in function, apply(), was added to support functions that
 
18633
need to call other functions with a constructed argument list.  The call
 
18634
 
 
18635
        apply(function, tuple)
 
18636
 
 
18637
is equivalent to
 
18638
 
 
18639
        function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
 
18640
 
 
18641
 
 
18642
While no new argument syntax was added in this phase, it would now be
 
18643
quite sensible to add explicit syntax to Python for default argument
 
18644
values (as in C++ or Modula-3), or a "rest" argument to receive the
 
18645
remaining arguments of a variable-length argument list.
 
18646
 
 
18647
 
 
18648
========================================================
 
18649
==> Release 0.9.3 (never made available outside CWI) <==
 
18650
========================================================
 
18651
 
 
18652
- string sys.version shows current version (also printed on interactive entry)
 
18653
- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
 
18654
- 'global' statement to declare module-global variables assigned in functions.
 
18655
- new class declaration syntax: class C(Base1, Base2, ...): suite
 
18656
  (the old syntax is still accepted -- be sure to convert your classes now!)
 
18657
- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
 
18658
- C comparison operators: == != (the old = and <> remain valid).
 
18659
- floating point numbers may now start with a period (e.g., .14).
 
18660
- definition of integer division tightened (always truncates towards zero).
 
18661
- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
 
18662
- new list method l.count(x) returns the number of occurrences of x in l.
 
18663
- new SGI module: al (Indigo and 4D/35 audio library).
 
18664
- the FORMS interface (modules fl and FL) now uses FORMS 2.0
 
18665
- module gl: added lrect{read,write}, rectzoom and pixmode;
 
18666
  added (non-GL) functions (un)packrect.
 
18667
- new socket method: s.allowbroadcast(flag).
 
18668
- many objects support __dict__, __methods__ or __members__.
 
18669
- dir() lists anything that has __dict__.
 
18670
- class attributes are no longer read-only.
 
18671
- classes support __bases__, instances support __class__ (and __dict__).
 
18672
- divmod() now also works for floats.
 
18673
- fixed obscure bug in eval('1            ').
 
18674
 
 
18675
 
 
18676
===================================
 
18677
==> Release 0.9.2 (Autumn 1991) <==
 
18678
===================================
 
18679
 
 
18680
Highlights
 
18681
----------
 
18682
 
 
18683
- tutorial now (almost) complete; library reference reorganized
 
18684
- new syntax: continue statement; semicolons; dictionary constructors;
 
18685
  restrictions on blank lines in source files removed
 
18686
- dramatically improved module load time through precompiled modules
 
18687
- arbitrary precision integers: compute 2 to the power 1000 and more...
 
18688
- arithmetic operators now accept mixed type operands, e.g., 3.14/4
 
18689
- more operations on list: remove, index, reverse; repetition
 
18690
- improved/new file operations: readlines, seek, tell, flush, ...
 
18691
- process management added to the posix module: fork/exec/wait/kill etc.
 
18692
- BSD socket operations (with example servers and clients!)
 
18693
- many new STDWIN features (color, fonts, polygons, ...)
 
18694
- new SGI modules: font manager and FORMS library interface
 
18695
 
 
18696
 
 
18697
Extended list of changes in 0.9.2
 
18698
---------------------------------
 
18699
 
 
18700
Here is a summary of the most important user-visible changes in 0.9.2,
 
18701
in somewhat arbitrary order.  Changes in later versions are listed in
 
18702
the "highlights" section above.
 
18703
 
 
18704
 
 
18705
1. Changes to the interpreter proper
 
18706
 
 
18707
- Simple statements can now be separated by semicolons.
 
18708
  If you write "if t: s1; s2", both s1 and s2 are executed
 
18709
  conditionally.
 
18710
- The 'continue' statement was added, with semantics as in C.
 
18711
- Dictionary displays are now allowed on input: {key: value, ...}.
 
18712
- Blank lines and lines bearing only a comment no longer need to
 
18713
  be indented properly.  (A completely empty line still ends a multi-
 
18714
  line statement interactively.)
 
18715
- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
 
18716
- Option "-c command" to execute statements from the command line
 
18717
- Compiled versions of modules are cached in ".pyc" files, giving a
 
18718
  dramatic improvement of start-up time
 
18719
- Other, smaller speed improvements, e.g., extracting characters from
 
18720
  strings, looking up single-character keys, and looking up global
 
18721
  variables
 
18722
- Interrupting a print operation raises KeyboardInterrupt instead of
 
18723
  only cancelling the print operation
 
18724
- Fixed various portability problems (it now passes gcc with only
 
18725
  warnings -- more Standard C compatibility will be provided in later
 
18726
  versions)
 
18727
- Source is prepared for porting to MS-DOS
 
18728
- Numeric constants are now checked for overflow (this requires
 
18729
  standard-conforming strtol() and strtod() functions; a correct
 
18730
  strtol() implementation is provided, but the strtod() provided
 
18731
  relies on atof() for everything, including error checking
 
18732
 
 
18733
 
 
18734
2. Changes to the built-in types, functions and modules
 
18735
 
 
18736
- New module socket: interface to BSD socket primitives
 
18737
- New modules pwd and grp: access the UNIX password and group databases
 
18738
- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
 
18739
- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
 
18740
- New numeric type: long integer, for unlimited precision
 
18741
        - integer constants suffixed with 'L' or 'l' are long integers
 
18742
        - new built-in function long(x) converts int or float to long
 
18743
        - int() and float() now also convert from long integers
 
18744
- New built-in function:
 
18745
        - pow(x, y) returns x to the power y
 
18746
- New operation and methods for lists:
 
18747
        - l*n returns a new list consisting of n concatenated copies of l
 
18748
        - l.remove(x) removes the first occurrence of the value x from l
 
18749
        - l.index(x) returns the index of the first occurrence of x in l
 
18750
        - l.reverse() reverses l in place
 
18751
- New operation for tuples:
 
18752
        - t*n returns a tuple consisting of n concatenated copies of t
 
18753
- Improved file handling:
 
18754
        - f.readline() no longer restricts the line length, is faster,
 
18755
          and isn't confused by null bytes; same for raw_input()
 
18756
        - f.read() without arguments reads the entire (rest of the) file
 
18757
        - mixing of print and sys.stdout.write() has different effect
 
18758
- New methods for files:
 
18759
        - f.readlines() returns a list containing the lines of the file,
 
18760
          as read with f.readline()
 
18761
        - f.flush(), f.tell(), f.seek() call their stdio counterparts
 
18762
        - f.isatty() tests for "tty-ness"
 
18763
- New posix functions:
 
18764
        - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
 
18765
        - popen() returns a file object connected to a pipe
 
18766
        - utime() replaces utimes() (the latter is not a POSIX name)
 
18767
- New stdwin features, including:
 
18768
        - font handling
 
18769
        - color drawing
 
18770
        - scroll bars made optional
 
18771
        - polygons
 
18772
        - filled and xor shapes
 
18773
        - text editing objects now have a 'settext' method
 
18774
 
 
18775
 
 
18776
3. Changes to the standard library
 
18777
 
 
18778
- Name change: the functions path.cat and macpath.cat are now called
 
18779
  path.join and macpath.join
 
18780
- Added new modules: formatter, mutex, persist, sched, mainloop
 
18781
- Added some modules and functionality to the "widget set" (which is
 
18782
  still under development, so please bear with me):
 
18783
        DirList, FormSplit, TextEdit, WindowSched
 
18784
- Fixed module testall to work non-interactively
 
18785
- Module string:
 
18786
        - added functions join() and joinfields()
 
18787
        - fixed center() to work correct and make it "transitive"
 
18788
- Obsolete modules were removed: util, minmax
 
18789
- Some modules were moved to the demo directory
 
18790
 
 
18791
 
 
18792
4. Changes to the demonstration programs
 
18793
 
 
18794
- Added new useful scipts: byteyears, eptags, fact, from, lfact,
 
18795
  objgraph, pdeps, pi, primes, ptags, which
 
18796
- Added a bunch of socket demos
 
18797
- Doubled the speed of ptags
 
18798
- Added new stdwin demos: microedit, miniedit
 
18799
- Added a windowing interface to the Python interpreter: python (most
 
18800
  useful on the Mac)
 
18801
- Added a browser for Emacs info files: demo/stdwin/ibrowse
 
18802
  (yes, I plan to put all STDWIN and Python documentation in texinfo
 
18803
  form in the future)
 
18804
 
 
18805
 
 
18806
5. Other changes to the distribution
 
18807
 
 
18808
- An Emacs Lisp file "python.el" is provided to facilitate editing
 
18809
  Python programs in GNU Emacs (slightly improved since posted to
 
18810
  gnu.emacs.sources)
 
18811
- Some info on writing an extension in C is provided
 
18812
- Some info on building Python on non-UNIX platforms is provided
 
18813
 
 
18814
 
 
18815
=====================================
 
18816
==> Release 0.9.1 (February 1991) <==
 
18817
=====================================
 
18818
 
 
18819
- Micro changes only
 
18820
- Added file "patchlevel.h"
 
18821
 
 
18822
 
 
18823
=====================================
 
18824
==> Release 0.9.0 (February 1991) <==
 
18825
=====================================
 
18826
 
 
18827
Original posting to alt.sources.