blob: 8327dca44d1826963c1ec71d2d4640002932cecd [file] [log] [blame]
Guido van Rossuma598c932000-09-04 16:26:03 +00001Python History
Guido van Rossuma7925f11994-01-26 10:20:16 +00002--------------
3
Guido van Rossum439d1fa1998-12-21 21:41:14 +00004This file contains the release messages for previous Python releases.
5As you read on you go back to the dark ages of Python's history.
Christian Heimesc3f30c42008-02-22 16:37:40 +00006(Note: news about 2.5c2 and later 2.5 releases is in the Misc/NEWS
7file of the release25-maint branch.)
Guido van Rossum439d1fa1998-12-21 21:41:14 +00008
9
10======================================================================
11
12
Georg Brandl8fc6cb32012-10-01 18:55:32 +020013What's New in Python 3.2?
14=========================
15
16*Release date: 20-Feb-2011*
17
18Core and Builtins
19-----------------
20
21- Issue #11249: Fix potential crashes when using the limited API.
22
23Build
24-----
25
26- Issue #11222: Fix non-framework shared library build on Mac OS X.
27
28- Issue #11184: Fix large-file support on AIX.
29
30- Issue #941346: Fix broken shared library build on AIX.
31
32Documentation
33-------------
34
35- Issue #10709: Add updated AIX notes in Misc/README.AIX.
36
37
38What's New in Python 3.2 Release Candidate 3?
39=============================================
40
41*Release date: 13-Feb-2011*
42
43Core and Builtins
44-----------------
45
46- Issue #11134: Add missing fields to typeslots.h.
47
48- Issue #11135: Remove redundant doc field from PyType_Spec.
49
50- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
51 ABI.
52
53- Issue #11118: Fix bogus export of None in python3.dll.
54
55Library
56-------
57
58- Issue #11116: any error during addition of a message to a mailbox now causes a
59 rollback, instead of leaving the mailbox partially modified.
60
61- Issue #11132: Fix passing of "optimize" parameter when recursing in
62 compileall.compile_dir().
63
64- Issue #11110: Fix a potential decref of a NULL in sqlite3.
65
66- Issue #8275: Fix passing of callback arguments with ctypes under Win64. Patch
67 by Stan Mihai.
68
69Build
70-----
71
72- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
73 installers now includes a link to the installed documentation and no longer
74 includes an Extras directory. The Tools directory is now installed in the
75 framework under share/doc.
76
77- Issue #11121: Fix building with --enable-shared.
78
79Tests
80-----
81
82- Issue #10971: test_zipimport_support is once again compatible with the refleak
83 hunter feature of test.regrtest.
84
85
86What's New in Python 3.2 Release Candidate 2?
87=============================================
88
89*Release date: 30-Jan-2011*
90
91Core and Builtins
92-----------------
93
94- Issue #10451: memoryview objects could allow to mutate a readable buffer.
95 Initial patch by Ross Lagerwall.
96
97Library
98-------
99
100- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
101 files in binary mode, using the email package's binary support to parse
102 arbitrary email messages. StringIO and text file input is deprecated,
103 and string input fails early if non-ASCII characters are used, where
104 previously it would fail when the email was processed in a later step.
105
106- Issue #10845: Mitigate the incompatibility between the multiprocessing
107 module on Windows and the use of package, zipfile or directory execution
108 by special casing main modules that actually *are* called __main__.py.
109
110- Issue #11045: Protect logging call against None argument.
111
112- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
113 commands.
114
115- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
116 preventing a confusing hung appearance on OS X with the windows
117 obscured.
118
119- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
120 menu accelerators for Open Module, Go to Line, and New Indent Width.
121 The accelerators still work but no longer appear in the menu items.
122
123- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
124
125- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
126 conversion.
127
128- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
129 with a None body.
130
131- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
132 keyword-only argument. The preceding positional argument was deprecated,
133 so it made no sense to add filter as a positional argument.
134
135- Issue #11004: Repaired edge case in deque.count().
136
137- Issue #10974: IDLE no longer crashes if its recent files list includes files
138 with non-ASCII characters in their path names.
139
140- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
141 return sets instead of one returning a tuple and the other a frozenset.
142
143- Issue #10987: Fix the recursion limit handling in the _pickle module.
144
145- Issue #10983: Fix several bugs making tunnel requests in http.client.
146
147- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
148 filenames, at bootstrap, if the codec registry is not ready yet. It is still
149 possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
150 for all file entries in the ZIP file.
151
152- Issue #10949: Improved robustness of rotating file handlers.
153
154- Issue #10955: Fix a potential crash when trying to mmap() a file past its
155 length. Initial patch by Ross Lagerwall.
156
157- Issue #10898: Allow compiling the posix module when the C library defines
158 a symbol named FSTAT.
159
160- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
161 encoding. This is the preferred encoding of PEP 3333 and the base encoding
162 of HTTP 1.1.
163
164- To match the behaviour of HTTP server, the HTTP client library now also
165 encodes headers with iso-8859-1 (latin1) encoding. It was already doing
166 that for incoming headers which makes this behaviour now consistent in
167 both incoming and outgoing direction.
168
169- Issue #9509: argparse now properly handles IOErrors raised by
170 argparse.FileType.
171
172- Issue #10961: The new pydoc server now better handles exceptions raised
173 during request handling.
174
175- Issue #10680: Fix mutually exclusive arguments for argument groups in
176 argparse.
177
178Build
179-----
180
181- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
182 the system-provided Python.
183
184
185What's New in Python 3.2 Release Candidate 1
186============================================
187
188*Release date: 16-Jan-2011*
189
190Core and Builtins
191-----------------
192
193- Issue #10889: range indexing and slicing now works correctly on ranges with
194 a length that exceeds sys.maxsize.
195
196- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
197 class.
198
199- Issue #8020: Avoid a crash where the small objects allocator would read
200 non-Python managed memory while it is being modified by another thread. Patch
201 by Matt Bandy.
202
203- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
204 io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
205 translates newlines (\r\n => \n).
206
207- Remove buffer API from stable ABI for now, see #10181.
208
209- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
210 doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
211 (length bigger than 2^31-1 bytes).
212
213- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
214 stdprinter.write() clamp the length to INT_MAX on Windows.
215
216- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
217 can now handle dates after 2038.
218
219- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
220 PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
221 filesystem encoding instead of UTF-8.
222
223- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
224 encoding instead of UTF-8.
225
226- Add sys.flags attribute for the new -q command-line option.
227
228- Issue #11506: Trying to assign to a bytes literal should result in a
229 SyntaxError.
230
231Library
232-------
233
234- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
235 and a non-zero offset, and an attempt to read past the end of file is made
236 (IndexError is raised instead). Patch by Ross Lagerwall.
237
238- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
239 of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
240
241- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
242 than the currently problematic Apple-supplied one, when running with the
243 64-/32-bit installer variant.
244
245- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
246 as unicode, and accept binary files. Add encoding and errors attributes to
247 cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
248 Linderman).
249
250- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
251
252- Issue #10899: No function type annotations in the standard library. Removed
253 function type annotations from _pyio.py.
254
255- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
256
257- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
258 if available.
259
260- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
261 twice.
262
263- Issue #5871: email.header.Header.encode now raises an error if any
264 continuation line in the formatted value has no leading white space and looks
265 like a header. Since Generator uses Header to format all headers, this check
266 is made for all headers in any serialized message at serialization time. This
267 provides protection against header injection attacks.
268
269- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
270 private by renaming it to ``_GeneratorContextManager``.
271
272- Issue #10042: Fixed the total_ordering decorator to handle cross-type
273 comparisons that could lead to infinite recursion.
274
275- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
276 non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
277 presentation, instead of replacing them with ?s.
278
279- email.header.Header was incorrectly encoding folding whitespace when
280 rfc2047-encoding header values with embedded newlines, leaving them without
281 folding whitespace. It now uses the continuation_ws, as it does for
282 continuation lines that it creates itself.
283
284- Issue #1777412, #10827: Changed the rules for 2-digit years. The
285 time.asctime(), time.ctime() and time.strftime() functions will now format
286 any year when ``time.accept2dyear`` is False and will accept years >= 1000
287 otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
288 supported by the OS. With Visual Studio or on Solaris, the year is limited to
289 the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
290
291- Issue #7858: Raise an error properly when os.utime() fails under Windows
292 on an existing file.
293
294- Issue #3839: wsgiref should not override a Content-Length header set by
295 the application. Initial patch by Clovis Fabricio.
296
297- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
298 compilation (if the input is a string).
299
300- Issue #7995: When calling accept() on a socket with a timeout, the returned
301 socket is now always blocking, regardless of the operating system.
302
303- Issue #10756: atexit normalizes the exception before displaying it. Patch by
304 Andreas Stührk.
305
306- Issue #10790: email.header.Header.append's charset logic now works correctly
307 for charsets whose output codec is different from its input codec.
308
309- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
310 raising a ValueError, to fix repr().
311
312- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
313 the input buffer length doesn't fit into an unsigned int (length bigger than
314 2^32-1 bytes).
315
316- Issue #6643: Reinitialize locks held within the threading module after fork to
317 avoid a potential rare deadlock or crash on some platforms.
318
319- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
320 descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross
321 Lagerwall.
322
323- `unittest.TestCase` can be instantiated without a method name; for simpler
324 exploration from the interactive interpreter.
325
326- Issue #10798: Reject supporting concurrent.futures if the system has too
327 few POSIX semaphores.
328
329- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
330 the codec aliases. They are still accessible via codecs.lookup().
331
332- Issue #10801: In zipfile, support different encodings for the header and the
333 filenames.
334
335- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
336 David Daniels.
337
338- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
339 define __missing__().
340
341- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
342 time. `sys.stderr` now looked up at instantiation time. Fix contributed by
343 Mark Roddy.
344
345- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
346 won't be quoted when the URI is constructed by the wsgiref.util's request_uri
347 method. According to RFC 3986, these characters can be a part of params in
348 PATH component of URI and need not be quoted.
349
350- Issue #10738: Fix webbrowser.Opera.raise_opts.
351
352- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
353 browsers actually parse cookies.
354
355- Issue #9333: os.symlink now available regardless of user privileges. The
356 function now raises OSError on Windows >=6.0 when the user is unable to create
357 symbolic links. XP and 2003 still raise NotImplementedError.
358
359- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
360
361- Issue #10730: Add SVG mime types to mimetypes module.
362
363- Issue #10768: Make the Tkinter ScrolledText widget work again.
364
365- Issue #10777: Fix "dictionary changed size during iteration" bug in
366 ElementTree register_namespace().
367
368- Issue #10626: test_logging now preserves logger disabled states.
369
370- Issue #10774: test_logging now removes temp files created during tests.
371
372- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
373 it now prints the filename, line number, and traceback to stderr and skips
374 the rest of that individual file, instead of stopping processing entirely.
375
376- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
377 pipes (bug specific to Windows).
378
379- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
380 compliance (no "s around encoded values).
381
382- Improved the diff message in the unittest module's assertCountEqual().
383
384- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
385 the '-' of a timezone field as well as before a '+'.
386
387- Issue #4871: The zipfile module now gives a more useful error message if
388 an attempt is made to use a string to specify the archive password.
389
390- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
391
392- Deprecated assertDictContainsSubset() in the unittest module.
393
394C-API
395-----
396
397- PyObject_CallMethod now passes along any underlying AttributeError from
398 PyObject_GetAttr, instead of replacing it with something less informative
399
400- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
401 PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
402
403- Issue #10333: Remove ancient GC API, which has been deprecated since Python
404 2.2.
405
406Build
407-----
408
409- Issue #10843: Update third-party library versions used in OS X 32-bit
410 installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
411 and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
412
413- Issue #10820: Fix OS X framework installs to support version-specific
414 scripts (#10679).
415
416- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
417 the configure script but use $GREP instead. Patch by Fabian Groffen.
418
419- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
420 and DragonFly BSD. Patch by Nicolas Joly.
421
422- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
423 a version-specific suffix on "make altinstall".
424
425- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
426 timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
427 support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
428 only be present on OS X; the former is the correct one for Linux with GCC.
429
430- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
431 using GCC 4.0.
432
433Tools/Demos
434-----------
435
436- Issue #10843: Install the Tools directory on OS X in the applications Extras
437 (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
438 installed.
439
440- Issue #7962: The Demo directory is gone. Most of the old and unmaintained
441 demos have been removed, others integrated in documentation or a new
442 Tools/demo subdirectory.
443
444- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
445 Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
446 Curtin.
447
448Tests
449-----
450
451- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
452
453- Fix test_startfile to wait for child process to terminate before finishing.
454
455- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
456 by Ross Lagerwall.
457
458- Make the --coverage flag work for test.regrtest.
459
460- Issue #1677694: Refactor and improve test_timeout. Original patch by
461 Björn Lindqvist.
462
463- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
464 Patch by Jean-Paul Calderone and Sandro Tosi.
465
466- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default in
467 whole runs and enabled selectively using ``--header`` when running an explicit
468 list of tests. Original patch by Collin Winter.
469
470
471What's New in Python 3.2 Beta 2?
472================================
473
474*Release date: 19-Dec-2010*
475
476Core and Builtins
477-----------------
478
479- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
480 by signals on platforms using pthreads. Patch by Reid Kleckner.
481
482- Issue #4236: PyModule_Create2 now checks the import machinery directly
483 rather than the Py_IsInitialized flag, avoiding a Fatal Python
484 error in certain circumstances when an import is done in __del__.
485
486- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
487 Daniel Urban.
488
489Library
490-------
491
492- Issue #3243: Support iterable bodies in httplib. Patch Contributions by
493 Xuanji Li and Chris AtLee.
494
495- Issue #10611: SystemExit exception will no longer kill a unittest run.
496
497- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
498 up function.
499
500- Issue #10573: use actual/expected consistently in unittest methods.
501 The order of the args of assertCountEqual is also changed.
502
503- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
504 words in the local part of email addresses, thereby preserving the input.
505
506- Issue #6791: Limit header line length (to 65535 bytes) in http.client
507 and http.server, to avoid denial of services from the other party.
508
509- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
510
511- Issue #9907: Fix tab handling on OSX when using editline by calling
512 rl_initialize first, then setting our custom defaults, then reading .editrc.
513
514- Issue #4188: Avoid creating dummy thread objects when logging operations
515 from the threading module (with the internal verbose flag activated).
516
517- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
518 parameter to HTTPConnection and friends is deprecated.
519
520- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
521 ';' character. Patch by Wes Chow.
522
523- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
524 for security reasons. Initial patch by Ross Lagerwall.
525
526- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
527
528- Issue #10667: Fast path for collections.Counter().
529
530- Issue #10695: passing the port as a string value to telnetlib no longer
531 causes debug mode to fail.
532
533- Issue #1078919: add_header now automatically RFC2231 encodes parameters
534 that contain non-ascii values.
535
536- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
537 a warning on sys.stderr rather than throwing a misleading exception
538 if cleanup fails due to nulling out of modules during shutdown.
539 Also avoids an AttributeError when mkdtemp call fails and issues
540 a ResourceWarning on implicit cleanup via __del__.
541
542- Issue #10107: Warn about unsaved files in IDLE on OSX.
543
544- Issue #7213: subprocess.Popen's default for close_fds has been changed.
545 It is now True in most cases other than on Windows when input, output or
546 error handles are provided.
547
548- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
549 added in 3.2beta1) to allow specifying a specific list of file descriptors
550 to keep open in the child process.
551
552- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
553 OSError exception when The OS had been told to ignore SIGCLD in our process
554 or otherwise not wait for exiting child processes.
555
556Tests
557-----
558
559- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
560 encountering them.
561
562Tools/Demos
563-----------
564
565- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
566 Cocoa AquaTk.
567
568- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
569
570- Issue #10706: Remove outdated script runtests.sh. Either ``make test``
571 or ``python -m test`` should be used instead.
572
573Build
574-----
575
576- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
577
578- Issue #9234: argparse supports alias names for subparsers.
579
580
581What's New in Python 3.2 Beta 1?
582================================
583
584*Release date: 05-Dec-2010*
585
586Core and Builtins
587-----------------
588
589- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
590 methods.
591
592- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
593 with respect to signed zeros. -4.0 % 4.0 should be 0.0, not -0.0.
594
595- Issue #1772833: Add the -q command-line option to suppress copyright and
596 version output in interactive mode.
597
598- Provide an *optimize* parameter in the built-in compile() function.
599
600- Fixed several corner case issues on Windows in os.stat/os.lstat related to
601 reparse points.
602
603- PEP 384 (Defining a Stable ABI) is implemented.
604
605- Issue #2690: Range objects support negative indices and slicing.
606
607- Issue #9915: Speed up sorting with a key.
608
609- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
610 larger than operand ``b``. Patch by Andrew Bennetts.
611
612- Issue #10518: Bring back the callable() builtin.
613
614- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
615 method of float, complex, and Decimal. This allows more precise control over
616 when decimal points are displayed.
617
618- Issue #10474: range.count() should return integers.
619
620- Issue #1574217: isinstance now catches only AttributeError, rather than
621 masking all errors.
622
623Library
624-------
625
626- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
627
628- test.support: Added TestHandler and Matcher classes for better support of
629 assertions about logging.
630
631- Issue #4391: Use proper plural forms in argparse.
632
633- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
634 UnicodeEncodeError.
635
636- Add the "display" and "undisplay" pdb commands.
637
638- Issue #7245: Add a SIGINT handler in pdb that allows to break a program again
639 after a "continue" command.
640
641- Add the "interact" pdb command.
642
643- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
644
645- Issue #1569291: Speed up array.repeat().
646
647- Provide an interface to set the optimization level of compilation in
648 py_compile, compileall and zipfile.PyZipFile.
649
650- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
651 RFC3986. Anything before :// is considered a scheme and is followed by an
652 authority (or netloc) and by '/' led path, which is optional.
653
654- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
655
656- Issue #10620: `python -m unittest` can accept file paths instead of module
657 names for running specific tests.
658
659- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
660 `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
661 and replace them with the correct methods in the Python test suite.
662
663- Issue #10272: The ssl module now raises socket.timeout instead of a generic
664 SSLError on socket timeouts.
665
666- Issue #10528: Allow translators to reorder placeholders in localizable
667 messages from argparse.
668
669- Issue #10497: Fix incorrect use of gettext in argparse.
670
671- Issue #10478: Reentrant calls inside buffered IO objects (for example by
672 way of a signal handler) now raise a RuntimeError instead of freezing the
673 current process.
674
675- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
676
677- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
678
679- Issue #2001: New HTML server with enhanced Web page features. Patch by Ron
680 Adam.
681
682- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
683 of non-weakrefable objects.
684
685- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
686
687- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
688 DoS attacks. Patch by Savio Sena.
689
690- Issue #4925: Add filename to error message when executable can't be found in
691 subprocess.
692
693- Issue #10391: Don't dereference invalid memory in error messages in the ast
694 module.
695
696- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
697 os.lstat. Patch by Hirokazu Yamamoto.
698
699- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
700 held by the user's account, i.e., when the function can actually be used.
701
702- Issue #8879: Add os.link support for Windows.
703
704- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
705 failure messages by default. Patch by Mark Roddy.
706
707- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
708 guess at the correct parsing of invalid html.
709
710- Issue #10554: Add context manager support to subprocess.Popen objects.
711
712- Issue #8989: email.utils.make_msgid now has a domain parameter that can
713 override the domain name used in the generated msgid.
714
715- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
716 exists' exception when a target directory already exists with the specified
717 mode. Patch by Ray Allen.
718
719- Issue #9573: os.fork() now works correctly when triggered as a side effect of
720 a module import.
721
722- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
723
724- Added itertools.accumulate().
725
726- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
727 Original patch by Daniel Urban.
728
729- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
730 `assertRegex` and `assertRaisesRegex`.
731
732- Issue #10535: Enable silenced warnings in unittest by default.
733
734- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
735 sequences as input in addition to character strings.
736
737- Issue #10586: The statistics API for the new functools.lru_cache has been
738 changed to a single cache_info() method returning a named tuple.
739
740- Issue #10323: itertools.islice() now consumes the minimum number of inputs
741 before stopping. Formerly, the final state of the underlying iterator was
742 undefined.
743
744- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
745 __next__.
746
747- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
748 more informative name, unittest.CountEqual.
749
750- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
751
752- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
753 be set to False to turn off the previously undocumented 'popularity'
754 heuristic. Patch by Terry Reedy and Eli Bendersky.
755
756- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
757 undocumented and now redundant isbjunk and isbpopular methods.
758
759- Issue #9846: zipfile is now correctly closing underlying file objects.
760
761- Issue #10459: Update CJK character names to Unicode 6.0.
762
763- Issue #4493: urllib.request adds '/' in front of path components which does not
764 start with '/. Common behavior exhibited by browsers and other clients.
765
766- Issue #6378: idle.bat now runs with the appropriate Python version rather than
767 the system default. Patch by Sridhar Ratnakumar.
768
769- Issue #10470: 'python -m unittest' will now run test discovery by default,
770 when no extra arguments have been provided.
771
772- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
773 output stream only when end_headers is invoked. This is a speedup and an
774 internal optimization. Patch by Andrew Shaaf.
775
776- Issue #10220: Added inspect.getgeneratorstate. Initial patch by Rodolpho
777 Eckhardt.
778
779- Issue #10453: compileall now uses argparse instead of getopt, and thus
780 provides clean output when called with '-h'.
781
782- Issue #8078: Add constants for higher baud rates in the termios module. Patch
783 by Rodolpho Eckhardt.
784
785- Issue #10407: Fix two NameErrors in distutils.
786
787- Issue #10371: Deprecated undocumented functions in the trace module.
788
789- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
790 end of the file.
791
792- configparser: 100% test coverage.
793
794- Issue #10499: configparser supports pluggable interpolation handlers. The
795 default classic interpolation handler is called BasicInterpolation. Another
796 interpolation handler added (ExtendedInterpolation) which supports the syntax
797 used by zc.buildout (e.g. interpolation between sections).
798
799- configparser: the SafeConfigParser class has been renamed to ConfigParser.
800 The legacy ConfigParser class has been removed but its interpolation mechanism
801 is still available as LegacyInterpolation.
802
803- configparser: Usage of RawConfigParser is now discouraged for new projects
804 in favor of ConfigParser(interpolation=None).
805
806- Issue #1682942: configparser supports alternative option/value delimiters.
807
808- Issue #5412: configparser supports mapping protocol access.
809
810- Issue #9411: configparser supports specifying encoding for read operations.
811
812- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
813 accept vars and default arguments just like get() does.
814
815- Issue #9452: configparser supports reading from strings and dictionaries
816 (thanks to the mapping protocol API, the latter can be used to copy data
817 between parsers).
818
819- configparser: accepted INI file structure is now customizable, including
820 comment prefixes, name of the DEFAULT section, empty lines in multiline
821 values, and indentation.
822
823- Issue #10326: unittest.TestCase instances can be pickled.
824
825- Issue #9926: Wrapped TestSuite subclass does not get __call__ executed.
826
827- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to complex
828 zeros on systems where the log1p function fails to respect the sign of zero.
829 This fixes a test failure on AIX.
830
831- Issue #9732: Addition of getattr_static to the inspect module.
832
833- Issue #10446: Module documentation generated by pydoc now links to a
834 version-specific online reference manual.
835
836- Make the 'No module named' exception message from importlib consistent.
837
838- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
839
840- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
841 Patch by Robert Collins.
842
843- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
844 than strings.
845
846C-API
847-----
848
849- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
850 which transforms non-ASCII decimal digits in a Unicode string to their ASCII
851 equivalents.
852
853- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
854 zero-initialize all fields, fixing compiler warnings seen when building
855 extension modules with gcc with "-Wmissing-field-initializers" (implied by
856 "-W").
857
858- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
859 Schemenauer.
860
861- structseq.h is now included in Python.h.
862
863- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
864
865Tests
866-----
867
868- regrtest.py once again ensures the test directory is removed from sys.path
869 when it is invoked directly as the __main__ module.
870
871- `python -m test` can be used to run the test suite as well as `python -m
872 test.regrtest`.
873
874- Do not fail test_socket when the IP address of the local hostname cannot be
875 looked up.
876
877- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
878 Carstensen.
879
880Build
881-----
882
883- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
884 PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
885
886Documentation
887-------------
888
889- Issue #10299: List the built-in functions in a table in functions.rst.
890
891
892What's New in Python 3.2 Alpha 4?
893=================================
894
895*Release date: 13-Nov-2010*
896
897Core and Builtins
898-----------------
899
900- Issue #10372: Import the warnings module only after the IO library is
901 initialized, so as to avoid bootstrap issues with the '-W' option.
902
903- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
904 undocumented value PyBUF_SHADOW, and strangely-looking code in
905 PyMemoryView_GetContiguous.
906
907- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
908
909- If FileIO.__init__ fails, close the file descriptor.
910
911- Issue #10221: dict.pop(k) now has a key error message that includes the
912 missing key (same message d[k] returns for missing keys).
913
914- Issue #5437: A preallocated MemoryError instance should not keep traceback
915 data (including local variables caught in the stack trace) alive infinitely.
916
917- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
918 of the offending line.
919
920- Issue #10089: Add support for arbitrary -X options on the command line. They
921 can be retrieved through a new attribute ``sys._xoptions``.
922
923- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
924 the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment
925 variable is not set, the locale encoding is ISO-8859-1, whereas most programs
926 (including Python) expect UTF-8. Python already uses UTF-8 for the filesystem
927 encoding and to encode command line arguments on this OS.
928
929- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
930 filenames encoded to the filesystem encoding with the surrogateescape error
931 handler (to support undecodable bytes), instead of UTF-8 in strict mode.
932
933- Issue #9997: Don't let the name "top" have special significance in scope
934 resolution.
935
936- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
937 the default 512 when compiling on AIX.
938
939- Use locale encoding instead of UTF-8 to encode and decode filenames if
940 Py_FileSystemDefaultEncoding is not set.
941
942- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
943 descriptor.
944
945- Issue #9418: Moved private string methods ``_formatter_parser`` and
946 ``_formatter_field_name_split`` into a new ``_string`` module.
947
948- Issue #9992: Remove PYTHONFSENCODING environment variable.
949
950Library
951-------
952
953- Issue #12943: python -m tokenize support has been added to tokenize.
954
955- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
956
957- Issue #10356: Decimal.__hash__(-1) should return -2.
958
959- Issue #1553375: logging: Added stack_info kwarg to display stack information.
960
961- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
962
963- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2. (See also issue
964 #10356.)
965
966- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
967 IMAP4 connections. Original patch by Lorenzo M. Catucci.
968
969- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
970 there are non-base64 alphabet characters in the input.
971
972- Issue #10386: Add __all__ to token module; this simplifies importing in
973 tokenize module and prevents leaking of private names through ``import *``.
974
975- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by Lorenzo
976 M. Catucci.
977
978- Fix IMAP.login() to work properly.
979
980- Issue #9244: multiprocessing pool worker processes could terminate
981 unexpectedly if the return value of a task could not be pickled. Only the
982 ``repr`` of such errors are now sent back, wrapped in an
983 ``MaybeEncodingError`` exception.
984
985- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
986 ``multiprocessing.Pool`` now accepts a ``error_callback`` argument. This can
987 be a callback with the signature ``callback(exc)``, which will be called if
988 the target raises an exception.
989
990- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
991 sockets now has additional items such as ``issuer`` and ``notBefore``.
992
993- ``usenetrc`` is now false by default for NNTP objects.
994
995- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
996 Patch by Andrew Vant.
997
998- Issue #10335: Add tokenize.open(), detect the file encoding using
999 tokenize.detect_encoding() and open it in read only mode.
1000
1001- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
1002 method send_message to send an email.message.Message object.
1003
1004- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
1005 handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
1006 code directory name contains a non-ASCII character and the locale encoding is
1007 ASCII.
1008
1009- Issue #10329: The trace module writes reports using the input Python script
1010 encoding, instead of the locale encoding. Patch written by Alexander
1011 Belopolsky.
1012
1013- Issue #10126: Fix distutils' test_build when Python was built with
1014 --enable-shared.
1015
1016- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
1017 Arfrever.
1018
1019- Issue #10229: Fix caching error in gettext.
1020
1021- Issue #10252: Close file objects in a timely manner in distutils code and
1022 tests. Patch by Brian Brazil, completed by Éric Araujo.
1023
1024- Issue #10180: Pickling file objects is now explicitly forbidden, since
1025 unpickling them produced nonsensical results.
1026
1027- Issue #10311: The signal module now restores errno before returning from its
1028 low-level signal handler. Patch by Hallvard B Furuseth.
1029
1030- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
1031
1032- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
1033
1034- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
1035 environment better, and to correct unicode environment values for WSGI 1.0.1.
1036
1037- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
1038 response, instead of raising an exception.
1039
1040- wsgiref now implements and validates PEP 3333, rather than an experimental
1041 extension of PEP 333. (Note: earlier versions of Python 3.x may have
1042 incorrectly validated some non-compliant applications as WSGI compliant; if
1043 your app validates with Python <3.2b1+, but not on this version, it is likely
1044 the case that your app was not compliant.)
1045
1046- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
1047 by the server.
1048
1049- Issue #10184: Touch directories only once when extracting a tarfile.
1050
1051- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
1052 that were formerly found under Demo/turtle.
1053
1054- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
1055
1056- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
1057 filename. Patch by Brian Brazil.
1058
1059- Issue #10110: Queue objects didn't recognize full queues when the maxsize
1060 parameter had been reduced.
1061
1062- Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
1063
1064- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
1065
1066- Issue #5729: json.dumps() now supports using a string such as '\t' for
1067 pretty-printing multilevel objects.
1068
1069- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
1070 append that isn't seekable. Patch by Brian Brazil.
1071
1072- Support context manager protocol for file-like objects returned by mailbox
1073 ``get_file()`` methods.
1074
1075- Issue #10246: uu.encode didn't close file objects explicitly when filenames
1076 were given to it. Patch by Brian Brazil.
1077
1078- Issue #10198: fix duplicate header written to wave files when writeframes() is
1079 called without data.
1080
1081- Close file objects in modulefinder in a timely manner.
1082
1083- Close a io.TextIOWrapper object in email.parser in a timely manner.
1084
1085- Close a file object in distutils.sysconfig in a timely manner.
1086
1087- Close a file object in pkgutil in a timely manner.
1088
1089- Issue #10233: Close file objects in a timely manner in the tarfile module and
1090 its test suite.
1091
1092- Issue #10093: ResourceWarnings are now issued when files and sockets are
1093 deallocated without explicit closing. These warnings are silenced by default,
1094 except in pydebug mode.
1095
1096- tarfile.py: Add support for all missing variants of the GNU sparse extensions
1097 and create files with holes when extracting sparse members.
1098
1099- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
1100
1101- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
1102 deprecate the old name ``zipfile.BadZipfile``.
1103
1104- Issue #5027: The standard ``xml`` namespace is now understood by
1105 xml.sax.saxutils.XMLGenerator as being bound to
1106 http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
1107
1108- Issue #5975: Add csv.unix_dialect class.
1109
1110- Issue #7761: telnetlib.interact failures on Windows fixed.
1111
1112- logging: Added style option to Formatter to allow %, {} or $-formatting.
1113
1114- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
1115 context manager.
1116
1117- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
1118 encode method now support a 'linesep' argument.
1119
1120- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
1121 order to support the TLS SNI extension. ``HTTPSConnection`` and ``urlopen()``
1122 also use this argument, so that HTTPS virtual hosts are now supported.
1123
1124- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
1125
1126- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
1127
1128- logging: Made StreamHandler terminator configurable.
1129
1130- logging: Allowed filters to be just callables.
1131
1132- logging: Added tests for _logRecordClass changes.
1133
1134- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
1135
1136- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
1137 increase flexibility of LogRecord creation.
1138
1139- Issue #5117: Case normalization was needed on ntpath.relpath(). Also fixed
1140 root directory issue on posixpath.relpath(). (Ported working fixes from
1141 ntpath.)
1142
1143- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
1144 short_empty_elements to direct it to use self-closing tags when appropriate.
1145
1146- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags. Add --abiflags
1147 switch to python-config for command line access.
1148
1149- Issue #6098: Don't claim DOM level 3 conformance in minidom.
1150
1151- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
1152 XML namespace attribute is encountered.
1153
1154- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
1155 characters by default. Deprecate ``cgi.escape()``.
1156
1157- Issue #9409: Fix the regex to match all kind of filenames, for interactive
1158 debugging in doctests.
1159
1160- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
1161 same instance as ``datetime.timezone.utc``.
1162
1163- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
1164 supported by the system. Patch by Nikita Vetoshkin.
1165
1166- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
1167 protocol. file:// urls had fallback to access remote hosts via ftp. This was
1168 not correct, change is made to raise a URLError when a remote host is tried to
1169 access via file:// scheme.
1170
1171- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
1172 created in modes 'a' or 'w' and then closed without adding any files. Raise
1173 BadZipfile (rather than IOError) when opening small non-ZIP files.
1174
1175- Issue #10041: The signature of optional arguments in socket.makefile() didn't
1176 match that of io.open(), and they also didn't get forwarded properly to
1177 TextIOWrapper in text mode. Patch by Kai Zhu.
1178
1179- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
1180 urllib.request.urlopen now take optional arguments to allow for server
1181 certificate checking, as recommended in public uses of HTTPS.
1182
1183- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
1184 current directory was deleted. Patch written by W. Trevor King.
1185
1186- Issue #3873: Speed up unpickling from file objects that have a peek() method.
1187
1188- Issue #10075: Add a session_stats() method to SSLContext objects.
1189
1190- Issue #9948: Fixed problem of losing filename case information.
1191
1192Extension Modules
1193-----------------
1194
1195- Issue #5109: array.array constructor will now use fast code when
1196 initial data is provided in an array object with correct type.
1197
1198- Issue #6317: Now winsound.PlaySound only accepts unicode.
1199
1200- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
1201
1202- Issue #9377: Use Unicode API for gethostname on Windows.
1203
1204- Issue #10143: Update "os.pathconf" values.
1205
1206- Issue #6518: Support context manager protcol for ossaudiodev types.
1207
1208- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
1209
1210- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
1211 version 2.0.1.
1212
1213- Issue #5355: Provide mappings from Expat error numbers to string descriptions
1214 and backwards, in order to actually make it possible to analyze error codes
1215 provided by ExpatError.
1216
1217- The Unicode database was updated to 6.0.0.
1218
1219C-API
1220-----
1221
1222- Issue #10288: The deprecated family of "char"-handling macros
1223 (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
1224
1225- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
1226 type has been introduced.
1227
1228Tools/Demos
1229-----------
1230
1231- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
1232 encoding other than ASCII or UTF-8. Source encoding is preserved when
1233 reindented code is written to a file.
1234
1235- Issue #7287: Demo/imputil/knee.py was removed.
1236
1237Tests
1238-----
1239
1240- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
1241 as unicode strings. Initial patch by Sandro Tosi.
1242
1243- Issue #10294: Remove dead code form test_unicode_file.
1244
1245- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
1246 test specific to unicode (non-ascii name and filename).
1247
1248Build
1249-----
1250
1251- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
1252
1253- Issue #8852: Allow the socket module to build on OpenSolaris.
1254
1255- Drop -OPT:Olimit compiler option.
1256
1257- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
1258
1259- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
1260
1261- Issue #7473: avoid link errors when building a framework with a different set
1262 of architectures than the one that is currently installed.
1263
1264
1265What's New in Python 3.2 Alpha 3?
1266=================================
1267
1268*Release date: 09-Oct-2010*
1269
1270Core and Builtins
1271-----------------
1272
1273- Issue #10068: Global objects which have reference cycles with their module's
1274 dict are now cleared again. This causes issue #7140 to appear again.
1275
1276- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
1277 encodings.
1278
1279- ast.literal_eval() can now handle negative numbers. It is also a little more
1280 liberal in what it accepts without compromising the safety of the evaluation.
1281 For example, 3j+4 and 3+4+5 are both accepted.
1282
1283- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
1284 result metaclasses can now be ABCs (see #9533).
1285
1286- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
1287
1288- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
1289 UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
1290 32 bits wchar_t (eg. Linux in narrow build).
1291
1292- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
1293 introduced by issue #9324.
1294
1295- Issue #9979: Create function PyUnicode_AsWideCharString().
1296
1297- Issue #7397: Mention that importlib.import_module() is probably what someone
1298 really wants to be using in __import__'s docstring.
1299
1300- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
1301 to use named arguments.
1302
1303- Issue #9930: Remove bogus subtype check that was causing (e.g.)
1304 float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
1305
1306- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
1307
1308- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
1309 threads are still running. Instead, reinitialize the GIL on a second call to
1310 Py_Initialize().
1311
1312- All SyntaxErrors now have a column offset and therefore a caret when the error
1313 is printed.
1314
1315- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
1316 module that was imported, but instead gets the module from sys.modules.
1317
1318- Issue #9213: The range type_items now provides index() and count() methods, to
1319 conform to the Sequence ABC. Patch by Daniel Urban and Daniel Stutzbach.
1320
1321- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
1322 with a non-empty format string. This is an effort to future-proof user
1323 code. If a derived class does not currently implement __format__ but later
1324 adds its own __format__, it would most likely break user code that had
1325 supplied a format string. This will be changed to a DeprecationWaring in
1326 Python 3.3 and it will be an error in Python 3.4.
1327
1328- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
1329 re-created on a subsequent call to Py_Initialize(). The problem (a crash)
1330 wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
1331
1332- Issue #9210: Configure option --with-wctype-functions was removed. Using the
1333 functions from the libc caused the methods .upper() and lower() to become
1334 locale aware and created subtly wrong results.
1335
1336- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
1337 non-ASCII byte in the format string.
1338
1339- Issue #4617: Previously it was illegal to delete a name from the local
1340 namespace if it occurs as a free variable in a nested block. This limitation
1341 of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
1342
1343- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
1344 ``\UXXXXXXXX``, regardless of whether the character is printable or not.
1345 Also, the "backslashreplace" error handler now joins surrogate pairs into a
1346 single character on UCS-2 builds.
1347
1348- Issue #9757: memoryview objects get a release() method to release the
1349 underlying buffer (previously this was only done when deallocating the
1350 memoryview), and gain support for the context management protocol.
1351
1352- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
1353 thread-local storage key.
1354
1355Library
1356-------
1357
1358- Issue #2236: distutils' mkpath ignored the mode parameter.
1359
1360- Fix typo in one sdist option (medata-check).
1361
1362- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
1363
1364- Issue #1718574: Fix options that were supposed to accept arguments but did
1365 not in build_clib.
1366
1367- Issue #9437: Fix building C extensions with non-default LDFLAGS.
1368
1369- Issue #4661: email can now parse bytes input and generate either converted
1370 7bit output or bytes output. Email version bumped to 5.1.0.
1371
1372- Issue #1589: Add ssl.match_hostname(), to help implement server identity
1373 verification for higher-level protocols.
1374
1375- Issue #9759: GzipFile now raises ValueError when an operation is attempted
1376 after the file is closed. Patch by Jeffrey Finkelstein.
1377
1378- Issue #9042: Fix interaction of custom translation classes and caching in
1379 gettext.
1380
1381- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
1382 returning a (sock, addr) pair which is called when a connection has been
1383 established with a new remote endpoint. This is supposed to be used as a
1384 replacement for old handle_accept() and avoids the user to call accept()
1385 directly.
1386
1387- Issue #9065: tarfile no longer uses "root" as the default for the uname and
1388 gname field.
1389
1390- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
1391 an environment that does not have docutils. Patch by Arfrever.
1392
1393- Issue #1050268: parseaddr now correctly quotes double quote and backslash
1394 characters that appear inside quoted strings in email addresses.
1395
1396- Issue #10004: quoprimime no longer generates a traceback when confronted with
1397 invalid characters after '=' in a Q-encoded word.
1398
1399- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
1400 sending a 200 OK for the Expect: 100-continue request header.
1401
1402- Issue #9360: Cleanup and improvements to the nntplib module. The API now
1403 conforms to the philosophy of bytes and unicode separation in Python 3. A
1404 test suite has also been added.
1405
1406- Issue #9962: GzipFile now has the peek() method.
1407
1408- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
1409 retry the select() loop instead of bailing out. This is because select() can
1410 incorrectly report a socket as ready for reading (for example, if it received
1411 some data with an invalid checksum).
1412
1413- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
1414
1415- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
1416 received. Now sendall() properly calls signal handlers if necessary, and
1417 retries sending if these returned successfully, including on sockets with a
1418 timeout.
1419
1420- Issue #9947: logging: Fixed locking bug in stopListening.
1421
1422- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
1423
1424- Issue #9936: Fixed executable lines' search in the trace module.
1425
1426- Issue #9790: Rework imports necessary for samefile and sameopenfile
1427 in ntpath.
1428
1429- Issue #9928: Properly initialize the types exported by the bz2 module.
1430
1431- Issue #1675951: Allow GzipFile to work with unseekable file objects. Patch by
1432 Florian Festi.
1433
1434- Logging: Added QueueListener class to facilitate logging usage for
1435 performance-critical threads.
1436
1437- Issue #9916: Add some missing errno symbols.
1438
1439- Issue #9877: Expose sysconfig.get_makefile_filename()
1440
1441- logging: Added hasHandlers() method to Logger and LoggerAdapter.
1442
1443- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
1444
1445- Issue #2643: msync() is not called anymore when deallocating an open mmap
1446 object, only munmap().
1447
1448- logging: Changed LoggerAdapter implementation internally, to make it easier to
1449 subclass in a useful way.
1450
1451- logging: hasHandlers method was added to Logger, and isEnabledFor,
1452 getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
1453 LoggerAdapter was introduced into the unit tests for logging.
1454
1455- Issue #1686: Fix string.Template when overriding the pattern attribute.
1456
1457- Issue #9854: SocketIO objects now observe the RawIOBase interface in
1458 non-blocking mode: they return None when an operation would block (instead of
1459 raising an exception).
1460
1461- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
1462 another kind.
1463
1464- Issue #9441: logging has better coverage for rotating file handlers.
1465
1466- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
1467
1468- Issue #9854: The default read() implementation in io.RawIOBase now handles
1469 non-blocking readinto() returning None correctly.
1470
1471- Issue #1552: socket.socketpair() now returns regular socket.socket objects
1472 supporting the whole socket API (rather than the "raw" _socket.socket
1473 objects).
1474
1475- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
1476 to match the corresponding socket methods.
1477
1478- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
1479 them handle recursive calls within the same thread.
1480
1481- logging: Enhanced HTTPHandler with secure and credentials initializers.
1482
1483- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
1484
1485- Issue #9837: The read() method of ZipExtFile objects (as returned by
1486 ZipFile.open()) could return more bytes than requested.
1487
1488- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
1489 d['x'] = d.
1490
1491- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
1492 it possible for the user to create self-referencing ordered dictionaries which
1493 become permanently uncollectable GC garbage. Reinstated the Python 3.1
1494 approach of using weakref proxies so that reference cycles never get created
1495 in the first place.
1496
1497- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
1498 encode the value with filesystem encoding and surrogateescape (instead of
1499 utf-8 in strict mode) . Patch written by David Watson.
1500
1501- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
1502 environment variable to set the filesystem encoding at Python startup.
1503 sys.setfilesystemencoding() creates inconsistencies because it is unable to
1504 reencode all filenames in all objects.
1505
1506- Issue #9410: Various optimizations to the pickle module, leading to speedups
1507 up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow;
1508 initial patch by Alexandre Vassalotti.
1509
1510- The pprint module now supports printing OrderedDicts in their given order
1511 (formerly, it would sort the keys).
1512
1513- Logging: Added QueueHandler class to facilitate logging usage with
1514 multiprocessing.
1515
1516- Issue #9707: Rewritten reference implementation of threading.local which is
1517 friendlier towards reference cycles. This change is not normally visible
1518 since an optimized C implementation (_thread._local) is used instead.
1519
1520- Issue #6394: os.getppid() is now supported on Windows. Note that it will
1521 still return the id of the parent process after it has exited. This process
1522 id may even have been reused by another unrelated process.
1523
1524- Issue #9792: In case of connection failure, socket.create_connection() would
1525 swallow the exception and raise a new one, making it impossible to fetch the
1526 original errno, or to filter timeout errors. Now the original error is
1527 re-raised.
1528
1529- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
1530 the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
1531 back after the system call. Original patch by Brian Brazil.
1532
1533- Updates to the random module:
1534
1535 * Document which parts of the module are guaranteed to stay the same across
1536 versions and which parts are subject to change.
1537
1538 * Update the seed() method to use all of the bits in a string instead of just
1539 the hash value. This makes better use of the seed value and assures the
1540 seeding is platform independent. Issue #7889.
1541
1542 * Improved the random()-->integer algorithm used in choice(), shuffle(),
1543 sample(), randrange(), and randint(). Formerly, it used int(n*random())
1544 which has a slight bias whenever n is not a power of two. Issue #9025.
1545
1546 * Improved documentation of arguments to randrange(). Issue #9379.
1547
1548- collections.OrderedDict now supports a new method for repositioning keys to
1549 either end.
1550
1551- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
1552 cases now also have assertWarns and assertWarnsRegexp methods to check that a
1553 given warning type was triggered by the code under test.
1554
1555- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
1556 their contents without duplicating them. The view is both readable and
1557 writable.
1558
1559- Issue #7566: Implement os.path.sameopenfile for Windows.
1560
1561- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
1562 unsupported operation is attempted (for example, writing to a file open only
1563 for reading).
1564
1565- hashlib has two new constant attributes: algorithms_guaranteed and
1566 algorithms_avaiable that respectively list the names of hash algorithms
1567 guaranteed to exist in all Python implementations and the names of hash
1568 algorithms available in the current process.
1569
1570- A new package ``concurrent.futures`` as defined by PEP 3148.
1571
1572C-API
1573-----
1574
1575- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
1576
1577- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
1578 PySequence_DelSlice when the object doesn't have any mapping operations
1579 defined.
1580
1581Tools/Demos
1582-----------
1583
1584- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
1585 wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
1586 and the interpreter under test.
1587
1588Tests
1589-----
1590
1591- Issue #9308: Added tests for importing encoded modules that do not
1592 depend on specific stdlib modules being encoded in a certain way.
1593
1594- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
1595 certificate and private key files used by SSL-related certs.
1596
1597- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
1598 in test_os)
1599
1600- Issue #7110: regrtest now sends test failure reports and single-failure
1601 tracebacks to stderr rather than stdout.
1602
1603- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
1604
1605- Issue #9899: Fix test_tkinter.test_font on various platforms. Patch by Ned
1606 Deily.
1607
1608- Issue #9894: Do not hardcode ENOENT in test_subprocess.
1609
1610- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
1611
1612- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
1613 case when running profile or trace, for example.
1614
1615- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
1616
1617Build
1618-----
1619
1620- Issue #10062: Allow building on platforms which do not have sem_timedwait.
1621
1622- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by Akira
1623 Kitada.
1624
1625- Issue #10055: Make json C89-compliant in UCS4 mode.
1626
1627- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
1628
1629- Issue #1633863: Don't ignore $CC under AIX.
1630
1631- Issue #9810: Compile bzip2 source files in Python's project file directly. It
1632 used to be built with bzip2's makefile.
1633
1634- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
1635 module.
1636
1637- Issue #9806: python-config now has an ``--extension-suffix`` option that
1638 outputs the suffix for dynamic libraries including the ABI version name
1639 defined by PEP 3149.
1640
1641- Issue #941346: Improve the build process under AIX and allow Python to be
1642 built as a shared library. Patch by Sébastien Sablé.
1643
1644- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
1645 Sablé.
1646
1647- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
1648 the "bin" directory inside the framework is on the shell's search path. This
1649 feature now also supports the ZSH shell.
1650
1651
1652What's New in Python 3.2 Alpha 2?
1653=================================
1654
1655*Release date: 05-Sep-2010*
1656
1657Core and Builtins
1658-----------------
1659
1660- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
1661 the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but our
1662 bytecode is a bit simplified. Patch by Demur Rumed.
1663
1664- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
1665 confusion with the proper variables names from 'warnings' itself.
1666
1667- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
1668 conform to the Set ABC. Patch by Daniel Urban.
1669
1670- Issue #9737: Fix a crash when trying to delete a slice or an item from a
1671 memoryview object.
1672
1673- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
1674 now removed, since their effect was inexistent in 3.x (the default encoding is
1675 hardcoded to utf-8 and cannot be changed).
1676
1677- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
1678 properly. Patch by Stefan Behnel.
1679
1680- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
1681 platforms. Previously, it inlined only when using Microsoft Visual C.
1682
1683- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
1684
1685- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
1686
1687- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
1688 the pyconfig.h generated by configure on other systems.
1689
1690- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
1691 occur during attribute lookup are now propagated to the caller.
1692
1693- Issue #8622: Add PYTHONFSENCODING environment variable to override the
1694 filesystem encoding.
1695
1696- Issue #5127: The C functions that access the Unicode Database now accept and
1697 return characters from the full Unicode range, even on narrow unicode builds
1698 (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
1699 in Python is that unicodedata.numeric() now returns the correct value for
1700 large code points, and repr() may consider more characters as printable.
1701
1702- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
1703 as a unicode object, instead of a byte string. Function needed to support
1704 unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
1705 function.
1706
1707- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
1708
1709- Issue #9612: The set object is now 64-bit clean under Windows.
1710
1711- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
1712 the module file to be executed with the -m command line option.
1713
1714- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
1715 write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
1716 sys.stderr.
1717
1718- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
1719 decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
1720 objects are output as-is.
1721
1722- Issue #9203: Computed gotos are now enabled by default on supported compilers
1723 (which are detected by the configure script). They can still be disable
1724 selectively by specifying --without-computed-gotos.
1725
1726- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
1727 use PyUnicode_FromFormatV() to format the warning message.
1728
1729- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
1730 array.
1731
1732- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
1733
1734- Issue #9337: The str() of a float or complex number is now identical to its
1735 repr().
1736
1737- Issue #9416: Fix some issues with complex formatting where the output with no
1738 type specifier failed to match the str output:
1739
1740 - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
1741 - format(complex(0.0, 2.0), '-') included a sign and parentheses.
1742
1743Extension Modules
1744-----------------
1745
1746- Issue #8013: time.asctime and time.ctime no longer call system
1747 asctime and ctime functions. The year range for time.asctime is now
1748 1900 through maxint. The range for time.ctime is the same as for
1749 time.localtime. The string produced by these functions is longer
1750 than 24 characters when year is greater than 9999.
1751
1752- Issue #6608: time.asctime is now checking struct tm fields its input
1753 before passing it to the system asctime. Patch by MunSic Jeong.
1754
1755- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
1756 descriptor is provided. Patch by Pascal Chambon.
1757
1758- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
1759 posix module. Patch by Marcin Bachry.
1760
1761- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
1762 socket module, and fix the width of socket descriptors to be correctly
1763 detected under 64-bit Windows.
1764
1765- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
1766 and gethostbyaddr. getnameinfo is now restricted to numeric addresses as
1767 input.
1768
1769- Issue #9214: Set operations on a KeysView or ItemsView in collections now
1770 correctly return a set. Patch by Eli Bendersky.
1771
1772- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
1773 Matthew Ahrens.
1774
1775- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
1776 the surrogate error handler.
1777
1778- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
1779 than ``TypeError`` raised by the iterator argument.
1780
1781- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
1782
1783- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
1784 Lock around all system calls. Original patch by Ryan Kelly.
1785
1786- Issue #8524: Add a detach() method to socket objects, so as to put the socket
1787 into the closed state without closing the underlying file descriptor.
1788
1789- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
1790
1791- Issue #6869: Fix a refcount problem in the _ctypes extension.
1792
1793- Issue #5504: ctypes should now work with systems where mmap can't be
1794 PROT_WRITE and PROT_EXEC.
1795
1796- Issue #9507: Named tuple repr will now automatically display the right name in
1797 a tuple subclass.
1798
1799- Issue #9324: Add parameter validation to signal.signal on Windows in order to
1800 prevent crashes.
1801
1802- Issue #9526: Remove some outdated (int) casts that were preventing the array
1803 module from working correctly with arrays of more than 2**31 elements.
1804
1805- Fix memory leak in ssl._ssl._test_decode_cert.
1806
1807- Issue #8065: Fix memory leak in readline module (from failure to free the
1808 result of history_get_history_state()).
1809
1810- Issue #9450: Fix memory leak in readline.replace_history_item and
1811 readline.remove_history_item for readline version >= 5.0.
1812
1813- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
1814
1815- Issue #8046: Add context manager protocol support and .closed property to mmap
1816 objects.
1817
1818Library
1819-------
1820
1821- Issue #7451: Improve decoding performance of JSON objects, and reduce the
1822 memory consumption of said decoded objects when they use the same strings as
1823 keys.
1824
1825- Issue #1100562: Fix deep-copying of objects derived from the list and dict
1826 types. Patch by Michele Orrù and Björn Lindqvist.
1827
1828- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
1829
1830- Issue #9421: Made the get<type> methods consistently accept the vars and
1831 default arguments on all parser classes.
1832
1833- Issue #7005: Fixed output of None values for RawConfigParser.write and
1834 ConfigParser.write.
1835
1836- Issue #8990: array.fromstring() and array.tostring() get renamed to
1837 frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
1838 array.frombytes(), array.extend() as well as the array.array() constructor now
1839 accept bytearray objects. Patch by Thomas Jollans.
1840
1841- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
1842 issues when socket.close is called from a __del__ method.
1843
1844- Issue #9706: ssl module provides a better error handling in various
1845 circumstances.
1846
1847- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
1848 rid of the cached copy of thread-local attribute dictionary.
1849
1850- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
1851 are rounded to the nearest integer.
1852
1853- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
1854 falling into recursion.
1855
1856- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
1857 character years even if the message contains RFC822 two character years.
1858
1859- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
1860 operations on its self, namely x -= x and x ^= x.
1861
1862- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
1863 handling when accepting a new connection.
1864
1865- Issue #9601: ftplib now provides a workaround for non-compliant
1866 implementations such as IIS shipped with Windows server 2003 returning invalid
1867 response codes for MKD and PWD commands.
1868
1869- Issue #658749: asyncore's connect() method now correctly interprets winsock
1870 errors.
1871
1872- Issue #9501: Fixed logging regressions in cleanup code.
1873
1874- Fix functools.total_ordering() to skip methods inherited from object.
1875
1876- Issue #9572: Importlib should not raise an exception if a directory it thought
1877 it needed to create was done concurrently by another process.
1878
1879- Issue #9617: Signals received during a low-level write operation aren't
1880 ignored by the buffered IO layer anymore.
1881
1882- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
1883
1884- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
1885 error handler, or strict error handler on Windows.
1886
1887- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
1888 ``gzip.decompress``. Original patch by Anand B. Pillai.
1889
1890- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
1891 ssl.SSLContext object allowing bundling SSL configuration options,
1892 certificates and private keys into a single (potentially long-lived)
1893 structure.
1894
1895- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
1896 single keyword arguments.
1897
1898- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
1899 compiler flag values over defining its own.
1900
1901- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
1902 formatted code information in a string rather than displaying on screen.
1903
1904- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
1905 pointing to the original callable.
1906
1907- Issue #3445: functools.update_wrapper now tolerates missing attributes on
1908 wrapped callables.
1909
1910- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
1911
1912- Issue #9605: posix.getlogin() decodes the username with file filesystem
1913 encoding and surrogateescape error handler. Patch written by David Watson.
1914
1915- Issue #9604: posix.initgroups() encodes the username using the fileystem
1916 encoding and surrogateescape error handler. Patch written by David Watson.
1917
1918- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
1919 using the filesystem encoding and surrogateescape error handler. Patch written
1920 by David Watson.
1921
1922- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
1923 for use with the statvfs() function. Patch by Adam Jackson.
1924
1925- Issue #8688: MANIFEST files created by distutils now include a magic comment
1926 indicating they are generated. Manually maintained MANIFESTs without this
1927 marker will not be overwritten or removed.
1928
1929- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
1930 BadZipfile error is raised if it doesn't match (as used to be the case in
1931 Python 2.5 and earlier).
1932
1933- Issue #9550: a BufferedReader could issue an additional read when the original
1934 read request had been satisfied, which could block indefinitely when the
1935 underlying raw IO channel was e.g. a socket. Report and original patch by
1936 Jason V. Miller.
1937
1938- Issue #3757: thread-local objects now support cyclic garbage collection.
1939 Thread-local objects involved in reference cycles will be deallocated timely
1940 by the cyclic GC, even if the underlying thread is still running.
1941
1942- Issue #9452: Add read_file, read_string, and read_dict to the configparser
1943 API; new source attribute to exceptions.
1944
1945- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
1946 node.
1947
1948- Issue #8047: Fix the xml.etree serializer to return bytes by default. Use
1949 ``encoding="unicode"`` to generate a Unicode string.
1950
1951- Issue #8280: urllib2's Request method will remove fragments in the url. This
1952 is how it is supposed to work, wget and curl do the same. Previous behavior
1953 was wrong.
1954
1955- Issue #6683: For SMTP logins we now try all authentication methods advertised
1956 by the server. Many servers are buggy and advertise authentication methods
1957 they do not support in reality.
1958
1959- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
1960 included in the set of attributes copied by default by functools.wraps and
1961 functools.update_wrapper. Patch by Terrence Cole.
1962
1963- Issue #2944: asyncore doesn't handle connection refused correctly.
1964
1965- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
1966 the private attributes. Add tests for smtpd module.
1967
1968- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
1969 encoded in base64 is lacking padding.
1970
1971- Issue #9444: Argparse now uses the first element of prefix_chars as the option
1972 character for the added 'h/help' option if prefix_chars does not contain a
1973 '-', instead of raising an error.
1974
1975- Issue #7372: Fix pstats regression when stripping paths from profile data
1976 generated with the profile module.
1977
1978- Issue #9428: Fix running scripts with the profile/cProfile modules from the
1979 command line.
1980
1981- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
1982 browser.
1983
1984- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
1985 expressions.
1986
1987- Update collections.OrderedDict to match the implementation in Py2.7 (based on
1988 lists instead of weakly referenced Link objects).
1989
1990- Issue #8397: Raise an error when attempting to mix iteration and regular reads
1991 on a BZ2File object, rather than returning incorrect results.
1992
1993- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
1994 re-initializing a buffered IO object by calling its ``__init__`` method.
1995
1996- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
1997 across devices.
1998
1999- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
2000
2001- Issue #1690103: Fix initial namespace for code run with trace.main().
2002
2003- Issue #7395: Fix tracebacks in pstats interactive browser.
2004
2005- Issue #8230: Fix Lib/test/sortperf.py.
2006
2007- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
2008 newline, it no longer truncates the last character of the last command line.
2009
2010- Issue #5146: Handle UID THREAD command correctly in imaplib.
2011
2012- Issue #5147: Fix the header generated for cookie files written by
2013 http.cookiejar.MozillaCookieJar.
2014
2015- Issue #8198: In pydoc, output all help text to the correct stream when
2016 sys.stdout is reassigned.
2017
2018- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
2019 in ntpath.normpath().
2020
2021- Issue #1286: Allow using fileinput.FileInput as a context manager.
2022
2023- Add lru_cache() decorator to the functools module.
2024
2025Tools/Demos
2026-----------
2027
2028- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
2029
2030- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
2031 non-ASCII content.
2032
2033Tests
2034-----
2035
2036- Issue #9601: Provide a test case for ftplib.parse257.
2037
2038- Issue #8857: Provide a test case for socket.getaddrinfo.
2039
2040- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
2041
2042- Issue #8433: Fix test_curses failure with newer versions of ncurses.
2043
2044- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
2045 Michele Orrù.
2046
2047- Issue #8687: provide a test suite for sched.py module.
2048
2049Build
2050-----
2051
2052- Issue #1303434: Generate ZIP file containing all PDBs.
2053
2054- Issue #9193: PEP 3149 is accepted.
2055
2056- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
2057 become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
2058
2059- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
2060 Sébastien Sablé.
2061
2062- Don't run pgen twice when using make -j.
2063
2064
2065What's New in Python 3.2 Alpha 1?
2066=================================
2067
2068*Release date: 01-Aug-2010*
2069
2070Core and Builtins
2071-----------------
2072
2073- Issue #8991: convertbuffer() rejects discontigious buffers.
2074
2075- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
2076 compiler.
2077
2078- Issue #8413: structsequence now subclasses tuple.
2079
2080- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
2081 start byte and the continuation byte(s) are now considered invalid, instead of
2082 the number of bytes specified by the start byte. E.g.:
2083 '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
2084 with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
2085 even if '\xf1' is the start byte of a 4-bytes sequence. Previous versions
2086 returned a single u'\ufffd'.
2087
2088- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
2089 rather than 0.0. So "-7j" is now exactly equivalent to "-(7j)".
2090
2091- Be more specific in error messages about positional arguments.
2092
2093- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
2094 objects, as described in the documentation.
2095
2096- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
2097 Fix the encoding of the modules filename. Patch written by Amaury Forgeot
2098 d'Arc.
2099
2100- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
2101 dealing with unary minus applied to a constant. The removed code was mutating
2102 the ST, causing a second compilation to fail.
2103
2104- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
2105 mode raises unicode errors. The encoder only supports "strict" and "replace"
2106 error handlers, the decoder only supports "strict" and "ignore" error
2107 handlers. Patch written by Mark Hammond.
2108
2109- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
2110 "w*" format instead. Add tests for "w*" format.
2111
2112- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
2113 formats if the string contains a null byte/character. Write unit tests for
2114 string formats.
2115
2116- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
2117 suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
2118 location of the raised exception.
2119
2120- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
2121 filenames and enable os.fsencode().
2122
2123- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
2124
2125- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
2126 interpreter with characters outside the Basic Multilingual Plane (higher than
2127 0x10000).
2128
2129- Issue #8950: (See also issue #5080). Py_ArgParse*() functions now raise
2130 TypeError instead of giving a DeprecationWarning when a float is parsed using
2131 the 'L' code (for long long). (All other integer codes already raise
2132 TypeError in this case.)
2133
2134- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
2135 enable shortcuts for upper case encoding name. Add also a shortcut for
2136 "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
2137
2138- Issue #8838: Remove codecs.charbuffer_encode() function. The buffer protocol
2139 doesn't support "char buffer" anymore in Python 3.
2140
2141- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
2142 instead. codecs.charbuffer_encode() now accepts modifiable buffer objects
2143 like bytearray.
2144
2145- Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is no
2146 used anymore and it was never documented.
2147
2148- In str.format(), raise a ValueError when indexes to arguments are too large.
2149
2150- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
2151 integers n (including n = -909).
2152
2153- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
2154 of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
2155 easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
2156 equal value.
2157
2158- Issue #8748: Fix two issues with comparisons between complex and integer
2159 objects. (1) The comparison could incorrectly return True in some cases
2160 (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
2161 (2) The comparison raised an OverflowError for large integers, leading to
2162 unpredictable exceptions when combining integers and complex objects in sets
2163 or dicts.
2164
2165- Issue #8766: Initialize _warnings module before importing the first module.
2166 Fix a crash if an empty directory called "encodings" exists in sys.path.
2167
2168- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
2169 encoding and surrogateescape error handler instead of the locale encoding to
2170 be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
2171
2172- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
2173 of strict) error handler to escape surrogates.
2174
2175- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
2176 object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
2177 handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall
2178 back to UTF-8.
2179
2180- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
2181 error handler, not only the default error handler (strict).
2182
2183- Issue #8610: Load file system codec at startup, and display a fatal error on
2184 failure. Set the file system encoding to utf-8 (instead of None) if getting
2185 the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
2186
2187- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
2188 PyUnicode_FromString() to support surrogates in the filename and use the right
2189 encoding.
2190
2191- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
2192
2193- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
2194
2195- Issue #8419: Prevent the dict constructor from accepting non-string keyword
2196 arguments.
2197
2198- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
2199 indirectly Python signal handlers anymore because mywrite() ignores exceptions
2200 (KeyboardInterrupt).
2201
2202- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
2203 unicode string (eg. backslashreplace).
2204
2205- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
2206 anymore, you have to convert your bytearray filenames to bytes.
2207
2208- Issue #7332: Remove the 16KB stack-based buffer in
2209 PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
2210 compared to the dynamic memory allocation fallback. Patch by Charles-François
2211 Natali.
2212
2213- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
2214 passed to bytes or bytearray.
2215
2216- Issue #7301: Add environment variable $PYTHONWARNINGS.
2217
2218- Issue #8329: Don't return the same lists from select.select when no fds are
2219 changed.
2220
2221- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
2222 64-bit machines. The shift count for either left or right shift is permitted
2223 to be up to sys.maxsize.
2224
2225- Ensure that tokenization of identifiers is not affected by locale.
2226
2227- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
2228
2229- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
2230
2231- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
2232 is set.
2233
2234- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
2235 is unknown.
2236
2237- Issue #1583863: A str subclass can now override the __str__ method.
2238
2239- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
2240 PyMemberDefs could produce an internal error; raise TypeError instead.
2241
2242- Issue #7845: Rich comparison methods on the complex type now return
2243 NotImplemented rather than raising a TypeError when comparing with an
2244 incompatible type; this allows user-defined classes to implement their own
2245 comparisons with complex.
2246
2247- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
2248 (SIGINT). If an error occurs while importing the site module, the error is
2249 printed and Python exits. Initialize the GIL before importing the site module.
2250
2251- Issue #7173: Generator finalization could invalidate sys.exc_info().
2252
2253- Issue #7544: Preallocate thread memory before creating the thread to avoid a
2254 fatal error in low memory condition.
2255
2256- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
2257 check fails.
2258
2259- Handle errors from looking up __prepare__ correctly.
2260
2261- Issue #5939: Add additional runtime checking to ensure a valid capsule in
2262 Modules/_ctypes/callproc.c.
2263
2264- Issue #7309: Fix unchecked attribute access when converting
2265 UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
2266
2267- Issue #6902: Fix problem with built-in types format incorrectly with 0
2268 padding.
2269
2270- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
2271 Now it matches other numeric types.
2272
2273- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
2274 PyOS_ascii_strtod, and PyOS_ascii_atof. Use PyOS_double_to_string and
2275 PyOS_string_to_double instead. See issue #5835 for the original deprecations.
2276
2277- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
2278 fails. Patch by Florent Xicluna.
2279
2280- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
2281 very large step value.
2282
2283- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
2284 add the additional members returned in an OSVERSIONINFOEX structure. The new
2285 members are service_pack_major, service_pack_minor, suite_mask, and
2286 product_type.
2287
2288- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
2289 crash in many places because of the PyByteArray_AS_STRING() macro returning
2290 NULL. The macro now returns a statically allocated empty string instead.
2291
2292- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
2293 where the right hand operand is a set of constants, by turning the set into a
2294 frozenset and pre-building it as a constant. The comparison operation is made
2295 against the constant instead of building a new set each time it is executed (a
2296 similar optimization already existed which turned a list of constants into a
2297 pre-built tuple). Patch and additional tests by Dave Malcolm.
2298
2299- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
2300 of bytes, bytearray and unicode objects by using a common implementation based
2301 on stringlib's fast search. Patch by Florent Xicluna.
2302
2303- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
2304 including: (1) a serious 'wrong output' bug that could occur for long (> 40
2305 digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
2306 parsing certain long numeric strings corresponding to subnormal values, (3) a
2307 memory leak for some values large enough to cause overflow, and (4) a number
2308 of flaws that could lead to incorrectly rounded results.
2309
2310- The __complex__ method is now looked up on the class of instances to make it
2311 consistent with other special methods.
2312
2313- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
2314 `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
2315
2316- Issue #7604: Deleting an unset slotted attribute did not raise an
2317 AttributeError.
2318
2319- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
2320 in ** operator. The behaviour now conforms to that described in C99 Annex F.
2321
2322- Issue #1811: improve accuracy and cross-platform consistency for true division
2323 of integers: the result of a/b is now correctly rounded for ints a and b (at
2324 least on IEEE 754 platforms), and in particular does not depend on the
2325 internal representation of an int.
2326
2327- Issue #6834: replace the implementation for the 'python' and 'pythonw'
2328 executables on OSX.
2329
2330 These executables now work properly with the arch(1) command: ``arch -ppc
2331 python`` will start a universal binary version of python in PPC mode (unlike
2332 previous releases).
2333
2334- Issue #7466: Segmentation fault when the garbage collector is called in the
2335 middle of populating a tuple. Patch by Florent Xicluna.
2336
2337- Issue #7419: setlocale() could crash the interpreter on Windows when called
2338 with invalid values.
2339
2340- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
2341 mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
2342
2343- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
2344 10.6.
2345
2346- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
2347
2348- Issue #6970: Remove redundant calls when comparing objects that don't
2349 implement the relevant rich comparison methods.
2350
2351- Issue #7298: Fixes for range and reversed(range(...)). Iteration over
2352 range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
2353 long but the length of the range did not. Also fix several cases where
2354 reversed(range(a, b, c)) gave wrong results, and fix a refleak for
2355 reversed(range(a, b, c)) with large arguments.
2356
2357- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
2358 during the formation of an output tuple.
2359
2360- Issue #3297: On wide unicode builds, do not split unicode characters into
2361 surrogates.
2362
2363- Remove length limitation when constructing a complex number from a string.
2364
2365- Issue #1087418: Boost performance of bitwise operations for longs.
2366
2367- Support for AtheOS has been completely removed from the code base. It was
2368 disabled since Python 3.0.
2369
2370- Support for several legacy threading libraries has been disabled. These
2371 libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
2372 will be entirely removed in 3.3.
2373
2374- Support for OSF* has been disabled. If nobody stands up, support will be
2375 removed in 3.3. See <http://bugs.python.org/issue8606>.
2376
2377- Peephole constant folding had missed UNARY_POSITIVE.
2378
2379- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
2380 fixes the problem of some exceptions being thrown at shutdown when the
2381 interpreter is killed. Patch by Adam Olsen.
2382
2383- Issue #7147: Remove support for compiling Python without complex number
2384 support.
2385
2386- Issue #7120: logging: Removed import of multiprocessing which is causing crash
2387 in GAE.
2388
2389- Issue #1754094: Improve the stack depth calculation in the compiler. There
2390 should be no other effect than a small decrease in memory use. Patch by
2391 Christopher Tur Lesniewski-Laas.
2392
2393- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
2394 byte values greater than 127. Patch by Derk Drukker.
2395
2396- Issue #1571184: The Unicode database contains properties for more characters.
2397 The tables for code points representing numeric values, white spaces or line
2398 breaks are now generated from the official Unicode Character Database files,
2399 and include information from the Unihan.txt file.
2400
2401- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
2402 producing internally inconsistent Python longs.
2403
2404- Issue #6990: Fix threading.local subclasses leaving old state around after a
2405 reference cycle GC which could be recycled by new locals.
2406
2407- Issue #5460: Fix an ambiguity in the grammar.
2408
2409- Issue #1766304: Improve performance of membership tests on range objects.
2410
2411- Issue #6713: Improve performance of integer -> string conversions.
2412
2413- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
2414
2415- Issue #6750: A text file opened with io.open() could duplicate its output when
2416 writing from multiple threads at the same time.
2417
2418- Issue #6707: dir() on an uninitialized module caused a crash.
2419
2420- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
2421
2422- Issue #6573: set.union() stopped processing inputs if an instance of self
2423 occurred in the argument chain.
2424
2425- Issue #6070: On posix platforms import no longer copies the execute bit from
2426 the .py file to the .pyc file if it is set.
2427
2428- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
2429
2430- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
2431 and not an int. Fix the corresponding error message, and the documentation.
2432
2433- The deprecated PyCObject has been removed.
2434
2435- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a
2436 build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
2437 of stdint.h on that platform.
2438
2439- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
2440 'surrogateescape' error handler, a string which contains unpaired surrogates.
2441
2442- Issue #4856: Remove checks for win NT.
2443
2444- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
2445 to construct a null-initialized bytes object.
2446
2447- Issue #1023290: Add from_bytes() and to_bytes() methods to integers. These
2448 methods allow the conversion of integers to bytes, and vice-versa.
2449
2450- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
2451 from being copied with copy.copy(), and bytes subclasses from being pickled
2452 properly.
2453
2454- Code objects now support weak references.
2455
2456- Issue #7072: isspace(0xa0) is true on Mac OS X.
2457
2458- Issue #8084: PEP 370 now conforms to system conventions for framework builds
2459 on MacOS X. That is, "python setup.py install --user" will install into
2460 "~/Library/Python/2.7" instead of "~/.local".
2461
2462C-API
2463-----
2464
2465- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
2466 variable argument list. `Py_VA_COPY` is equivalent to C99
2467 `va_copy`, but available on all python platforms.
2468
2469- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
2470 instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX]. This makes it safe to do
2471 "step = -step" when reversing a slice.
2472
2473- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
2474 interpreter to set sys.argv without also modifying sys.path. This helps fix
2475 `CVE-2008-5983
2476 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
2477
2478- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
2479 strings in an efficient manner.
2480
2481- Issue #8276: PyEval_CallObject() is now only available in macro form. The
2482 function declaration, which was kept for backwards compatibility reasons, is
2483 now removed (the macro was introduced in 1997!).
2484
2485- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
2486 PyLong_AsLongAndOverflow.
2487
2488- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
2489 has '\0' at the end.
2490
2491- Issue #5080: The argument parsing functions PyArg_ParseTuple,
2492 PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
2493 PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
2494 'L' format code. This will become a TypeError in a future version of Python,
2495 to match the behaviour of the other integer format codes.
2496
2497- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
2498
2499- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
2500 PyArg_ParseTupleAndKeywords.
2501
2502- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
2503 PyErr_Format, on machines with HAVE_LONG_LONG defined.
2504
2505- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
2506 PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be should used for
2507 accessing the d_type and d_name members of structures using PyDescr_COMMON.
2508
2509- Issue #6405: Remove duplicate type declarations in descrobject.h.
2510
2511- The code flags for old __future__ features are now available again.
2512
2513- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
2514 PyCode_Addr2Line().
2515
2516- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
2517 object at a specified file, function, and line number.
2518
2519- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
2520 ``const char *`` as the string is stored beyond the call.
2521
2522- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
2523 allocator will be automatically disabled when running under Valgrind. This
2524 gives improved memory leak detection when running under Valgrind, while taking
2525 advantage of pymalloc at other times.
2526
2527Library
2528-------
2529
2530- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
2531 old commands are restored.
2532
2533- For traceback debugging, the pdb listing now also shows the locations where
2534 the exception was originally (re)raised, if it differs from the last line
2535 executed (e.g. in case of finally clauses).
2536
2537- The pdb command "source" has been added. It displays the source code for a
2538 given object, if possible.
2539
2540- The pdb command "longlist" has been added. It displays the whole source code
2541 for the current function.
2542
2543- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
2544 output into methods.
2545
2546- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
2547 emit a message when a breakpoint is enabled or disabled.
2548
2549- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
2550 top-level debugged frame.
2551
2552- Issue #5727: Restore the ability to use readline when calling into pdb in
2553 doctests.
2554
2555- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
2556 source file to be debugged is in a non-builtin encoding.
2557
2558- Issue #8048: Prevent doctests from failing when sys.displayhook has been
2559 reassigned.
2560
2561- Issue #8015: In pdb, do not crash when an empty line is entered as a
2562 breakpoint command.
2563
2564- In pdb, allow giving a line number to the "until" command.
2565
2566- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
2567 files. Also, add a command-line option "-c" that runs a command as if given
2568 in .pdbrc.
2569
2570- Issue #4179: In pdb, allow "list ." as a command to return to the currently
2571 debugged line.
2572
2573- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
2574 entries, consider the first one.
2575
2576- Issue #6630: Allow customizing regex flags when subclassing the
2577 string.Template class.
2578
2579- Issue #9411: Allow specifying an encoding for config files in the configparser
2580 module.
2581
2582- Issue #1682942: Improvements to configparser: support alternate delimiters,
2583 alternate comment prefixes and empty lines in values.
2584
2585- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
2586
2587- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
2588
2589- Issue #9378: python -m pickle <pickle file> will now load and display the
2590 first object in the pickle file.
2591
2592- Issue #4770: Restrict binascii module to accept only bytes (as specified).
2593 And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
2594 before ASCII-to-binary decoding.
2595
2596- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
2597
2598- The default size of the re module's compiled regular expression cache has been
2599 increased from 100 to 500 and the cache replacement policy has changed from
2600 simply clearing the entire cache on overflow to forgetting the least recently
2601 used cached compiled regular expressions. This is a performance win for
2602 applications that use a lot of regular expressions and limits the impact of
2603 the performance hit anytime the cache is exceeded.
2604
2605- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
2606
2607- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
2608 error occurs when the server closes the socket and the client sends a big
2609 XML-RPC request.
2610
2611- Issue #4629: getopt raises an error if an argument ends with "=", whereas
2612 getopt doesn't accept a value (eg. --help= is rejected if getopt uses
2613 ['help='] long options).
2614
2615- Issue #7989: Added pure python implementation of the `datetime` module. The C
2616 module is renamed to `_datetime` and if available, overrides all classes
2617 defined in datetime with fast C impementation. Python implementation is based
2618 on the original python prototype for the datetime module by Tim Peters with
2619 minor modifications by the PyPy project. The test suite now tests `datetime`
2620 module with and without `_datetime` acceleration using the same test cases.
2621
2622- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
2623
2624- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the
2625 script being traced. Patch by Eli Bendersky.
2626
2627- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for
2628 the patch.
2629
2630- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
2631 parameters.
2632
2633- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
2634 which controls printing of opcode descriptions in ``dis()`` output.
2635
2636- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
2637 crosses an 8192 byte boundary.
2638
2639- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
2640
2641- ``ast.literal_eval()`` now allows byte literals.
2642
2643- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
2644 keyword arguments called 'self' or 'other' specially.
2645
2646- ``ast.literal_eval()`` now allows set literals.
2647
2648- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
2649
2650- Issue #7646: The fnmatch pattern cache no longer grows without bound.
2651
2652- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
2653 produced when profiling the decimal module. This was due to a dangerous
2654 iteration over 'locals()' in Context.__init__.
2655
2656- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
2657 and the exponent is tiny (for example, ``Decimal(10) **
2658 Decimal('1e-999999999')``).
2659
2660- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
2661
2662- Issue #9130: Fix validation of relative imports in parser module.
2663
2664- Issue #9128: Fix validation of class decorators in parser module.
2665
2666- Issue #9094: python -m pickletools will now disassemble pickle files listed in
2667 the command line arguments. See output of python -m pickletools -h for more
2668 details.
2669
2670- Issue #5468: urlencode to handle bytes type and other encodings in its query
2671 parameter. Patch by Dan Mahn.
2672
2673- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
2674 ensure that the input string length is a multiple of the frame size.
2675
2676- Issue #6507: Accept source strings in dis.dis(). Original patch by Daniel
2677 Urban.
2678
2679- Issue #7829: Clearly document that the dis module is exposing an
2680 implementation detail that is not stable between Python VMs or releases.
2681
2682- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
2683 raises an exception.
2684
2685- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
2686 that act as both context managers and decorators. contextmanager changes to
2687 use ContextDecorator.
2688
2689- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
2690 for removal in Python 3.4.
2691
2692- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
2693 giving the number of frames to go.
2694
2695- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
2696 ``str`` or ``bytes``.
2697
2698- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
2699 OpenSSL structure.
2700
2701- Issue #8682: The ssl module now temporary increments the reference count of a
2702 socket object got through ``PyWeakref_GetObject``, so as to avoid possible
2703 deallocation while the object is still being used.
2704
2705- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
2706 password instead of presenting an interactive prompt. Older behavior can be
2707 obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
2708
2709- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
2710 smart enough to find source files in the linecache.
2711
2712- Issue #5610: feedparser no longer eats extra characters at the end of a body
2713 part if the body part ends with a ``\r\n``.
2714
2715- Issue #8986: math.erfc was incorrectly raising OverflowError for values
2716 between -27.3 and -30.0 on some platforms.
2717
2718- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
2719
2720- Issue #8966: If a ctypes structure field is an array of c_char, convert its
2721 value to bytes instead of str (as done for c_char and c_char_p).
2722
2723- Issue #8188: Comparisons between Decimal and Fraction objects are now
2724 permitted, returning a result based on the exact numerical values of the
2725 operands. This builds on issue #2531, which allowed Decimal-to-float
2726 comparisons; all comparisons involving numeric types (bool, int, float,
2727 complex, Decimal, Fraction) should now act as expected.
2728
2729- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
2730 Thomas Jollans.
2731
2732- Issue #8899: time.struct_time now has class and attribute docstrings.
2733
2734- Issue #6470: Drop UNC prefix in FixTk.
2735
2736- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
2737 strings. They are now correctly converted to strings.
2738
2739- Issue #8833: tarfile created hard link entries with a size field != 0 by
2740 mistake.
2741
2742- Charset.body_encode now correctly handles base64 encoding by encoding with the
2743 output_charset before calling base64mime.encode. Passes the tests from 2.x
2744 issue #1368247.
2745
2746- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
2747 attribute that is True iff there are uncommitted changes.
2748
2749- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
2750 divided by float and int objects. Results are rounded to the nearest multiple
2751 of timedelta.resolution with ties resolved using round-half-to-even method.
2752
2753- Issue #7150: Raise OverflowError if the result of adding or subtracting
2754 timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
2755
2756- Issue #8806: add SSL contexts support to ftplib.
2757
2758- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
2759 and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
2760 API.
2761
2762- Issue #8770: Now sysconfig displays information when it's called as a script.
2763 Initial idea by Sridhar Ratnakumar.
2764
2765- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
2766 Fredrik Håård.
2767
2768- Issue #8540: Decimal module: rename the Context._clamp attribute to
2769 Context.clamp and make it public. This is useful in creating contexts that
2770 correspond to the decimal interchange formats specified in IEEE 754.
2771
2772- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
2773 twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
2774 StreamWriter classes.
2775
2776- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
2777 of the C file stderr, to use stderr encoding and error handler.
2778
2779- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
2780 of files without one.
2781
2782- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
2783 comparing to a non-mapping.
2784
2785- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
2786 correct encoding.
2787
2788- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
2789 ``OP_*`` constants to the `ssl` module. This allows to selectively disable
2790 protocol versions, when used in combination with `PROTOCOL_SSLv23`.
2791
2792- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
2793
2794- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
2795 compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
2796 stdout is not a TTY).
2797
2798- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
2799 subprocess.Popen() and os._execvpe() support bytes program name. Add
2800 os.supports_bytes_environ flag: True if the native OS type of the environment
2801 is bytes (eg. False on Windows).
2802
2803- Issue #8633: tarfile is now able to read and write archives with "raw" binary
2804 pax headers as described in POSIX.1-2008.
2805
2806- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
2807 unquote, unquote_to_bytes.
2808
2809- Issue #8688: Distutils now recalculates MANIFEST everytime.
2810
2811- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
2812 surrogates and bytes for the filename.
2813
2814- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
2815
2816- Issue #8681: Make the zlib module's error messages more informative when the
2817 zlib itself doesn't give any detailed explanation.
2818
2819- The audioop module now supports sound fragments of length greater than 2**31
2820 bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
2821
2822- Issue #4972: Add support for the context manager protocol to the ftplib.FTP
2823 class.
2824
2825- Issue #8664: In py_compile, create __pycache__ when the compiled path is
2826 given.
2827
2828- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
2829 for use in the file system, environment variables or the command line.
2830
2831- Issue #8571: Fix an internal error when compressing or decompressing a chunk
2832 larger than 1GB with the zlib module's compressor and decompressor objects.
2833
2834- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
2835 mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
2836 file system encoding with the surrogateescape error handler (instead of
2837 utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
2838
2839- Issue #8573: asyncore _strerror() function might throw ValueError.
2840
2841- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
2842 messages when accessing undefined class attributes because of the cheap
2843 inheritance with the underlying socket object. The cheap inheritance has been
2844 deprecated.
2845
2846- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
2847 Patch by Tres Seaver.
2848
2849- Issue #8390: tarfile uses surrogateescape as the default error handler
2850 (instead of replace in read mode or strict in write mode).
2851
2852- Issue #7755: Use an unencumbered audio file for tests.
2853
2854- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
2855 and any children created using ``os.fork`` on MacOS X 10.6.
2856
2857- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
2858 operation raises multiple signals and more than one of those signals is
2859 trapped, the specification determines the order in which the signals should be
2860 handled. In many cases this order wasn't being followed, leading to the wrong
2861 Python exception being raised.
2862
2863- Issue #7865: The close() method of ``io`` objects should not swallow
2864 exceptions raised by the implicit flush(). Also qensure that calling close()
2865 several times is supported. Patch by Pascal Chambon.
2866
2867- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
2868 gc.DEBUG_STATS.
2869
2870- Issue #8354: The siginterrupt setting is now preserved for all signals, not
2871 just SIGCHLD.
2872
2873- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
2874 webbrowser.get("safari").
2875
2876- Issue #8464: tarfile no longer creates files with execute permissions set when
2877 mode="w|" is used.
2878
2879- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
2880 the Linux kernel. Patch by Yaniv Aknin.
2881
2882- Issue #8295: Added shutil.unpack_archive.
2883
2884- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
2885 It should correctly return an empty response now.
2886
2887- Issue #8546: Reject None given as the buffering argument to _pyio.open.
2888
2889- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
2890 Sridhar Ratnakumar.
2891
2892- Issue #6656: fix locale.format_string to handle escaped percents
2893 and mappings.
2894
2895- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
2896 the method could block indefinitely if called just before the event loop
2897 started running. This also fixes the occasional freezes witnessed in
2898 test_httpservers.
2899
2900- Issue #8524: When creating an SSL socket, the timeout value of the original
2901 socket wasn't retained (instead, a socket with a positive timeout would be
2902 turned into a non-blocking SSL socket).
2903
2904- Issue #5103: SSL handshake would ignore the socket timeout and block
2905 indefinitely if the other end didn't respond.
2906
2907- The do_handshake() method of SSL objects now adjusts the blocking mode of the
2908 SSL structure if necessary (as other methods already do).
2909
2910- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
2911 bytes strings for environment keys and values.
2912
2913- Issue #8467: Pure Python implementation of subprocess encodes the error
2914 message using surrogatepass error handler to support surrogates in the
2915 message.
2916
2917- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
2918
2919- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
2920 string "python" as the *ident*. openlog() arguments are all optional and
2921 keywords.
2922
2923- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
2924 non-infinite timeout. Also make that method friendlier with applications
2925 wanting to continue using the socket in clear-text mode, by disabling
2926 OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
2927
2928- Issue #8496: make mailcap.lookup() always return a list, rather than an
2929 iterator. Patch by Gregory Nofi.
2930
2931- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
2932 collation name contains a surrogate character.
2933
2934- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
2935 extension, such that verification of some SSL certificates doesn't fail
2936 because of an "unknown algorithm".
2937
2938- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
2939
2940- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
2941
2942- Issue #4814: timeout parameter is now applied also for connections resulting
2943 from PORT/EPRT commands.
2944
2945- Issue #8463: added missing reference to bztar in shutil's documentation.
2946
2947- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
2948 long as the user didn't specify 'automatic proxy configuration').
2949
2950- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
2951 as stated in RFC-959 at chapter 5.4.
2952
2953- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
2954 surrogates.
2955
2956- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
2957 `threading.Semaphore` objects. Original patch by Torsten Landschoff.
2958
2959- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
2960 available cipher list. Helps fix test_ssl with OpenSSL 1.0.0.
2961
2962- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
2963 the current working directory.
2964
2965- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
2966 using backslashreplace error handler.
2967
2968- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
2969
2970- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
2971 Locke and Hans Ulrich Niedermann.
2972
2973- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
2974
2975- Issue #7316: The acquire() method of lock objects in the ``threading``
2976 module now takes an optional timeout argument in seconds. Timeout support
2977 relies on the system threading library, so as to avoid a semi-busy wait loop.
2978
2979- Issue #8383: pickle and pickletools use surrogatepass error handler when
2980 encoding unicode as utf8 to support lone surrogates and stay compatible with
2981 Python 2.x and 3.x.
2982
2983- Issue #7585: difflib context and unified diffs now place a tab between
2984 filename and date, conforming to the 'standards' they were originally designed
2985 to follow. This improves compatibility with patch tools.
2986
2987- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
2988 character sets will now consistently use a Content-Transfer-Encoding of 7bit
2989 rather than sometimes being marked as 8bit.
2990
2991- Issue #8375: test_distutils now checks if the temporary directory are still
2992 present before it cleans them.
2993
2994- Issue #8374: Update the internal alias table in the ``locale`` module to
2995 cover recent locale changes and additions.
2996
2997- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
2998 using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
2999 `ssl.OPENSSL_VERSION_NUMBER`.
3000
3001- Add functools.total_ordering() and functools.cmp_to_key().
3002
3003- Issue #8257: The Decimal construct now accepts a float instance directly,
3004 converting that float to a Decimal of equal value:
3005
3006 >>> Decimal(1.1)
3007 Decimal('1.100000000000000088817841970012523233890533447265625')
3008
3009- Issue #8294: The Fraction constructor now accepts Decimal and float instances
3010 directly.
3011
3012- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
3013 InvalidOperation instead of returning False. (Comparisons involving a quiet
3014 NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
3015 signaling NaNs remain unhashable.
3016
3017- Issue #2531: Comparison operations between floats and Decimal instances now
3018 return a result based on the numeric values of the operands; previously they
3019 returned an arbitrary result based on the relative ordering of id(float) and
3020 id(Decimal). See also issue #8188, which adds Decimal-to-Fraction
3021 comparisons.
3022
3023- Added a subtract() method to collections.Counter().
3024
3025- Issue #8233: When run as a script, py_compile.py optionally takes a single
3026 argument `-` which tells it to read files to compile from stdin. Each line is
3027 read on demand and the named file is compiled immediately. (Original patch by
3028 Piotr Ożarowski).
3029
3030- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
3031 form feed (0x0C) are now considered linebreaks, as specified in Unicode
3032 Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
3033
3034- Comparisons using one of <, <=, >, >= between a complex instance and a
3035 Fractions instance now raise TypeError instead of returning True/False. This
3036 makes Fraction <=> complex comparisons consistent with int <=> complex, float
3037 <=> complex, and complex <=> complex comparisons.
3038
3039- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
3040 methods (such as oss_mixer_device.fileno()) were not available. Initial patch
3041 by Bertrand Janin.
3042
3043- Issue #8205: Remove the "Modules" directory from sys.path when Python is
3044 running from the build directory (POSIX only).
3045
3046- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
3047 didn't support chflags() (for example ZFS under FreeBSD). The error is now
3048 silenced.
3049
3050- Issue #7860: platform.uname now reports the correct 'machine' type when Python
3051 is running in WOW64 mode on 64 bit Windows.
3052
3053- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
3054 Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
3055 reads and writes are always retried by OpenSSL itself.
3056
3057- Issue #4282: Fix the main function of the profile module for a non-ASCII
3058 script, open the file in binary mode and not in text mode with the default
3059 (utf8) encoding.
3060
3061- Issue #8179: Fix macpath.realpath() on a non-existing path.
3062
3063- Issue #8024: Update the Unicode database to 5.2.
3064
3065- Issue #8168: py_compile now handles files with utf-8 BOMS.
3066
3067- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
3068 detected.
3069
3070- Issue #6716/2: Backslash-replace error output in compilall.
3071
3072- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
3073 with Tcl/Tk-8.5.
3074
3075- Issue #8140: extend compileall to compile single files. Add -i option.
3076
3077- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
3078 locale.
3079
3080- The internals of the subprocess module on POSIX systems have been replaced by
3081 an extension module (_posixsubprocess) so that the fork()+exec() can be done
3082 safely without the possibility of deadlock in multithreaded applications.
3083
3084- subprocess.Popen now has restore_signals and start_new_session features. The
3085 default of restore_signals=True is a new behavior compared to earlier Python
3086 versions. This means that signals such as SIGPIPE are not ignored by default
3087 in subprocesses launched by Python (Issue #1652).
3088
3089- Issue #6472: The xml.etree package is updated to ElementTree 1.3. The
3090 cElementTree module is updated too.
3091
3092- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
3093 an non existent program name and Python is unable to retrieve the real program
3094 name.
3095
3096- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
3097
3098- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
3099 replacement were all bytes. Patch by Antoine Pitrou.
3100
3101- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
3102 bugs and allows loading SQLite extensions from shared libraries.
3103
3104- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
3105 Review Issue #29 (http://unicode.org/review/pr-29.html).
3106
3107- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
3108 reset also the pointer to the current pointer context.
3109
3110- Issue #7232: Add support for the context manager protocol to the TarFile
3111 class.
3112
3113- Issue #7250: Fix info leak of os.environ across multi-run uses of
3114 wsgiref.handlers.CGIHandler.
3115
3116- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
3117
3118- Issue #691291: codecs.open() should not convert end of lines on reading and
3119 writing.
3120
3121- Issue #7869: logging: improved diagnostic for format-time errors.
3122
3123- Issue #7868: logging: added loggerClass attribute to Manager.
3124
3125- logging: Implemented PEP 391.
3126
3127- Issue #1537721: Add a writeheader() method to csv.DictWriter.
3128
3129- Issue #7959: ctypes callback functions are now registered correctly with the
3130 cycle garbage collector.
3131
3132- Issue #5801: removed spurious empty lines in wsgiref.
3133
3134- Issue #6666: fix bug in trace.py that applied the list of directories to be
3135 ignored only to the first file. Noted by Bogdan Opanchuk.
3136
3137- Issue #7597: curses.use_env() can now be called before initscr(). Noted by
3138 Kan-Ru Chen.
3139
3140- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
3141
3142- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
3143 messages parsed by email.Parser.HeaderParser.
3144
3145- Issue #7361: Importlib was not properly checking the number of bytes in
3146 bytecode file when it was less then 8 bytes.
3147
3148- Issue #7633: In the decimal module, Context class methods (with the exception
3149 of canonical and is_canonical) now accept instances of int and long wherever a
3150 Decimal instance is accepted, and implicitly convert that argument to Decimal.
3151 Previously only some arguments were converted.
3152
3153- Issue #7835: shelve should no longer produce mysterious warnings during
3154 interpreter shutdown.
3155
3156- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
3157 processing instructions and comments. These raw characters are allowed by the
3158 XML specification, and are necessary when outputting e.g. PHP code in a
3159 processing instruction. Patch by Neil Muller.
3160
3161- Issue #6233: ElementTree failed converting unicode characters to XML entities
3162 when they could't be represented in the requested output encoding. Patch by
3163 Jerry Chen.
3164
3165- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
3166 compression type.
3167
3168- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
3169 specified, rather than fall through to AF_PACKET (in the `socket` module).
3170 Also, raise ValueError rather than TypeError when an unknown TIPC address type
3171 is specified. Patch by Brian Curtin.
3172
3173- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
3174 position when calling `truncate()`. It would previously change the file
3175 position to the given argument, which goes against the tradition of
3176 ftruncate() and other truncation APIs. Patch by Pascal Chambon.
3177
3178- Issue #7610: Reworked implementation of the internal
3179 ``zipfile.ZipExtFile`` class used to represent files stored inside an
3180 archive. The new implementation is significantly faster and can be wrapped in
3181 a ``io.BufferedReader`` object for more speedups. It also solves an
3182 issue where interleaved calls to `read()` and `readline()` give wrong results.
3183 Patch by Nir Aides.
3184
3185- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
3186 allowing for a maximum number of tasks within the pool to be completed by the
3187 worker before that worker is terminated, and a new one created to replace it.
3188
3189- Issue #7792: Registering non-classes to ABCs raised an obscure error.
3190
3191- Issue #7785: Don't accept bytes in FileIO.write().
3192
3193- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
3194
3195- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
3196 the release file is empty.
3197
3198- Issue #7561: Fix crashes when using bytearray objects with the posix
3199 module.
3200
3201- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
3202 multipart/signed MIME parts, which fixes one of the sources of invalid
3203 modifications to such parts by Generator.
3204
3205- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`. Patch
3206 by Florent Xicluna, along with some additional tests.
3207
3208- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
3209 argument. Patch by Victor Stinner.
3210
3211- Issue #3299: Fix possible crash in the _sre module when given bad argument
3212 values in debug mode. Patch by Victor Stinner.
3213
3214- Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch
3215 by Brian Curtin.
3216
3217- Issue #7681: Use floor division in appropiate places in the wave module.
3218
3219- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
3220 Extension extra options may change the output without changing the .c
3221 file). Initial patch by Collin Winter.
3222
3223- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
3224 when it has a fully qualified configuration prefix. Initial patch by Arfrever.
3225
3226- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
3227 destruction of weakref'ed objects while iterating.
3228
3229- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
3230 Stinner.
3231
3232- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
3233 properly handles EINTR within the read, readline, write & flush methods. The
3234 socket.sendall() method now properly handles interrupted system calls.
3235
3236- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
3237 make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
3238 wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
3239
3240- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
3241 parameter to allow specifying where your connections come from.
3242
3243- socket.create_connection now accepts an optional source_address parameter.
3244
3245- Issue #5511: now zipfile.ZipFile can be used as a context manager. Initial
3246 patch by Brian Curtin.
3247
3248- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
3249 Manifest file in text mode so string patterns can be used in regular
3250 expressions.
3251
3252- Issue #7552: Removed line feed in the base64 Authorization header in the
3253 Distutils upload command to avoid an error when PyPI reads it. This occurs on
3254 long passwords. Initial patch by JP St. Pierre.
3255
3256- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
3257 Tatsuhiro Tsujikawa.
3258
3259- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
3260 TypeError when given an `str` object (rather than a `bytes`-like object).
3261 Patch by Victor Stinner and Florent Xicluna.
3262
3263- Issue #7349: Make methods of file objects in the io module accept None as an
3264 argument where file-like objects (ie StringIO and BytesIO) accept them to mean
3265 the same as passing no argument.
3266
3267- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
3268
3269- Issue #5949: added check for correct lineends in input from IMAP server in
3270 imaplib.
3271
3272- Add count() and reverse() methods to collections.deque().
3273
3274- Fix variations of extending deques: d.extend(d) d.extendleft(d) d+=d
3275
3276- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
3277 parameter types. Patch by Victor Stinner.
3278
3279- Issue #7457: added a read_pkg_file method to
3280 distutils.dist.DistributionMetadata.
3281
3282- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
3283 TLS with authentication credentials.
3284
3285- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
3286 in Distutils. Patch by Stephen Emslie.
3287
3288- Issue #4120: Drop reference to CRT from manifest when building extensions with
3289 msvc9compiler.
3290
3291- Issue #7333: The `posix` module gains an `initgroups()` function providing
3292 access to the initgroups(3) C library call on Unix systems which implement it.
3293 Patch by Jean-Paul Calderone.
3294
3295- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
3296 ownership when the group is not forced, because the group may be different
3297 from the user's group and inherit from its container when the test is run.
3298
3299- Issue #4486: When an exception has an explicit cause, do not print its
3300 implicit context too. This affects the `traceback` module as well as built-in
3301 exception printing.
3302
3303- Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert
3304 Collins.
3305
3306- Issue #7403: logging: Fixed possible race condition in lock creation.
3307
3308- Issue #6845: Add restart support for binary upload in ftplib. The
3309 `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
3310 argument. Patch by Pablo Mouzo.
3311
3312- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
3313 returning the total number of seconds in the duration. Patch by Brian
3314 Quinlan.
3315
3316- Issue #7133: SSL objects now support the new buffer API.
3317
3318- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
3319
3320- Issue #6123: tarfile now opens empty archives correctly and consistently
3321 raises ReadError on empty files.
3322
3323- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
3324
3325- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
3326 of __str__.
3327
3328- Issue #7341: Close the internal file object in the TarFile constructor in case
3329 of an error.
3330
3331- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
3332 Windows box. Help provided by David Bolen.
3333
3334- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
3335 or SSL. Patch by Giampaolo Rodola'.
3336
3337- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
3338
3339- Issue #4969: The mimetypes module now reads the MIME database from the
3340 registry under Windows. Patch by Gabriel Genellina.
3341
3342- Issue #6816: runpy now provides a run_path function that allows Python code to
3343 execute file paths that refer to source or compiled Python files as well as
3344 zipfiles, directories and other valid sys.path entries that contain a
3345 __main__.py file. This allows applications that run other Python scripts to
3346 support the same flexibility as the CPython command line itself.
3347
3348- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
3349 connection with another process, rather than looping endlessly. The default
3350 timeout is 20 seconds, which should be amply sufficient for local connections.
3351
3352- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
3353 unpickled. This fixes crashes under Windows when trying to run
3354 test_multiprocessing in verbose mode.
3355
3356- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
3357 argument added to the TextTestRunner constructor allowing a different result
3358 class to be used without having to subclass.
3359
3360- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
3361 name in failure reports even if the test has a docstring.
3362
3363- Issue #3001: Add a C implementation of recursive locks which is used by
3364 default when instantiating a `threading.RLock` object. This makes recursive
3365 locks as fast as regular non-recursive locks (previously, they were slower by
3366 10x to 15x).
3367
3368- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
3369 those started through `threading.Thread` (for example, using
3370 `_thread.start_new_thread()`).
3371
3372- Issue #7187: Importlib would not silence the IOError raised when trying to
3373 write new bytecode when it was made read-only.
3374
3375- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
3376 which are part of a reference cycle.
3377
3378- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
3379 objects on 64-bit systems. Patch by Michael Broghton.
3380
3381- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
3382 modification is done through it. This fixes inconsistencies and test failures
3383 on systems with slightly bogus mtime behaviour.
3384
3385- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
3386 from stdin so that existing input does not confuse it and lead to incorrect
3387 entry or an IOError. It also properly flushes it afterwards to avoid the
3388 terminal echoing the input afterwards on OSes such as Solaris.
3389
3390- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
3391 they accept an int or long as the second argument. Also fix buggy handling of
3392 large arguments (those with coefficient longer than the current precision) in
3393 shift and rotate.
3394
3395- Issue #4750: Store the basename of the original filename in the gzip FNAME
3396 header as required by RFC 1952.
3397
3398- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
3399 Distutils.
3400
3401- Issue #7218: Fix test_site for win32, the directory comparison was done with
3402 an uppercase.
3403
3404- Issue #7205: Fix a possible deadlock when using a BZ2File object from
3405 several threads at once.
3406
3407- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
3408
3409- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
3410 larger than emax.
3411
3412- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
3413 platforms, and assorted locale fixes by Derk Drukker.
3414
3415- Issue #5833: Fix extra space character in readline completion with the GNU
3416 readline library version 6.0.
3417
3418- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
3419
3420- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
3421 anachronisms in the code which were a relic of 1.5.2 compatibility.
3422
3423- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
3424 to look for it is the Content-Type header.
3425
3426- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
3427 builtin tokenizer.
3428
3429- Issue #7048: Force Decimal.logb to round its result when that result is too
3430 large to fit in the current precision.
3431
3432- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
3433 other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
3434
3435- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
3436 always result in NULL.
3437
3438- Issue #5042: Structure sub-subclass does now initialize correctly with base
3439 class positional arguments.
3440
3441- Issue #6882: Import uuid creates zombies processes.
3442
3443- Issue #6635: Fix profiler printing usage message.
3444
3445- Issue #6856: Add a filter keyword argument to TarFile.add().
3446
3447- Issue #6888: pdb's alias command was broken when no arguments were given.
3448
3449- Issue #6857: Default format() alignment should be '>' for Decimal instances.
3450
3451- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
3452 NaN or raising InvalidContext. Also, fix infinite recursion in
3453 long(Decimal('nan')).
3454
3455- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
3456 type specifier.
3457
3458- Issue #6239: ctypes.c_char_p return value must return bytes.
3459
3460- Issue #6838: Use a list to accumulate the value instead of repeatedly
3461 concatenating strings in http.client's HTTPResponse._read_chunked providing a
3462 significant speed increase when downloading large files servend with a
3463 Transfer-Encoding of 'chunked'.
3464
3465- Trying to import a submodule from a module that is not a package, ImportError
3466 should be raised, not AttributeError.
3467
3468- When the globals past to importlib.__import__() has __package__ set to None,
3469 fall back to computing what __package__ should be instead of giving up.
3470
3471- Raise a TypeError when the name of a module to be imported for
3472 importlib.__import__ is not a string (was raising an AttributeError before).
3473
3474- Allow the fromlist passed into importlib.__import__ to be any iterable.
3475
3476- Have importlib raise ImportError if None is found in sys.modules.
3477
3478- Issue #6054: Do not normalize stored pathnames in tarfile.
3479
3480- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
3481 payloads are now ordered by integer value rather than lexicographically.
3482
3483- Issue #1356969: Add missing info methods in tix.HList.
3484
3485- Issue #1522587: New constants and methods for the tix.Grid widget.
3486
3487- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
3488
3489- Issue #1119673: Do not override tkinter.Text methods when creating a
3490 ScrolledText.
3491
3492- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
3493
3494- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
3495 and yview* methods.
3496
3497- Issue #6629: Fix a data corruption issue in the new I/O library, which could
3498 occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
3499 "wb+" mode) after having buffered a certain amount of data for reading. This
3500 bug was not present in the pure Python implementation.
3501
3502- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
3503 POP3.apop.
3504
3505- Issue #2715: Remove remnants of Carbon.File from binhex module.
3506
3507- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
3508 digits in input, as recommended by the standard. Previously it was restricted
3509 to accepting [0-9].
3510
3511- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
3512 DO/DONT correctly.
3513
3514- Issue #1424152: Fix for http.client, urllib.request to support SSL while
3515 working through proxy. Original patch by Christopher Li, changes made by
3516 Senthil Kumaran.
3517
3518- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
3519 loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
3520 PyPycLoader inherit from this class and provide implementations in relation to
3521 other methods required by the ABCs.
3522
3523- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
3524 the documentation said it did even though the code in PyLoader relied on the
3525 abstract method required by ResourceLoader.
3526
3527- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
3528 to handle a comparison without loss of precision. Also add correct handling
3529 of infinities and nans for comparisons with float.
3530
3531- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
3532
3533- Issue #6358: The exit status of a command started with os.popen() was reported
3534 differently than it did with python 2.x.
3535
3536- Issue #6323: The pdb debugger did not exit when running a script with a syntax
3537 error.
3538
3539- Issue #3392: The subprocess communicate() method no longer fails in select()
3540 when file descriptors are large; communicate() now uses poll() when possible.
3541
3542- Issue #6369: Fix an RLE decompression bug in the binhex module.
3543
3544- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
3545
3546- The deprecated function string.maketrans has been removed.
3547
3548- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
3549 sys.path.
3550
3551- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
3552
3553- The os.get_exec_path() function to return the list of directories that will be
3554 searched for an executable when launching a subprocess was added.
3555
3556- Issue #7481: When a threading.Thread failed to start it would leave the
3557 instance stuck in initial state and present in threading.enumerate().
3558
3559- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
3560 and os.read system calls where appropriate.
3561
3562- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
3563
3564- Issue #6247: The argparse module has been added to the standard library.
3565
3566- Issue #8235: _socket: Add the constant ``SO_SETFIB``. SO_SETFIB is a socket
3567 option available on FreeBSD 7.1 and newer.
3568
3569- Issue #9315: Fix for the trace module to record correct class name
3570 for tracing methods.
3571
3572Extension Modules
3573-----------------
3574
3575- Issue #9959: Tweak formula used for computing math.log of an integer,
3576 making it marginally more accurate for exact powers of 2.
3577
3578- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
3579
3580- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
3581 compared to other unix systems. In particular, os.getgroups() does not reflect
3582 any changes made using os.setgroups() but basicly always returns the same
3583 information as the id command. os.getgroups() can now return more than 16
3584 groups on MacOSX.
3585
3586- Issue #6095: Make directory argument to os.listdir optional.
3587
3588- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
3589 struct.pack('>?')): if conversion to bool raised an exception then that
3590 exception wasn't properly propagated on machines where char is unsigned.
3591
3592- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
3593 they contain instances of old-style classes.
3594
3595- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
3596 existing isinf and isnan functions.
3597
3598- Issue #1578269: Implement os.symlink for Windows 6.0+. Patch by Jason
3599 R. Coombs.
3600
3601- In struct.pack, correctly propogate exceptions from computing the truth of an
3602 object in the '?' format.
3603
3604- Issue #9000: datetime.timezone objects now have eval-friendly repr.
3605
3606- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
3607 special methods.
3608
3609- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
3610 Prior to this change, timezone adjustment in utctimetuple() could produce
3611 tm_year value of 0 or 10,000. Now an OverflowError is raised in these edge
3612 cases.
3613
3614- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
3615 directive. When the ``%z`` directive is present in the format string, an
3616 aware ``datetime`` object is returned with ``tzinfo`` bound to a
3617 ``datetime.timezone`` instance constructed from the parsed offset. If both
3618 ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
3619 name, but ``%Z`` data without ``%z`` is discarded.
3620
3621- Issue #5094: The ``datetime`` module now has a simple concrete class
3622 implementing ``datetime.tzinfo`` interface. Instances of the new class,
3623 ``datetime.timezone``, return fixed name and UTC offset from their
3624 ``tzname(dt)`` and ``utcoffset(dt)`` methods. The ``dst(dt)`` method always
3625 returns ``None``. A class attribute, ``utc`` contains an instance
3626 representing the UTC timezone. Original patch by Rafe Kaplan.
3627
3628- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
3629 includes documentation for the struct.Struct class.
3630
3631- Issue #3129: Trailing digits in struct format string are no longer ignored.
3632 For example, "1" or "ilib123" are now invalid formats and cause
3633 ``struct.error`` to be raised. Patch by Caleb Deveraux.
3634
3635- Issue #7384: If the system readline library is linked against ncurses, the
3636 curses module must be linked against ncurses as well. Otherwise it is not safe
3637 to load both the readline and curses modules in an application.
3638
3639- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
3640 requiring a re-try in order to get the complete result.
3641
3642- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
3643 with an improved 'binary-split' algorithm that uses fewer multiplications and
3644 allows many of the multiplications to be performed using plain C integer
3645 arithmetic instead of PyLong arithmetic. Also uses a lookup table for small
3646 arguments.
3647
3648- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
3649 overflow checks in the audioop module.
3650
3651- Issue #8644: The accuracy of td.total_seconds() has been improved (by
3652 calculating with integer arithmetic instead of float arithmetic internally):
3653 the result is now always correctly rounded, and is equivalent to ``td /
3654 timedelta(seconds=1)``.
3655
3656- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
3657 timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
3658 timedelta) are all supported.
3659
3660- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
3661
3662- Issue #8300: When passing a non-integer argument to struct.pack with any
3663 integer format code, struct.pack first attempts to convert the non-integer
3664 using its __index__ method. If that method is non-existent or raises
3665 TypeError it goes on to try the __int__ method, as described below.
3666
3667- Issue #8142: Update libffi to the 3.0.9 release.
3668
3669- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
3670
3671- Issue #6544: Fix a reference leak in the kqueue implementation's error
3672 handling.
3673
3674- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
3675 msvcr100.dll is not a platform assembly anymore.
3676
3677- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
3678
3679- Issue #7078: Set struct.__doc__ from _struct.__doc__.
3680
3681- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
3682
3683- Issue #6877: It is now possible to link the readline extension to the libedit
3684 readline emulation on OSX 10.5 or later.
3685
3686- Issue #6848: Fix curses module build failure on OS X 10.6.
3687
3688- Fix a segfault that could be triggered by expat with specially formed input.
3689
3690- Issue #6561: '\d' in a regex now matches only characters with Unicode category
3691 'Nd' (Number, Decimal Digit). Previously it also matched characters with
3692 category 'No'.
3693
3694- Issue #4509: Array objects are no longer modified after an operation failing
3695 due to the resize restriction in-place when the object has exported buffers.
3696
3697- Issue #2389: Array objects are now pickled in a portable manner.
3698
3699- Expat: Fix DoS via XML document with malformed UTF-8 sequences
3700 (CVE_2009_3560).
3701
3702- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
3703 could raise an incorrect RuntimeError about not holding the import lock. The
3704 import lock is now reinitialized after fork.
3705
3706- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
3707 parameter on some platforms such as OS X.
3708
3709- Build the ossaudio extension on GNU/kFreeBSD.
3710
3711- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
3712 the return value of QueryReflectionKey.
3713
3714- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
3715
3716Build
3717-----
3718
3719- Use OpenSSL 1.0.0a on Windows.
3720
3721- Issue #9280: Make sharedinstall depend on sharedmods.
3722
3723- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
3724 override the configure and makefile defaults, without deleting options the
3725 user didn't intend to override. Developers should no longer need to specify
3726 OPT or EXTRA_CFLAGS, although those variables are still present for
3727 backward-compatibility.
3728
3729- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
3730
3731- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
3732 multiprocessing only.
3733
3734- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
3735 (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
3736 result of the issue #1628484 fix, combined with autoconf's strange choice of
3737 default CFLAGS produced by AC_PROG_CC for gcc.)
3738
3739- Issue #3646: It is now easily possible to install a Python framework into your
3740 home directory on MacOSX, see Mac/README for more information.
3741
3742- Issue #3928: os.mknod() now available in Solaris, also.
3743
3744- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
3745 give false warnings.
3746
3747- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
3748 anymore. It also forwards the LDFLAGS settings to the linker when building a
3749 shared library.
3750
3751- Issue #6716: Quote -x arguments of compileall in MSI installer. Exclude 2to3
3752 tests from compileall.
3753
3754- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
3755
3756- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
3757 memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
3758 instead. Also disable caching of powers of 5.
3759
3760- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
3761
3762- Issue #6943: Use pkg-config to find the libffi headers when the
3763 --with-system-ffi flag is used.
3764
3765- Issue #7609: Add a --with-system-expat option that causes the system's expat
3766 library to be used for the pyexpat module instead of the one included with
3767 Python.
3768
3769- Issue #7589: Only build the nis module when the correct header files are
3770 found.
3771
3772- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
3773
3774- Issue #5792: Extend the short float repr support to x86 systems using
3775 icc or suncc.
3776
3777- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
3778 correctly under gcc on x86-64. This fixes a reported problem with the
3779 --with-tsc build on x86-64.
3780
3781- Issue #6802: Fix build issues on MacOSX 10.6.
3782
3783- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
3784
3785- Issue #4601: 'make install' did not set the appropriate permissions on
3786 directories.
3787
3788- Issue #5390: Add uninstall icon independent of whether file extensions are
3789 installed.
3790
3791- Issue #7541: When using ``python-config`` with a framework install the
3792 compiler might use the wrong library.
3793
3794- python-config now supports multiple options on the same command line.
3795
3796- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
3797
3798- Issue #8510: Update to autoconf2.65.
3799
3800Documentation
3801-------------
3802
3803- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
3804 to Doc/license.rst.
3805
3806- Issue #9524: Document that two CTRL* signals are meant for use only
3807 with os.kill.
3808
3809- Issue #9255: Document that the 'test' package is meant for internal Python use
3810 only.
3811
3812- A small WSGI server was added as Tools/scripts/serve.py, and is used to
3813 implement a local documentation server via 'make serve' in the doc directory.
3814
3815- Updating `Using Python` documentation to include description of CPython's -J
3816 and -X options.
3817
3818- Document that importing a module that has None in sys.modules triggers an
3819 ImportError.
3820
3821- Issue #6556: Fixed the Distutils configuration files location explanation for
3822 Windows.
3823
3824- Update python manual page (options -B, -O0, -s, environment variables
3825 PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
3826
3827- Issue #8909: Added the size of the bitmap used in the installer created by
3828 distutils' bdist_wininst. Patch by Anatoly Techtonik.
3829
3830Tests
3831-----
3832
3833- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
3834 import lock was disabled.
3835
3836- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
3837
3838- Issue #7449: Skip test_socketserver if threading support is disabled.
3839
3840- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
3841 by a decompressor object without errors (it returns incomplete uncompressed
3842 data).
3843
3844- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
3845 UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
3846
3847- Issue #8576: Remove use of find_unused_port() in test_smtplib and
3848 test_multiprocessing. Patch by Paul Moore.
3849
3850- Issue #7449: Fix many tests to support Python compiled without thread
3851 support. Patches written by Jerry Seutter.
3852
3853- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
3854 SSL shutdowns.
3855
3856- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
3857 by Dave Malcolm.
3858
3859- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
3860 thread was previously started, most likely due to a platform bug.
3861
3862- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
3863
3864- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
3865
3866- Issue #8263: Now regrtest.py will report a failure if it receives a
3867 KeyboardInterrupt (SIGINT).
3868
3869- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
3870 Unicode normalization cases.
3871
3872- Issue #7783: test.support.open_urlresource invalidates the outdated files from
3873 the local cache.
3874
3875- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
3876 effectively raised.
3877
3878- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
3879 TestCase for some tests: test_genericpath.CommonTest.
3880
3881- Print platform information when running the whole test suite, or using the
3882 --verbose flag.
3883
3884- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
3885 filesystem encoding.
3886
3887- Issue #6292: for the moment at least, the test suite runs cleanly if python is
3888 run with the -OO flag. Tests requiring docstrings are skipped.
3889
3890- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
3891 also used by regrtest to run all the tests in a temporary directory. The
3892 original CWD is saved in `support.SAVEDCWD`. Thanks to Florent Xicluna who
3893 helped with the patch.
3894
3895- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
3896 (only seen so far on platforms where the curses module wasn't built), due to
3897 an uncleared exception.
3898
3899- Issue #7728: test_timeout was changed to use support.bind_port instead of a
3900 hard coded port.
3901
3902- Issue #7376: Instead of running a self-test (which was failing) when called
3903 with no arguments, doctest.py now gives a usage message.
3904
3905- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
3906
3907- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
3908 instead of a hardcoded port number in test_rapid_restart.
3909
3910- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
3911 in the Lib/test directory, which might be read-only for the user running the
3912 tests.
3913
3914- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
3915 of an option with no handler.
3916
3917- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
3918 fails. Can be combined with -j.
3919
3920- Issue #6551: test_zipimport could import and then destroy some modules of the
3921 encodings package, which would make other tests fail further down the road
3922 because the internally cached encoders and decoders would point to empty
3923 global variables.
3924
3925- Issue #7295: Do not use a hardcoded file name in test_tarfile.
3926
3927- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
3928 primitives such as Lock, RLock, Condition, Event and Semaphore.
3929
3930- Issue #7248 (part 2): Use a unique temporary directory for importlib source
3931 tests instead of tempfile.tempdir. This prevents the tests from sharing state
3932 between concurrent executions on the same system.
3933
3934- Issue #7248: In importlib.test.source.util a try/finally block did not make
3935 sure that some referenced objects actually were created in the block before
3936 calling methods on the object.
3937
3938- Issue #7222: Make thread "reaping" more reliable so that reference
3939 leak-chasing test runs give sensible results. The previous method of reaping
3940 threads could return successfully while some Thread objects were still
3941 referenced. This also introduces a new private function:
3942 ``_thread._count()``.
3943
3944- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
3945 runs the risk of causing the worker thread to fail.
3946
3947- Issue #7055: test___all__ now greedily detects all modules which have an
3948 __all__ attribute, rather than using a hardcoded and incomplete list.
3949
3950- Issue #7058: Added save/restore for things like sys.argv and cwd to
3951 runtest_inner in regrtest, with warnings if the called test modifies them, and
3952 a new section in the summary report at the end.
3953
3954- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
3955
3956- Fixed tests in importlib.test.source.test_abc_loader that were masking the
3957 proper exceptions that should be raised for missing or improper code object
3958 bytecode.
3959
3960- Removed importlib's custom test discovery code and switched to
3961 unittest.TestLoader.discover().
3962
3963Tools/Demos
3964-----------
3965
3966- Issue #5464, #8974: Implement plural forms in msgfmt.py.
3967
3968- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
3969 added to the `Tools/` directory. They were previously living in the sandbox.
3970
3971
3972What's New in Python 3.1?
3973=========================
3974
3975*Release date: 27-June-2009*
3976
3977Core and Builtins
3978-----------------
3979
3980- Issue #6334: Fix bug in range length calculation for ranges with
3981 large arguments.
3982
3983- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
3984 because it wasn't recognized as a sequence).
3985
3986Library
3987-------
3988
3989- Issue #6126: Fixed pdb command-line usage.
3990
3991- Issue #6314: logging: performs extra checks on the "level" argument.
3992
3993- Issue #6274: Fixed possible file descriptors leak in subprocess.py
3994
3995- Accessing io.StringIO.buffer now raises an AttributeError instead of
3996 io.UnsupportedOperation.
3997
3998- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
3999 (On Unix)
4000
4001- Issue #1202: zipfile module would cause a struct.error when attempting to
4002 store files with a CRC32 > 2**31-1.
4003
4004Extension Modules
4005-----------------
4006
4007- Issue #5590: Remove unused global variable in pyexpat extension.
4008
4009
4010What's New in Python 3.1 Release Candidate 2?
4011=============================================
4012
4013*Release date: 13-June-2009*
4014
4015Core and Builtins
4016-----------------
4017
4018- Fixed SystemError triggered by "range([], 1, -1)".
4019
4020- Issue #5924: On Windows, a large PYTHONPATH environment variable
4021 (more than 255 characters) would be completely ignored.
4022
4023- Issue #4547: When debugging a very large function, it was not always
4024 possible to update the lineno attribute of the current frame.
4025
4026- Issue #5330: C functions called with keyword arguments were not reported by
4027 the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
4028
4029Library
4030-------
4031
4032- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
4033 expression string pattern was trying to match against a bytes returned by
4034 Popen. Tested under win32 to build the py-postgresql project.
4035
4036- Issue #6258: Support AMD64 in bdist_msi.
4037
4038- Issue #6195: fixed doctest to no longer try to read 'source' data from
4039 binary files.
4040
4041- Issue #5262: Fixed bug in next rollover time computation in
4042 TimedRotatingFileHandler.
4043
4044- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
4045 errors property. Additionally, the errors and encoding properties of StringIO
4046 are always None now.
4047
4048- Issue #6137: The pickle module now translates module names when loading
4049 or dumping pickles with a 2.x-compatible protocol, in order to make data
4050 sharing and migration easier. This behaviour can be disabled using the
4051 new `fix_imports` optional argument.
4052
4053- Removed the ipaddr module.
4054
4055- Issue #3613: base64.{encode,decode}string are now called
4056 base64.{encode,decode}bytes which reflects what type they accept and return.
4057 The old names are still there as deprecated aliases.
4058
4059- Issue #5767: Remove sgmlop support from xmlrpc.client.
4060
4061- Issue #6150: Fix test_unicode on wide-unicode builds.
4062
4063- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
4064 parameters.
4065
4066Windows
4067-------
4068
4069- Issue #6221: Delete test registry key before running the test.
4070
4071- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
4072
4073C-API
4074-----
4075
4076- Issue #5735: Python compiled with --with-pydebug should throw an
4077 ImportError when trying to import modules compiled without
4078 --with-pydebug, and vice-versa.
4079
4080
4081Build
4082-----
4083
4084- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
4085 added LIBS to OS X framework builds.
4086
4087- Issue #5809: Specifying both --enable-framework and --enable-shared is
4088 an error. Configure now explicity tells you about this.
4089
4090
4091
4092What's New in Python 3.1 release candidate 1?
4093=============================================
4094
4095*Release date: 2009-05-30*
4096
4097Core and Builtins
4098-----------------
4099
4100- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
4101 of the command line.
4102
4103- Issue #6012: Add cleanup support to O& argument parsing.
4104
4105- Issue #6089: Fixed str.format with certain invalid field specifiers
4106 that would raise SystemError.
4107
4108- Issue #5982: staticmethod and classmethod now expose the wrapped
4109 function with __func__.
4110
4111- Added support for multiple context managers in the same with-statement.
4112 Deprecated contextlib.nested() which is no longer needed.
4113
4114- Issue #5829: complex("1e500") no longer raises OverflowError. This
4115 makes it consistent with float("1e500") and interpretation of real
4116 and imaginary literals.
4117
4118- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
4119
4120- Issue #5994: the marshal module now has docstrings.
4121
4122- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
4123 (1) inf and nan strings with trailing whitespace were incorrectly
4124 rejected; (2) parsing of strings representing infinities and nans
4125 was locale aware; and (3) the interpretation of fromhex('-nan')
4126 didn't match that of float('-nan').
4127
4128Library
4129-------
4130
4131- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
4132
4133- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
4134
4135- Issue #6121: pydoc now ignores leading and trailing spaces in the
4136 argument to the 'help' function.
4137
4138- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
4139 arguments for strings with a space in them.
4140
4141- collections.namedtuple() was not working with the following field
4142 names: cls, self, tuple, itemgetter, and property.
4143
4144- In unittest, using a skipping decorator on a class is now equivalent to
4145 skipping every test on the class. The ClassTestSuite class has been removed.
4146
4147- Issue #6050: Don't fail extracting a directory from a zipfile if
4148 the directory already exists.
4149
4150- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
4151 than an int, which makes some operations possible under 64-bit Linux (e.g.
4152 DN_MULTISHOT with F_NOTIFY).
4153
4154- Issue #5761: Add the name of the underlying file to the repr() of various
4155 IO objects.
4156
4157- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix
4158 by Musashi Tamura, tests by Marcin Bachry.
4159
4160- Issue #1983: Fix functions taking or returning a process identifier to use
4161 the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
4162 a process identifier type wider than the standard C integer type.
4163
4164- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
4165 Patch by Farhan Ahmad, test by Marcin Bachry.
4166
4167- Issue #2116: Weak references and weak dictionaries now support copy()ing and
4168 deepcopy()ing.
4169
4170- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
4171
4172- Issue #5918: Fix a crash in the parser module.
4173
4174- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
4175
4176- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
4177 library. This means, for example, that opening an UTF-16 text file in
4178 append mode doesn't add a BOM at the end of the file if the file isn't
4179 empty.
4180
4181- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
4182 file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix
4183 corrects a pydoc regression.
4184
4185- Issue #5955: aifc's close method did not close the file it wrapped,
4186 now it does. This also means getfp method now returns the real fp.
4187
4188Installation
4189------------
4190
4191- Issue #6047: fullinstall has been removed because Python 3's executable will
4192 now be known as python3.
4193
4194- Lib/smtpd.py is no longer installed as a script.
4195
4196Extension Modules
4197-----------------
4198
4199- Issue #3061: Use wcsftime for time.strftime where available.
4200
4201- Issue #4873: Fix resource leaks in error cases of pwd and grp.
4202
4203- Issue #6093: Fix off-by-one error in locale.strxfrm.
4204
4205- The _functools and _locale modules are now built into the libpython shared
4206 library instead of as extension modules.
4207
4208Build
4209-----
4210
4211- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
4212 and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
4213 Clinton Roy.
4214
4215Tests
4216-----
4217
4218- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
4219 tests on darwin even when the OS was installed on a case-sensitive
4220 filesystem. Also fixed tests that should not be run when
4221 sys.dont_write_bytecode is true.
4222
4223
4224What's New in Python 3.1 beta 1?
4225================================
4226
4227*Release date: 2009-05-06*
4228
4229Core and Builtins
4230-----------------
4231
4232- Issue #5914: Add new C API function PyOS_string_to_double, and
4233 deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
4234
4235- Issue #3382: float.__format__, complex.__format__, and %-formatting
4236 no longer map 'F' to 'f'. Because of issue #5859 (below), this only
4237 affects nan -> NAN and inf -> INF.
4238
4239- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
4240 in all operations, including splitdrive, split, etc. splitunc() now issues
4241 a PendingDeprecation warning.
4242
4243- Issue #5920: For float.__format__, change the behavior with the
4244 empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
4245 to be like 'g' but with at least one decimal point and with a
4246 default precision of 12. Previously, the behavior the same but with
4247 a default precision of 6. This more closely matches str(), and
4248 reduces surprises when adding alignment flags to the empty
4249 presentation type. This also affects the new complex.__format__ in
4250 the same way.
4251
4252- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
4253
4254- Issue #5890: in subclasses of 'property' the __doc__ attribute was
4255 shadowed by classtype's, even if it was None. property now
4256 inserts the __doc__ into the subclass instance __dict__.
4257
4258- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
4259 sequences. Patch by Nick Barnes and Victor Stinner.
4260
4261- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
4262
4263- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
4264 received a new method, detach(). detach() disconnects the underlying stream
4265 from the buffer or text IO and returns it.
4266
4267- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
4268 floats with absolute value over 1e50. Also remove length
4269 restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
4270 12.34 no longer raise an exception.
4271
4272- Issue #1588: Add complex.__format__. For example,
4273 format(complex(1, 2./3), '.5') now produces a sensible result.
4274
4275- Issue #5864: Fix empty format code formatting for floats so that it
4276 never gives more than the requested number of significant digits.
4277
4278- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
4279 new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
4280
4281- Issue #5835: Deprecate PyOS_ascii_formatd.
4282
4283- Issue #4971: Fix titlecase for characters that are their own
4284 titlecase, but not their own uppercase.
4285
4286- Issue #5283: Setting __class__ in __del__ caused a segfault.
4287
4288- Issue #5816: complex(repr(z)) now recovers z exactly, even when
4289 z involves nans, infs or negative zeros.
4290
4291- Issue #3166: Make int -> float conversions correctly rounded.
4292
4293- Issue #1869 (and many duplicates): make round(x, n) correctly
4294 rounded for a float x, by using the decimal <-> binary conversions
4295 from Python/dtoa.c. As a consequence, (e.g.) round(x, 2) now
4296 consistently agrees with format(x, '.2f').
4297
4298- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
4299 some builtin types.
4300
4301- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
4302
4303- Issue #5515: str.format() type 'n' combined with commas and leading
4304 zeros no longer gives odd results with ints and floats.
4305
4306- Implement PEP 378, Format Specifier for Thousands Separator, for
4307 floats.
4308
4309- The str function switches to exponential notation at
4310 1e11, not 1e12. This avoids printing 13 significant digits in
4311 situations where only 12 of them are correct. Example problem
4312 value: str(1e11 + 0.5). (This minor issue has existed in 2.x for a
4313 long time.)
4314
4315- Issue #1580: On most platforms, use a 'short' float repr: for a
4316 finite float x, repr(x) now outputs a string based on the shortest
4317 sequence of decimal digits that rounds to x. Previous behaviour was
4318 to output 17 significant digits and then strip trailing zeros.
4319 Another minor difference is that the new repr switches to
4320 exponential notation at 1e16 instead of the previous 1e17; this
4321 avoids misleading output in some cases.
4322
4323 There's a new sys attribute sys.float_repr_style, which takes
4324 the value 'short' to indicate that we're using short float repr,
4325 and 'legacy' if the short float repr isn't available for one
4326 reason or another.
4327
4328 The float repr change involves incorporating David Gay's 'perfect
4329 rounding' code into the Python core (it's in Python/dtoa.c). As a
4330 secondary consequence, all string-to-float and float-to-string
4331 conversions (including all float formatting operations) will be
4332 correctly rounded on these platforms.
4333
4334 See issue #1580 discussions for details of platforms for which
4335 this change does not apply.
4336
4337- Issue #5759: float() didn't call __float__ on str subclasses.
4338
4339- The string.maketrans() function is deprecated; there is a new static method
4340 maketrans() on the bytes and bytearray classes. This removes confusion about
4341 the types string.maketrans() is supposed to work with, and mirrors the
4342 methods available on the str class.
4343
4344- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
4345 its clarity and its speed.
4346
4347- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
4348 to avoid compiler warnings.
4349
4350- Issue #3739: The unicode-internal encoder now reports the number of characters
4351 consumed like any other encoder (instead of the number of bytes).
4352
4353Installation
4354------------
4355
4356- Issue #5756: Install idle and pydoc with a 3 suffix.
4357
4358Library
4359-------
4360
4361- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
4362
4363- Issue #5311: bdist_msi can now build packages that do not depend on a
4364 specific Python version.
4365
4366- Issue #5150: IDLE's format menu now has an option to strip trailing
4367 whitespace.
4368
4369- Issue #5940: distutils.command.build_clib.check_library_list was not doing
4370 the right type checkings anymore.
4371
4372- Issue #4875: On win32, ctypes.util.find_library does no longer
4373 return directories.
4374
4375- Issue #5142: Add the ability to skip modules while stepping to pdb.
4376
4377- Issue #1309567: Fix linecache behavior of stripping subdirectories when
4378 looking for files given by a relative filename.
4379
4380- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
4381 turtle demos in Demo/turtle.
4382
4383- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
4384 extracting a file to the root directory.
4385
4386- Issue #5913: os.listdir() should fail for empty path on windows.
4387
4388- Issue #5084: unpickling now interns the attribute names of pickled objects,
4389 saving memory and avoiding growth in size of subsequent pickles. Proposal
4390 and original patch by Jake McGuire.
4391
4392- The json module now works exclusively with str and not bytes.
4393
4394- Issue #3959: The ipaddr module has been added to the standard library.
4395 Contributed by Google.
4396
4397- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
4398 error when a named pipe is encountered, rather than blocking infinitely.
4399
4400- Issue #5857: tokenize.tokenize() now returns named tuples.
4401
4402- Issue #4305: ctypes should now build again on mipsel-linux-gnu
4403
4404- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
4405 string is already in normalized form, by performing a quick check beforehand.
4406 Original patch by Rauli Ruohonen.
4407
4408- Issue #5853: calling a function of the mimetypes module from several threads
4409 at once could hit the recursion limit if the mimetypes database hadn't been
4410 initialized before.
4411
4412- Issue #5854: Updated __all__ to include some missing names and remove some
4413 names which should not be exported.
4414
4415- Issue #3102: All global symbols that the _ctypes extension defines
4416 are now prefixed with 'Py' or '_ctypes'.
4417
4418- Issue #5041: ctypes does now allow pickling wide character.
4419
4420- Issue #5812: For the two-argument form of the Fraction constructor,
4421 Fraction(m, n), m and n are permitted to be arbitrary Rational
4422 instances.
4423
4424- Issue #5812: Fraction('1e6') is valid: more generally, any string
4425 that's valid for float() is now valid for Fraction(), with the
4426 exception of strings representing NaNs and infinities.
4427
4428- Issue #5734: BufferedRWPair was poorly tested and had several glaring
4429 bugs. Patch by Brian Quinlan.
4430
4431- Issue #1161031: fix readwrite select flag handling: POLLPRI now
4432 results in a handle_expt_event call, not handle_read_event, and POLLERR
4433 and POLLNVAL now call handle_close, not handle_expt_event. Also,
4434 dispatcher now has an 'ignore_log_types' attribute for suppressing
4435 log messages, which is set to 'warning' by default.
4436
4437- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
4438 new arguments introduced in 2.5.
4439
4440- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
4441 makeunicodedata.py and regenerated the Unicode database (This fixes
4442 u'\u1d79'.lower() == '\x00').
4443
4444Extension Modules
4445-----------------
4446
4447- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
4448 pwd.
4449
4450- Issue #5463: In struct module, remove deprecated float coercion
4451 for integer type codes: struct.pack('L', 0.3) should now raise
4452 an error. The _PY_STRUCT_FLOAT_COERCE constant has been removed.
4453 The version number has been bumped to 0.3.
4454
4455- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
4456 using Berkeley DB.
4457
4458Tests
4459-----
4460
4461- Issue #5354: New test support function import_fresh_module() makes
4462 it easy to import both normal and optimised versions of modules.
4463 test_heapq and test_warnings have been adjusted to use it, tests for
4464 other modules with both C and Python implementations in the stdlib
4465 can be adjusted to use it over time.
4466
4467- Issue #5837: Certain sequences of calls to set() and unset() for
4468 support.EnvironmentVarGuard objects restored the environment variables
4469 incorrectly on __exit__.
4470
4471C-API
4472-----
4473
4474- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
4475
4476
4477What's New in Python 3.1 alpha 2?
4478=================================
4479
4480*Release date: 2009-4-4*
4481
4482Core and Builtins
4483-----------------
4484
4485- Implement PEP 378, Format Specifier for Thousands Separator, for
4486 integers.
4487
4488- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
4489
4490- Issue #5499: The 'c' code for argument parsing functions now only accepts a
4491 byte, and the 'C' code only accepts a unicode character.
4492
4493- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
4494 when hitting the recursion limit under certain circumstances.
4495
4496- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
4497
4498- Fix a segfault when running test_exceptions with coverage, caused by
4499 insufficient checks in accessors of Exception.__context__.
4500
4501- Issue #5604: non-ASCII characters in module name passed to
4502 imp.find_module() were converted to UTF-8 while the path is
4503 converted to the default filesystem encoding, causing nonsense.
4504
4505- Issue #5126: str.isprintable() returned False for space characters.
4506
4507- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
4508 the end sys.path, for compatibility with the system install of Python.
4509
4510- Issue #4688: Add a heuristic so that tuples and dicts containing only
4511 untrackable objects are not tracked by the garbage collector. This can
4512 reduce the size of collections and therefore the garbage collection overhead
4513 on long-running programs, depending on their particular use of datatypes.
4514
4515- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
4516 improve its performance. Long divisions and remainder operations
4517 are now between 50% and 150% faster.
4518
4519- Issue #4258: Make it possible to use base 2**30 instead of base
4520 2**15 for the internal representation of integers, for performance
4521 reasons. Base 2**30 is enabled by default on 64-bit machines. Add
4522 --enable-big-digits option to configure, which overrides the
4523 default. Add sys.int_info structseq to provide information about
4524 the internal format.
4525
4526- Issue #4474: PyUnicode_FromWideChar now converts characters outside
4527 the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
4528 and sizeof(Py_UNICODE) == 2.
4529
4530- Issue #5237: Allow auto-numbered fields in str.format(). For
4531 example: '{} {}'.format(1, 2) == '1 2'.
4532
4533- Issue #5392: when a very low recursion limit was set, the interpreter would
4534 abort with a fatal error after the recursion limit was hit twice.
4535
4536- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
4537 short file names.
4538
4539Library
4540-------
4541
4542- Issue #2625: added missing items() call to the for loop in
4543 mailbox.MH.get_message().
4544
4545- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
4546 error substitutions from non-strict codec error callbacks in
4547 incrementalencoder and StreamWriter.
4548
4549- Issue #5656: Fix the coverage reporting when running the test suite with
4550 the -T argument.
4551
4552- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
4553
4554- Issue #5624: Fix the _winreg module name still used in several modules.
4555
4556- Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
4557
4558- Issue #5619: Multiprocessing children disobey the debug flag and causes
4559 popups on windows buildbots. Patch applied to work around this issue.
4560
4561- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
4562
4563- Issue #5387: Fixed mmap.move crash by integer overflow.
4564
4565- Issue #5261: Patch multiprocessing's semaphore.c to support context
4566 manager use: "with multiprocessing.Lock()" works now.
4567
4568- Issue #5236: Change time.strptime() to only take strings. Didn't work with
4569 bytes already but the failure was non-obvious.
4570
4571- Issue #5177: Multiprocessing's SocketListener class now uses
4572 socket.SO_REUSEADDR on all connections so that the user no longer needs
4573 to wait 120 seconds for the socket to expire.
4574
4575- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
4576
4577- Issue #1174606: Calling read() without arguments of an unbounded file
4578 (typically /dev/zero under Unix) could crash the interpreter.
4579
4580- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
4581 io.BufferedRandom have been deprecated for removal in Python 3.2.
4582
4583- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
4584 forever on incomplete input. That caused tarfile.open() to hang when used
4585 with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
4586 partial bzip2 compressed data.
4587
4588- Issue #2110: Add support for thousands separator and 'n' type
4589 specifier to Decimal.__format__
4590
4591- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
4592 '>' alignment characters.
4593
4594- The error detection code in FileIO.close() could fail to reflect the `errno`
4595 value, and report it as -1 instead.
4596
4597- Issue #5016: FileIO.seekable() could return False if the file position
4598 was negative when truncated to a C int. Patch by Victor Stinner.
4599
4600Extension Modules
4601-----------------
4602
4603- Issue #5391: mmap now deals exclusively with bytes.
4604
4605- Issue #5463: In struct module, remove deprecated overflow wrapping
4606 when packing an integer: struct.pack('=L', -1) now raises
4607 struct.error instead of returning b'\xff\xff\xff\xff'. The
4608 _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
4609 have been removed from the struct module.
4610
4611
4612What's New in Python 3.1 alpha 1
4613================================
4614
4615*Release date: 2009-03-07*
4616
4617Core and Builtins
4618-----------------
4619
4620- The io module has been reimplemented in C for speed.
4621
4622- Give dict views an informative __repr__.
4623
4624- Issue #5247: Improve error message when unknown format codes are
4625 used when using str.format() with str, int, and float arguments.
4626
4627- Issue #5249: time.strftime returned malformed string when format string
4628 contained non ascii character on windows.
4629
4630- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
4631 source has already been decoded into str.
4632
4633- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
4634 rotating the object pointer by 4 bits to the right.
4635
4636- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
4637 it now forces its argument to double before testing for infinity.
4638
4639- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
4640 returns a non-number type.
4641
4642- Issue #5182: Removed memoryview.__str__.
4643
4644- Issue #1717: Removed builtin cmp() function, dropped tp_compare
4645 slot, the C API functions PyObject_Compare and PyUnicode_Compare and
4646 the type definition cmpfunc. The tp_compare slot has been renamed
4647 to tp_reserved, and is reserved for future usage.
4648
4649- Issue #1242657: the __len__() and __length_hint__() calls in several tools
4650 were suppressing all exceptions. These include list() and bytearray().
4651
4652- Issue #4707: round(x, n) now returns an integer if x is an integer.
4653 Previously it returned a float.
4654
4655- Issue #4753: By enabling a configure option named '--with-computed-gotos'
4656 on compilers that support it (notably: gcc, SunPro, icc), the bytecode
4657 evaluation loop is compiled with a new dispatch mechanism which gives
4658 speedups of up to 20%, depending on the system, on various benchmarks.
4659
4660- Issue #4874: Most builtin decoders now reject unicode input.
4661
4662- Issue #4842: Don't allow trailing 'L' when constructing an integer
4663 from a string.
4664
4665- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
4666
4667- Issue #4838: When a module is deallocated, free the memory backing the
4668 optional module state data.
4669
4670- Issue #4910: Rename nb_long slot to nb_reserved, and change its
4671 type to ``(void *)``.
4672
4673- Issue #4935: The overflow checking code in the expandtabs() method common
4674 to str, bytes and bytearray could be optimized away by the compiler, letting
4675 the interpreter segfault instead of raising an error.
4676
4677- Issue #3720: Fix a crash when an iterator modifies its class and removes its
4678 __next__ method.
4679
4680- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
4681 function no longer attempt to call the __long__ slot to convert an object
4682 to an integer. Only the __int__ and __trunc__ slots are examined.
4683
4684- Issue #4893: Use NT threading on CE.
4685
4686- Issue #4915: Port sysmodule to Windows CE.
4687
4688- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
4689 common cases are optimized thanks to a dedicated fast path and a moderate
4690 amount of loop unrolling.
4691
4692- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
4693 collecting the oldest generation) so that allocating lots of objects without
4694 destroying them does not show quadratic performance. Based on a proposal by
4695 Martin von Löwis at
4696 http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
4697
4698- Issue #4604: Some objects of the I/O library could still be used after
4699 having been closed (for instance, a read() call could return some
4700 previously buffered data). Patch by Dmitry Vasiliev.
4701
4702- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
4703 flag to work properly. Furthermore, when specifying -u, the text stdout
4704 and stderr streams have line-by-line buffering enabled (the default being
4705 to buffer arbitrary chunks of data).
4706
4707- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
4708 instead of ints (reducing its size from 4 to 8 times thereby reducing
4709 Python's overall memory).
4710
4711- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
4712 an existing .py counterpart, override the co_filename attributes of all
4713 code objects if the original filename is obsolete (which can happen if the
4714 file has been renamed, moved, or if it is accessed through different paths).
4715 Patch by Ziga Seilnacht and Jean-Paul Calderone.
4716
4717- Issue #4580: Fix slicing of memoryviews when the item size is greater than
4718 one byte. Also fixes the meaning of len() so that it returns the number of
4719 items, rather than the size in bytes.
4720
4721- Issue #4075: Use OutputDebugStringW in Py_FatalError.
4722
4723- Issue #4747: When the terminal does not use utf-8, executing a script with
4724 non-ascii characters in its name could fail with a "SyntaxError: None" error.
4725
4726- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
4727 to open file with a bytes filename on Windows.
4728
4729- Issue #3680: Reference cycles created through a dict, set or deque iterator
4730 did not get collected.
4731
4732- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
4733 where the tp_hash and tp_dict slots are both NULL.
4734
4735- Issue #4759: None is now allowed as the first argument of
4736 bytearray.translate(). It was always allowed for bytes.translate().
4737
4738- Added test case to ensure attempts to read from a file opened for writing
4739 fail.
4740
4741- Issue #3106: Speedup some comparisons (str/str and int/int).
4742
4743- Issue #2183: Simplify and optimize bytecode for list, dict and set
4744 comprehensions. Original patch for list comprehensions by Neal Norwitz.
4745
4746- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
4747 print elapsed times, not only when some objects are uncollectable /
4748 unreachable. Original patch by Neil Schemenauer.
4749
4750- Issue #3439: Add a bit_length method to int.
4751
4752- Issue #2173: When getting device encoding, check that return value of
4753 nl_langinfo is not the empty string. This was causing silent build
4754 failures on OS X.
4755
4756- Issue #4597: Fixed several opcodes that weren't always propagating
4757 exceptions.
4758
4759- Issue #4589: Fixed exception handling when the __exit__ function of a
4760 context manager returns a value that cannot be converted to a bool.
4761
4762- Issue #4445: Replace "sizeof(PyBytesObject)" with
4763 "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
4764 bytes instances. On a typical machine this saves 3 bytes of memory
4765 (on average) per allocation of a bytes instance.
4766
4767- Issue #4533: File read operation was dreadfully slow due to a slowly
4768 growing read buffer. Fixed by using the same growth rate algorithm as
4769 Python 2.x.
4770
4771- Issue #4509: Various issues surrounding resize of bytearray objects to
4772 which there are buffer exports (e.g. memoryview instances).
4773
4774- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
4775 method on file objects with closefd=False. The file descriptor is still
4776 kept open but the file object behaves like a closed file. The ``FileIO``
4777 object also got a new readonly attribute ``closefd``.
4778
4779- Issue #4569: Interpreter crash when mutating a memoryview with an item size
4780 larger than 1.
4781
4782- Issue #4748: Lambda generators no longer return a value.
4783
4784- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
4785
4786- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
4787 PyUnicode_DecodeUTF8() once, remember the result and output it in a second
4788 step. This avoids problems with counting UTF-8 bytes that ignores the effect
4789 of using the replace error handler in PyUnicode_DecodeUTF8().
4790
4791Library
4792-------
4793
4794- Issue #7071: byte-compilation in Distutils is now done with respect to
4795 sys.dont_write_bytecode.
4796
4797- Issue #7066: archive_util.make_archive now restores the cwd if an error is
4798 raised. Initial patch by Ezio Melotti.
4799
4800- Issue #6516: Added owner/group support when creating tar archives in
4801 Distutils.
4802
4803- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
4804
4805- Issue #6163: Fixed HP-UX runtime library dir options in
4806 distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
4807 Michael Haubenwallner.
4808
4809- Issue #6693: New functions in site.py to get user/global site packages paths.
4810
4811- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
4812 opening an empty or very small file.
4813
4814- Issue #6545: Removed assert statements in distutils.Extension, so the
4815 behavior is similar when used with -O.
4816
4817- unittest has been split up into a package. All old names should still work.
4818
4819- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
4820 uses the same refactored function to get gcc/ld/dllwrap versions numbers.
4821 It's `distutils.util.get_compiler_versions`. Added deprecation warnings
4822 for the obsolete get_versions() functions.
4823
4824- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
4825
4826- Issue #6314: logging: Extra checks on the "level" argument in more places.
4827
4828- Issue #2622: Fixed an ImportError when importing email.message from a
4829 standalone application built with py2exe or py2app.
4830
4831- Issue #6455: Fixed test_build_ext under win32.
4832
4833- Issue #6377: Enabled the compiler option, and deprecate its usage as an
4834 attribute.
4835
4836- Issue #6413: Fixed the log level in distutils.dist for announce.
4837
4838- Issue #6403: Fixed package path usage in build_ext.
4839
4840- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
4841 unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
4842 descriptor errors
4843
4844- Issue #6365: Distutils build_ext inplace mode was copying the compiled
4845 extension in a subdirectory if the extension name had dots.
4846
4847- Issue #6164: Added an AIX specific linker argument in Distutils
4848 unixcompiler. Original patch by Sridhar Ratnakumar.
4849
4850- Issue #6286: Now Distutils upload command is based on urllib2 instead of
4851 httplib, allowing the usage of http_proxy.
4852
4853- Issue #6287: Added the license field in Distutils documentation.
4854
4855- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
4856
4857- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
4858 in Makefiles. This prevents compile errors when using syntax like:
4859 `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
4860
4861- Issue #6131: test_modulefinder leaked when run after test_distutils.
4862 Patch by Hirokazu Yamamoto.
4863
4864- Issue #6048: Now Distutils uses the tarfile module in archive_util.
4865
4866- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
4867 and tests on pywin32 by Tim Golden.
4868
4869- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
4870
4871- Issue #6046: Fixed the library extension when distutils build_ext is used
4872 inplace. Initial patch by Roumen Petrov.
4873
4874- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
4875 subcommand.
4876
4877- Issue #6022: a test file was created in the current working directory by
4878 test_get_outputs in Distutils.
4879
4880- Issue #5977: distutils build_ext.get_outputs was not taking into account the
4881 inplace option. Initial patch by kxroberto.
4882
4883- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
4884 for old-style extensions.
4885
4886- Issue #5976: Fixed Distutils test_check_environ.
4887
4888- Issue #5941: Distutils build_clib command was not working anymore because
4889 of an incomplete costumization of the archiver command. Added ARFLAGS in the
4890 Makefile besides AR and make Distutils use it. Original patch by David
4891 Cournapeau.
4892
4893- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
4894
4895- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
4896 anymore.
4897
4898- Issue #5810: Fixed Distutils test_build_scripts so it uses
4899 sysconfig.get_config_vars.
4900
4901- Issue #4951: Fixed failure in test_httpservers.
4902
4903- Issue #5795: Fixed test_distutils failure on Debian ppc.
4904
4905- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
4906
4907- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
4908 a value in SafeConfigParser.
4909
4910- Issue #5732: added a new command in Distutils: check.
4911
4912- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
4913 platforms. Initial patch by Paul Moore.
4914
4915- Issue #5095: Added bdist_msi to the list of bdist supported formats.
4916 Initial fix by Steven Bethard.
4917
4918- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
4919 Initial fix by Wayne Davison.
4920
4921- Issue #5694: removed spurious test output in Distutils (test_clean).
4922
4923- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
4924
4925- Issue #1665206 (partially): Move imports in cgitb to the top of the module
4926 instead of performing them in functions. Helps prevent import deadlocking in
4927 threads.
4928
4929- Issue #2522: locale.format now checks its first argument to ensure it has
4930 been passed only one pattern, avoiding mysterious errors where it appeared
4931 that it was failing to do localization.
4932
4933- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
4934 Brandl.
4935
4936- Issue #1222: locale.format() bug when the thousands separator is a space
4937 character.
4938
4939- Issue #5472: Fixed distutils.test_util tear down. Original patch by
4940 Tim Golden.
4941
4942- collections.deque() objects now have a read-only attribute called maxlen.
4943
4944- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
4945 it is has been populated and properly configured in order to prevent
4946 window flashing.
4947
4948- Issue #4792: Prevent a segfault in _tkinter by using the
4949 guaranteed to be safe interp argument given to the PythonCmd in place of
4950 the Tcl interpreter taken from a PythonCmd_ClientData.
4951
4952- Issue #5193: Guarantee that tkinter.Text.search returns a string.
4953
4954- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
4955 Original patch by Akira Kitada.
4956
4957- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
4958
4959- Issue #5385: Fixed mmap crash after resize failure on windows.
4960
4961- Issue #5179: Fixed subprocess handle leak on failure on windows.
4962
4963- PEP 372: Added collections.OrderedDict().
4964
4965- The _asdict() for method for namedtuples now returns an OrderedDict().
4966
4967- configparser now defaults to using an ordered dictionary.
4968
4969- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
4970 import guess_extension`` was used.
4971
4972- Issue #1733986: Fixed mmap crash in accessing elements of second map object
4973 with same tagname but larger size than first map. (Windows)
4974
4975- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
4976 overrun.
4977
4978- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
4979 bdist_rpm command.
4980
4981- Issue #5378: added --quiet option to Distutils bdist_rpm command.
4982
4983- Issue #5052: make Distutils compatible with 2.3 again.
4984
4985- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
4986 in Distutils tests.
4987
4988- Issue #5287: Add exception handling around findCaller() call to help out
4989 IronPython.
4990
4991- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
4992 The file was resized to wrong size.
4993
4994- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
4995
4996- Issue #2279: distutils.sdist.add_defaults now add files
4997 from the package_data and the data_files metadata.
4998
4999- Issue #5257: refactored all tests in distutils, so they use
5000 support.TempdirManager, to avoid writing in the tests directory.
5001
5002- Issue #4524: distutils build_script command failed with --with-suffix=3.
5003 Initial patch by Amaury Forgeot d'Arc.
5004
5005- Issue #2461: added tests for distutils.util
5006
5007- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
5008 which inherited from numbers.py which did not have __slots__ defined. The
5009 numbers hierarchy now has its own __slots__ declarations.
5010
5011- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
5012 encoding.
5013
5014- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
5015 function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
5016
5017- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
5018 under NT and OS2. Patch by Philip Jenvey.
5019
5020- Issue #5128: Make compileall properly inspect bytecode to determine if needs
5021 to be recreated. This avoids a timing hole thanks to the old reliance on the
5022 ctime of the files involved.
5023
5024- Issue #5122: Synchronize tk load failure check to prevent a potential
5025 deadlock.
5026
5027- Issue #1818: collections.namedtuple() now supports a keyword argument
5028 'rename' which lets invalid fieldnames be automatically converted to
5029 positional names in the form, _1, _2, ...
5030
5031- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
5032
5033- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
5034 public documented method ``ZipImporter.get_filename()``.
5035
5036- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
5037 the execution of packages by looking for and executing a ``__main__``
5038 submodule when a package name is supplied. Initial patch by Andi
5039 Vajda.
5040
5041- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
5042 not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
5043 Tkapp_Call when calling from a thread different than the one that created
5044 the Tcl interpreter. Patch by Robert Hancock.
5045
5046- Issue #4285: Change sys.version_info to be a named tuple. Patch by
5047 Ross Light.
5048
5049- Issue #1520877: Now distutils.sysconfig reads $AR from the
5050 environment/Makefile. Patch by Douglas Greiman.
5051
5052- Issue #1276768: The verbose option was not used in the code of
5053 distutils.file_util and distutils.dir_util.
5054
5055- Issue #5132: Fixed trouble building extensions under Solaris with
5056 --enabled-shared activated. Initial patch by Dave Peterson.
5057
5058- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
5059
5060- The shelve module now defaults to pickle protocol 3.
5061
5062- Fix a bug in the trace module where a bytes object from co_lnotab had its
5063 items being passed through ord().
5064
5065- Issue #2047: shutil.move() could believe that its destination path was
5066 inside its source path if it began with the same letters (e.g. "src" vs.
5067 "src.new").
5068
5069- Added the ttk module. See issue #2983: Ttk support for Tkinter.
5070
5071- Removed isSequenceType(), isMappingType, and isNumberType() from the
5072 operator module; use the abstract base classes instead. Also removed
5073 the repeat() function; use mul() instead.
5074
5075- Issue #5021: doctest.testfile() did not create __name__ and
5076 collections.namedtuple() relied on __name__ being defined.
5077
5078- Backport importlib from Python 3.1. Only the import_module() function has
5079 been backported to help facilitate transitions from 2.7 to 3.1.
5080
5081- Issue #1885: distutils. When running sdist with --formats=tar,gztar
5082 the tar file was overriden by the gztar one.
5083
5084- Issue #4863: distutils.mwerkscompiler has been removed.
5085
5086- Added a new itertools functions: combinations_with_replacement()
5087 and compress().
5088
5089- Issue #5032: added a step argument to itertools.count() and
5090 allowed non-integer arguments.
5091
5092- Fix and properly document the multiprocessing module's logging
5093 support, expose the internal levels and provide proper usage
5094 examples.
5095
5096- Issue #1672332: fix unpickling of subnormal floats, which was
5097 producing a ValueError on some platforms.
5098
5099- Issue #3881: Help Tcl to load even when started through the
5100 unreadable local symlink to "Program Files" on Vista.
5101
5102- Issue #4710: Extract directories properly in the zipfile module;
5103 allow adding directories to a zipfile.
5104
5105- Issue #3807: _multiprocessing build fails when configure is passed
5106 --without-threads argument. When this occurs, _multiprocessing will
5107 be disabled, and not compiled.
5108
5109- Issue #5008: When a file is opened in append mode with the new IO library,
5110 do an explicit seek to the end of file (so that e.g. tell() returns the
5111 file size rather than 0). This is consistent with the behaviour of the
5112 traditional 2.x file object.
5113
5114- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
5115 parameter was set.
5116
5117- Issue #4842: Always append a trailing 'L' when pickling longs using
5118 pickle protocol 0. When reading, the 'L' is optional.
5119
5120- Add the importlib package.
5121
5122- Issue #4301: Patch the logging module to add processName support, remove
5123 _check_logger_class from multiprocessing.
5124
5125- Issue #3325: Remove python2.x try: except: imports for old cPickle from
5126 multiprocessing.
5127
5128- Issue #4959: inspect.formatargspec now works for keyword only arguments
5129 without defaults.
5130
5131- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
5132 for Unix machines for negative handles and large int handles. Without this check
5133 it is possible to segfault the interpreter.
5134
5135- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
5136 in sharedctypes.py.
5137
5138- Issue #1225107: inspect.isclass() returned True for instances with a custom
5139 __getattr__.
5140
5141- Issue #3826 and #4791: The socket module now closes the underlying socket
5142 appropriately when it is being used via socket.makefile() objects
5143 rather than delaying the close by waiting for garbage collection to do it.
5144
5145- Issue #1696199: Add collections.Counter() for rapid and convenient
5146 counting.
5147
5148- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
5149
5150- Issue #4867: Fixed a crash in ctypes when passing a string to a
5151 function without defining argtypes.
5152
5153- Issue #4272: Add an optional argument to the GzipFile constructor to override
5154 the timestamp in the gzip stream. The default value remains the current time.
5155 The information can be used by e.g. gunzip when decompressing. Patch by
5156 Jacques Frechet.
5157
5158- Restore Python 2.3 compatibility for decimal.py.
5159
5160- Issue #3638: Remove functions from _tkinter module level that depend on
5161 TkappObject to work with multiple threads.
5162
5163- Issue #4718: Adapt the wsgiref package so that it actually works with
5164 Python 3.x, in accordance with the `official amendments of the spec
5165 <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
5166
5167- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
5168 to the decimal module.
5169
5170- Fractions.from_float() no longer loses precision for integers too big to
5171 cast as floats.
5172
5173- Issue #4812: add missing underscore prefix to some internal-use-only
5174 constants in the decimal module. (Dec_0 becomes _Dec_0, etc.)
5175
5176- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
5177 did unnecessary work in the common case where no key function was specified.
5178
5179- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
5180 the function is not a generator.
5181
5182- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
5183 no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
5184
5185- Issue #4646: distutils was choking on empty options arg in the setup
5186 function. Original patch by Thomas Heller.
5187
5188- Issue #3767: Convert Tk object to string in tkColorChooser.
5189
5190- Issue #3248: Allow placing ScrolledText in a PanedWindow.
5191
5192- Issue #4444: Allow assertRaises() to be used as a context handler, so that
5193 the code under test can be written inline if more practical.
5194
5195- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
5196 works as expected in the interactive environment.
5197
5198- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
5199 Gabriel Genellina.
5200
5201- Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char
5202 boundary.
5203
5204- Issue #4223: inspect.getsource() will now correctly display source code
5205 for packages loaded via zipimport (or any other conformant PEP 302
5206 loader). Original patch by Alexander Belopolsky.
5207
5208- Issue #4201: pdb can now access and display source code loaded via
5209 zipimport (or any other conformant PEP 302 loader). Original patch by
5210 Alexander Belopolsky.
5211
5212- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
5213 302 conformant loader) will now work correctly in most cases (they
5214 are still subject to the constraints that exist for all code running
5215 from inside a module loaded via a PEP 302 loader and attempting to
5216 perform IO operations based on __file__). Original patch by
5217 Alexander Belopolsky.
5218
5219- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
5220 allows backporting to maintenance branches. Original patch by
5221 Alexander Belopolsky.
5222
5223- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
5224 a non-ASCII letter.
5225
5226- Issue #4616: TarFile.utime(): Restore directory times on Windows.
5227
5228- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
5229 codec cannot be found. This is for compatibility with the builtin behavior.
5230
5231- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
5232 give correct results in the case where one argument is a quiet NaN
5233 and the other is a finite number that requires rounding.
5234
5235- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
5236 libs.
5237
5238- Added the subprocess.check_call_output() convenience function to get output
5239 from a subprocess on success or raise an exception on error.
5240
5241- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
5242 support unusual filenames (such as those containing semi-colons) in
5243 Content-Disposition headers.
5244
5245- Issue #4384: Added logging integration with warnings module using
5246 captureWarnings(). This change includes a NullHandler which does nothing;
5247 it will be of use to library developers who want to avoid the "No handlers
5248 could be found for logger XXX" message which can appear if the library user
5249 doesn't configure logging.
5250
5251- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
5252 exception.
5253
5254- Issue #4529: fix the parser module's validation of try-except-finally
5255 statements.
5256
5257- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
5258 not a malformed option.
5259
5260- Added the subprocess.check_output() convenience function to get output
5261 from a subprocess on success or raise an exception on error.
5262
5263- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
5264 the corresponding tests now pass.
5265
5266- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
5267 it was calling the wrong open() function.
5268
5269- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
5270 support unusual filenames (such as those containing semi-colons) in
5271 Content-Disposition headers.
5272
5273- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
5274 biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
5275
5276- Issue #5104: The socket module now raises OverflowError when 16-bit port and
5277 protocol numbers are supplied outside the allowed 0-65536 range on bind()
5278 and getservbyport().
5279
5280- Windows locale mapping updated to Vista.
5281
5282Tools/Demos
5283-----------
5284
5285- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
5286 and make it 2.6-compatible.
5287
5288- Ttk demos added in Demo/tkinter/ttk/
5289
5290- Issue #4677: add two list comprehension tests to pybench.
5291
5292
5293Build
5294-----
5295
5296- Issue #6094: Build correctly with Subversion 1.7.
5297
5298- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
5299
5300- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
5301 linker, rather than always exit successfully. Patch by Floris Bruynooghe.
5302
5303- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
5304 the order that backends for the dbm extension are checked.
5305
5306- Link the shared python library with $(MODLIBS).
5307
5308- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
5309
5310- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
5311
5312- Issue #4895: Use _strdup on Windows CE.
5313
5314- Issue #4472: "configure --enable-shared" now works on OSX
5315
5316- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
5317
5318- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
5319
5320- Issue #4289: Remove Cancel button from AdvancedDlg.
5321
5322- Issue #1656675: Register a drop handler for .py* files on Windows.
5323
5324- Issue #4120: Exclude manifest from extension modules in VS2008.
5325
5326- Issue #4091: Install pythonxy.dll in system32 again.
5327
5328- Issue #4018: Disable "for me" installations on Vista.
5329
5330- Issue #3758: Add ``patchcheck`` build target to .PHONY.
5331
5332- Issue #4204: Fixed module build errors on FreeBSD 4.
5333
5334
5335C-API
5336-----
5337
5338- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
5339 NUL: Bogus TypeError detail string.
5340
5341- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
5342 for negative arguments. Previously, it raised TypeError.
5343
5344- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
5345
5346- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
5347 the GIL is released, or owned by another thread.
5348
5349- Issue #4122: On Windows, fix a compilation error when using the
5350 Py_UNICODE_ISSPACE macro in an extension module.
5351
5352
5353Extension Modules
5354-----------------
5355
5356- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
5357 supporting objects as input no matter how it was compiled (built in
5358 implementations or external openssl library).
5359
5360- Issue #4397: Fix occasional test_socket failure on OS X.
5361
5362- Issue #4279: Fix build of parsermodule under Cygwin.
5363
5364- Issue #4751: hashlib now releases the GIL when hashing large buffers
5365 (with a hardwired threshold of 2048 bytes), allowing better parallelization
5366 on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
5367
5368- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
5369
5370- Issue #4738: Each zlib object now has a separate lock, allowing to compress
5371 or decompress several streams at once on multi-CPU systems. Also, the GIL
5372 is now released when computing the CRC of a large buffer. Patch by ebfe.
5373
5374- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
5375
5376- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
5377
5378- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
5379 OpenBSD.
5380
5381- Issue #4583: array.array would not always prohibit resizing when a buffer
5382 has been exported, resulting in an interpreter crash when accessing the
5383 buffer.
5384
5385
5386- Issue #5228: Make functools.partial objects can now be pickled.
5387
5388Tests
5389-----
5390
5391- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
5392 regression tests in parallel, shortening the total runtime.
5393
5394- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
5395 Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
5396 the same behaviour as test_ttkguionly (and now also test_tk) which is to
5397 skip the tests if DISPLAY is defined but can't be used.
5398
5399- regrtest no longer treats ImportError as equivalent to SkipTest. Imports
5400 that should cause a test to be skipped are now done using import_module
5401 from test support, which does the conversion.
5402
5403- Issue #5083: New 'gui' resource for regrtest.
5404
5405
5406Docs
5407----
5408
5409
Barry Warsaw97f005d2008-12-03 16:46:14 +00005410What's New in Python 3.0 final
5411==============================
5412
5413*Release date: 03-Dec-2008*
5414
5415Core and Builtins
5416-----------------
5417
5418- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
5419 interpreter to abort ("Fatal Python error: Could not reset the stack!")
5420 instead of throwing a MemoryError.
5421
5422- Issue #3689: The list reversed iterator now supports __length_hint__
5423 instead of __len__. Behavior now matches other reversed iterators.
5424
5425- Issue #4367: Python would segfault during compiling when the unicodedata
5426 module couldn't be imported and \N escapes were present.
5427
5428- Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
5429
5430Library
5431-------
5432
5433- Issue #4387: binascii now refuses to accept str as binary input.
5434
5435- Issue #4073: Add 2to3 support to build_scripts, refactor that support
5436 in build_py.
5437
5438- IDLE would print a "Unhandled server exception!" message when internal
5439 debugging is enabled.
5440
5441- Issue #4455: IDLE failed to display the windows list when two windows have
5442 the same title.
5443
5444- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
5445 exception.
5446
5447- Issue #4433: Fixed an access violation when garbage collecting
5448 _ctypes.COMError instances.
5449
5450- Issue #4429: Fixed UnicodeDecodeError in ctypes.
5451
5452- Issue #4373: Corrected a potential reference leak in the pickle module and
5453 silenced a false positive ref leak in distutils.tests.test_build_ext.
5454
5455- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
5456 files.
5457
5458- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
5459 fail to properly display the error message.
5460
5461Build
5462-----
5463
5464- Issue #4407: Fix source file that caused the compileall step in Windows installer
5465 to fail.
5466
5467Docs
5468----
5469
5470- Issue #4449: Fixed multiprocessing examples
5471
5472- Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
5473 for keys and values which will be converted to bytes before committal.
5474
5475
5476What's New in Python 3.0 release candidate 3?
5477=============================================
5478
5479*Release date: 20-Nov-2008*
5480
5481
5482Core and Builtins
5483-----------------
5484
5485- Issue #4349: sys.path included a non-existent platform directory because of a
5486 faulty Makefile.
5487
5488- Issue #3327: Don't overallocate in the modules_by_index list.
5489
5490- Issue #1721812: Binary set operations and copy() returned the input type
5491 instead of the appropriate base type. This was incorrect because set
5492 subclasses would be created without their __init__() method being called.
5493 The corrected behavior brings sets into line with lists and dicts.
5494
5495- Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates to
5496 True, even when x doesn't compare equal to itself. This was a regression
5497 from 2.6.
5498
5499- Issue #3705: Command-line arguments were not correctly decoded when the
5500 terminal does not use UTF8.
5501
5502Library
5503-------
5504
5505- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
5506 the ctypes module is not present.
5507
5508- FileIO's mode attribute now always includes ``"b"``.
5509
5510- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String
5511 keys are now written out in UTF-8.
5512
5513- Issue #4338: Fix distutils upload command.
5514
5515- Issue #4354: Fix distutils register command.
5516
5517- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
5518
5519- Issue #4307: The named tuple that ``inspect.getfullargspec()`` returns now
5520 uses ``kwonlydefaults`` instead of ``kwdefaults``.
5521
5522- Issue #4298: Fix a segfault when pickle.loads is passed a ill-formed input.
5523
5524- Issue #4283: Fix a left-over "iteritems" call in distutils.
5525
5526Build
5527-----
5528
5529- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
5530
5531- Issue #4289: Remove Cancel button from AdvancedDlg.
5532
5533- Issue #1656675: Register a drop handler for .py* files on Windows.
5534
5535Tools/Demos
5536-----------
5537
5538- Demos of the socketserver module now work with Python 3.
5539
5540
5541What's New in Python 3.0 release candidate 2
5542============================================
5543
5544*Release date: 05-Nov-2008*
5545
5546Core and Builtins
5547-----------------
5548
5549- Issue #4211: The __path__ attribute of frozen packages is now a list instead
5550 of a string as required by PEP 302.
5551
5552- Issue #3727: Fixed poplib.
5553
5554- Issue #3714: Fixed nntplib by using bytes where appropriate.
5555
5556- Issue #1210: Fixed imaplib and its documentation.
5557
5558- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
5559 method on file objects with closefd=False. The file descriptor is still
5560 kept open but the file object behaves like a closed file. The ``FileIO``
5561 object also got a new readonly attribute ``closefd``.
5562
5563- Issue #3626: On cygwin, starting python with a non-existent script name
5564 would not display anything if the file name is only 1 character long.
5565
5566- Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
5567 method does not return iterators for the 4th and 5th items.
5568
5569- Issue #3723: Fixed initialization of subinterpreters.
5570
5571- Issue #4213: The file system encoding is now normalized by the
5572 codec subsystem, for example UTF-8 is turned into utf-8.
5573
5574- Issue #4200: Changed the atexit module to store its state in its
5575 PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
5576
5577- Issue #4237: io.FileIO() was raising invalid warnings caused by
5578 insufficient initialization of PyFileIOObject struct members.
5579
5580- Issue #4170: Pickling a collections.defaultdict object would crash the
5581 interpreter.
5582
5583- Issue #4146: Compilation on OpenBSD has been restored.
5584
5585- Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
5586
5587- Issues #2384 and #3975: Tracebacks were not correctly printed when the
5588 source file contains a ``coding:`` header: the wrong line was displayed, and
5589 the encoding was not respected.
5590
5591- Issue #3740: Null-initialize module state.
5592
5593- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
5594
5595- Issue #1688: On Windows, the input() prompt was not correctly displayed if it
5596 contains non-ascii characters.
5597
5598- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
5599
5600Library
5601-------
5602
5603- Issue #3664: The pickle module could segfault if a subclass of Pickler fails
5604 to call the base __init__ method.
5605
5606- Issue #3725: telnetlib now works completely in bytes.
5607
5608- Issue #4072: Restore build_py_2to3.
5609
5610- Issue #4014: Don't claim that Python has an Alpha release status, in addition
5611 to claiming it is Mature.
5612
5613- Issue #3187: Add sys.setfilesystemencoding.
5614
5615- Issue #3187: Better support for "undecodable" filenames. Code by Victor
5616 Stinner, with small tweaks by GvR.
5617
5618- Issue #3965: Allow repeated calls to turtle.Screen, by making it a
5619 true singleton object.
5620
5621- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
5622
5623- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
5624 raise a TypeError: "'tuple' object is not callable" instead of the expected
5625 dbm.error.
5626
5627- Bug #3884: Make the turtle module toplevel again.
5628
5629- Issue #3547: Fixed ctypes structures bitfields of varying integer
5630 sizes.
5631
5632Extension Modules
5633-----------------
5634
5635- Issue #3659: Subclasses of str didn't work as SQL parameters.
5636
5637Build
5638-----
5639
5640- Issue #4120: Exclude manifest from extension modules in VS2008.
5641
5642- Issue #4091: Install pythonxy.dll in system32 again.
5643
5644- Issue #4018: Disable "for me" installations on Vista.
5645
5646- Issue #4204: Fixed module build errors on FreeBSD 4.
5647
5648Tools/Demos
5649-----------
5650
5651- Issue #3717: Fix Demo/embed/demo.c.
5652
5653- Issue #4072: Add a distutils demo for build_py_2to3.
5654
5655
5656What's New in Python 3.0 release candidate 1
5657============================================
5658
5659*Release date: 17-Sep-2008*
5660
5661Core and Builtins
5662-----------------
5663
5664- Issue #3827: memoryview lost its size attribute in favor of using len(view).
5665
5666- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
5667
5668- Issue #3705: fix crash when given a non-ascii value on the command line for
5669 the "-c" and "-m" parameters. Now the behaviour is as expected under Linux,
5670 although under Windows it fails at a later point.
5671
5672- Issue #3279: Importing site at interpreter was failing silently because the
5673 site module uses the open builtin which was not initialized at the time.
5674
5675- Issue #3660: Corrected a reference leak in str.encode() when the encoder
5676 does not return a bytes object.
5677
5678- Issue #3774: Added a few more checks in PyTokenizer_FindEncoding to handle
5679 error conditions.
5680
5681- Issue #3594: Fix Parser/tokenizer.c:fp_setreadl() to open the file being
5682 tokenized by either a file path or file pointer for the benefit of
5683 PyTokenizer_FindEncoding().
5684
5685- Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin. On
5686 these systems, the mbstowcs() function is slightly buggy and must be
5687 replaced with strlen() for the purpose of counting of number of wide
5688 characters needed to represent the multi-byte character string.
5689
5690- Issue #3697: "Fatal Python error: Cannot recover from stack overflow"
5691 could be easily encountered under Windows in debug mode when exercising
5692 the recursion limit checking code, due to bogus handling of recursion
5693 limit when USE_STACKCHEK was enabled.
5694
5695- Issue 3639: The _warnings module could segfault the interpreter when
5696 unexpected types were passed in as arguments.
5697
5698- Issue #3712: The memoryview object had a reference leak and didn't support
5699 cyclic garbage collection.
5700
5701- Issue #3668: Fix a memory leak with the "s*" argument parser in
5702 PyArg_ParseTuple and friends, which occurred when the argument for "s*"
5703 was correctly parsed but parsing of subsequent arguments failed.
5704
5705- Issue #3611: An exception __context__ could be cleared in a complex pattern
5706 involving a __del__ method re-raising an exception.
5707
5708- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
5709 match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
5710 mechanism. In the process, fix a bug where isinstance() and issubclass(),
5711 when given a tuple of classes as second argument, were looking up
5712 __instancecheck__ / __subclasscheck__ on the tuple rather than on each
5713 type object.
5714
5715- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
5716
5717- Issue #3651: Fix various memory leaks when using the buffer
5718 interface, or when the "s#" code of PyArg_ParseTuple is given a
5719 bytes object.
5720
5721- Issue #3657: Fix uninitialized memory read when pickling longs.
5722 Found by valgrind.
5723
5724- Apply security patches from Apple.
5725
5726- Fix crashes on memory allocation failure found with failmalloc.
5727
5728- Fix memory leaks found with valgrind and update suppressions file.
5729
5730- Fix compiler warnings in opt mode which would lead to invalid memory reads.
5731
5732- Fix problem using wrong name in decimal module reported by pychecker.
5733
5734- Issue #3650: Fixed a reference leak in bytes.split('x').
5735
5736- bytes(o) now tries to use o.__bytes__() before using fallbacks.
5737
5738- Issue #1204: The configure script now tests for additional libraries
5739 that may be required when linking against readline. This fixes issues
5740 with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
5741
5742C API
5743-----
5744
5745- PyObject_Bytes and PyBytes_FromObject were added.
5746
5747Library
5748-------
5749
5750- Issue #3756: make re.escape() handle bytes as well as str.
5751
5752- Issue #3800: fix filter() related bug in formatter.py.
5753
5754- Issue #874900: fix behaviour of threading module after a fork.
5755
5756- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
5757
5758- Issue #3776: Deprecate the bsddb package for removal in 3.0.
5759
5760- Issue #3762: platform.architecture() fails if python is lanched via
5761 its symbolic link.
5762
5763- Issue #3660: fix a memory leak in the C accelerator of the pickle module.
5764
5765- Issue #3160: the "bdist_wininst" distutils command didn't work.
5766
5767- Issue #1658: tkinter changes dict size during iteration in both
5768 tkinter.BaseWidget and tkinter.scrolledtext.ScrolledText.
5769
5770- The bsddb module (and therefore the dbm.bsd module) has been removed.
5771 It is now maintained outside of the standard library at
5772 http://www.jcea.es/programacion/pybsddb.htm.
5773
5774- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
5775 to the urlparse one. Added a DeprecationWarning in the old module, it
5776 will be deprecated in the future.
5777
5778- Issue #3719: platform.architecture() fails if there are spaces in the
5779 path to the Python binary.
5780
5781- Issue 3602: As part of the merge of r66135, make the parameters on
5782 warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning.
5783
5784- The deprecation warnings for the camelCase threading API names were removed.
5785
5786- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
5787 SEM_VALUE_MAX.
5788
5789Extension Modules
5790-----------------
5791
5792- Issue #3782: os.write() must not accept unicode strings.
5793
5794- Issue #2975: When compiling several extension modules with Visual Studio 2008
5795 from the same python interpreter, some environment variables would grow
5796 without limit.
5797
5798- Issue #3643: Added a few more checks to _testcapi to prevent segfaults by
5799 exploitation of poor argument checking.
5800
5801- bsddb code updated to version 4.7.3pre2. This code is the same than
5802 Python 2.6 one, since the intention is to keep an unified 2.x/3.x codebase.
5803 The Python code is automatically translated using "2to3". Please, do not
5804 update this code in Python 3.0 by hand. Update the 2.6 one and then
5805 do "2to3".
5806
5807- The _bytesio and _stringio modules are now compiled into the python binary.
5808
5809- Issue #3492 and #3790: Fixed the zlib module and zipimport module uses of
5810 mutable bytearray objects where they should have been using immutable bytes.
5811
5812- Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to
5813 return bytes objects instead of bytearray objects.
5814
5815
5816Tools/Demos
5817-----------
5818
5819- Fix Misc/gdbinit so it works.
5820
5821
5822Build
5823-----
5824
5825- Issue #3812: Failed to build python if configure --without-threads.
5826
5827- Issue #3791: Remove the bsddb module from the Windows installer, and the
5828 core bsddb library from the Windows build files.
5829
5830
5831What's new in Python 3.0b3?
5832===========================
5833
5834*Release date: 20-Aug-2008*
5835
5836Core and Builtins
5837-----------------
5838
5839- Issue #3653: Fix a segfault when sys.excepthook was called with invalid
5840 arguments.
5841
5842- Issue #2394: implement more of the memoryview API, with the caveat that
5843 only one-dimensional contiguous buffers are supported and exercised right
5844 now. Slicing, slice assignment and comparison (equality and inequality)
5845 have been added. Also, the tolist() method has been implemented, but only
Georg Brandl98b52ef2009-05-25 22:20:44 +00005846 for byte buffers. Finally, the API has been updated to return bytes objects
Barry Warsaw97f005d2008-12-03 16:46:14 +00005847 wherever it used to return bytearrays.
5848
5849- Issue #3560: clean up the new C PyMemoryView API so that naming is
5850 internally consistent; add macros PyMemoryView_GET_BASE() and
5851 PyMemoryView_GET_BUFFER() to access useful properties of a memory views
5852 without relying on a particular implementation; remove the ill-named
5853 PyMemoryView() function (PyMemoryView_GET_BUFFER() can be used instead).
5854
5855- ctypes function pointers that are COM methods have a boolean True
5856 value again.
5857
5858- Issue #1819: function calls with several named parameters are now on
5859 average 35% faster (as measured by pybench).
5860
5861- The undocumented C APIs PyUnicode_AsString() and
5862 PyUnicode_AsStringAndSize() were made private to the interpreter, in
5863 order to be able to refine their interfaces for Python 3.1.
5864
5865 If you need to access the UTF-8 representation of a Unicode object
5866 as bytes string, please use PyUnicode_AsUTF8String() instead.
5867
5868- Issue #3460: PyUnicode_Join() implementation is 10% to 80% faster thanks
5869 to Python 3.0's stricter semantics which allow to avoid successive
5870 reallocations of the result string (this also affects str.join()).
5871
5872
5873Library
5874-------
5875
5876- Issue #1276: Added temporary aliases for CJK Mac encodings to resolve
5877 a build problem on MacOS with CJK locales. It adds four temporary
5878 mappings to existing legacy codecs that are virtually compatible
5879 with Mac encodings. They will be replaced by codecs correctly
5880 implemented in 3.1.
5881
5882- Issue #3614: Corrected a typo in xmlrpc.client, leading to a NameError
5883 "global name 'header' is not defined".
5884
5885- Issue #2834: update the regular expression library to match the unicode
5886 standards of py3k. In other words, mixing bytes and unicode strings
5887 (be it as pattern, search string or replacement string) raises a TypeError.
5888 Moreover, the re.UNICODE flag is enabled automatically for unicode patterns,
5889 and can be disabled by specifying a new re.ASCII flag; as for bytes
5890 patterns, ASCII matching is the only option and trying to specify re.UNICODE
5891 for such patterns raises a ValueError.
5892
5893- Issue #3300: make urllib.parse.[un]quote() default to UTF-8.
5894 Code contributed by Matt Giuca. quote() now encodes the input
5895 before quoting, unquote() decodes after unquoting. There are
5896 new arguments to change the encoding and errors settings.
5897 There are also new APIs to skip the encode/decode steps.
5898 [un]quote_plus() are also affected.
5899
5900- Issue #2235: numbers.Number now blocks inheritance of the default id()
5901 based hash because that hash mechanism is not correct for numeric types.
5902 All concrete numeric types that inherit from Number (rather than just
5903 registering with it) must explicitly provide a hash implementation in
5904 order for their instances to be hashable.
5905
5906- Issue #2676: in the email package, content-type parsing was hanging on
5907 pathological input because of quadratic or exponential behaviour of a
5908 regular expression.
5909
5910- Issue #3476: binary buffered reading through the new "io" library is now
5911 thread-safe.
5912
5913- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
5914 menu entries were not deleted.
5915
5916- Remove the TarFileCompat class from tarfile.py.
5917
5918- Issue #2491: os.fdopen is now almost an alias for the built-in open(), and
5919 accepts the same parameters. It just checks that its first argument is an
5920 integer.
5921
5922- Issue #3394: zipfile.writestr sets external attributes when passed a
5923 file name rather than a ZipInfo instance, so files are extracted with
5924 mode 0600 rather than 000 under Unix.
5925
5926- Issue #2523: Fix quadratic behaviour when read()ing a binary file without
5927 asking for a specific length.
5928
5929Extension Modules
5930-----------------
5931
5932- Bug #3542: Support Unicode strings in _msi module.
5933
5934What's new in Python 3.0b2?
5935===========================
5936
5937*Release date: 17-Jul-2008*
5938
5939Core and Builtins
5940-----------------
5941
5942- Issue #3008: the float type has a new instance method 'float.hex'
5943 and a new class method 'float.fromhex' to convert floating-point
5944 numbers to and from hexadecimal strings, respectively.
5945
5946- Issue #3083: Add alternate (#) formatting for bin, oct, hex output
5947 for str.format(). This adds the prefix 0b, 0o, or 0x, respectively.
5948
5949- Issue #3280: like chr(), the "%c" format now accepts unicode code points
5950 beyond the Basic Multilingual Plane (above 0xffff) on all configurations. On
5951 "narrow Unicode" builds, the result is a string of 2 code units, forming a
5952 UTF-16 surrogate pair.
5953
5954- Issue #3282: str.isprintable() should return False for undefined
5955 Unicode characters.
5956
5957- Issue #3236: Return small longs from PyLong_FromString.
5958
5959- Exception tracebacks now support exception chaining.
5960
5961Library
5962-------
5963
5964- Removed the sunaudio module. Use sunau instead.
5965
5966- Issue #3554: ctypes.string_at and ctypes.wstring_at did call Python
5967 api functions without holding the GIL, which could lead to a fatal
5968 error when they failed.
5969
5970- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
5971
5972- Removed "ast" function aliases from the parser module.
5973
5974- Issue #3313: Fixed a crash when a failed dlopen() call does not set
5975 a valid dlerror() message.
5976
5977- Issue #3258: Fixed a crash when a ctypes POINTER type to an
5978 incomplete structure was created.
5979
5980- Issue #2683: Fix inconsistency in subprocess.Popen.communicate(): the
5981 argument now must be a bytes object in any case.
5982
5983- Issue #3145: help("modules whatever") failed when trying to load the source
5984 code of every single module of the standard library, including invalid files
5985 used in the test suite.
5986
5987- The gettext library now consistently uses Unicode strings for message ids
5988 and message strings, and ``ugettext()`` and the like don't exist anymore.
5989
5990- The traceback module has been expanded to handle chained exceptions.
5991
5992C API
5993-----
5994
5995- Issue #3247: the function Py_FindMethod was removed. Modern types should
5996 use the tp_methods slot instead.
5997
5998Tools/Demos
5999-----------
6000
6001- The Mac/Demos directory has been removed.
6002
6003- All of the Mac scripts have been removed (including BuildApplet.py).
6004
6005
6006What's new in Python 3.0b1?
6007===========================
6008
6009*Release date: 18-Jun-2008*
6010
6011Core and Builtins
6012-----------------
6013
6014- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
6015 argument being anything other than a dict or None. Also fixed a bug in error
6016 handling when 'message' and 'category' were both set to None, triggering a
6017 bus error.
6018
6019- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
6020 holds the last (strong) reference to its referent.
6021
6022- Issue #2630: implement PEP 3138. repr() now returns printable
6023 Unicode characters unescaped, to get an ASCII-only representation
6024 of an object use ascii().
6025
6026- Issue #1342: On windows, Python could not start when installed in a
6027 directory with non-ascii characters.
6028
6029- Implement PEP 3121: new module initialization and finalization API.
6030
6031- Removed the already-defunct ``-t`` option.
6032
6033- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
6034 unmarshalling many code objects, which happens when importing a
6035 large .pyc file (~1000 functions).
6036
6037- Issue #2963: fix merging oversight that disabled method cache for
6038 all types.
6039
6040- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
6041
6042- Issue #2895: Don't crash when given bytes objects as keyword names.
6043
6044- Issue #2798: When parsing arguments with PyArg_ParseTuple, the "s"
6045 code now allows any unicode string and returns a utf-8 encoded
6046 buffer, just like the "s#" code already does. The "z" code was
6047 corrected as well.
6048
6049- Issue #2863: generators now have a ``gen.__name__`` attribute that
6050 equals ``gen.gi_code.co_name``, like ``func.__name___`` that equals
6051 ``func.func_code.co_name``. The repr() of a generator now also
6052 contains this name.
6053
6054- Issue #2831: enumerate() now has a ``start`` argument.
6055
6056- Issue #2801: fix bug in the float.is_integer method where a
6057 ValueError was sometimes incorrectly raised.
6058
6059- The ``--with-toolbox-glue`` option (and the associated
6060 pymactoolbox.h) have been removed.
6061
6062- Issue #2196: hasattr() now lets exceptions which do not inherit
6063 Exception (KeyboardInterrupt, and SystemExit) propagate instead of
6064 ignoring them.
6065
6066- #3021 Exception reraising sematics have been significantly improved. However,
6067 f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
6068 code anymore.
6069
6070- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
6071 removed.
6072
6073Extension Modules
6074-----------------
6075
6076- Renamed ``_winreg`` module to ``winreg``.
6077
6078- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the
6079 platform.
6080
6081- Support for Windows 9x has been removed from the winsound module.
6082
6083- Issue #2870: cmathmodule.c compile error.
6084
6085Library
6086-------
6087
6088- The methods ``is_in_tuple()``, ``is_vararg()``, and ``is_keywordarg()`` of
6089 symtable.Symbol have been removed.
6090
6091- Patch #3133: http.server.CGIHTTPRequestHandler did not work on windows.
6092
6093- a new ``urllib`` package was created. It consists of code from
6094 ``urllib``, ``urllib2``, ``urlparse``, and ``robotparser``. The old
6095 modules have all been removed. The new package has five submodules:
6096 ``urllib.parse``, ``urllib.request``, ``urllib.response``,
6097 ``urllib.error``, and ``urllib.robotparser``. The
6098 ``urllib.request.urlopen()`` function uses the url opener from
6099 ``urllib2``. (Note that the unittests have not been renamed for the
6100 beta, but they will be renamed in the future.)
6101
6102- rfc822 has been removed in favor of the email package.
6103
6104- mimetools has been removed in favor of the email package.
6105
6106- Patch #2849: Remove use of rfc822 module from standard library.
6107
6108- Added C optimized implementation of io.StringIO.
6109
6110- The ``pickle`` module is now automatically use an optimized C
6111 implementation of Pickler and Unpickler when available. The
6112 ``cPickle`` module is no longer needed.
6113
6114- Removed the ``htmllib`` and ``sgmllib`` modules.
6115
6116- The deprecated ``SmartCookie`` and ``SimpleCookie`` classes have
6117 been removed from ``http.cookies``.
6118
6119- The ``commands`` module has been removed. Its getoutput() and
6120 getstatusoutput() functions have been moved to the ``subprocess`` module.
6121
6122- The ``http`` package was created; it contains the old ``httplib``
6123 as ``http.client``, ``Cookie`` as ``http.cookies``, ``cookielib``
6124 as ``http.cookiejar``, and the content of the three ``HTTPServer``
6125 modules as ``http.server``.
6126
6127- The ``xmlrpc`` package was created; it contains the old
6128 ``xmlrpclib`` module as ``xmlrpc.client`` and the content of
6129 the old ``SimpleXMLRPCServer`` and ``DocXMLRPCServer`` modules
6130 as ``xmlrpc.server``.
6131
6132- The ``dbm`` package was created, containing the old modules
6133 ``anydbm`` and ``whichdb`` in its ``__init__.py``, and having
6134 ``dbm.gnu`` (was ``gdbm``), ``dbm.bsd`` (was ``dbhash``),
6135 ``dbm.ndbm`` (was ``dbm``) and ``dbm.dumb`` (was ``dumbdbm``)
6136 as submodules.
6137
6138- The ``repr`` module has been renamed to ``reprlib``.
6139
6140- The ``statvfs`` module has been removed.
6141
6142- Issue #1713041: fix pprint's handling of maximum depth.
6143
6144- Issue #2250: Exceptions raised during evaluation of names in
6145 rlcompleter's ``Completer.complete()`` method are now caught and
6146 ignored.
6147
6148- Patch #2659: Added ``break_on_hyphens`` option to textwrap's
6149 ``TextWrapper`` class.
6150
6151- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
6152 large to fit in a C long. ldexp(x, n) now returns a zero (with
6153 suitable sign) if n is large and negative; previously, it raised
6154 OverflowError.
6155
6156- The ``ConfigParser`` module has been renamed to ``configparser``.
6157
6158- Issue #2865: webbrowser.open() works again in a KDE environment.
6159
6160- The ``multifile`` module has been removed.
6161
6162- The ``SocketServer`` module has been renamed to ``socketserver``.
6163
6164- Fixed the ``__all__`` setting on ``collections`` to include
6165 ``UserList`` and ``UserString``.
6166
6167- The sre module has been removed.
6168
6169- The Queue module has been renamed to queue.
6170
6171- The copy_reg module has been renamed to copyreg.
6172
6173- The mhlib module has been removed.
6174
6175- The ihooks module has been removed.
6176
6177- The fpformat module has been removed.
6178
6179- The dircache module has been removed.
6180
6181- The Canvas module has been removed.
6182
6183- The Decimal module gained the magic methods __round__, __ceil__,
6184 __floor__ and __trunc__, to give support for round, math.ceil,
6185 math.floor and math.trunc.
6186
6187- The user module has been removed.
6188
6189- The mutex module has been removed.
6190
6191- The imputil module has been removed.
6192
6193- os.path.walk has been removed in favor of os.walk.
6194
6195- pdb gained the "until" command.
6196
6197- The test.test_support module has been renamed to test.support.
6198
6199- The threading module API was renamed to be PEP 8 compliant. The
6200 old names are still present, but will be removed in the near future.
6201
6202Tools/Demos
6203-----------
6204
6205- The bgen tool has been removed.
6206
6207Build
6208-----
6209
6210
6211What's New in Python 3.0a5?
6212===========================
6213
6214*Release date: 08-May-2008*
6215
6216Core and Builtins
6217-----------------
6218
6219- Fixed misbehaviour of PyLong_FromSsize_t on systems where
6220 sizeof(size_t) > sizeof(long).
6221
6222- Issue #2221: Corrected a SystemError "error return without exception
6223 set", when the code executed by exec() raises an exception, and
6224 sys.stdout.flush() also raises an error.
6225
6226- Bug #2565: The repr() of type objects now calls them 'class', not
6227 'type' - whether they are builtin types or not.
6228
6229- The command line processing was converted to pass Unicode strings
6230 through as unmodified as possible; as a consequence, the C API
6231 related to command line arguments was changed to use wchar_t.
6232
6233- All backslashes in raw strings are interpreted literally. This
6234 means that '\u' and '\U' escapes are not treated specially.
6235
6236Extension Modules
6237-----------------
6238
6239Library
6240-------
6241
6242- ctypes objects now support the PEP3118 buffer interface.
6243
6244- Issue #2682: ctypes callback functions now longer contain a cyclic
6245 reference to themselves.
6246
6247- Issue #2058: Remove the buf attribute and add __slots__ to the
6248 TarInfo class in order to reduce tarfile's memory usage.
6249
6250- Bug #2606: Avoid calling .sort() on a dict_keys object.
6251
6252- The bundled libffi copy is now in sync with the recently released
6253 libffi3.0.5 version, apart from some small changes to
6254 Modules/_ctypes/libffi/configure.ac.
6255
6256Build
6257-----
6258
6259- Issue #1496032: On alpha, use -mieee when gcc is the compiler.
6260
6261- "make install" is now an alias for "make altinstall", to prevent
6262 accidentally overwriting a Python 2.x installation. Use "make
6263 fullinstall" to force Python 3.0 to be installed as "python".
6264
6265- Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when
6266 gcc is used as compiler.
6267
6268
6269What's New in Python 3.0a4?
6270===========================
6271
6272*Release date: 02-Apr-2008*
6273
6274Core and Builtins
6275-----------------
6276
6277- Bug #2301: Don't try decoding the source code into the original
6278 encoding for syntax errors.
6279
6280Extension Modules
6281-----------------
6282
6283- The dl module was removed, use the ctypes module instead.
6284
6285- Use wchar_t functions in _locale module.
6286
6287Library
6288-------
6289
6290- The class distutils.commands.build_py.build_py_2to3 can be used as a
6291 build_py replacement to automatically run 2to3 on modules that are
6292 going to be installed.
6293
6294- A new pickle protocol (protocol 3) is added with explicit support
6295 for bytes. This is the default protocol. It intentionally cannot
6296 be unpickled by Python 2.x.
6297
6298- When a pickle written by Python 2.x contains an (8-bit) str
6299 instance, this is now decoded to a (Unicode) str instance. The
6300 encoding used to do this defaults to ASCII, but can be overridden
6301 via two new keyword arguments to the Unpickler class. Previously
6302 this would create bytes instances, which is usually wrong: str
6303 instances are often used to pickle attribute names etc., and text is
6304 more common than binary data anyway.
6305
6306- Default to ASCII as the locale.getpreferredencoding, if the POSIX
6307 system doesn't support CODESET and LANG isn't set or doesn't allow
6308 deduction of an encoding.
6309
6310- Issue #1202: zlib.crc32 and zlib.adler32 now return an unsigned
6311 value.
6312
6313- Issue #719888: Updated tokenize to use a bytes API. generate_tokens
6314 has been renamed tokenize and now works with bytes rather than
6315 strings. A new detect_encoding function has been added for
6316 determining source file encoding according to PEP-0263. Token
6317 sequences returned by tokenize always start with an ENCODING token
6318 which specifies the encoding used to decode the file. This token is
6319 used to encode the output of untokenize back to bytes.
6320
6321
6322What's New in Python 3.0a3?
6323===========================
6324
6325*Release date: 29-Feb-2008*
6326
6327Core and Builtins
6328-----------------
6329
6330- Issue #2282: io.TextIOWrapper was not overriding seekable() from
6331 io.IOBase.
6332
6333- Issue #2115: Important speedup in setting __slot__ attributes. Also
6334 prevent a possible crash: an Abstract Base Class would try to access
6335 a slot on a registered virtual subclass.
6336
6337- Fixed repr() and str() of complex numbers with infinity or nan as
6338 real or imaginary part.
6339
6340- Clear all free list during a gc.collect() of the highest generation
6341 in order to allow pymalloc to free more arenas. Python may give back
6342 memory to the OS earlier.
6343
6344- Issue #2045: Fix an infinite recursion triggered when printing a
6345 subclass of collections.defaultdict, if its default_factory is set
6346 to a bound method.
6347
6348- Fixed a minor memory leak in dictobject.c. The content of the free
6349 list was not freed on interpreter shutdown.
6350
6351- Limit free list of method and builtin function objects to 256
6352 entries each.
6353
6354- Patch #1953: Added ``sys._compact_freelists()`` and the C API
6355 functions ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
6356 to compact the internal free lists of pre-allocted ints and floats.
6357
6358- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
6359 Python expected the return type int but the fork familie returns
6360 pi_t.
6361
6362- Issue #1678380: Fix a bug that identifies 0j and -0j when they
6363 appear in the same code unit.
6364
6365- Issue #2025: Added tuple.count() and tuple.index() methods to comply
6366 with the collections.Sequence API.
6367
6368- Fixed multiple reinitialization of the Python interpreter. The small
6369 int list in longobject.c has caused a seg fault during the third
6370 finalization.
6371
6372- Issue #1973: bytes.fromhex('') raised SystemError.
6373
6374- Issue #1771: remove cmp parameter from sorted() and list.sort().
6375
6376- Issue #1969: split and rsplit in bytearray are inconsistent.
6377
6378- map() no longer accepts None for the first argument. Use zip()
6379 instead.
6380
6381- Issue #1769: Now int("- 1") is not allowed any more.
6382
6383- Object/longobject.c: long(float('nan')) raises an OverflowError
6384 instead of returning 0.
6385
6386- Issue #1762972: __file__ points to the source file instead of the
6387 pyc/pyo file if the py file exists.
6388
6389- Issue #1393: object_richcompare() returns NotImplemented instead of
6390 False if the objects aren't equal, to give the other side a chance.
6391
6392- Issue #1692: Interpreter was not displaying location of SyntaxError.
6393
6394- Improve some exception messages when Windows fails to load an
6395 extension module. Now we get for example '%1 is not a valid Win32
6396 application' instead of 'error code 193'. Also use Unicode strings
6397 to deal with non-English locales.
6398
6399- Issue #1587: Added instancemethod wrapper for PyCFunctions. The
6400 Python C API has gained a new type *PyInstanceMethod_Type* and the
6401 functions *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)*
6402 and *PyInstanceMethod_Function(im)*.
6403
6404- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed
6405 from the gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE
6406 are now enough to print the corresponding list of objects considered
6407 by the garbage collector.
6408
6409- Issue #1573: Improper use of the keyword-only syntax makes the
6410 parser crash.
6411
6412- Issue #1564: The set implementation should special-case PyUnicode
6413 instead of PyString.
6414
6415- Patch #1031213: Decode source line in SyntaxErrors back to its
6416 original source encoding.
6417
6418- inspect.getsource() includes the decorators again.
6419
6420- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
6421 mountpoint.
6422
6423- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when
6424 the first chunk fed to the decoder started with a BOM, but was
6425 longer than 3 bytes.
6426
6427Extension Modules
6428-----------------
6429
6430- Code for itertools ifilter(), imap(), and izip() moved to bultins
6431 and renamed to filter(), map(), and zip(). Also, renamed
6432 izip_longest() to zip_longest() and ifilterfalse() to filterfalse().
6433
6434- Issue #1762972: Readded the reload() function as imp.reload().
6435
6436- Bug #2111: mmap segfaults when trying to write a block opened with
6437 PROT_READ.
6438
6439- Issue #2063: correct order of utime and stime in os.times() result
6440 on Windows.
6441
6442Library
6443-------
6444
6445- Weakref dictionaries now inherit from MutableMapping.
6446
6447- Created new UserDict class in collections module. This one inherits
6448 from and complies with the MutableMapping ABC. Also, moved
6449 UserString and UserList to the collections module. The
6450 MutableUserString class was removed.
6451
6452- Removed UserDict.DictMixin. Replaced all its uses with
6453 collections.MutableMapping.
6454
6455- Issue #1703: getpass() should flush after writing prompt.
6456
6457- Issue #1585: IDLE uses non-existent xrange() function.
6458
6459- Issue #1578: Problems in win_getpass.
6460
6461Build
6462-----
6463
6464- Renamed --enable-unicode configure flag to --with-wide-unicode,
6465 since Unicode strings can't be disabled anymore.
6466
6467C API
6468-----
6469
6470- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
6471 Py_TYPE and Py_REFCNT.
6472
6473- New API PyImport_ImportModuleNoBlock(), works like
6474 PyImport_ImportModule() but won't block on the import lock
6475 (returning an error instead).
6476
6477
6478What's New in Python 3.0a2?
6479===========================
6480
6481*Release date: 07-Dec-2007*
6482
6483(Note: this list is incomplete.)
6484
6485Core and Builtins
6486-----------------
6487
6488- str8 now has the same construction signature as bytes.
6489
6490- Comparisons between str and str8 now return False/True for ==/!=.
6491 sqlite3 returns str8 when recreating on object from it's __conform__
6492 value. The struct module returns str8 for all string-related
6493 formats. This was true before this change, but becomes more
6494 apparent thanks to string comparisons always being False.
6495
6496- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode,
6497 buffer, encoding, newline)`.
6498
6499- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
6500
6501- Changed `__file__` and `co_filename` to unicode. The path names are decoded
6502 with `Py_FileSystemDefaultEncoding` and a new API method
6503 `PyUnicode_DecodeFSDefault(char*)` was added.
6504
6505- io.open() and _fileio.FileIO have grown a new argument closefd. A
6506 false value disables the closing of the file descriptor.
6507
6508- Added a new option -b to issues warnings (-bb for errors) about
6509 certain operations between bytes/buffer and str like str(b'') and
6510 comparison.
6511
6512- The standards streams sys.stdin, stdout and stderr may be None when
6513 the when the C runtime library returns an invalid file descriptor
6514 for the streams (fileno(stdin) < 0). For now this happens only for
6515 Windows GUI apps and scripts started with `pythonw.exe`.
6516
6517- Added PCbuild9 directory for VS 2008.
6518
6519- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to
6520 work around a name clash with VS 2008 on Windows.
6521
6522- Unbound methods are gone for good. ClassObject.method returns an
6523 ordinary function object, instance.method still returns a bound
6524 method object. The API of bound methods is cleaned up, too. The
6525 im_class attribute is removed and im_func + im_self are renamed to
6526 __func__ and __self__. The factory PyMethod_New takes only func and
6527 instance as argument.
6528
6529- intobject.h is no longer included by Python.h. The remains were
6530 moved to longobject.h. It still exists to define several aliases
6531 from PyInt to PyLong functions.
6532
6533- Removed sys.maxint, use sys.maxsize instead.
6534
6535Extension Modules
6536-----------------
6537
6538- The `hotshot` profiler has been removed; use `cProfile` instead.
6539
6540Library
6541-------
6542
6543- When loading an external file using testfile(), the passed-in
6544 encoding argument was being ignored if __loader__ is defined and
6545 forcing the source to be UTF-8.
6546
6547- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have
6548 been removed in favor of the tempfile module.
6549
6550- Removed the 'new' module.
6551
6552- Removed all types from the 'types' module that are easily accessable
6553 through builtins.
6554
6555
6556What's New in Python 3.0a1?
6557===========================
6558
6559*Release date: 31-Aug-2007*
6560
6561Core and Builtins
6562-----------------
6563
6564- PEP 3131: Support non-ASCII identifiers.
6565
6566- PEP 3120: Change default encoding to UTF-8.
6567
6568- PEP 3123: Use proper C inheritance for PyObject.
6569
6570- Removed the __oct__ and __hex__ special methods and added a bin()
6571 builtin function.
6572
6573- PEP 3127: octal literals now start with "0o". Old-style octal
6574 literals are invalid. There are binary literals with a prefix of
6575 "0b". This also affects int(x, 0).
6576
6577- None, True, False are now keywords.
6578
6579- PEP 3119: isinstance() and issubclass() can be overridden.
6580
6581- Remove BaseException.message.
6582
6583- Remove tuple parameter unpacking (PEP 3113).
6584
6585- Remove the f_restricted attribute from frames. This naturally leads
6586 to the removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
6587
6588- PEP 3132 was accepted. That means that you can do ``a, *b =
6589 range(5)`` to assign 0 to a and [1, 2, 3, 4] to b.
6590
6591- range() now returns an iterator rather than a list. Floats are not
6592 allowed. xrange() is no longer defined.
6593
6594- Patch #1660500: hide iteration variable in list comps, add set comps
6595 and use common code to handle compilation of iterative expressions.
6596
6597- By default, != returns the opposite of ==, unless the latter returns
6598 NotImplemented.
6599
6600- Patch #1680961: sys.exitfunc has been removed and replaced with a
6601 private C-level API.
6602
6603- PEP 3115: new metaclasses: the metaclass is now specified as a
6604 keyword arg in the class statement, which can now use the full
6605 syntax of a parameter list. Also, the metaclass can implement a
6606 __prepare__ function which will be called to create the dictionary
6607 for the new class namespace.
6608
6609- The long-deprecated argument "pend" of PyFloat_FromString() has been
6610 removed.
6611
6612- The dir() function has been extended to call the __dir__() method on
6613 its argument, if it exists. If not, it will work like before. This
6614 allows customizing the output of dir() in the presence of a
6615 __getattr__().
6616
6617- Removed support for __members__ and __methods__.
6618
6619- Removed indexing/slicing on BaseException.
6620
6621- input() became raw_input(): the name input() now implements the
6622 functionality formerly known as raw_input(); the name raw_input() is
6623 no longer defined.
6624
6625- Classes listed in an 'except' clause must inherit from
6626 BaseException.
6627
6628- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
6629 and .keys(), .items(), .values() return dict views, which behave
6630 like sets.
6631
6632- PEP 3105: print is now a function. Also (not in the PEP) the
6633 'softspace' attribute of files is now gone (since print() doesn't
6634 use it). A side effect of this change is that you can get
6635 incomplete output lines in interactive sessions:
6636
6637 >>> print(42, end="")
6638 42>>>
6639
6640 We may be able to fix this after the I/O library rewrite.
6641
6642- PEP 3102: keyword-only arguments.
6643
6644- Int/Long unification is complete. The 'long' built-in type and
6645 literals with trailing 'L' or 'l' have been removed. Performance
6646 may be sub-optimal (haven't really benchmarked).
6647
6648- 'except E, V' must now be spelled as 'except E as V' and deletes V
6649 at the end of the except clause; V must be a simple name.
6650
6651- Added function annotations per PEP 3107.
6652
6653- Added nonlocal declaration from PEP 3104:
6654
6655 >>> def f(x):
6656 ... def inc():
6657 ... nonlocal x
6658 ... x += 1
6659 ... return x
6660 ... return inc
6661 ...
6662 >>> inc = f(0)
6663 >>> inc()
6664 1
6665 >>> inc()
6666 2
6667
6668- Moved intern() to sys.intern().
6669
6670- exec is now a function.
6671
6672- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
6673
6674- Classic classes are a thing of the past. All classes are new style.
6675
6676- Exceptions *must* derive from BaseException.
6677
6678- Integer division always returns a float. The -Q option is no more.
6679 All the following are gone:
6680
6681 * PyNumber_Divide and PyNumber_InPlaceDivide
6682 * __div__, __rdiv__, and __idiv__
6683 * nb_divide, nb_inplace_divide
6684 * operator.div, operator.idiv, operator.__div__, operator.__idiv__
6685 (Only __truediv__ and __floordiv__ remain, not sure how to handle
6686 them if we want to re-use __div__ and friends. If we do, it will
6687 make it harder to write code for both 2.x and 3.x.)
6688
6689- 'as' and 'with' are keywords.
6690
6691- Absolute import is the default behavior for 'import foo' etc.
6692
6693- Removed support for syntax: backticks (ie, `x`), <>.
6694
6695- Removed these Python builtins: apply(), callable(), coerce(),
6696 execfile(), file(), reduce(), reload().
6697
6698- Removed these Python methods: {}.has_key.
6699
6700- Removed these opcodes: BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT.
6701
6702- Remove C API support for restricted execution.
6703
6704- zip(), map() and filter() now return iterators, behaving like their
6705 itertools counterparts. This also affect map()'s behavior on
6706 sequences of unequal length -- it now stops after the shortest one
6707 is exhausted.
6708
6709- Additions: set literals, set comprehensions, ellipsis literal.
6710
6711- Added class decorators per PEP 3129.
6712
6713
6714Extension Modules
6715-----------------
6716
6717- Removed the imageop module. Obsolete long with its unit tests
6718 becoming useless from the removal of rgbimg and imgfile.
6719
6720- Removed these attributes from the operator module: div, idiv,
6721 __div__, __idiv__, isCallable, sequenceIncludes.
6722
6723- Removed these attributes from the sys module: exc_clear(), exc_type,
6724 exc_value, exc_traceback.
6725
6726
6727Library
6728-------
6729
6730- Removed the compiler package. Use of the _ast module and (an
6731 eventual) AST -> bytecode mechanism.
6732
6733- Removed these modules: audiodev, Bastion, bsddb185, exceptions,
6734 linuxaudiodev, md5, MimeWriter, mimify, popen2, rexec, sets, sha,
6735 stringold, strop, sunaudiodev, timing, xmllib.
6736
6737- Moved the toaiff module to Tools/Demos.
6738
6739- Removed obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL,
6740 DEVICE, ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile,
6741 IOCTL, jpeg, panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
6742
6743- Removed obsolete functions: commands.getstatus(), os.popen*().
6744
6745- Removed functions in the string module that are also string methods;
6746 Remove string.{letters, lowercase, uppercase}.
6747
6748- Removed support for long obsolete platforms: plat-aix3, plat-irix5.
6749
6750- Removed xmlrpclib.SlowParser. It was based on xmllib.
6751
6752- Patch #1680961: atexit has been reimplemented in C.
6753
6754- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
6755
6756Build
6757-----
6758
6759C API
6760-----
6761
6762- Removed these Python slots: __coerce__, __div__, __idiv__, __rdiv__.
6763
6764- Removed these C APIs: PyNumber_Coerce(), PyNumber_CoerceEx(),
6765 PyMember_Get, PyMember_Set.
6766
6767- Removed these C slots/fields: nb_divide, nb_inplace_divide.
6768
6769- Removed these macros: staticforward, statichere, PyArg_GetInt,
6770 PyArg_NoArgs, _PyObject_Del.
6771
6772- Removed these typedefs: intargfunc, intintargfunc, intobjargproc,
6773 intintobjargproc, getreadbufferproc, getwritebufferproc,
6774 getsegcountproc, getcharbufferproc, memberlist.
6775
6776Tests
6777-----
6778
6779- Removed test.testall as test.regrtest replaces it.
6780
6781Documentation
6782-------------
6783
6784Mac
6785---
6786
6787- The cfmfile module was removed.
6788
6789Platforms
6790---------
6791
6792- Support for BeOS and AtheOS was removed (according to PEP 11).
6793
6794- Support for RiscOS, Irix, Tru64 was removed (alledgedly).
6795
6796Tools/Demos
6797-----------
6798
6799
Christian Heimesc3f30c42008-02-22 16:37:40 +00006800What's New in Python 2.5 release candidate 1?
6801=============================================
6802
6803*Release date: 17-AUG-2006*
6804
6805Core and builtins
6806-----------------
6807
6808- Unicode objects will no longer raise an exception when being
6809 compared equal or unequal to a string and a UnicodeDecodeError
6810 exception occurs, e.g. as result of a decoding failure.
6811
6812 Instead, the equal (==) and unequal (!=) comparison operators will
6813 now issue a UnicodeWarning and interpret the two objects as
6814 unequal. The UnicodeWarning can be filtered as desired using
6815 the warning framework, e.g. silenced completely, turned into an
6816 exception, logged, etc.
6817
6818 Note that compare operators other than equal and unequal will still
6819 raise UnicodeDecodeError exceptions as they've always done.
6820
6821- Fix segfault when doing string formatting on subclasses of long.
6822
6823- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
6824 with new-style classes.
6825
6826- Fix bug related to __len__ functions returning negative values with
6827 classic classes.
6828
6829- Patch #1538606, Fix __index__() clipping. There were some problems
6830 discovered with the API and how integers that didn't fit into Py_ssize_t
6831 were handled. This patch attempts to provide enough alternatives
6832 to effectively use __index__.
6833
6834- Bug #1536021: __hash__ may now return long int; the final hash
6835 value is obtained by invoking hash on the long int.
6836
6837- Bug #1536786: buffer comparison could emit a RuntimeWarning.
6838
6839- Bug #1535165: fixed a segfault in input() and raw_input() when
6840 sys.stdin is closed.
6841
6842- On Windows, the PyErr_Warn function is now exported from
6843 the Python dll again.
6844
6845- Bug #1191458: tracing over for loops now produces a line event
6846 on each iteration. Fixing this problem required changing the .pyc
6847 magic number. This means that .pyc files generated before 2.5c1
6848 will be regenerated.
6849
6850- Bug #1333982: string/number constants were inappropriately stored
6851 in the byte code and co_consts even if they were not used, ie
6852 immediately popped off the stack.
6853
6854- Fixed a reference-counting problem in property().
6855
6856
6857Library
6858-------
6859
6860- Fix a bug in the ``compiler`` package that caused invalid code to be
6861 generated for generator expressions.
6862
6863- The distutils version has been changed to 2.5.0. The change to
6864 keep it programmatically in sync with the Python version running
6865 the code (introduced in 2.5b3) has been reverted. It will continue
6866 to be maintained manually as static string literal.
6867
6868- If the Python part of a ctypes callback function returns None,
6869 and this cannot be converted to the required C type, an exception is
6870 printed with PyErr_WriteUnraisable. Before this change, the C
6871 callback returned arbitrary values to the calling code.
6872
6873- The __repr__ method of a NULL ctypes.py_object() no longer raises
6874 an exception.
6875
6876- uuid.UUID now has a bytes_le attribute. This returns the UUID in
6877 little-endian byte order for Windows. In addition, uuid.py gained some
6878 workarounds for clocks with low resolution, to stop the code yielding
6879 duplicate UUIDs.
6880
6881- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
6882 before raising SystemExit, allowing IDLE to honor quit() and exit().
6883
6884- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
6885
6886- Patch #1536071: trace.py should now find the full module name of a
6887 file correctly even on Windows.
6888
6889- logging's atexit hook now runs even if the rest of the module has
6890 already been cleaned up.
6891
6892- Bug #1112549, fix DoS attack on cgi.FieldStorage.
6893
6894- Bug #1531405, format_exception no longer raises an exception if
6895 str(exception) raised an exception.
6896
6897- Fix a bug in the ``compiler`` package that caused invalid code to be
6898 generated for nested functions.
6899
6900
6901Extension Modules
6902-----------------
6903
6904- Patch #1511317: don't crash on invalid hostname (alias) info.
6905
6906- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
6907 raises the correct exceptions.
6908
6909- Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The
6910 '-no-stack-protector' compiler flag for OpenBSD has been removed.
6911
6912- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
6913 uses the _as_parameter_ attribute when objects are passed to foreign
6914 function calls. The ctypes version number was changed to 1.0.1.
6915
6916- Bug #1530559, struct.pack raises TypeError where it used to convert.
6917 Passing float arguments to struct.pack when integers are expected
6918 now triggers a DeprecationWarning.
6919
6920
6921Tests
6922-----
6923
6924- test_socketserver should now work on cygwin and not fail sporadically
6925 on other platforms.
6926
6927- test_mailbox should now work on cygwin versions 2006-08-10 and later.
6928
6929- Bug #1535182: really test the xreadlines() method of bz2 objects.
6930
6931- test_threading now skips testing alternate thread stack sizes on
6932 platforms that don't support changing thread stack size.
6933
6934
6935Documentation
6936-------------
6937
6938- Patch #1534922: unittest docs were corrected and enhanced.
6939
6940
6941Build
6942-----
6943
6944- Bug #1535502, build _hashlib on Windows, and use masm assembler
6945 code in OpenSSL.
6946
6947- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
6948
6949- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
6950
6951
6952C API
6953-----
6954
6955- New API for Unicode rich comparisons: PyUnicode_RichCompare()
6956
6957- Bug #1069160. Internal correctness changes were made to
6958 ``PyThreadState_SetAsyncExc()``. A test case was added, and
6959 the documentation was changed to state that the return value
6960 is always 1 (normal) or 0 (if the specified thread wasn't found).
6961
6962
6963What's New in Python 2.5 beta 3?
6964================================
6965
6966*Release date: 03-AUG-2006*
6967
6968Core and builtins
6969-----------------
6970
6971- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
6972 returned a long (see PEP 353).
6973
6974- Bug #1515471: string.replace() accepts character buffers again.
6975
6976- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
6977 This provides the proper warning for struct.pack().
6978 PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
6979
6980- Patch #1531113: Fix augmented assignment with yield expressions.
6981 Also fix a SystemError when trying to assign to yield expressions.
6982
6983- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
6984 with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
6985 used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
6986 excessive filesystem operations during imports.
6987
6988- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
6989 operations on signed longs that are formally undefined by C.
6990 Unfortunately, at least one compiler now cares about that, so complicated
6991 the code to make that compiler happy again.
6992
6993- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
6994
6995- Patch #1232023: Stop including current directory in search
6996 path on Windows.
6997
6998- Fix some potential crashes found with failmalloc.
6999
7000- Fix warnings reported by Klocwork's static analysis tool.
7001
7002- Bug #1512814, Fix incorrect lineno's when code within a function
7003 had more than 255 blank lines.
7004
7005- Patch #1521179: Python now accepts the standard options ``--help`` and
7006 ``--version`` as well as ``/?`` on Windows.
7007
7008- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
7009 again. Fixing this problem required changing the .pyc magic number.
7010 This means that .pyc files generated before 2.5b3 will be regenerated.
7011
7012- Bug #1524317: Compiling Python ``--without-threads`` failed.
7013 The Python core compiles again, and, in a build without threads, the
7014 new ``sys._current_frames()`` returns a dictionary with one entry,
7015 mapping the faux "thread id" 0 to the current frame.
7016
7017- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
7018
7019
7020Library
7021-------
7022
7023- Fix #1693149. Now you can pass several modules separated by
7024 comma to trace.py in the same --ignore-module option.
7025
7026- Correction of patch #1455898: In the mbcs decoder, set final=False
7027 for stream decoder, but final=True for the decode function.
7028
7029- os.urandom no longer masks unrelated exceptions like SystemExit or
7030 KeyboardInterrupt.
7031
7032- Bug #1525866: Don't copy directory stat times in
7033 shutil.copytree on Windows
7034
7035- Bug #1002398: The documentation for os.path.sameopenfile now correctly
7036 refers to file descriptors, not file objects.
7037
7038- The renaming of the xml package to xmlcore, and the import hackery done
7039 to make it appear at both names, has been removed. Bug #1511497,
7040 #1513611, and probably others.
7041
7042- Bug #1441397: The compiler module now recognizes module and function
7043 docstrings correctly as it did in Python 2.4.
7044
7045- Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
7046 lost that tests are sorted by name before being run. This rarely
7047 matters for well-written tests, but can create baffling symptoms if
7048 side effects from one test to the next affect outcomes. ``DocTestFinder``
7049 has been changed to sort the list of tests it returns.
7050
7051- The distutils version has been changed to 2.5.0, and is now kept
7052 in sync with sys.version_info[:3].
7053
7054- Bug #978833: Really close underlying socket in _socketobject.close.
7055
7056- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
7057 title().
7058
7059- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
7060 to recursive calls and call it with the failing package name.
7061
7062- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
7063
7064- Patch #1515343: Fix printing of deprecated string exceptions with a
7065 value in the traceback module.
7066
7067- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
7068
7069- Patch #1524429: Use repr() instead of backticks in Tkinter again.
7070
7071- Bug #1520914: Change time.strftime() to accept a zero for any position in its
7072 argument tuple. For arguments where zero is illegal, the value is forced to
7073 the minimum value that is correct. This is to support an undocumented but
7074 common way people used to fill in inconsequential information in the time
7075 tuple pre-2.4.
7076
7077- Patch #1220874: Update the binhex module for Mach-O.
7078
7079- The email package has improved RFC 2231 support, specifically for
7080 recognizing the difference between encoded (name*0*=<blah>) and non-encoded
7081 (name*0=<blah>) parameter continuations. This may change the types of
7082 values returned from email.message.Message.get_param() and friends.
7083 Specifically in some cases where non-encoded continuations were used,
7084 get_param() used to return a 3-tuple of (None, None, string) whereas now it
7085 will just return the string (since non-encoded continuations don't have
7086 charset and language parts).
7087
7088 Also, whereas % values were decoded in all parameter continuations, they are
7089 now only decoded in encoded parameter parts.
7090
7091- Bug #1517990: IDLE keybindings on MacOS X now work correctly
7092
7093- Bug #1517996: IDLE now longer shows the default Tk menu when a
7094 path browser, class browser or debugger is the frontmost window on MacOS X
7095
7096- Patch #1520294: Support for getset and member descriptors in types.py,
7097 inspect.py, and pydoc.py. Specifically, this allows for querying the type
7098 of an object against these built-in types and more importantly, for getting
7099 their docstrings printed in the interactive interpreter's help() function.
7100
7101
7102Extension Modules
7103-----------------
7104
7105- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
7106 a socket operation on a socket with a timeout, the exception will be
7107 caught correctly. Previously, the exception was not caught.
7108
7109- Patch #1529514: The _ctypes extension is now compiled on more
7110 openbsd target platforms.
7111
7112- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
7113 a memory leak, affecting pickles and deep copies.
7114
7115- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
7116 Paul Eggert.
7117
7118- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
7119
7120- Patch #1521817: Index range checking on ctypes arrays containing
7121 exactly one element enabled again. This allows iterating over these
7122 arrays, without the need to check the array size before.
7123
7124- Bug #1521375: When the code in ctypes.util.find_library was
7125 run with root privileges, it could overwrite or delete
7126 /dev/null in certain cases; this is now fixed.
7127
7128- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
7129 default mode for loading shared libraries in ctypes.
7130
7131- Because of a misspelled preprocessor symbol, ctypes was always
7132 compiled without thread support; this is now fixed.
7133
7134- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
7135 methods now allow their database parameter to be None as the
7136 sleepycat API allows.
7137
7138- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
7139 bluetooth API compared with Linux and FreeBSD.
7140
7141Tests
7142-----
7143
7144- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
7145 how long the test file should take to play. Now accepts taking 2.93 secs
7146 (exact time) +/- 10% instead of the hard-coded 3.1 sec.
7147
7148- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
7149 ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
7150 run via ``regrtest.py``. Now they do.
7151
7152Build
7153-----
7154
7155- Bug #1439538: Drop usage of test -e in configure as it is not portable.
7156
7157Mac
7158---
7159
7160- PythonLauncher now works correctly when the path to the script contains
7161 characters that are treated specially by the shell (such as quotes).
7162
7163- Bug #1527397: PythonLauncher now launches scripts with the working directory
7164 set to the directory that contains the script instead of the user home
7165 directory. That latter was an implementation accident and not what users
7166 expect.
7167
7168
7169What's New in Python 2.5 beta 2?
7170================================
7171
7172*Release date: 11-JUL-2006*
7173
7174Core and builtins
7175-----------------
7176
7177- Bug #1441486: The literal representation of -(sys.maxint - 1)
7178 again evaluates to a int object, not a long.
7179
7180- Bug #1501934: The scope of global variables that are locally assigned
7181 using augmented assignment is now correctly determined.
7182
7183- Bug #927248: Recursive method-wrapper objects can now safely
7184 be released.
7185
7186- Bug #1417699: Reject locale-specific decimal point in float()
7187 and atof().
7188
7189- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
7190 omit a default "error" argument for NULL pointer. This allows
7191 the parser to take a codec from cjkcodecs again.
7192
7193- Bug #1519018: 'as' is now validated properly in import statements.
7194
7195- On 64 bit systems, int literals that use less than 64 bits are
7196 now ints rather than longs.
7197
7198- Bug #1512814, Fix incorrect lineno's when code at module scope
7199 started after line 256.
7200
7201- New function ``sys._current_frames()`` returns a dict mapping thread
7202 id to topmost thread stack frame. This is for expert use, and is
7203 especially useful for debugging application deadlocks. The functionality
7204 was previously available in Fazal Majid's ``threadframe`` extension
7205 module, but it wasn't possible to do this in a wholly threadsafe way from
7206 an extension.
7207
7208Library
7209-------
7210
7211- Bug #1257728: Mention Cygwin in distutils error message about a missing
7212 VS 2003.
7213
7214- Patch #1519566: Update turtle demo, make begin_fill idempotent.
7215
7216- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
7217 environment variable to be set in order to the SDK environment
7218 for finding the compiler, include files, etc.
7219
7220- Bug #1515998: Properly generate logical ids for files in bdist_msi.
7221
7222- warnings.py now ignores ImportWarning by default
7223
7224- string.Template() now correctly handles tuple-values. Previously,
7225 multi-value tuples would raise an exception and single-value tuples would
7226 be treated as the value they contain, instead.
7227
7228- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
7229 even if some data are received.
7230
7231- Bug #1267547: Put proper recursive setup.py call into the
7232 spec file generated by bdist_rpm.
7233
7234- Bug #1514693: Update turtle's heading when switching between
7235 degrees and radians.
7236
7237- Reimplement turtle.circle using a polyline, to allow correct
7238 filling of arcs.
7239
7240- Bug #1514703: Only setup canvas window in turtle when the canvas
7241 is created.
7242
7243- Bug #1513223: .close() of a _socketobj now releases the underlying
7244 socket again, which then gets closed as it becomes unreferenced.
7245
7246- Bug #1504333: Make sgmllib support angle brackets in quoted
7247 attribute values.
7248
7249- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
7250 sgmllib ('[' and ']' were not accepted).
7251
7252- Fix a bug in the turtle module's end_fill function.
7253
7254- Bug #1510580: The 'warnings' module improperly required that a Warning
7255 category be either a types.ClassType and a subclass of Warning. The proper
7256 check is just that it is a subclass with Warning as the documentation states.
7257
7258- The compiler module now correctly compiles the new try-except-finally
7259 statement (bug #1509132).
7260
7261- The wsgiref package is now installed properly on Unix.
7262
7263- A bug was fixed in logging.config.fileConfig() which caused a crash on
7264 shutdown when fileConfig() was called multiple times.
7265
7266- The sqlite3 module did cut off data from the SQLite database at the first
7267 null character before sending it to a custom converter. This has been fixed
7268 now.
7269
7270Extension Modules
7271-----------------
7272
7273- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
7274 means that select() on sockets > FD_SETSIZE (typically 1024) work again.
7275 The patch makes sockets use poll() internally where available.
7276
7277- Assigning None to pointer type fields in ctypes structures possible
7278 overwrote the wrong fields, this is fixed now.
7279
7280- Fixed a segfault in _ctypes when ctypes.wintypes were imported
7281 on non-Windows platforms.
7282
7283- Bug #1518190: The ctypes.c_void_p constructor now accepts any
7284 integer or long, without range checking.
7285
7286- Patch #1517790: It is now possible to use custom objects in the ctypes
7287 foreign function argtypes sequence as long as they provide a from_param
7288 method, no longer is it required that the object is a ctypes type.
7289
7290- The '_ctypes' extension module now works when Python is configured
7291 with the --without-threads option.
7292
7293- Bug #1513646: os.access on Windows now correctly determines write
7294 access, again.
7295
7296- Bug #1512695: cPickle.loads could crash if it was interrupted with
7297 a KeyboardInterrupt.
7298
7299- Bug #1296433: parsing XML with a non-default encoding and
7300 a CharacterDataHandler could crash the interpreter in pyexpat.
7301
7302- Patch #1516912: improve Modules support for OpenVMS.
7303
7304Build
7305-----
7306
7307- Automate Windows build process for the Win64 SSL module.
7308
7309- 'configure' now detects the zlib library the same way as distutils.
7310 Previously, the slight difference could cause compilation errors of the
7311 'zlib' module on systems with more than one version of zlib.
7312
7313- The MSI compileall step was fixed to also support a TARGETDIR
7314 with spaces in it.
7315
7316- Bug #1517388: sqlite3.dll is now installed on Windows independent
7317 of Tcl/Tk.
7318
7319- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
7320 trying to be installed even though it's empty.
7321
7322Tests
7323-----
7324
7325- Call os.waitpid() at the end of tests that spawn child processes in order
7326 to minimize resources (zombies).
7327
7328Documentation
7329-------------
7330
7331- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
7332 documentation for the warnings module.
7333
7334- Patch #1509163: MS Toolkit Compiler no longer available.
7335
7336- Patch #1504046: Add documentation for xml.etree.
7337
7338
7339What's New in Python 2.5 beta 1?
7340================================
7341
7342*Release date: 20-JUN-2006*
7343
7344Core and builtins
7345-----------------
7346
7347- Patch #1507676: Error messages returned by invalid abstract object operations
7348 (such as iterating over an integer) have been improved and now include the
7349 type of the offending object to help with debugging.
7350
7351- Bug #992017: A classic class that defined a __coerce__() method that returned
7352 its arguments swapped would infinitely recurse and segfault the interpreter.
7353
7354- Fix the socket tests so they can be run concurrently.
7355
7356- Removed 5 integers from C frame objects (PyFrameObject).
7357 f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
7358
7359- Bug #532646: object.__call__() will continue looking for the __call__
7360 attribute on objects until one without one is found. This leads to recursion
7361 when you take a class and set its __call__ attribute to an instance of the
7362 class. Originally fixed for classic classes, but this fix is for new-style.
7363 Removes the infinite_rec_3 crasher.
7364
7365- The string and unicode methods startswith() and endswith() now accept
7366 a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
7367
7368- Buffer objects, at the C level, never used the char buffer
7369 implementation even when the char buffer for the wrapped object was
7370 explicitly requested (originally returned the read or write buffer).
7371 Now a TypeError is raised if the char buffer is not present but is
7372 requested.
7373
7374- Patch #1346214: Statements like "if 0: suite" are now again optimized
7375 away like they were in Python 2.4.
7376
7377- Builtin exceptions are now full-blown new-style classes instead of
7378 instances pretending to be classes, which speeds up exception handling
7379 by about 80% in comparison to 2.5a2.
7380
7381- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
7382 Unicode 4.1.
7383
7384- Patch #921466: sys.path_importer_cache is now used to cache valid and
7385 invalid file paths for the built-in import machinery which leads to
7386 fewer open calls on startup.
7387
7388- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
7389 of-2 bases. The largest speedup is for inputs with about 1000 decimal
7390 digits. Conversion from non-power-of-2 bases remains quadratic-time in
7391 the number of input digits (it was and remains linear-time for bases
7392 2, 4, 8, 16 and 32).
7393
7394- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
7395 when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
7396 an integer close to ``sys.maxint``. This was repaired by patch
7397 #1335972, which also gives a nice speedup.
7398
7399- Patch #1337051: reduced size of frame objects.
7400
7401- PyErr_NewException now accepts a tuple of base classes as its
7402 "base" parameter.
7403
7404- Patch #876206: function call speedup by retaining allocated frame
7405 objects.
7406
7407- Bug #1462152: file() now checks more thoroughly for invalid mode
7408 strings and removes a possible "U" before passing the mode to the
7409 C library function.
7410
7411- Patch #1488312, Fix memory alignment problem on SPARC in unicode
7412
7413- Bug #1487966: Fix SystemError with conditional expression in assignment
7414
7415- WindowsError now has two error code attributes: errno, which carries
7416 the error values from errno.h, and winerror, which carries the error
7417 values from winerror.h. Previous versions put the winerror.h values
7418 (from GetLastError()) into the errno attribute.
7419
7420- Patch #1475845: Raise IndentationError for unexpected indent.
7421
7422- Patch #1479181: split open() and file() from being aliases for each other.
7423
7424- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
7425 methods were always silently ignored by dictionaries when comparing keys.
7426 They are now passed through (except when using the C API function
7427 ``PyDict_GetItem()``, whose semantics did not change).
7428
7429- Bug #1456209: In some obscure cases it was possible for a class with a
7430 custom ``__eq__()`` method to confuse dict internals when class instances
7431 were used as a dict's keys and the ``__eq__()`` method mutated the dict.
7432 No, you don't have any code that did this ;-)
7433
7434Extension Modules
7435-----------------
7436
7437- Bug #1295808: expat symbols should be namespaced in pyexpat
7438
7439- Patch #1462338: Upgrade pyexpat to expat 2.0.0
7440
7441- Change binascii.hexlify to accept a read-only buffer instead of only a char
7442 buffer and actually follow its documentation.
7443
7444- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
7445
7446- Patch #1478788 (modified version): The functional extension module has
7447 been renamed to _functools and a functools Python wrapper module added.
7448 This provides a home for additional function related utilities that are
7449 not specifically about functional programming. See PEP 309.
7450
7451- Patch #1493701: performance enhancements for struct module.
7452
7453- Patch #1490224: time.altzone is now set correctly on Cygwin.
7454
7455- Patch #1435422: zlib's compress and decompress objects now have a
7456 copy() method.
7457
7458- Patch #1454481: thread stack size is now tunable at runtime for thread
7459 enabled builds on Windows and systems with Posix threads support.
7460
7461- On Win32, os.listdir now supports arbitrarily-long Unicode path names
7462 (up to the system limit of 32K characters).
7463
7464- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
7465 As a result, these functions now raise WindowsError instead of OSError.
7466
7467- ``time.clock()`` on Win64 should use the high-performance Windows
7468 ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
7469 Windows platforms).
7470
7471- Calling Tk_Init twice is refused if the first call failed as that
7472 may deadlock.
7473
7474- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
7475 accept it without potentially using an uninitialized pointer.
7476
7477- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
7478 assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
7479 patch numbers 1494885 and 1494902]
7480
7481- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
7482 [pybsddb project SF patch number 1466734]
7483
7484- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
7485 parameter is supplied. [SF pybsddb bug #1477863]
7486
7487- bsddb: the __len__ method of a DB object has been fixed to return correct
7488 results. It could previously incorrectly return 0 in some cases.
7489 Fixes SF bug 1493322 (pybsddb bug 1184012).
7490
7491- bsddb: the bsddb.dbtables Modify method now raises the proper error and
7492 aborts the db transaction safely when a modifier callback fails.
7493 Fixes SF python patch/bug #1408584.
7494
7495- bsddb: multithreaded DB access using the simple bsddb module interface
7496 now works reliably. It has been updated to use automatic BerkeleyDB
7497 deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
7498 database calls that would previously deadlock. [SF python bug #775414]
7499
7500- Patch #1446489: add support for the ZIP64 extensions to zipfile.
7501
7502- Patch #1506645: add Python wrappers for the curses functions
7503 is_term_resized, resize_term and resizeterm.
7504
7505Library
7506-------
7507
7508- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
7509 functions.
7510
7511- Patch #812986: Update turtle output even if not tracing.
7512
7513- Patch #1494750: Destroy master after deleting children in
7514 Tkinter.BaseWidget.
7515
7516- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
7517
7518- Patch #763580: Add name and value arguments to Tkinter variable
7519 classes.
7520
7521- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
7522 mime.types file for determining MIME types.
7523
7524- Bug #1339007: Shelf objects now don't raise an exception in their
7525 __del__ method when initialization failed.
7526
7527- Patch #1455898: The MBCS codec now supports the incremental mode for
7528 double-byte encodings.
7529
7530- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
7531 guarantee that adjacent triples in the return list always describe
7532 non-adjacent blocks. Previously, a pair of matching blocks could end
7533 up being described by multiple adjacent triples that formed a partition
7534 of the matching pair.
7535
7536- Bug #1498146: fix optparse to handle Unicode strings in option help,
7537 description, and epilog.
7538
7539- Bug #1366250: minor optparse documentation error.
7540
7541- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
7542 clarify docs.
7543
7544- The wsgiref package has been added to the standard library.
7545
7546- The functions update_wrapper() and wraps() have been added to the functools
7547 module. These make it easier to copy relevant metadata from the original
7548 function when writing wrapper functions.
7549
7550- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
7551 ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
7552
7553- Patch #1359618: Speed up charmap encoder by using a trie structure
7554 for lookup.
7555
7556- The functions in the ``pprint`` module now sort dictionaries by key
7557 before computing the display. Before 2.5, ``pprint`` sorted a dictionary
7558 if and only if its display required more than one line, although that
7559 wasn't documented. The new behavior increases predictability; e.g.,
7560 using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
7561
7562- Patch #1497027: try HTTP digest auth before basic auth in urllib2
7563 (thanks for J. J. Lee).
7564
7565- Patch #1496206: improve urllib2 handling of passwords with respect to
7566 default HTTP and HTTPS ports.
7567
7568- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
7569
7570- Patch #1281707: speed up gzip.readline.
7571
7572- Patch #1180296: Two new functions were added to the locale module:
7573 format_string() to get the effect of "format % items" but locale-aware,
7574 and currency() to format a monetary number with currency sign.
7575
7576- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
7577 and several features added, such as speed and geometry control.
7578
7579- Patch #1488881: add support for external file objects in bz2 compressed
7580 tarfiles.
7581
7582- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
7583 stdout arguments, making it possible to redirect input and output
7584 for remote debugging.
7585
7586- Patch #1484695: Update the tarfile module to version 0.8. This fixes
7587 a couple of issues, notably handling of long file names using the
7588 GNU LONGNAME extension.
7589
7590- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
7591 new flag when ``name`` is already the name of an option flag.
7592
7593- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
7594 package.
7595
7596- Patch #1472854: make the rlcompleter.Completer class usable on non-
7597 UNIX platforms.
7598
7599- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
7600
7601- Bug #1472827: correctly escape newlines and tabs in attribute values in
7602 the saxutils.XMLGenerator class.
7603
7604
7605Build
7606-----
7607
7608- Bug #1502728: Correctly link against librt library on HP-UX.
7609
7610- OpenBSD 3.9 is supported now.
7611
7612- Patch #1492356: Port to Windows CE.
7613
7614- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
7615
7616- Patch #1471883: Add --enable-universalsdk.
7617
7618C API
7619-----
7620
7621Tests
7622-----
7623
7624Tools
7625-----
7626
7627Documentation
7628-------------
7629
7630
7631
7632What's New in Python 2.5 alpha 2?
7633=================================
7634
7635*Release date: 27-APR-2006*
7636
7637Core and builtins
7638-----------------
7639
7640- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
7641 by converting these apis from macros into exported functions again:
7642
7643 PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
7644 PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
7645 PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
7646 PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
7647 PyRun_String Py_CompileString
7648
7649- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
7650
7651- All uses of PyStructSequence_InitType have been changed to initialize
7652 the type objects only once, even if the interpreter is initialized
7653 multiple times.
7654
7655- Bug #1454485, array.array('u') could crash the interpreter. This was
7656 due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
7657 to unicode when it didn't make sense. 'u#' now requires a unicode string.
7658
7659- Py_UNICODE is unsigned. It was always documented as unsigned, but
7660 due to a bug had a signed value in previous versions.
7661
7662- Patch #837242: ``id()`` of any Python object always gives a positive
7663 number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
7664 ``PyLong_AsVoidPtr`` have been changed accordingly. Note that it has
7665 never been correct to implement a ``__hash()__`` method that returns the
7666 ``id()`` of an object:
7667
7668 def __hash__(self):
7669 return id(self) # WRONG
7670
7671 because a hash result must be a (short) Python int but it was always
7672 possible for ``id()`` to return a Python long. However, because ``id()``
7673 could return negative values before, on a 32-bit box an ``id()`` result
7674 was always usable as a hash value before this patch. That's no longer
7675 necessarily so.
7676
7677- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
7678 to load extension modules and now provides the dl module. As a result,
7679 sys.setdlopenflags() now works correctly on these systems. (SF patch
7680 #1454844)
7681
7682- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
7683 involving generators that have paused outside of any ``try`` or ``with``
7684 blocks. (In 2.5a1, a paused generator that was part of a reference
7685 cycle could not be garbage collected, regardless of whether it was
7686 paused in a ``try`` or ``with`` block.)
7687
7688Extension Modules
7689-----------------
7690
7691- Patch #1191065: Fix preprocessor problems on systems where recvfrom
7692 is a macro.
7693
7694- Bug #1467952: os.listdir() now correctly raises an error if readdir()
7695 fails with an error condition.
7696
7697- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
7698
7699- Bug #1117761: bsddb.*open() no longer raises an exception when using
7700 the cachesize parameter.
7701
7702- Bug #1149413: bsddb.*open() no longer raises an exception when using
7703 a temporary db (file=None) with the 'n' flag to truncate on open.
7704
7705- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
7706 as older versions cause excessive test failures.
7707
7708- Patch #1062014: AF_UNIX sockets under Linux have a special
7709 abstract namespace that is now fully supported.
7710
7711Library
7712-------
7713
7714- Bug #1223937: subprocess.CalledProcessError reports the exit status
7715 of the process using the returncode attribute, instead of
7716 abusing errno.
7717
7718- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
7719 a doctest to be skipped (the code is not run, and the expected output
7720 or exception is ignored).
7721
7722- Fixed contextlib.nested to cope with exceptions being raised and
7723 caught inside exit handlers.
7724
7725- Updated optparse module to Optik 1.5.1 (allow numeric constants in
7726 hex, octal, or binary; add ``append_const`` action; keep going if
7727 gettext cannot be imported; added ``OptionParser.destroy()`` method;
7728 added ``epilog`` for better help generation).
7729
7730- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
7731 called from a thread spawned as a side effect of importing a module.
7732
7733- The pydoc module now supports documenting packages contained in
7734 .zip or .egg files.
7735
7736- The pkgutil module now has several new utility functions, such
7737 as ``walk_packages()`` to support working with packages that are either
7738 in the filesystem or zip files.
7739
7740- The mailbox module can now modify and delete messages from
7741 mailboxes, in addition to simply reading them. Thanks to Gregory
7742 K. Johnson for writing the code, and to the 2005 Google Summer of
7743 Code for funding his work.
7744
7745- The ``__del__`` method of class ``local`` in module ``_threading_local``
7746 returned before accomplishing any of its intended cleanup.
7747
7748- Patch #790710: Add breakpoint command lists in pdb.
7749
7750- Patch #1063914: Add Tkinter.Misc.clipboard_get().
7751
7752- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
7753
7754- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
7755 Windows. Bug #1469163.
7756
7757- The warnings, linecache, inspect, traceback, site, and doctest modules
7758 were updated to work correctly with modules imported from zipfiles or
7759 via other PEP 302 __loader__ objects.
7760
7761- Patch #1467770: Reduce usage of subprocess._active to processes which
7762 the application hasn't waited on.
7763
7764- Patch #1462222: Fix Tix.Grid.
7765
7766- Fix exception when doing glob.glob('anything*/')
7767
7768- The pstats.Stats class accepts an optional stream keyword argument to
7769 direct output to an alternate file-like object.
7770
7771Build
7772-----
7773
7774- The Makefile now has a reindent target, which runs reindent.py on
7775 the library.
7776
7777- Patch #1470875: Building Python with MS Free Compiler
7778
7779- Patch #1161914: Add a python-config script.
7780
7781- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
7782 --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
7783 specified. (Can be overridden by explicitly setting LINKCC.) Decouple
7784 CXX from --with-cxx-main, see description in README.
7785
7786- Patch #1429775: Link extension modules with the shared libpython.
7787
7788- Fixed a libffi build problem on MIPS systems.
7789
7790- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
7791 now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
7792 and "%zu" for unsigned integers of type ``size_t``.
7793
7794Tests
7795-----
7796
7797- test_contextlib now checks contextlib.nested can cope with exceptions
7798 being raised and caught inside exit handlers.
7799
7800- test_cmd_line now checks operation of the -m and -c command switches
7801
7802- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
7803 it separately and by hand. It also wasn't cleaning up its changes to
7804 the current Decimal context.
7805
7806- regrtest.py now has a -M option to run tests that test the new limits of
7807 containers, on 64-bit architectures. Running these tests is only sensible
7808 on 64-bit machines with more than two gigabytes of memory. The argument
7809 passed is the maximum amount of memory for the tests to use.
7810
7811Tools
7812-----
7813
7814- Added the Python benchmark suite pybench to the Tools/ directory;
7815 contributed by Marc-Andre Lemburg.
7816
7817Documentation
7818-------------
7819
7820- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
7821
7822- PEP 343: Added Context Types section to the library reference
7823 and attempted to bring other PEP 343 related documentation into
7824 line with the implementation and/or python-dev discussions.
7825
7826- Bug #1337990: clarified that ``doctest`` does not support examples
7827 requiring both expected output and an exception.
7828
7829
7830What's New in Python 2.5 alpha 1?
7831=================================
7832
7833*Release date: 05-APR-2006*
7834
7835Core and builtins
7836-----------------
7837
7838- PEP 338: -m command line switch now delegates to runpy.run_module
7839 allowing it to support modules in packages and zipfiles
7840
7841- On Windows, .DLL is not an accepted file name extension for
7842 extension modules anymore; extensions are only found if they
7843 end in .PYD.
7844
7845- Bug #1421664: sys.stderr.encoding is now set to the same value as
7846 sys.stdout.encoding.
7847
7848- __import__ accepts keyword arguments.
7849
7850- Patch #1460496: round() now accepts keyword arguments.
7851
7852- Fixed bug #1459029 - unicode reprs were double-escaped.
7853
7854- Patch #1396919: The system scope threads are reenabled on FreeBSD
7855 5.4 and later versions.
7856
7857- Bug #1115379: Compiling a Unicode string with an encoding declaration
7858 now gives a SyntaxError.
7859
7860- Previously, Python code had no easy way to access the contents of a
7861 cell object. Now, a ``cell_contents`` attribute has been added
7862 (closes patch #1170323).
7863
7864- Patch #1123430: Python's small-object allocator now returns an arena to
7865 the system ``free()`` when all memory within an arena becomes unused
7866 again. Prior to Python 2.5, arenas (256KB chunks of memory) were never
7867 freed. Some applications will see a drop in virtual memory size now,
7868 especially long-running applications that, from time to time, temporarily
7869 use a large number of small objects. Note that when Python returns an
7870 arena to the platform C's ``free()``, there's no guarantee that the
7871 platform C library will in turn return that memory to the operating system.
7872 The effect of the patch is to stop making that impossible, and in tests it
7873 appears to be effective at least on Microsoft C and gcc-based systems.
7874 Thanks to Evan Jones for hard work and patience.
7875
7876- Patch #1434038: property() now uses the getter's docstring if there is
7877 no "doc" argument given. This makes it possible to legitimately use
7878 property() as a decorator to produce a read-only property.
7879
7880- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
7881 nb_index slot to the PyNumberMethods struct. The slot is consulted instead
7882 of requiring an int or long in slicing and a few other contexts, enabling
7883 other objects (e.g. Numeric Python's integers) to be used as slice indices.
7884
7885- Fixed various bugs reported by Coverity's Prevent tool.
7886
7887- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
7888 new exception base class, BaseException, which has a new message attribute.
7889 KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
7890 Raising a string exception now raises a DeprecationWarning.
7891
7892- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
7893 explicitly relative, using 'from .module import name' to mean 'from the same
7894 package as this module is in. Imports without dots still default to the
7895 old relative-then-absolute, unless 'from __future__ import
7896 absolute_import' is used.
7897
7898- Properly check if 'warnings' raises an exception (usually when a filter set
7899 to "error" is triggered) when raising a warning for raising string
7900 exceptions.
7901
7902- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
7903 The name was removed from Include/code.h.
7904
7905- PEP 308: conditional expressions were added: (x if cond else y).
7906
7907- Patch 1433928:
7908 - The copy module now "copies" function objects (as atomic objects).
7909 - dict.__getitem__ now looks for a __missing__ hook before raising
7910 KeyError.
7911
7912- PEP 343: with statement implemented. Needs ``from __future__ import
7913 with_statement``. Use of 'with' as a variable will generate a warning.
7914 Use of 'as' as a variable will also generate a warning (unless it's
7915 part of an import statement).
7916 The following objects have __context__ methods:
7917 - The built-in file type.
7918 - The thread.LockType type.
7919 - The following types defined by the threading module:
7920 Lock, RLock, Condition, Semaphore, BoundedSemaphore.
7921 - The decimal.Context class.
7922
7923- Fix the encodings package codec search function to only search
7924 inside its own package. Fixes problem reported in patch #1433198.
7925
7926 Note: Codec packages should implement and register their own
7927 codec search function. PEP 100 has the details.
7928
7929- PEP 353: Using ``Py_ssize_t`` as the index type.
7930
7931- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
7932 info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
7933 now allow Python to make use of memory blocks exceeding 2**32 bytes for
7934 some purposes on 64-bit boxes. A ``PYMALLOC_DEBUG`` build was limited
7935 to 4-byte allocations before.
7936
7937- Patch #1400181, fix unicode string formatting to not use the locale.
7938 This is how string objects work. u'%f' could use , instead of .
7939 for the decimal point. Now both strings and unicode always use periods.
7940
7941- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
7942 configure would break checking curses.h.
7943
Georg Brandl93dc9eb2010-03-14 10:56:14 +00007944- Bug #959576: The pwd module is now built in. This allows Python to be
Christian Heimesc3f30c42008-02-22 16:37:40 +00007945 built on UNIX platforms without $HOME set.
7946
7947- Bug #1072182, fix some potential problems if characters are signed.
7948
7949- Bug #889500, fix line number on SyntaxWarning for global declarations.
7950
7951- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
7952
7953- Support for converting hex strings to floats no longer works.
7954 This was not portable. float('0x3') now raises a ValueError.
7955
7956- Patch #1382163: Expose Subversion revision number to Python. New C API
7957 function Py_GetBuildNumber(). New attribute sys.subversion. Build number
7958 is now displayed in interactive prompt banner.
7959
7960- Implementation of PEP 341 - Unification of try/except and try/finally.
7961 "except" clauses can now be written together with a "finally" clause in
7962 one try statement instead of two nested ones. Patch #1355913.
7963
7964- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
7965 now encodes backslash correctly.
7966
7967- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
7968
7969- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
7970 and long longs.
7971
7972- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
7973 It was possible for dlerror() to return a NULL pointer, so
7974 it will now use a default error message in this case.
7975
7976- Replaced most Unicode charmap codecs with new ones using the
Georg Brandl93dc9eb2010-03-14 10:56:14 +00007977 new Unicode translate string feature in the built-in charmap
Christian Heimesc3f30c42008-02-22 16:37:40 +00007978 codec; the codecs were created from the mapping tables available
7979 at ftp.unicode.org and contain a few updates (e.g. the Mac OS
7980 encodings now include a mapping for the Apple logo)
7981
7982- Added a few more codecs for Mac OS encodings
7983
7984- Sped up some Unicode operations.
7985
7986- A new AST parser implementation was completed. The abstract
7987 syntax tree is available for read-only (non-compile) access
7988 to Python code; an _ast module was added.
7989
7990- SF bug #1167751: fix incorrect code being produced for generator expressions.
7991 The following code now raises a SyntaxError: foo(a = i for i in range(10))
7992
7993- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
7994
7995- SF Bug #887946: fix segfault when redirecting stdin from a directory.
7996 Provide a warning when a directory is passed on the command line.
7997
7998- Fix segfault with invalid coding.
7999
8000- SF bug #772896: unknown encoding results in MemoryError.
8001
8002- All iterators now have a Boolean value of True. Formerly, some iterators
8003 supported a __len__() method which evaluated to False when the iterator
8004 was empty.
8005
8006- On 64-bit platforms, when __len__() returns a value that cannot be
8007 represented as a C int, raise OverflowError.
8008
8009- test__locale is skipped on OS X < 10.4 (only partial locale support is
8010 present).
8011
8012- SF bug #893549: parsing keyword arguments was broken with a few format
8013 codes.
8014
8015- Changes donated by Elemental Security to make it work on AIX 5.3
8016 with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
8017 bug #105470: test_pwd fails on 64bit system (Opteron).
8018
8019- Changes donated by Elemental Security to make it work on HP-UX 11 on
8020 Itanium2 with HP's 64-bit compiler (SF patch #1225212).
8021
8022- Disallow keyword arguments for type constructors that don't use them
8023 (fixes bug #1119418).
8024
8025- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
8026
8027- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
8028 exceptions that cause a function to exit.
8029
8030- The implementation of set() and frozenset() was revised to use its
8031 own internal data structure. Memory consumption is reduced by 1/3
8032 and there are modest speed-ups as well. The API is unchanged.
8033
8034- SF bug #1238681: freed pointer is used in longobject.c:long_pow().
8035
8036- SF bug #1229429: PyObject_CallMethod failed to decrement some
8037 reference counts in some error exit cases.
8038
8039- SF bug #1185883: Python's small-object memory allocator took over
8040 a block managed by the platform C library whenever a realloc specified
8041 a small new size. However, there's no portable way to know then how
8042 much of the address space following the pointer is valid, so there's no
8043 portable way to copy data from the C-managed block into Python's
8044 small-object space without risking a memory fault. Python's small-object
8045 realloc now leaves such blocks under the control of the platform C
8046 realloc.
8047
8048- SF bug #1232517: An overflow error was not detected properly when
8049 attempting to convert a large float to an int in os.utime().
8050
8051- SF bug #1224347: hex longs now print with lowercase letters just
8052 like their int counterparts.
8053
8054- SF bug #1163563: the original fix for bug #1010677 ("thread Module
8055 Breaks PyGILState_Ensure()") broke badly in the case of multiple
8056 interpreter states; back out that fix and do a better job (see
8057 http://mail.python.org/pipermail/python-dev/2005-June/054258.html
8058 for a longer write-up of the problem).
8059
8060- SF patch #1180995: marshal now uses a binary format by default when
8061 serializing floats.
8062
8063- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
8064 the routines that promise to produce IEEE 754 binary representations
8065 of floats now simply copy bytes around.
8066
8067- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
8068 278.
8069
8070- patch #1109424: int, long, float, complex, and unicode now check for the
8071 proper magic slot for type conversions when subclassed. Previously the
8072 magic slot was ignored during conversion. Semantics now match the way
8073 subclasses of str always behaved. int/long/float, conversion of an instance
8074 to the base class has been moved to the proper nb_* magic slot and out of
8075 PyNumber_*().
Antoine Pitroufbd4f802012-08-11 16:51:50 +02008076 Thanks Walter Dörwald.
Christian Heimesc3f30c42008-02-22 16:37:40 +00008077
8078- Descriptors defined in C with a PyGetSetDef structure, where the setter is
8079 NULL, now raise an AttributeError when attempting to set or delete the
8080 attribute. Previously a TypeError was raised, but this was inconsistent
8081 with the equivalent pure-Python implementation.
8082
8083- It is now safe to call PyGILState_Release() before
8084 PyEval_InitThreads() (note that if there is reason to believe there
8085 are multiple threads around you still must call PyEval_InitThreads()
8086 before using the Python API; this fix is for extension modules that
8087 have no way of knowing if Python is multi-threaded yet).
8088
8089- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
8090 disabled caused a crash.
8091
8092- Bug #1165306: instancemethod_new allowed the creation of a method
8093 with im_class == im_self == NULL, which caused a crash when called.
8094
8095- Move exception finalisation later in the shutdown process - this
8096 fixes the crash seen in bug #1165761
8097
8098- Added two new builtins, any() and all().
8099
8100- Defining a class with empty parentheses is now allowed
8101 (e.g., ``class C(): pass`` is no longer a syntax error).
8102 Patch #1176012 added support to the 'parser' module and 'compiler' package
8103 (thanks to logistix for that added support).
8104
8105- Patch #1115086: Support PY_LONGLONG in structmember.
8106
8107- Bug #1155938: new style classes did not check that __init__() was
8108 returning None.
8109
8110- Patch #802188: Report characters after line continuation character
8111 ('\') with a specific error message.
8112
8113- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
8114
8115- Bug #1124295: the __name__ attribute of file objects was
8116 inadvertently made inaccessible in restricted mode.
8117
8118- Bug #1074011: closing sys.std{out,err} now causes a flush() and
8119 an ferror() call.
8120
8121- min() and max() now support key= arguments with the same meaning as in
8122 list.sort().
8123
8124- The peephole optimizer now performs simple constant folding in expressions:
8125 (2+3) --> (5).
8126
8127- set and frozenset objects can now be marshalled. SF #1098985.
8128
8129- Bug #1077106: Poor argument checking could cause memory corruption
8130 in calls to os.read().
8131
8132- The parser did not complain about future statements in illegal
8133 positions. It once again reports a syntax error if a future
8134 statement occurs after anything other than a doc string.
8135
8136- Change the %s format specifier for str objects so that it returns a
8137 unicode instance if the argument is not an instance of basestring and
8138 calling __str__ on the argument returns a unicode instance.
8139
8140- Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
8141 current thread state when the auto-GIL-state machinery knows about
8142 it (since the thread state is being deleted, continuing to remember it
8143 can't help, but can hurt if another thread happens to get created with
8144 the same thread id).
8145
8146Extension Modules
8147-----------------
8148
8149- Patch #1380952: fix SSL objects timing out on consecutive read()s
8150
8151- Patch #1309579: wait3 and wait4 were added to the posix module.
8152
8153- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
8154 In addition, the existing ulaw code was updated.
8155
8156- RFE #567972: Socket objects' family, type and proto properties are
8157 now exposed via new attributes.
8158
8159- Everything under lib-old was removed. This includes the following modules:
8160 Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
8161 lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
8162 util, whatsound, whrandom, zmod
8163
8164- The following modules were removed: regsub, reconvert, regex, regex_syntax.
8165
8166- re and sre were swapped, so help(re) provides full help. importing sre
8167 is deprecated. The undocumented re.engine variable no longer exists.
8168
8169- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
8170 SS2 (single-shift 2) escape sequences correctly.
8171
8172- The unicodedata module was updated to the 4.1 version of the Unicode
8173 database. The 3.2 version is still available as unicodedata.db_3_2_0
8174 for applications that require this specific version (such as IDNA).
8175
8176- The timing module is no longer built by default. It was deprecated
8177 in PEP 4 in Python 2.0 or earlier.
8178
8179- Patch 1433928: Added a new type, defaultdict, to the collections module.
8180 This uses the new __missing__ hook behavior added to dict (see above).
8181
8182- Bug #854823: socketmodule now builds on Sun platforms even when
8183 INET_ADDRSTRLEN is not defined.
8184
8185- Patch #1393157: os.startfile() now has an optional argument to specify
8186 a "command verb" to invoke on the file.
8187
8188- Bug #876637, prevent stack corruption when socket descriptor
8189 is larger than FD_SETSIZE.
8190
8191- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
8192 mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
8193 mmap.mmap(0, size) should not be used on Windows for anonymous memory.
8194
8195- Patch #1422385: The nis module now supports access to domains other
8196 than the system default domain.
8197
8198- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
8199 are reported, the limit on path name lengths is removed, and stat reports
8200 WindowsError now (instead of OSError).
8201
8202- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
8203
8204- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
8205 before the env.
8206
8207- Patch #1103116: Basic AF_NETLINK support.
8208
8209- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
8210
8211- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
8212 Also fix ungetmouse() which did not accept arguments properly.
8213 The code now conforms to the documented signature.
8214
8215- Bug #1400115, Fix segfault when calling curses.panel.userptr()
8216 without prior setting of the userptr.
8217
8218- Fix 64-bit problems in bsddb.
8219
8220- Patch #1365916: fix some unsafe 64-bit mmap methods.
8221
8222- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
8223 problem on AIX.
8224
8225- Bug #869197: os.setgroups rejects long integer arguments
8226
8227- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
8228
8229- Bug #1344508, Fix UNIX mmap leaking file descriptors
8230
8231- Patch #1338314, Bug #1336623: fix tarfile so it can extract
8232 REGTYPE directories from tarfiles written by old programs.
8233
8234- Patch #1407992, fixes broken bsddb module db associate when using
8235 BerkeleyDB 3.3, 4.0 or 4.1.
8236
8237- Get bsddb module to build with BerkeleyDB version 4.4
8238
8239- Get bsddb module to build with BerkeleyDB version 3.2
8240
8241- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
8242 but Python incorrectly assumes it is in UTF-8 format
8243
8244- Fix parse errors in the readline module when compiling without threads.
8245
8246- Patch #1288833: Removed thread lock from socket.getaddrinfo on
8247 FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
8248
8249- Patches #1298449 and #1298499: Add some missing checks for error
8250 returns in cStringIO.c.
8251
8252- Patch #1297028: fix segfault if call type on MultibyteCodec,
8253 MultibyteStreamReader, or MultibyteStreamWriter
8254
8255- Fix memory leak in posix.access().
8256
8257- Patch #1213831: Fix typo in unicodedata._getcode.
8258
8259- Bug #1007046: os.startfile() did not accept unicode strings encoded in
8260 the file system encoding.
8261
8262- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
8263 platforms that don't have inet_aton().
8264
8265- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
8266
8267- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
8268 line without newlines.
8269
8270- Bug #728515: mmap.resize() now resizes the file on Unix as it did
8271 on Windows.
8272
8273- Patch #1180695: Add nanosecond stat resolution, and st_gen,
8274 st_birthtime for FreeBSD.
8275
8276- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
8277 the request code argument, which results in more C-like behaviour
8278 for large or negative values.
8279
8280- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
8281 implementation treated all integer values except 1 as false.
8282
8283- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
8284
8285- Patch #1212117: os.stat().st_flags is now accessible as a attribute
8286 if available on the platform.
8287
8288- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
8289 available on the platform.
8290
8291- Bug #1166660: The readline module could segfault if hook functions
8292 were set in a different thread than that which called readline.
8293
8294- collections.deque objects now support a remove() method.
8295
8296- operator.itemgetter() and operator.attrgetter() now support retrieving
8297 multiple fields. This provides direct support for sorting on multiple
8298 keys (primary, secondary, etc).
8299
8300- os.access now supports Unicode path names on non-Win32 systems.
8301
8302- Patches #925152, #1118602: Avoid reading after the end of the buffer
8303 in pyexpat.GetInputContext.
8304
8305- Patches #749830, #1144555: allow UNIX mmap size to default to current
8306 file size.
8307
8308- Added functional.partial(). See PEP309.
8309
8310- Patch #1093585: raise a ValueError for negative history items in readline.
8311 {remove_history,replace_history}
8312
8313- The spwd module has been added, allowing access to the shadow password
8314 database.
8315
8316- stat_float_times is now True.
8317
8318- array.array objects are now picklable.
8319
8320- the cPickle module no longer accepts the deprecated None option in the
8321 args tuple returned by __reduce__().
8322
8323- itertools.islice() now accepts None for the start and step arguments.
8324 This allows islice() to work more readily with slices:
8325 islice(s.start, s.stop, s.step)
8326
8327- datetime.datetime() now has a strptime class method which can be used to
8328 create datetime object using a string and format.
8329
8330- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
8331 with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
8332
8333Library
8334-------
8335
8336- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
8337 been renamed to have only a single underscore prefix. This was done to
8338 make subclassing easier.
8339
8340- PEP 338: new module runpy defines a run_module function to support
8341 executing modules which provide access to source code or a code object
8342 via the PEP 302 import mechanisms.
8343
8344- The email module's parsedate_tz function now sets the daylight savings
8345 flag to -1 (unknown) since it can't tell from the date whether it should
8346 be set.
8347
8348- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
8349 now sport attributes that provide access to the parts of the result.
8350
8351- Patch #1462498: sgmllib now handles entity and character references
8352 in attribute values.
8353
8354- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
8355 a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
8356 later to build this - if you have an earlier version, the C extension
8357 module will not be built.
8358
8359- Bug #1460340: ``random.sample(dict)`` failed in various ways. Dicts
8360 aren't officially supported here, and trying to use them will probably
8361 raise an exception some day. But dicts have been allowed, and "mostly
8362 worked", so support for them won't go away without warning.
8363
8364- Bug #1445068: getpass.getpass() can now be given an explicit stream
8365 argument to specify where to write the prompt.
8366
8367- Patch #1462313, bug #1443328: the pickle modules now can handle classes
8368 that have __private names in their __slots__.
8369
8370- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
8371
8372- patch #1457316: "setup.py upload" now supports --identity to select the
8373 key to be used for signing the uploaded code.
8374
8375- Queue.Queue objects now support .task_done() and .join() methods
8376 to make it easier to monitor when daemon threads have completed
8377 processing all enqueued tasks. Patch #1455676.
8378
8379- popen2.Popen objects now preserve the command in a .cmd attribute.
8380
8381- Added the ctypes ffi package.
8382
8383- email 4.0 package now integrated. This is largely the same as the email 3.0
8384 package that was included in Python 2.3, except that PEP 8 module names are
8385 now used (e.g. mail.message instead of email.Message). The MIME classes
8386 have been moved to a subpackage (e.g. email.mime.text instead of
8387 email.MIMEText). The old names are still supported for now. Several
8388 deprecated Message methods have been removed and lots of bugs have been
8389 fixed. More details can be found in the email package documentation.
8390
8391- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
8392 (a subclass of tuple) that provides incremental decoders and encoders
8393 (a way to use stateful codecs without the stream API). Python functions
8394 codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
8395 as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
8396 have been added.
8397
8398- Patch #1359365: Calling next() on a closed StringIO.String object raises
8399 a ValueError instead of a StopIteration now (like file and cString.String do).
8400 cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
8401 called before (like file and StringIO.StringIO do).
8402
8403- A regrtest option -w was added to re-run failed tests in verbose mode.
8404
8405- Patch #1446372: quit and exit can now be called from the interactive
8406 interpreter to exit.
8407
8408- The function get_count() has been added to the gc module, and gc.collect()
8409 grew an optional 'generation' argument.
8410
8411- A library msilib to generate Windows Installer files, and a distutils
8412 command bdist_msi have been added.
8413
8414- PEP 343: new module contextlib.py defines decorator @contextmanager
8415 and helpful context managers nested() and closing().
8416
8417- The compiler package now supports future imports after the module docstring.
8418
8419- Bug #1413790: zipfile now sanitizes absolute archive names that are
8420 not allowed by the specs.
8421
8422- Patch #1215184: FileInput now can be given an opening hook which can
8423 be used to control how files are opened.
8424
8425- Patch #1212287: fileinput.input() now has a mode parameter for
8426 specifying the file mode input files should be opened with.
8427
8428- Patch #1215184: fileinput now has a fileno() function for getting the
8429 current file number.
8430
8431- Patch #1349274: gettext.install() now optionally installs additional
Georg Brandl93dc9eb2010-03-14 10:56:14 +00008432 translation functions other than _() in the builtins namespace.
Christian Heimesc3f30c42008-02-22 16:37:40 +00008433
8434- Patch #1337756: fileinput now accepts Unicode filenames.
8435
8436- Patch #1373643: The chunk module can now read chunks larger than
8437 two gigabytes.
8438
8439- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
8440
8441- Bug #1430298: It is now possible to send a mail with an empty
8442 return address using smtplib.
8443
8444- Bug #1432260: The names of lambda functions are now properly displayed
8445 in pydoc.
8446
8447- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
8448 unless the system is Win32.
8449
8450- Patch #1349118: urllib now supports user:pass@ style proxy
8451 specifications, raises IOErrors when proxies for unsupported protocols
8452 are defined, and uses the https proxy on https redirections.
8453
8454- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
8455
8456- Bug #1407902: Add support for sftp:// URIs to urlparse.
8457
8458- Bug #1371247: Update Windows locale identifiers in locale.py.
8459
8460- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
8461 any more.
8462
8463- Bug #1403410: The warnings module now doesn't get confused
8464 when it can't find out the module name it generates a warning for.
8465
8466- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
8467
8468- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
8469
8470- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
8471 LoadError as documented, instead of IOError. For compatibility,
8472 LoadError subclasses IOError.
8473
8474- Added the hashlib module. It provides secure hash functions for MD5 and
8475 SHA1, 224, 256, 384, and 512. Note that recent developments make the
8476 historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
8477 In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
8478 Ronald L. Rivest offered this advice for Python:
8479
8480 "The consensus of researchers in this area (at least as
8481 expressed at the NIST Hash Function Workshop 10/31/05),
8482 is that SHA-256 is a good choice for the time being, but
8483 that research should continue, and other alternatives may
8484 arise from this research. The larger SHA's also seem OK."
8485
8486- Added a subset of Fredrik Lundh's ElementTree package. Available
8487 modules are xml.etree.ElementTree, xml.etree.ElementPath, and
8488 xml.etree.ElementInclude, from ElementTree 1.2.6.
8489
8490- Patch #1162825: Support non-ASCII characters in IDLE window titles.
8491
8492- Bug #1365984: urllib now opens "data:" URLs again.
8493
8494- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
8495 is raised within the method itself on a previous call (e.g., passing in an
8496 illegal argument)
8497
8498- Bug #1340337: change time.strptime() to always return ValueError when there
8499 is an error in the format string.
8500
8501- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
8502
8503- Bug #729103: pydoc.py: Fix docother() method to accept additional
8504 "parent" argument.
8505
8506- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
8507 for padding.
8508
8509- Bug #1296004: httplib.py: Limit maximal amount of data read from the
8510 socket to avoid a MemoryError on Windows.
8511
8512- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
8513 to get the correct encoding.
8514
8515- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
8516 languages.
8517
8518- Patch #1268314: Cache lines in StreamReader.readlines for performance.
8519
8520- Bug #1290505: Fix clearing the regex cache for time.strptime().
8521
8522- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
8523
8524- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
8525 functionality.
8526
8527- Bug #1163178: Make IDNA return an empty string when the input is empty.
8528
8529- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
8530 separator and do not output trailing semicolon.
8531
8532- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
8533 ContentTooShortException, when the actually downloaded size does not
8534 match the Content-Length header.
8535
8536- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
8537
8538- Bug #1178484: Return complete lines from codec stream readers
8539 even if there is an exception in later lines, resulting in
8540 correct line numbers for decoding errors in source code.
8541
8542- Bug #1192315: Disallow negative arguments to clear() in pdb.
8543
8544- Patch #827386: Support absolute source paths in msvccompiler.py.
8545
8546- Patch #1105730: Apply the new implementation of commonprefix in posixpath
8547 to ntpath, macpath, os2emxpath and riscospath.
8548
8549- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
8550 __hasattr__ and __delattr__ methods on class Tk that were breaking
8551 Tkdnd.
8552
8553- Bug #1015140: disambiguated the term "article id" in nntplib docs and
8554 docstrings to either "article number" or "message id".
8555
8556- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
8557 parameter, but uses the usual "kwargs=None".
8558
8559- textwrap now processes text chunks at O(n) speed instead of O(n**2).
8560 Patch #1209527 (Contributed by Connelly).
8561
8562- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
8563 to W3C name (404 -> 'Not Found'). RFE #1216944.
8564
8565- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
8566 as this can cause problems with apps closing all file descriptors.
8567
8568- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
8569 it can be missing in embedded interpreters
8570
8571- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
8572
8573- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
8574 error messages.
8575
8576- Bug #1108948: Cookie.py produced invalid JavaScript code.
8577
8578- The tokenize module now detects and reports indentation errors.
8579 Bug #1224621.
8580
8581- The tokenize module has a new untokenize() function to support a full
8582 roundtrip from lexed tokens back to Python source code. In addition,
8583 the generate_tokens() function now accepts a callable argument that
8584 terminates by raising StopIteration.
8585
8586- Bug #1196315: fix weakref.WeakValueDictionary constructor.
8587
8588- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
8589 component of the path.
8590
8591- Patch #1120353: The xmlrpclib module provides better, more transparent,
8592 support for datetime.{datetime,date,time} objects. With use_datetime set
8593 to True, applications shouldn't have to fiddle with the DateTime wrapper
8594 class at all.
8595
8596- distutils.commands.upload was added to support uploading distribution
8597 files to PyPI.
8598
8599- distutils.commands.register now encodes the data as UTF-8 before posting
8600 them to PyPI.
8601
8602- decimal operator and comparison methods now return NotImplemented
8603 instead of raising a TypeError when interacting with other types. This
8604 allows other classes to implement __radd__ style methods and have them
8605 work as expected.
8606
8607- Bug #1163325: Decimal infinities failed to hash. Attempting to
8608 hash a NaN raised an InvalidOperation instead of a TypeError.
8609
8610- Patch #918101: Add tarfile open mode r|* for auto-detection of the
8611 stream compression; add, for symmetry reasons, r:* as a synonym of r.
8612
8613- Patch #1043890: Add extractall method to tarfile.
8614
8615- Patch #1075887: Don't require MSVC in distutils if there is nothing
8616 to build.
8617
8618- Patch #1103407: Properly deal with tarfile iterators when untarring
8619 symbolic links on Windows.
8620
8621- Patch #645894: Use getrusage for computing the time consumption in
8622 profile.py if available.
8623
8624- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
8625
8626- Patch #1117454: Remove code to special-case cookies without values
8627 in LWPCookieJar.
8628
8629- Patch #1117339: Add cookielib special name tests.
8630
8631- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
8632
8633- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
8634
8635- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
8636
8637- Patch #1104111: Alter setup.py --help and --help-commands.
8638
8639- Patch #1121234: Properly cleanup _exit and tkerror commands.
8640
8641- Patch #1049151: xdrlib now unpacks booleans as True or False.
8642
8643- Fixed bug in a NameError bug in cookielib. Patch #1116583.
8644
8645- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
8646 disables recursive traversal through instance attributes, which can
8647 be exploited in various ways.
8648
8649- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
8650 flags on the HTTP listening socket.
8651
8652- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
8653 Fixed by reading the HTTP body in chunks instead of one big socket.read().
8654
8655- Patches #893642, #1039083: add allow_none, encoding arguments to
8656 constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
8657
8658- Bug #1110478: Revert os.environ.update to do putenv again.
8659
8660- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
8661
8662- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
8663
8664- Enhancements to the csv module:
8665
8666 + Dialects are now validated by the underlying C code, better
8667 reflecting its capabilities, and improving its compliance with
8668 PEP 305.
8669 + Dialect parameter parsing has been re-implemented to improve error
8670 reporting.
8671 + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
8672 dictates.
8673 + the parser now removes the escapechar prefix from escaped characters.
8674 + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
8675 types, rather than any object that can be represented as a numeric.
8676 + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
8677 to floats.
8678 + reader now allows \r characters to be quoted (previously it only allowed
8679 \n to be quoted).
8680 + writer doublequote handling improved.
8681 + Dialect classes passed to the module are no longer instantiated by
8682 the module before being parsed (the former validation scheme required
8683 this, but the mechanism was unreliable).
8684 + The dialect registry now contains instances of the internal
8685 C-coded dialect type, rather than references to python objects.
8686 + the internal c-coded dialect type is now immutable.
8687 + register_dialect now accepts the same keyword dialect specifications
8688 as the reader and writer, allowing the user to register dialects
8689 without first creating a dialect class.
8690 + a configurable limit to the size of parsed fields has been added -
8691 previously, an unmatched quote character could result in the entire
8692 file being read into the field buffer before an error was reported.
8693 + A new module method csv.field_size_limit() has been added that sets
8694 the parser field size limit (returning the former limit). The initial
8695 limit is 128kB.
8696 + A line_num attribute has been added to the reader object, which tracks
8697 the number of lines read from the source iterator. This is not
8698 the same as the number of records returned, as records can span
8699 multiple lines.
8700 + reader and writer objects were not being registered with the cyclic-GC.
8701 This has been fixed.
8702
8703- _DummyThread objects in the threading module now delete self.__block that is
8704 inherited from _Thread since it uses up a lock allocated by 'thread'. The
8705 lock primitives tend to be limited in number and thus should not be wasted on
8706 a _DummyThread object. Fixes bug #1089632.
8707
8708- The imghdr module now detects Exif files.
8709
8710- StringIO.truncate() now correctly adjusts the size attribute.
8711 (Bug #951915).
8712
8713- locale.py now uses an updated locale alias table (built using
8714 Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
8715 alias file); the encoding lookup was enhanced to use Python's
8716 encoding alias table.
8717
8718- moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
8719
8720- the pickle module no longer accepts the deprecated None option in the
8721 args tuple returned by __reduce__().
8722
8723- optparse now optionally imports gettext. This allows its use in setup.py.
8724
8725- the pickle module no longer uses the deprecated bin parameter.
8726
8727- the shelve module no longer uses the deprecated binary parameter.
8728
8729- the pstats module no longer uses the deprecated ignore() method.
8730
8731- the filecmp module no longer uses the deprecated use_statcache argument.
8732
8733- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
8734 extended or overridden by subclasses. Formerly, the subclassed method would
8735 be ignored by the rest of the module. (Bug #1078905).
8736
8737- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
8738 the same meaning as in list.sort().
8739
8740- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
8741 once when a size argument is given. This prevents a buffer overflow in the
8742 tokenizer with very long source lines.
8743
8744- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
8745 immediately after creating the object, without any intervening
8746 ``.decompress()`` calls.
8747
8748- The reconvert.quote function can now emit triple-quoted strings. The
8749 reconvert module now has some simple documentation.
8750
8751- ``UserString.MutableString`` now supports negative indices in
8752 ``__setitem__`` and ``__delitem__``
8753
8754- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
8755 correctly.
8756
8757- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
8758 ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
8759 character even if the user has passed a size parameter to get a proper
8760 line ending. Remove the special handling of a "\r\n" that has been split
8761 between two lines.
8762
8763- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
8764 about illegal code points. The codec now supports PEP 293 style error
8765 handlers.
8766
8767- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
8768 from the input stream, so that the output is a byte string in the correct
8769 encoding instead of a unicode string.
8770
8771- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
8772 considering it exactly like a '*'.
8773
8774- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
8775 ``encodings.aliases``.
8776
8777- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
8778
8779- Patch #1413711: Certain patterns of differences were making difflib
8780 touch the recursion limit.
8781
8782- Bug #947906: An object oriented interface has been added to the calendar
8783 module. It's possible to generate HTML calendar now and the module can be
8784 called as a script (e.g. via ``python -mcalendar``). Localized month and
8785 weekday names can be ouput (even if an exotic encoding is used) using
8786 special classes that use unicode.
8787
8788Build
8789-----
8790
8791- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
8792 by using -mieee gcc option.
8793
8794- Patch #1432345: Make python compile on DragonFly.
8795
8796- Build support for Win64-AMD64 was added.
8797
8798- Patch #1428494: Prefer linking against ncursesw over ncurses library.
8799
8800- Patch #881820: look for openpty and forkpty also in libbsd.
8801
8802- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
Georg Brandl93dc9eb2010-03-14 10:56:14 +00008803 The zlib module is now built in on Windows.
Christian Heimesc3f30c42008-02-22 16:37:40 +00008804
8805- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
8806
8807- Bug #1189330: configure did not correctly determine the necessary
8808 value of LINKCC if python was built with GCC 4.0.
8809
8810- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
8811 vulnerability in zlib 1.2.1 and 1.2.2.
8812
8813- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
8814 flags that change binary compatibility. Changes were also made to
8815 distutils.sysconfig to also use the environment variable when used during
8816 compilation of the interpreter and of C extensions through distutils.
8817
8818- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
8819 and linking has changed (prebinding is now deprecated, and libcc_dynamic
8820 no longer exists). This configure patch makes things right.
8821
8822- Bug #1158607: Build with --disable-unicode again.
8823
8824- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
8825 defined. Discovered as a result of not being able to build on OS X.
8826
8827- setup.py now uses the directories specified in LDFLAGS using the -L option
8828 and in CPPFLAGS using the -I option for adding library and include
8829 directories, respectively, for compiling extension modules against. This has
8830 led to the core being compiled using the values in CPPFLAGS. It also removes
8831 the need for the special-casing of both DarwinPorts and Fink for darwin since
8832 the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
8833 ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
8834 Fink, ``-I/opt/local/include`` for DarwinPorts).
8835
8836- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
8837 to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
8838 Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
8839 Closes bug #1096244. Thanks Gregory Bond.
8840
8841C API
8842-----
8843
8844- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
8845 ``PyObject_{Free, FREE}``. They map to the system ``free()`` now. If memory
8846 is obtained via the ``PyObject_`` family, it must be released via the
8847 ``PyObject_`` family, and likewise for the ``PyMem_`` family. This has
8848 always been officially true, but when Python's small-object allocator was
8849 introduced, an attempt was made to cater to a few extension modules
8850 discovered at the time that obtained memory via ``PyObject_New`` but
8851 released it via ``PyMem_DEL``. It's years later, and if such code still
8852 exists it will fail now (probably with segfaults, but calling wrong
8853 low-level memory management functions can yield many symptoms).
8854
8855- Added a C API for set and frozenset objects.
8856
8857- Removed PyRange_New().
8858
8859- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
8860 mapping argument now. This string is used as a mapping table. Byte values
8861 greater than the length of the string and 0xFFFE are treated as undefined
8862 mappings.
8863
8864
8865Tests
8866-----
8867
8868- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
8869
8870- Patch #1276356: New resource "urlfetch" is implemented. This enables
8871 even impatient people to run tests that require remote files.
8872
8873
8874Documentation
8875-------------
8876
8877- Bug #1402224: Add warning to dl docs about crashes.
8878
8879- Bug #1396471: Document that Windows' ftell() can return invalid
8880 values for text files with UNIX-style line endings.
8881
8882- Bug #1274828: Document os.path.splitunc().
8883
8884- Bug #1190204: Clarify which directories are searched by site.py.
8885
8886- Bug #1193849: Clarify os.path.expanduser() documentation.
8887
8888- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
8889
8890- Bug #755617: Document the effects of os.chown() on Windows.
8891
8892- Patch #1180012: The documentation for modulefinder is now in the library reference.
8893
8894- Patch #1213031: Document that os.chown() accepts argument values of -1.
8895
8896- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
8897
8898- Bug #1175022: Correct the example code for property().
8899
8900- Document the IterableUserDict class in the UserDict module.
8901 Closes bug #1166582.
8902
8903- Remove all latent references for "Macintosh" that referred to semantics for
8904 Mac OS 9 and change to reflect the state for OS X.
8905 Closes patch #1095802. Thanks Jack Jansen.
8906
8907Mac
8908---
8909
8910
8911New platforms
8912-------------
8913
8914- FreeBSD 7 support is added.
8915
8916
8917Tools/Demos
8918-----------
8919
8920- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
8921 directory for syntax highlighting in Vim. Vim directory was added and placed
8922 vimrc to it (was previous up a level).
8923
8924- Added two new files to Tools/scripts: pysource.py, which recursively
8925 finds Python source files, and findnocoding.py, which finds Python
8926 source files that need an encoding declaration.
8927 Patch #784089, credits to Oleg Broytmann.
8928
8929- Bug #1072853: pindent.py used an uninitialized variable.
8930
8931- Patch #1177597: Correct Complex.__init__.
8932
8933- Fixed a display glitch in Pynche, which could cause the right arrow to
8934 wiggle over by a pixel.
8935
8936
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00008937What's New in Python 2.4 final?
8938===============================
8939
8940*Release date: 30-NOV-2004*
8941
8942Core and builtins
8943-----------------
8944
8945- Bug 875692: Improve signal handling, especially when using threads, by
8946 forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
8947 things_to_do is not cleared by Py_MakePendingCalls().
8948
8949
8950What's New in Python 2.4 (release candidate 1)
8951==============================================
8952
8953*Release date: 18-NOV-2004*
8954
8955Core and builtins
8956-----------------
8957
8958- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
8959 the years-old thread shutdown race bug 225673. Numeric history lesson
8960 aside, all bugs in all three reports are fixed now.
8961
8962
8963Library
8964-------
8965
8966- Bug 1052242: If exceptions are raised by an atexit handler function an
8967 attempt is made to execute the remaining handlers. The last exception
8968 raised is re-raised.
8969
8970- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
8971 doctests was broken in a dramatic but shallow way. Fixed.
8972
8973- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
8974 and ``month_abbr`` attributes emulate sequences of locale-correct
8975 spellings of month and day names. Because the locale can change at
8976 any time, the correct spelling is recomputed whenever one of these is
8977 indexed. In the worst case, the index may be a slice object, so these
8978 recomputed every day or month name each time they were indexed. This is
8979 much slower than necessary in the usual case, when the index is just an
8980 integer. In that case, only the single spelling needed is recomputed
8981 now; and, when the index is a slice object, only the spellings needed
8982 by the slice are recomputed now.
8983
8984- Patch 1061679: Added ``__all__`` to pickletools.py.
8985
8986Build
8987-----
8988
8989- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
8990 and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
8991 which has no known users. Thanks Bob Ippolito.
8992
8993C API
8994-----
8995
8996- The PyRange_New() function is deprecated.
8997
8998
8999What's New in Python 2.4 beta 2?
9000================================
9001
9002*Release date: 03-NOV-2004*
9003
9004License
9005-------
9006
9007The Python Software Foundation changed the license under which Python
9008is released, to remove Python version numbers. There were no other
9009changes to the license. So, for example, wherever the license for
9010Python 2.3 said "Python 2.3", the new license says "Python". The
9011intent is to make it possible to refer to the PSF license in a more
9012durable way. For example, some people say they're confused by that
9013the Open Source Initiative's entry for the Python Software Foundation
9014License::
9015
9016 http://www.opensource.org/licenses/PythonSoftFoundation.php
9017
9018says "Python 2.1.1" all over it, wondering whether it applies only
9019to Python 2.1.1.
9020
9021The official name of the new license is the Python Software Foundation
9022License Version 2.
9023
9024Core and builtins
9025-----------------
9026
9027- Bug #1055820 Cyclic garbage collection was not protecting against that
9028 calling a live weakref to a piece of cyclic trash could resurrect an
9029 insane mutation of the trash if any Python code ran during gc (via
9030 running a dead object's __del__ method, running another callback on a
9031 weakref to a dead object, or via any Python code run in any other thread
9032 that managed to obtain the GIL while a __del__ or callback was running
9033 in the thread doing gc). The most likely symptom was "impossible"
9034 ``AttributeError`` exceptions, appearing seemingly at random, on weakly
9035 referenced objects. The cure was to clear all weakrefs to unreachable
9036 objects before allowing any callbacks to run.
9037
9038- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
9039
9040Extension Modules
9041-----------------
9042
9043- Bug #1048870: the compiler now generates distinct code objects for
9044 functions with identical bodies. This was producing confusing
9045 traceback messages which pointed to the function where the code
9046 object was first defined rather than the function being executed.
9047
9048Library
9049-------
9050
9051- Patch #1056967 changes the semantics of Template.safe_substitute() so that
9052 no ValueError is raised on an 'invalid' match group. Now the delimiter is
9053 returned.
9054
9055- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
9056
9057- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
9058 paths with a base path before checking os.path.isfile().
9059
9060- The whichdb module can now be run from the command line.
9061
9062- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
9063 the year) when the day of the week and year are also specified.
9064
9065- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
9066
9067- Bug #1017553: fix bug in tarfile.filemode()
9068
9069- Patch #737473: fix bug that old source code is shown in tracebacks even if
9070 the source code is updated and reloaded.
9071
9072Build
9073-----
9074
9075- Patch #1044395: --enable-shared is allowed in FreeBSD also.
9076
9077What's New in Python 2.4 beta 1?
9078================================
9079
9080*Release date: 15-OCT-2004*
9081
9082Core and builtins
9083-----------------
9084
9085- Patch #975056: Restartable signals were not correctly disabled on
9086 BSD systems. Consistently use PyOS_setsig() instead of signal().
9087
9088- The internal portable implementation of thread-local storage (TLS), used
9089 by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
9090 thread-correct. This could lead to a variety of problems, up to and
9091 including segfaults. See bug 1041645 for an example.
9092
9093- Added a command line option, -m module, which searches sys.path for the
9094 module and then runs it. (Contributed by Nick Coghlan.)
9095
9096- The bytecode optimizer now folds tuples of constants into a single
9097 constant.
9098
9099- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
9100 an integer was compared to a float, the integer was coerced to a float.
9101 That could yield spurious overflow errors (if the integer was very
9102 large), and to anomalies such as
9103 ``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
9104 longer performed, and cases like ``long(1e200)-1 < 1e200``,
9105 ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
9106 correctly now.
9107
9108Extension modules
9109-----------------
9110
9111- ``collections.deque`` objects didn't play quite right with garbage
9112 collection, which could lead to a segfault in a release build, or
9113 an assert failure in a debug build. Also, added overflow checks,
9114 better detection of mutation during iteration, and shielded deque
9115 comparisons from unusual subclass overrides of the __iter__() method.
9116
9117Library
9118-------
9119
9120- Patch 1046644: distutils build_ext grew two new options - --swig for
9121 specifying the swig executable to use, and --swig-opts to specify
9122 options to pass to swig. --swig-opts="-c++" is the new way to spell
9123 --swig-cpp.
9124
9125- Patch 983206: distutils now obeys environment variable LDSHARED, if
9126 it is set.
9127
9128- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
9129
9130- time.strptime() now properly escapes timezones and all other locale-specific
9131 strings for regex-specific symbols. Was breaking under Japanese Windows when
9132 the timezone was specified as "Tokyo (standard time)".
9133 Closes bug #1039270.
9134
9135- Updates for the email package:
9136
9137 + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
9138 + All deprecated APIs that in email 2.x issued warnings have been removed:
9139 _encoder argument to the MIMEText constructor, Message.add_payload(),
9140 Utils.dump_address_pair(), Utils.decode(), Utils.encode()
9141 + New deprecations: Generator.__call__(), Message.get_type(),
9142 Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
9143 the Parser constructor. These will be removed in email 3.1.
9144 + Support for Python earlier than 2.3 has been removed (see PEP 291).
9145 + All defect classes have been renamed to end in 'Defect'.
9146 + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
9147 added to messages that claim to be multipart but really aren't.
9148 + Updates to documentation.
9149
9150- re's findall() and finditer() functions now take an optional flags argument
9151 just like the compile(), search(), and match() functions. Also, documented
9152 the previously existing start and stop parameters for the findall() and
9153 finditer() methods of regular expression objects.
9154
9155- rfc822 Messages now support iterating over the headers.
9156
9157- The (undocumented) tarfile.Tarfile.membernames has been removed;
9158 applications should use the getmember function.
9159
9160- httplib now offers symbolic constants for the HTTP status codes.
9161
9162- SF bug #1028306: Trying to compare a ``datetime.date`` to a
9163 ``datetime.datetime`` mistakenly compared only the year, month and day.
9164 Now it acts like a mixed-type comparison: ``False`` for ``==``,
9165 ``True`` for ``!=``, and raises ``TypeError`` for other comparison
9166 operators. Because datetime is a subclass of date, comparing only the
9167 base class (date) members can still be done, if that's desired, by
9168 forcing using of the approprate date method; e.g.,
9169 ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
9170 and day members of ``a_date`` and ``a_datetime`` are equal.
9171
9172- bdist_rpm now supports command line options --force-arch,
9173 {pre,post}-install, {pre,post}-uninstall, and
9174 {prep,build,install,clean,verify}-script.
9175
9176- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
9177 decoding incomplete input (when the input stream is temporarily exhausted).
9178 ``codecs.StreamReader`` now implements buffering, which enables proper
9179 readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
9180 has a new argument ``chars`` which specifies the number of characters to
9181 return. ``codecs.StreamReader.readline()`` and
9182 ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
9183 Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
9184
9185- The documentation for doctest is greatly expanded, and now covers all
9186 the new public features (of which there are many).
9187
9188- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
9189 updates it. This isn't good, because every ``testmod()`` call
9190 contributes to bloating the "hidden" state of ``doctest.master``, but
9191 some old code apparently relies on it. For now, all we can do is
9192 encourage people to stitch doctests together via doctest's unittest
9193 integration features instead.
9194
9195- httplib now handles ipv6 address/port pairs.
9196
9197- SF bug #1017864: ConfigParser now correctly handles default keys,
9198 processing them with ``ConfigParser.optionxform`` when supplied,
9199 consistent with the handling of config file entries and runtime-set
9200 options.
9201
9202- SF bug #997050: Document, test, & check for non-string values in
9203 ConfigParser. Moved the new string-only restriction added in
9204 rev. 1.65 to the SafeConfigParser class, leaving existing
9205 ConfigParser & RawConfigParser behavior alone, and documented the
9206 conditions under which non-string values work.
9207
9208Build
9209-----
9210
9211- Building on darwin now includes /opt/local/include and /opt/local/lib for
9212 building extension modules. This is so as to include software installed as
9213 a DarwinPorts port <http://darwinports.opendarwin.org/>
9214
9215- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
9216 platform C computes true for ``x != x`` if and only if X is a NaN.
9217 Other platforms can override the default definition with a platform-
9218 specific spelling in that platform's pyconfig.h. You can also override
9219 pyport.h's default Py_IS_INFINITY definition now.
9220
9221C API
9222-----
9223
9224- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
9225 non-zero if PyEval_InitThreads() has been called.
9226
9227- The undocumented and unused extern int ``_PyThread_Started`` was removed.
9228
9229- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
9230 are two of the very few advertised as being safe to call without holding
9231 the GIL. However, this wasn't true in a debug build, as bug 1041645
9232 demonstrated. In a debug build, Python redirects the ``PyMem`` family
9233 of calls to Python's small-object allocator, to get the benefit of
9234 its extra debugging capabilities. But Python's small-object allocator
9235 isn't threadsafe, relying on the GIL to avoid the expense of doing its
9236 own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
9237 call the platform ``malloc()`` directly now, regardless of build type.
9238
9239- PyLong_AsUnsignedLong[Mask] now support int objects as well.
9240
9241- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
9242 ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
9243 decoding.
9244
9245Tests
9246-----
9247
9248- test__locale ported to unittest
9249
9250Mac
9251---
9252
9253- ``plistlib`` now supports non-dict root objects. There is also a new
9254 interface for reading and writing plist files: ``readPlist(pathOrFile)``
9255 and ``writePlist(rootObject, pathOrFile)``
9256
9257Tools/Demos
9258-----------
9259
9260- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
9261 read the input files in universal-newline mode. This spares them
9262 from consuming a great deal of time to deduce the useless result that,
9263 e.g., a file with Windows line ends and a file with Linux line ends
9264 have no lines in common.
9265
9266
9267What's New in Python 2.4 alpha 3?
9268=================================
9269
9270*Release date: 02-SEP-2004*
9271
9272Core and builtins
9273-----------------
9274
9275- SF patch #1007189: ``from ... import ...`` statements now allow the name
9276 list to be surrounded by parentheses.
9277
9278- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
9279 multiplication was sped a little by optimizing the C code. Gradeschool
9280 squaring was sped by about a factor of 2, by exploiting that about half
9281 the digit products are duplicates in a square. Because exponentiation
9282 uses squaring often, this also speeds long power. For example, the time
9283 to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
9284 to this much. The cutoff for Karatsuba multiplication was raised,
9285 since gradeschool multiplication got quicker, and the cutoff was
9286 aggressively small regardless. The exponentiation algorithm was switched
9287 from right-to-left to left-to-right, which is more efficient for small
9288 bases. In addition, if the exponent is large, the algorithm now does
9289 5 bits (instead of 1 bit) at a time. That cut the time to compute
9290 17**1000000 on my box in half again, down to about 4.5 seconds.
9291
9292- OverflowWarning is no longer generated. PEP 237 scheduled this to
9293 occur in Python 2.3, but since OverflowWarning was disabled by default,
9294 nobody realized it was still being generated. On the chance that user
9295 code is still using them, the Python builtin OverflowWarning, and
9296 corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
9297
9298- Py_InitializeEx has been added.
9299
9300- Fix the order of application of decorators. The proper order is bottom-up;
9301 the first decorator listed is the last one called.
9302
9303- SF patch #1005778. Fix a seg fault if the list size changed while
9304 calling list.index(). This could happen if a rich comparison function
9305 modified the list.
9306
9307- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
9308 functions is now writable.
9309
9310- code_new (a.k.a new.code()) now checks its arguments sufficiently
9311 carefully that passing them on to PyCode_New() won't trigger calls
9312 to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
9313 that the returned code object might be entirely insane.
9314
9315- Subclasses of string can no longer be interned. The semantics of
9316 interning were not clear here -- a subclass could be mutable, for
9317 example -- and had bugs. Explicitly interning a subclass of string
9318 via intern() will raise a TypeError. Internal operations that attempt
9319 to intern a string subclass will have no effect.
9320
9321- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
9322 what xrange() intends, and repaired tests accordingly.
9323
9324Extension modules
9325-----------------
9326
9327- difflib now supports HTML side-by-side diff.
9328
9329- os.urandom has been added for systems that support sources of random
9330 data.
9331
Sean Reifscheider54cf12b2007-09-17 17:55:36 +00009332- Patch 1012740: truncate() on a writable cStringIO now resets the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009333 position to the end of the stream. This is consistent with the original
9334 StringIO module and avoids inadvertently resurrecting data that was
9335 supposed to have been truncated away.
9336
9337- Added socket.socketpair().
9338
9339- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
9340 members to xml.parsers.expat.XMLParser object.
9341
9342- The mpz, rotor, and xreadlines modules, all deprecated in earlier
9343 versions of Python, have now been removed.
9344
9345Library
9346-------
9347
9348- Patch #934356: if a module defines __all__, believe that rather than using
9349 heuristics for filtering out imported names.
9350
9351- Patch #941486: added os.path.lexists(), which returns True for broken
9352 symlinks, unlike os.path.exists().
9353
9354- the random module now uses os.urandom() for seeding if it is available.
9355 Added a new generator based on os.urandom().
9356
9357- difflib and diff.py can now generate HTML.
9358
9359- bdist_rpm now includes version and release in the BuildRoot, and
9360 replaces - by ``_`` in version and release.
9361
9362- distutils build/build_scripts now has an -e option to specify the
9363 path to the Python interpreter for installed scripts.
9364
9365- PEP 292 classes Template and SafeTemplate are added to the string module.
9366
9367- tarfile now generates GNU tar files by default.
9368
9369- HTTPResponse has now a getheaders method.
9370
9371- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
9372 Percivall.
9373
9374- logging.handlers.SMTPHandler.date_time has been removed;
9375 the class now uses email.Utils.formatdate to generate the time stamp.
9376
9377- A new function tkFont.nametofont was added to return an existing
9378 font. The Font class constructor now has an additional exists argument
9379 which, if True, requests to return/configure an existing font, rather
9380 than creating a new one.
9381
9382- Updated the decimal package's min() and max() methods to match the
9383 latest revision of the General Decimal Arithmetic Specification.
9384 Quiet NaNs are ignored and equal values are sorted based on sign
9385 and exponent.
9386
9387- The decimal package's Context.copy() method now returns deep copies.
9388
9389- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
9390 attribute will be kept around for backwards compatibility and atexit
9391 will just become the one preferred way to do it.
9392
9393- patch #675551: Add get_history_item and replace_history_item functions
9394 to the readline module.
9395
9396- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
9397 of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
9398 frame, u(p) to an older frame, not the other way around.
9399
9400- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
9401 path, as normalizing the path may alter the meaning of the path if it
9402 contains symlinks.
9403
9404- bug #851123: shutil.copyfile will raise an exception when trying to copy a
9405 file onto a link to itself. Thanks Gregory Ball.
9406
9407- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
9408 so as to properly list all functions in a module when the module itself is
9409 reached through a symlink. Thanks Johannes Gijsbers.
9410
9411- doctest refactoring continued. See the docs for details. As part of
9412 this effort, some old and little- (never?) used features are now
9413 deprecated: the Tester class, the module is_private() function, and the
9414 isprivate argument to testmod(). The Tester class supplied a feeble
9415 "by hand" way to combine multiple doctests, if you knew exactly what
9416 you were doing. The newer doctest features for unittest integration
9417 already did a better job of that, are stronger now than ever, and the
9418 new DocTestRunner class is a saner foundation if you want to do it by
9419 hand. The "private name" filtering gimmick was a mistake from the
9420 start, and testmod() changed long ago to ignore it by default. If
9421 you want to filter out tests, the new DocTestFinder class can be used
9422 to return a list of all doctests, and you can filter that list by
9423 any computable criteria before passing it to a DocTestRunner instance.
9424
9425- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
9426
9427Tools/Demos
9428-----------
9429
9430- IDLE's shortcut keys for windows are now case insensitive so that
9431 Control-V works the same as Control-v.
9432
9433- pygettext.py: Generate POT-Creation-Date header in ISO format.
9434
9435Build
9436-----
9437
9438- Backward incompatibility: longintrepr.h now triggers a compile-time
9439 error if SHIFT (the number of bits in a Python long "digit") isn't
9440 divisible by 5. This new requirement allows simple code for the new
9441 5-bits-at-a-time long_pow() implementation. If necessary, the
9442 restriction could be removed (by complicating long_pow(), or by
9443 falling back to the 1-bit-at-a-time algorithm), but there are no
9444 plans to do so.
9445
9446- bug #991962: When building with --disable-toolbox-glue on Darwin no
9447 attempt to build Mac-specific modules occurs.
9448
9449- The --with-tsc flag to configure to enable VM profiling with the
9450 processor's timestamp counter now works on PPC platforms.
9451
9452- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
9453 GCC's definition and avoid redefinition warnings.
9454
9455- Detect pthreads support (provided by gnu pth pthread emulation) on
9456 GNU/k*BSD systems.
9457
9458- bug #1005737, #1007249: Fixed several build problems and warnings
9459 found on old/legacy C compilers of HP-UX, IRIX and Tru64.
9460
9461C API
9462-----
9463
9464..
9465
9466Documentation
9467-------------
9468
9469- patch #1005936, bug #1009373: fix index entries which contain
9470 an underscore when viewed with Acrobat.
9471
9472- bug #990669: os.path.normpath may alter the meaning of a path if
9473 it contains symbolic links. This has been documented in a comment
9474 since 1992, but is now in the library reference as well.
9475
9476New platforms
9477-------------
9478
9479- FreeBSD 6 is now supported.
9480
9481Tests
9482-----
9483
9484..
9485
9486Windows
9487-------
9488
9489- Boosted the stack reservation for python.exe and pythonw.exe from
9490 the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
9491 bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
9492 within the default sys.getrecursionlimit() default value of 1000 were
9493 able to suffer undetected C stack overflows. The standard test program
9494 test_compiler was one such program. If a Python process on Windows
9495 "just vanishes" without a trace, and without an error message of any
9496 kind, but with an exit code of 128, undetected stack overflow may be
9497 the problem.
9498
9499Mac
9500---
9501
9502..
9503
9504
9505What's New in Python 2.4 alpha 2?
9506=================================
9507
9508*Release date: 05-AUG-2004*
9509
9510Core and builtins
9511-----------------
9512
9513- Patch #980695: Implements efficient string concatenation for statements
9514 of the form s=s+t and s+=t. This will vary across implementations.
9515 Accordingly, the str.join() method is strongly preferred for performance
9516 sensitive code.
9517
9518- PEP-0318, Function Decorators have been added to the language. These are
9519 implemented using the Java-style @decorator syntax, like so::
9520
9521 @staticmethod
9522 def foo(bar):
9523
9524 (The PEP needs to be updated to reflect the current state)
9525
9526- When importing a module M raises an exception, Python no longer leaves M
9527 in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
9528 succeed, picking up a module object from sys.modules reflecting as much
9529 of the initialization of M as completed before the exception was raised.
9530 Subsequent imports got no indication that M was in a partially-
9531 initialized state, and the importers could get into arbitrarily bad
9532 trouble as a result (the M they got was in an unintended state,
9533 arbitrarily far removed from M's author's intent). Now subsequent
9534 imports of M will continue raising exceptions (but if, for example, the
9535 source code for M is edited between import attempts, then perhaps later
9536 attempts will succeed, or raise a different exception).
9537
9538 This can break existing code, but in such cases the code was probably
9539 working before by accident. In the Python source, the only case of
9540 breakage discovered was in a test accidentally relying on a damaged
9541 module remaining in sys.modules. Cases are also known where tests
9542 deliberately provoking import errors remove damaged modules from
9543 sys.modules themselves, and such tests will break now if they do an
9544 unconditional del sys.modules[M].
9545
9546- u'%s' % obj will now try obj.__unicode__() first and fallback to
9547 obj.__str__() if no __unicode__ method can be found.
9548
9549- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
9550 PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
9551
9552- Allow string and unicode return types from .encode()/.decode()
9553 methods on string and unicode objects. Added unicode.decode()
9554 which was missing for no apparent reason.
9555
9556- An attempt to fix the mess that is Python's behaviour with
9557 signal handlers and threads, complicated by readline's behaviour.
9558 It's quite possible that there are still bugs here.
9559
9560- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
9561 types that support garbage collection.
9562
9563- Compiler now treats None as a constant.
9564
9565- The type of values returned by __int__, __float__, __long__,
9566 __oct__, and __hex__ are now checked. Returning an invalid type
9567 will cause a TypeError to be raised. This matches the behavior of
9568 Jython.
9569
9570- Implemented bind_textdomain_codeset() in locale module.
9571
9572- Added a workaround for proper string operations in BSDs. str.split
9573 and str.is* methods can now work correctly with UTF-8 locales.
9574
9575- Bug #989185: unicode.iswide() and unicode.width() is dropped and
9576 the East Asian Width support is moved to unicodedata extension
9577 module.
9578
9579- Patch #941229: The source code encoding in interactive mode
9580 now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
9581 allows for non-latin-1 users to write unicode strings directly.
9582
9583Extension modules
9584-----------------
9585
9586- cpickle now supports the same keyword arguments as pickle.
9587
9588Library
9589-------
9590
9591- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
9592 TIS-620
9593
9594- Thanks to Edward Loper, doctest has been massively refactored, and
9595 many new features were added. Full docs will appear later. For now
9596 the doctest module comments and new test cases give good coverage.
9597 The refactoring provides many hook points for customizing behavior
9598 (such as how to report errors, and how to compare expected to actual
9599 output). New features include a <BLANKLINE> marker for expected
9600 output containing blank lines, options to produce unified or context
9601 diffs when actual output doesn't match expectations, an option to
9602 normalize whitespace before comparing, and an option to use an
9603 ellipsis to signify "don't care" regions of output.
9604
9605- Tkinter now supports the wish -sync and -use options.
9606
9607- The following methods in time support passing of None: ctime(), gmtime(),
9608 and localtime(). If None is provided, the current time is used (the
9609 same as when the argument is omitted).
9610 [SF bug 658254, patch 663482]
9611
9612- nntplib does now allow to ignore a .netrc file.
9613
9614- urllib2 now recognizes Basic authentication even if other authentication
9615 schemes are offered.
9616
9617- Bug #1001053. wave.open() now accepts unicode filenames.
9618
9619- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
9620 underlying file object (provided it has a fileno() method). This is
9621 needed if you want to use os.fsync() on a GzipFile.
9622
9623- imaplib has two new methods: deleteacl and myrights.
9624
9625- nntplib has two new methods: description and descriptions. They
9626 use a more RFC-compliant way of getting a newsgroup description.
9627
9628- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
9629 raised during interpreter shutdown from a registered function with atexit
9630 when dummy_threading is being used.
9631
9632- Bug #857297/Patch #916874. Fix an error when extracting a hard link
9633 from a tarfile.
9634
9635- Patch #846659. Fix an error in tarfile.py when using
9636 GNU longname/longlink creation.
9637
Georg Brandl93dc9eb2010-03-14 10:56:14 +00009638- The obsolete FCNTL.py has been deleted. The built-in fcntl module
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009639 has been available (on platforms that support fcntl) since Python
9640 1.5a3, and all FCNTL.py did is export fcntl's names, after generating
9641 a deprecation warning telling you to use fcntl directly.
9642
9643- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
9644 iso2022_jp_2004, shift_jis_2004.
9645
9646- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
9647 implementations, exploiting Conditions (which didn't exist at the time
9648 Queue was introduced). A minor semantic change is that the Full and
9649 Empty exceptions raised by non-blocking calls now occur only if the
9650 queue truly was full or empty at the instant the queue was checked (of
9651 course the Queue may no longer be full or empty by the time a calling
9652 thread sees those exceptions, though). Before, the exceptions could
9653 also be raised if it was "merely inconvenient" for the implementation
9654 to determine the true state of the Queue (because the Queue was locked
9655 by some other method in progress).
9656
9657- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
9658 case of comparing two empty lists. This affected both context_diff() and
9659 unified_diff(),
9660
9661- Bug #980938: smtplib now prints debug output to sys.stderr.
9662
9663- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
9664 returning the last point in the path that was not part of any loop. Thanks
9665 AM Kuchling.
9666
9667- Bug #980327: ntpath not handles compressing erroneous slashes between the
9668 drive letter and the rest of the path. Also clearly handles UNC addresses now
9669 as well. Thanks Paul Moore.
9670
9671- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
9672 for file sizes (compressed and uncompressed) was being stored as signed
9673 instead of unsigned.
9674
9675- decimal.py now only uses signals in the IBM spec. The other conditions are
9676 no longer part of the public API.
9677
9678- codecs module now has two new generic APIs: encode() and decode()
9679 which don't restrict the return types (unlike the unicode and
9680 string methods of the same name).
9681
9682- Non-blocking SSL sockets work again; they were broken in Python 2.3.
9683 SF patch 945642.
9684
9685- doctest unittest integration improvements:
9686
9687 o Improved the unitest test output for doctest-based unit tests
9688
9689 o Can now pass setUp and tearDown functions when creating
9690 DocTestSuites.
9691
9692- The threading module has a new class, local, for creating objects
9693 that provide thread-local data.
9694
9695- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
9696 no longer returns spurious empty fields.
9697
9698- Implemented bind_textdomain_codeset() in gettext module.
9699
9700- Introduced in gettext module the l*gettext() family of functions,
9701 which return translation strings encoded in the preferred encoding,
9702 as informed by locale module's getpreferredencoding().
9703
9704- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
9705
9706 - Add expansion of default values in help text: the string
9707 "%default" in an option's help string is expanded to str() of
9708 that option's default value, or "none" if no default value.
9709
9710 - Bug #955889: option default values that happen to be strings are
9711 now processed in the same way as values from the command line; this
9712 allows generation of nicer help when using custom types. Can
9713 be disabled with parser.set_process_default_values(False).
9714
9715 - Bug #960515: don't crash when generating help for callback
9716 options that specify 'type', but not 'dest' or 'metavar'.
9717
9718 - Feature #815264: change the default help format for short options
9719 that take an argument from e.g. "-oARG" to "-o ARG"; add
9720 set_short_opt_delimiter() and set_long_opt_delimiter() methods to
9721 HelpFormatter to allow (slight) customization of the formatting.
9722
9723 - Patch #736940: internationalize Optik: all built-in user-
9724 targeted literal strings are passed through gettext.gettext(). (If
9725 you want translations (.po files), they're not included with Python
9726 -- you'll find them in the Optik source distribution from
9727 http://optik.sourceforge.net/ .)
9728
9729 - Bug #878453: respect $COLUMNS environment variable for
9730 wrapping help output.
9731
9732 - Feature #988122: expand "%prog" in the 'description' passed
9733 to OptionParser, just like in the 'usage' and 'version' strings.
9734 (This is *not* done in the 'description' passed to OptionGroup.)
9735
9736C API
9737-----
9738
9739- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
9740 error occurs while loading the module, these now delete the module's
9741 entry from sys.modules. All ways of loading modules eventually call
9742 one of these, so this is an error-case change in semantics for all
9743 ways of loading modules. In rare cases, a module loader may wish
9744 to keep a module object in sys.modules despite that the module's
9745 code cannot be executed. In such cases, the module loader must
9746 arrange to reinsert the name and module object in sys.modules.
9747 PyImport_ReloadModule() has been changed to reinsert the original
9748 module object into sys.modules if the module reload fails, so that
9749 its visible semantics have not changed.
9750
9751- A large pile of datetime field-extraction macros is now documented,
9752 thanks to Anthony Tuininga (patch #986010).
9753
9754Documentation
9755-------------
9756
9757- Improved the tutorial on creating types in C.
9758
9759 - point out the importance of reassigning data members before
9760 assigning their values
9761
9762 - correct my misconception about return values from visitprocs. Sigh.
9763
9764 - mention the labor saving Py_VISIT and Py_CLEAR macros.
9765
9766- Major rewrite of the math module docs, to address common confusions.
9767
9768Tests
9769-----
9770
9771- The test data files for the decimal test suite are now installed on
9772 platforms that use the Makefile.
9773
9774- SF patch 995225: The test file testtar.tar accidentally contained
9775 CVS keywords (like $Id$), which could cause spurious failures in
9776 test_tarfile.py depending on how the test file was checked out.
9777
9778
9779What's New in Python 2.4 alpha 1?
9780=================================
9781
9782*Release date: 08-JUL-2004*
9783
9784Core and builtins
9785-----------------
9786
9787- weakref.ref is now the type object also known as
9788 weakref.ReferenceType; it can be subclassed like any other new-style
9789 class. There's less per-entry overhead in WeakValueDictionary
9790 objects now (one object instead of three).
9791
9792- Bug #951851: Python crashed when reading import table of certain
9793 Windows DLLs.
9794
9795- Bug #215126. The locals argument to eval(), execfile(), and exec now
9796 accept any mapping type.
9797
9798- marshal now shares interned strings. This change introduces
9799 a new .pyc magic.
9800
9801- Bug #966623. classes created with type() in an exec(, {}) don't
9802 have a __module__, but code in typeobject assumed it would always
9803 be there.
9804
9805- Python no longer relies on the LC_NUMERIC locale setting to be
9806 the "C" locale; as a result, it no longer tries to prevent changing
9807 the LC_NUMERIC category.
9808
9809- Bug #952807: Unpickling pickled instances of subclasses of
9810 datetime.date, datetime.datetime and datetime.time could yield insane
9811 objects. Thanks to Jiwon Seo for a fix.
9812
9813- Bug #845802: Python crashes when __init__.py is a directory.
9814
9815- Unicode objects received two new methods: iswide() and width().
9816 These query East Asian width information, as specified in Unicode
9817 TR11.
9818
9819- Improved the tuple hashing algorithm to give fewer collisions in
9820 common cases. Fixes bug #942952.
9821
9822- Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
9823
9824- Enabled the profiling of C extension functions (and builtins) - check
9825 new documentation and modified profile and bdb modules for more details
9826
9827- Set file.name to the object passed to open (instead of a new string)
9828
9829- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
9830
9831- Optimized the byte coding for multiple assignments like "a,b=b,a" and
9832 "a,b,c=1,2,3". Improves their speed by 25% to 30%.
9833
9834- Limit the nested depth of a tuple for the second argument to isinstance()
9835 and issubclass() to the recursion limit of the interpreter.
9836 Fixes bug #858016 .
9837
9838- Optimized dict iterators, creating separate types for each
9839 and having them reveal their length. Also optimized the
9840 methods: keys(), values(), and items().
9841
9842- Implemented a newcode opcode, LIST_APPEND, that simplifies
9843 the generated bytecode for list comprehensions and further
9844 improves their performance (about 35%).
9845
9846- Implemented rich comparisons for floats, which seems to make
9847 comparisons involving NaNs somewhat less surprising when the
9848 underlying C compiler actually implements C99 semantics.
9849
9850- Optimized list.extend() to save memory and no longer create
9851 intermediate sequences. Also, extend() now pre-allocates the
9852 needed memory whenever the length of the iterable is known in
9853 advance -- this halves the time to extend the list.
9854
9855- Optimized list resize operations to make fewer calls to the system
9856 realloc(). Significantly speeds up list appends, list pops,
9857 list comprehensions, and the list constructor (when the input iterable
9858 length is not known).
9859
9860- Changed the internal list over-allocation scheme. For larger lists,
9861 overallocation ranged between 3% and 25%. Now, it is a constant 12%.
9862 For smaller lists (n<8), overallocation was upto eight elements. Now,
9863 the overallocation is no more than three elements -- this improves space
9864 utilization for applications that have large numbers of small lists.
9865
9866- Most list bodies now get re-used rather than freed. Speeds up list
9867 instantiation and deletion by saving calls to malloc() and free().
9868
9869- The dict.update() method now accepts all the same argument forms
9870 as the dict() constructor. This now includes item lists and/or
9871 keyword arguments.
9872
9873- Support for arbitrary objects supporting the read-only buffer
9874 interface as the co_code field of code objects (something that was
9875 only possible to create from C code) has been removed.
9876
9877- Made omitted callback and None equivalent for weakref.ref() and
9878 weakref.proxy(); the None case wasn't handled correctly in all
9879 cases.
9880
9881- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
9882 assumed that initial existing entries in an object's weakref list
9883 would not be removed while allocating a new weakref object. Since
9884 GC could be invoked at that time, however, that assumption was
9885 invalid. In a truly obscure case of GC being triggered during
9886 creation for a new weakref object for an referent which already
9887 has a weakref without a callback which is only referenced from
9888 cyclic trash, a memory error can occur. This consistently created a
9889 segfault in a debug build, but provided less predictable behavior in
9890 a release build.
9891
Georg Brandl93dc9eb2010-03-14 10:56:14 +00009892- input() built-in function now respects compiler flags such as
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009893 __future__ statements. SF patch 876178.
9894
9895- Removed PendingDeprecationWarning from apply(). apply() remains
9896 deprecated, but the nuisance warning will not be issued.
9897
9898- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
9899 collection twice, both before and after tearing down modules. The
9900 call after tearing down modules has been disabled, because too much
9901 of Python has been torn down then for __del__ methods and weakref
9902 callbacks to execute sanely. The most common symptom was a sequence
9903 of uninformative messages on stderr when Python shut down, produced
9904 by threads trying to raise exceptions, but unable to report the nature
9905 of their problems because too much of the sys module had already been
9906 destroyed.
9907
9908- Removed FutureWarnings related to hex/oct literals and conversions
9909 and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
9910 This addresses most of the remaining semantic changes promised by
9911 PEP 237, except for repr() of a long, which still shows the trailing
9912 'L'. The PEP appears to promise warnings for operations that
9913 changed semantics compared to Python 2.3, but this is not
9914 implemented; we've suffered through enough warnings related to
9915 hex/oct literals and I think it's best to be silent now.
9916
9917- For str and unicode objects, the ljust(), center(), and rjust()
9918 methods now accept an optional argument specifying a fill
9919 character other than a space.
9920
9921- When method objects have an attribute that can be satisfied either
9922 by the function object or by the method object, the function
9923 object's attribute usually wins. Christian Tismer pointed out that
9924 that this is really a mistake, because this only happens for special
9925 methods (like __reduce__) where the method object's version is
9926 really more appropriate than the function's attribute. So from now
9927 on, all method attributes will have precedence over function
9928 attributes with the same name.
9929
9930- Critical bugfix, for SF bug 839548: if a weakref with a callback,
9931 its callback, and its weakly referenced object, all became part of
9932 cyclic garbage during a single run of garbage collection, the order
9933 in which they were torn down was unpredictable. It was possible for
9934 the callback to see partially-torn-down objects, leading to immediate
9935 segfaults, or, if the callback resurrected garbage objects, to
9936 resurrect insane objects that caused segfaults (or other surprises)
9937 later. In one sense this wasn't surprising, because Python's cyclic gc
9938 had no knowledge of Python's weakref objects. It does now. When
9939 weakrefs with callbacks become part of cyclic garbage now, those
9940 weakrefs are cleared first. The callbacks don't trigger then,
9941 preventing the problems. If you need callbacks to trigger, then just
9942 as when cyclic gc is not involved, you need to write your code so
9943 that weakref objects outlive the objects they weakly reference.
9944
9945- Critical bugfix, for SF bug 840829: if cyclic garbage collection
9946 happened to occur during a weakref callback for a new-style class
9947 instance, subtle memory corruption was the result (in a release build;
9948 in a debug build, a segfault occurred reliably very soon after).
9949 This has been repaired.
9950
9951- Compiler flags set in PYTHONSTARTUP are now active in __main__.
9952
Georg Brandl93dc9eb2010-03-14 10:56:14 +00009953- Added two built-in types, set() and frozenset().
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009954
Georg Brandl93dc9eb2010-03-14 10:56:14 +00009955- Added a reversed() built-in function that returns a reverse iterator
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009956 over a sequence.
9957
Georg Brandl93dc9eb2010-03-14 10:56:14 +00009958- Added a sorted() built-in function that returns a new sorted list
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009959 from any iterable.
9960
9961- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
9962
9963- list.sort() now supports three keyword arguments: cmp, key, and reverse.
9964 The key argument can be a function of one argument that extracts a
9965 comparison key from the original record: mylist.sort(key=str.lower).
9966 The reverse argument is a boolean value and if True will change the
9967 sort order as if the comparison arguments were reversed. In addition,
9968 the documentation has been amended to provide a guarantee that all sorts
9969 starting with Py2.3 are guaranteed to be stable (the relative order of
9970 records with equal keys is unchanged).
9971
9972- Added test whether wchar_t is signed or not. A signed wchar_t is not
9973 usable as internal unicode type base for Py_UNICODE since the
9974 unicode implementation assumes an unsigned type.
9975
9976- Fixed a bug in the cache of length-one Unicode strings that could
9977 lead to a seg fault. The specific problem occurred when an earlier,
9978 non-fatal error left an uninitialized Unicode object in the
9979 freelist.
9980
9981- The % formatting operator now supports '%F' which is equivalent to
9982 '%f'. This has always been documented but never implemented.
9983
9984- complex(obj) could leak a little memory if obj wasn't a string or
9985 number.
9986
9987- zip() with no arguments now returns an empty list instead of raising
9988 a TypeError exception.
9989
9990- obj.__contains__() now returns True/False instead of 1/0. SF patch
9991 820195.
9992
9993- Python no longer tries to be smart about recursive comparisons.
9994 When comparing containers with cyclic references to themselves it
9995 will now just hit the recursion limit. See SF patch 825639.
9996
Georg Brandl93dc9eb2010-03-14 10:56:14 +00009997- str and unicode built-in types now have an rsplit() method that is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00009998 same as split() except that it scans the string from the end
9999 working towards the beginning. See SF feature request 801847.
10000
10001- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
10002 to clear the error when attempts to get the __getstate__ attribute
10003 fail caused intermittent errors and odd behavior.
10004
10005- buffer objects based on other objects no longer cache a pointer to
10006 the data and the data length. Instead, the appropriate tp_as_buffer
10007 method is called as necessary.
10008
10009- fixed: if a file is opened with an explicit buffer size >= 1, repeated
10010 close() calls would attempt to free() the buffer already free()ed on
10011 the first call.
10012
10013
10014Extension modules
10015-----------------
10016
10017- Added socket.getservbyport(), and make the second argument in
10018 getservbyname() and getservbyport() optional.
10019
10020- time module code that deals with input POSIX timestamps will now raise
10021 ValueError if more than a second is lost in precision when the
10022 timestamp is cast to the platform C time_t type. There's no chance
10023 that the platform will do anything sensible with the result in such
10024 cases. This includes ctime(), localtime() and gmtime(). Assorted
10025 fromtimestamp() and utcfromtimestamp() methods in the datetime module
10026 were also protected. Closes bugs #919012 and 975996.
10027
10028- fcntl.ioctl now warns if the mutate flag is not specified.
10029
10030- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
10031
10032- the weakref module now supports additional objects: array.array,
10033 sre.pattern_objects, file objects, and sockets.
10034
10035- operator.isMappingType() and operator.isSequenceType() now give
10036 fewer false positives.
10037
10038- socket.sslerror is now a subclass of socket.error . Also added
10039 socket.error to the socket module's C API.
10040
10041- Bug #920575: A problem where the _locale module segfaults on
10042 nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
10043
10044- array objects now support the copy module. Also, their resizing
10045 scheme has been updated to match that used for list objects. This improves
10046 the performance (speed and memory usage) of append() operations.
10047 Also, array.array() and array.extend() now accept any iterable argument
10048 for repeated appends without needing to create another temporary array.
10049
10050- cStringIO.writelines() now accepts any iterable argument and writes
10051 the lines one at a time rather than joining them and writing once.
10052 Made a parallel change to StringIO.writelines(). Saves memory and
10053 makes suitable for use with generator expressions.
10054
10055- time.strftime() now checks that the values in its time tuple argument
10056 are within the proper boundaries to prevent possible crashes from the
10057 platform's C library implementation of strftime(). Can possibly
10058 break code that uses values outside the range that didn't cause
10059 problems previously (such as sitting day of year to 0). Fixes bug
10060 #897625.
10061
10062- The socket module now supports Bluetooth sockets, if the
10063 system has <bluetooth/bluetooth.h>
10064
10065- Added a collections module containing a new datatype, deque(),
10066 offering high-performance, thread-safe, memory friendly appends
10067 and pops on either side of the deque.
10068
10069- Several modules now take advantage of collections.deque() for
10070 improved performance: Queue, mutex, shlex, threading, and pydoc.
10071
10072- The operator module has two new functions, attrgetter() and
10073 itemgetter() which are useful for creating fast data extractor
10074 functions for map(), list.sort(), itertools.groupby(), and
10075 other functions that expect a function argument.
10076
10077- socket.SHUT_{RD,WR,RDWR} was added.
10078
10079- os.getsid was added.
10080
10081- The pwd module incorrectly advertised its struct type as
10082 struct_pwent; this has been renamed to struct_passwd. (The old name
10083 is still supported for backwards compatibility.)
10084
10085- The xml.parsers.expat module now provides Expat 1.95.7.
10086
10087- socket.IPPROTO_IPV6 was added.
10088
10089- readline.clear_history was added.
10090
10091- select.select() now accepts sequences for its first three arguments.
10092
10093- cStringIO now supports the f.closed attribute.
10094
10095- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
10096
10097- curses module now supports use_default_colors(). [patch #739124]
10098
10099- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
10100
10101- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
10102
10103- Implemented non-recursive SRE matching scheme (#757624).
10104
10105- Implemented (?(id/name)yes|no) support in SRE (#572936).
10106
10107- random.seed() with no arguments or None uses time.time() as a default
10108 seed. Modified to match Py2.2 behavior and use fractional seconds so
10109 that successive runs are more likely to produce different sequences.
10110
10111- random.Random has a new method, getrandbits(k), which returns an int
10112 with k random bits. This method is now an optional part of the API
10113 for user defined generators. Any generator that defines genrandbits()
10114 can now use randrange() for ranges with a length >= 2**53. Formerly,
10115 randrange would return only even numbers for ranges that large (see
10116 SF bug #812202). Generators that do not define genrandbits() now
10117 issue a warning when randrange() is called with a range that large.
10118
10119- itertools has a new function, groupby() for aggregating iterables
10120 into groups sharing the same key (as determined by a key function).
10121 It offers some of functionality of SQL's groupby keyword and of
10122 the Unix uniq filter.
10123
10124- itertools now has a new tee() function which produces two independent
10125 iterators from a single iterable.
10126
10127- itertools.izip() with no arguments now returns an empty iterator instead
10128 of raising a TypeError exception.
10129
10130- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
10131 as parameter.
10132
10133Library
10134-------
10135
10136- Added a new module: cProfile, a C profiler with the same interface as the
10137 profile module. cProfile avoids some of the drawbacks of the hotshot
10138 profiler and provides a bit more information than the other two profilers.
10139 Based on "lsprof" (patch #1212837).
10140
10141- Bug #1266283: The new function "lexists" is now in os.path.__all__.
10142
10143- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
10144 the documented behavior: the function passed to the onerror()
10145 handler can now also be os.listdir.
10146
10147- Bug #754449: threading.Thread objects no longer mask exceptions raised during
10148 interpreter shutdown with another exception from attempting to handle the
10149 original exception.
10150
10151- Added decimal.py per PEP 327.
10152
10153- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
10154 "netloc" portion of a URL.
10155
10156- Bug #919012: shutil.move() will not try to move a directory into itself.
10157 Thanks Johannes Gijsbers.
10158
10159- Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
10160
10161- Bug #823209: cmath.log() now takes an optional base argument so that its
10162 API matches math.log().
10163
10164- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
10165 that generate a -debuginfo.rpm
10166
10167- os.path.devnull has been added for all supported platforms.
10168
10169- Fixed #877165: distutils now picks the right C++ compiler command
10170 on cygwin and mingw32.
10171
10172- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
10173
10174- refactored site.py into functions. Also wrote regression tests for the
10175 module.
10176
10177- The distutils install command now supports the --home option and
10178 installation scheme for all platforms.
10179
10180- asyncore.loop now has a repeat count parameter that defaults to
10181 looping forever.
10182
10183- The distutils sdist command now ignores all .svn directories, in
10184 addition to CVS and RCS directories. .svn directories hold
10185 administrative files for the Subversion source control system.
10186
10187- Added a new module: cookielib. Automatic cookie handling for HTTP
10188 clients. Also, support for cookielib has been added to urllib2, so
10189 urllib2.urlopen() can transparently handle cookies.
10190
10191- stringprep.py now uses built-in set() instead of sets.Set().
10192
10193- Bug #876278: Unbounded recursion in modulefinder
10194
10195- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
10196 Applications relying on the wrong order need to be corrected.
10197
10198- Bug #926075: Fixed a bug that returns a wrong pattern object
10199 for a string or unicode object in sre.compile() when a different
10200 type pattern with the same value exists.
10201
10202- Added countcallers arg to trace.Trace class (--trackcalls command line arg
10203 when run from the command prompt).
10204
10205- Fixed a caching bug in platform.platform() where the argument of 'terse' was
10206 not taken into consideration when caching value.
10207
10208- Added two new command-line arguments for profile (output file and
10209 default sort).
10210
10211- Added global runctx function to profile module
10212
10213- Add hlist missing entryconfigure and entrycget methods.
10214
10215- The ptcp154 codec was added for Kazakh character set support.
10216
10217- Support non-anonymous ftp URLs in urllib2.
10218
10219- The encodings package will now apply codec name aliases
10220 first before starting to try the import of the codec module.
10221 This simplifies overriding built-in codecs with external
10222 packages, e.g. the included CJK codecs with the JapaneseCodecs
10223 package, by adjusting the aliases dictionary in encodings.aliases
10224 accordingly.
10225
10226- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
10227 decoding standards.
10228
10229- urllib2 now supports processors. A processor is a handler that
10230 implements an xxx_request or xxx_response method. These methods are
10231 called for all requests.
10232
10233- distutils compilers now compile source files in the same order as
10234 they are passed to the compiler.
10235
10236- pprint.pprint() and pprint.pformat() now have additional parameters
10237 indent, width and depth.
10238
10239- Patch #750542: pprint now will pretty print subclasses of list, tuple
10240 and dict too, as long as they don't overwrite __repr__().
10241
10242- Bug #848614: distutils' msvccompiler fails to find the MSVC6
10243 compiler because of incomplete registry entries.
10244
10245- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
10246
10247- Patch #841977: modulefinder didn't find extension modules in packages
10248
10249- imaplib.IMAP4.thread was added.
10250
10251- Plugged a minor hole in tempfile.mktemp() due to the use of
10252 os.path.exists(), switched to using os.lstat() directly if possible.
10253
10254- bisect.py and heapq.py now have underlying C implementations
10255 for better performance.
10256
10257- heapq.py has two new functions, nsmallest() and nlargest().
10258
10259- traceback.format_exc has been added (similar to print_exc but it returns
10260 a string).
10261
10262- xmlrpclib.MultiCall has been added.
10263
10264- poplib.POP3_SSL has been added.
10265
10266- tmpfile.mkstemp now returns an absolute path even if dir is relative.
10267
10268- urlparse is RFC 2396 compliant.
10269
10270- The fieldnames argument to the csv module's DictReader constructor is now
10271 optional. If omitted, the first row of the file will be used as the
10272 list of fieldnames.
10273
10274- encodings.bz2_codec was added for access to bz2 compression
10275 using "a long string".encode('bz2')
10276
10277- Various improvements to unittest.py, realigned with PyUnit CVS.
10278
10279- dircache now passes exceptions to the caller, instead of returning
10280 empty lists.
10281
10282- The bsddb module and dbhash module now support the iterator and
10283 mapping protocols which make them more substitutable for dictionaries
10284 and shelves.
10285
10286- The csv module's DictReader and DictWriter classes now accept keyword
10287 arguments. This was an omission in the initial implementation.
10288
10289- The email package handles some RFC 2231 parameters with missing
10290 CHARSET fields better. It also includes a patch to parameter
10291 parsing when semicolons appear inside quotes.
10292
10293- sets.py now runs under Py2.2. In addition, the argument restrictions
10294 for most set methods (but not the operators) have been relaxed to
10295 allow any iterable.
10296
10297- _strptime.py now has a behind-the-scenes caching mechanism for the most
10298 recent TimeRE instance used along with the last five unique directive
10299 patterns. The overall module was also made more thread-safe.
10300
10301- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
10302 and removed in Py2.4.
10303
10304- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
10305
10306- Patch #873597: CJK codecs are imported into rank of default codecs.
10307
10308Tools/Demos
10309-----------
10310
10311- A hotshotmain script was added to the Tools/scripts directory that
10312 makes it easy to run a script under control of the hotshot profiler.
10313
10314- The db2pickle and pickle2db scripts can now dump/load gdbm files.
10315
10316- The file order on the command line of the pickle2db script was reversed.
10317 It is now [ picklefile ] dbfile. This provides better symmetry with
10318 db2pickle. The file arguments to both scripts are now source followed by
10319 destination in situations where both files are given.
10320
10321- The pydoc script will display a link to the module documentation for
10322 modules determined to be part of the core distribution. The documentation
10323 base directory defaults to http://www.python.org/doc/current/lib/ but can
10324 be changed by setting the PYTHONDOCS environment variable.
10325
10326- texcheck.py now detects double word errors.
10327
10328- md5sum.py mistakenly opened input files in text mode by default, a
10329 silent and dangerous change from previous releases. It once again
10330 opens input files in binary mode by default. The -t and -b flags
10331 remain for compatibility with the 2.3 release, but -b is the default
10332 now.
10333
10334- py-electric-colon now works when pending-delete/delete-selection mode is
10335 in effect
10336
10337- py-help-at-point is no longer bound to the F1 key - it's still bound to
10338 C-c C-h
10339
10340- Pynche was fixed to not crash when there is no ~/.pynche file and no
10341 -d option was given.
10342
10343Build
10344-----
10345
10346- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
10347 build under OS X.
10348
10349- Profiling using gprof is now available if Python is configured with
10350 --enable-profiling.
10351
10352- Profiling the VM using the Pentium TSC is now possible if Python
10353 is configured --with-tsc.
10354
10355- In order to find libraries, setup.py now also looks in /lib64, for use
10356 on AMD64.
10357
10358- Bug #934635: Fixed a bug where the configure script couldn't detect
10359 getaddrinfo() properly if the KAME stack had SCTP support.
10360
10361- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
10362 removed.
10363
10364- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
10365 supported (see PEP 11).
10366
10367- Universal newline support can no longer be disabled (see PEP 11).
10368
10369- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
10370
10371- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
10372 (see PEP 11).
10373
10374- Tests for sizeof(char) were removed since ANSI C mandates that
10375 sizeof(char) must be 1.
10376
10377C API
10378-----
10379
10380- Thanks to Anthony Tuininga, the datetime module now supplies a C API
10381 containing type-check macros and constructors. See new docs in the
10382 Python/C API Reference Manual for details.
10383
10384- Private function _PyTime_DoubleToTimet added, to convert a Python
10385 timestamp (C double) to platform time_t with some out-of-bounds
10386 checking. Declared in new header file timefuncs.h. It would be
10387 good to expose some other internal timemodule.c functions there.
10388
10389- New public functions PyEval_EvaluateFrame and PyGen_New to expose
10390 generator objects.
10391
10392- New public functions Py_IncRef() and Py_DecRef(), exposing the
10393 functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
10394 runtime dynamic embedding of Python. See patch #938302, by Bob
10395 Ippolito.
10396
10397- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
10398 underlying array of PyObject pointers. Useful for high speed looping.
10399
10400- Created a new method flag, METH_COEXIST, which causes a method to be loaded
10401 even if already defined by a slot wrapper. This allows a __contains__
10402 method, for example, to co-exist with a defined sq_contains slot. This
10403 is helpful because the PyCFunction can take advantage of optimized calls
10404 whenever METH_O or METH_NOARGS flags are defined.
10405
10406- Added a new function, PyDict_Contains(d, k) which is like
10407 PySequence_Contains() but is specific to dictionaries and executes
10408 about 10% faster.
10409
10410- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
10411 Each return the singleton they mention after Py_INCREF()ing them.
10412
10413- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
10414 variable length argument list of Python objects without having to invoke
10415 the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
10416 is equivalent to Py_BuildValue("(OOO)", a, b, c).
10417
10418Windows
10419-------
10420
10421- The _winreg module could segfault when reading very large registry
10422 values, due to unchecked alloca() calls (SF bug 851056). The fix is
10423 uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
10424 as appropriate, followed by a size check.
10425
10426- file.truncate() could misbehave if the file was open for update
10427 (modes r+, rb+, w+, wb+), and the most recent file operation before
10428 the truncate() call was an input operation. SF bug 801631.
10429
10430
10431What's New in Python 2.3 final?
10432===============================
10433
10434*Release date: 29-Jul-2003*
10435
10436IDLE
10437----
10438
10439- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
10440 This was unique to Windows, and was fixed by adding an -n switch to
10441 the command the Windows installer creates to execute "Edit with IDLE"
10442 context-menu actions.
10443
10444- IDLE displays a new message upon startup: some "personal firewall"
10445 kinds of programs (for example, ZoneAlarm) open a dialog of their
10446 own when any program opens a socket. IDLE does use sockets, talking
10447 on the computer's internal loopback interface. This connection is not
10448 visible on any external interface and no data is sent to or received
10449 from the Internet. So, if you get such a dialog when opening IDLE,
10450 asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
10451 and rest assured no communication external to your machine is taking
10452 place. If you don't allow it, IDLE won't be able to start.
10453
10454
10455What's New in Python 2.3 release candidate 2?
10456=============================================
10457
10458*Release date: 24-Jul-2003*
10459
10460Core and builtins
10461-----------------
10462
10463- It is now possible to import from zipfiles containing additional
10464 data bytes before the zip compatible archive. Zipfiles containing a
10465 comment at the end are still unsupported.
10466
10467Extension modules
10468-----------------
10469
10470- A longstanding bug in the parser module's initialization could cause
10471 fatal internal refcount confusion when the module got initialized more
10472 than once. This has been fixed.
10473
10474- Fixed memory leak in pyexpat; using the parser's ParseFile() method
10475 with open files that aren't instances of the standard file type
10476 caused an instance of the bound .read() method to be leaked on every
10477 call.
10478
10479- Fixed some leaks in the locale module.
10480
10481Library
10482-------
10483
10484- Lib/encodings/rot_13.py when used as a script, now more properly
10485 uses the first Python interpreter on your path.
10486
10487- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
10488 fix a locale related bug in the test suite. Although another patch
10489 was needed to actually fix the problem, the cache code was not
10490 restored.
10491
10492IDLE
10493----
10494
10495- Calltips patches.
10496
10497Build
10498-----
10499
10500- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
10501 on Panther (OSX 10.3).
10502
10503C API
10504-----
10505
10506Windows
10507-------
10508
10509- The tempfile module could do insane imports on Windows if PYTHONCASEOK
10510 was set, making temp file creation impossible. Repaired.
10511
10512- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
10513
10514Mac
10515---
10516
10517- Various fixes to pimp.
10518
10519- Scripts runs with pythonw no longer had full window manager access.
10520
10521- Don't force boot-disk-only install, for reasons unknown it causes
10522 more problems than it solves.
10523
10524
10525What's New in Python 2.3 release candidate 1?
10526=============================================
10527
10528*Release date: 18-Jul-2003*
10529
10530Core and builtins
10531-----------------
10532
10533- The new function sys.getcheckinterval() returns the last value set
10534 by sys.setcheckinterval().
10535
10536- Several bugs in the symbol table phase of the compiler have been
10537 fixed. Errors could be lost and compilation could fail without
10538 reporting an error. SF patch 763201.
10539
10540- The interpreter is now more robust about importing the warnings
10541 module. In an executable generated by freeze or similar programs,
10542 earlier versions of 2.3 would fail if the warnings module could
10543 not be found on the file system. Fixes SF bug 771097.
10544
10545- A warning about assignments to module attributes that shadow
10546 builtins, present in earlier releases of 2.3, has been removed.
10547
Georg Brandl93dc9eb2010-03-14 10:56:14 +000010548- It is not possible to create subclasses of built-in types like str
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000010549 and tuple that define an itemsize. Earlier releases of Python 2.3
10550 allowed this by mistake, leading to crashes and other problems.
10551
10552- The thread_id is now initialized to 0 in a non-thread build. SF bug
10553 770247.
10554
10555- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
10556
10557Extension modules
10558-----------------
10559
10560- weakref.proxy() can now handle "del obj[i]" for proxy objects
10561 defining __delitem__. Formerly, it generated a SystemError.
10562
10563- SSL no longer crashes the interpreter when the remote side disconnects.
10564
10565- On Unix the mmap module can again be used to map device files.
10566
10567- time.strptime now exclusively uses the Python implementation
10568 contained within the _strptime module.
10569
10570- The print slot of weakref proxy objects was removed, because it was
10571 not consistent with the object's repr slot.
10572
10573- The mmap module only checks file size for regular files, not
10574 character or block devices. SF patch 708374.
10575
10576- The cPickle Pickler garbage collection support was fixed to traverse
10577 the find_class attribute, if present.
10578
10579- There are several fixes for the bsddb3 wrapper module.
10580
10581 bsddb3 no longer crashes if an environment is closed before a cursor
10582 (SF bug 763298).
10583
10584 The DB and DBEnv set_get_returns_none function was extended to take
10585 a level instead of a boolean flag. The new level 2 means that in
10586 addition, cursor.set()/.get() methods return None instead of raising
10587 an exception.
10588
10589 A typo was fixed in DBCursor.join_item(), preventing a crash.
10590
10591Library
10592-------
10593
10594- distutils now supports MSVC 7.1
10595
10596- doctest now examines all docstrings by default. Previously, it would
10597 skip over functions with private names (as indicated by the underscore
10598 naming convention). The old default created too much of a risk that
10599 user tests were being skipped inadvertently. Note, this change could
10600 break code in the unlikely case that someone had intentionally put
10601 failing tests in the docstrings of private functions. The breakage
10602 is easily fixable by specifying the old behavior when calling testmod()
10603 or Tester().
10604
10605- There were several fixes to the way dumbdbms are closed. It's vital
10606 that a dumbdbm database be closed properly, else the on-disk data
10607 and directory files can be left in mutually inconsistent states.
10608 dumbdbm.py's _Database.__del__() method attempted to close the
10609 database properly, but a shutdown race in _Database._commit() could
10610 prevent this from working, so that a program trusting __del__() to
10611 get the on-disk files in synch could be badly surprised. The race
10612 has been repaired. A sync() method was also added so that shelve
10613 can guarantee data is written to disk.
10614
10615 The close() method can now be called more than once without complaint.
10616
10617- The classes in threading.py are now new-style classes. That they
10618 weren't before was an oversight.
10619
10620- The urllib2 digest authentication handlers now define the correct
10621 auth_header. The earlier versions would fail at runtime.
10622
10623- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
10624 when there are no lines.
10625
10626- SF bug 763637: fix exception in Tkinter with after_cancel
10627 which could occur with Tk 8.4
10628
10629- SF bug 770601: CGIHTTPServer.py now passes the entire environment
10630 to child processes.
10631
10632- SF bug 765238: add filter to fnmatch's __all__.
10633
10634- SF bug 748201: make time.strptime() error messages more helpful.
10635
10636- SF patch 764470: Do not dump the args attribute of a Fault object in
10637 xmlrpclib.
10638
10639- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
10640 responses.
10641
10642- SF patch 766650: The whichdb module was fixed to recognize dbm files
10643 generated by gdbm on OS/2 EMX.
10644
10645- SF bugs 763047 and 763052: fixes bug of timezone value being left as
10646 -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
10647 is true when it should only when time.daylight is true.
10648
10649- SF bug 764548: re now allows subclasses of str and unicode to be
10650 used as patterns.
10651
10652- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
10653 of varying sizes. Tk 8.4 returns a different number of values
10654 than Tk 8.3.
10655
10656- SF bug 763023: difflib.ratio() did not catch zero division.
10657
10658- The Queue module now has an __all__ attribute.
10659
10660Tools/Demos
10661-----------
10662
10663- See Lib/idlelib/NEWS.txt for IDLE news.
10664
10665- SF bug 753592: webchecker/wsgui now handles user supplied directories.
10666
10667- The trace.py script has been removed. It is now in the standard library.
10668
10669Build
10670-----
10671
10672- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
10673
10674- The socket module compiles on IRIX 6.5.10.
10675
10676- An irix64 system is treated the same way as an irix6 system (SF
10677 patch 764560).
10678
10679- Several definitions were missing on FreeBSD 5.x unless the
10680 __BSD_VISIBLE symbol was defined. configure now defines it as
10681 needed.
10682
10683C API
10684-----
10685
10686- Unicode objects now support mbcs as a built-in encoding, so the C
10687 API can use it without deferring to the encodings package.
10688
10689Windows
10690-------
10691
10692- The Windows implementation of PyThread_start_new_thread() never
10693 checked error returns from Windows functions correctly. As a result,
10694 it could claim to start a new thread even when the Microsoft
10695 _beginthread() function failed (due to "too many threads" -- this is
10696 on the order of thousands when it happens). In these cases, the
10697 Python exception ::
10698
10699 thread.error: can't start new thread
10700
10701 is raised now.
10702
10703- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
10704 use. The interpreter now calls WSACleanup() from Py_Finalize()
10705 instead of from DLL teardown.
10706
10707Mac
10708---
10709
10710- Bundlebuilder now inherits default values in the right way. It was
10711 previously possible for app bundles to get a type of "BNDL" instead
10712 of "APPL." Other improvements include, a --build-id option to
10713 specify the CFBundleIdentifier and using the --python option to set
10714 the executable in the bundle.
10715
10716- Fixed two bugs in MacOSX framework handling.
10717
10718- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
10719
10720- Python is now compiled with -mno-fused-madd, making all tests pass
10721 on Panther.
10722
10723What's New in Python 2.3 beta 2?
10724================================
10725
10726*Release date: 29-Jun-2003*
10727
10728Core and builtins
10729-----------------
10730
10731- A program can now set the environment variable PYTHONINSPECT to some
10732 string value in Python, and cause the interpreter to enter the
10733 interactive prompt at program exit, as if Python had been invoked
10734 with the -i option.
10735
10736- list.index() now accepts optional start and stop arguments. Similar
10737 changes were made to UserList.index(). SF feature request 754014.
10738
10739- SF patch 751998 fixes an unwanted side effect of the previous fix
10740 for SF bug 742860 (the next item).
10741
10742- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
10743 wasn't threadsafe, was very inefficient (expected time O(len(dict))
10744 instead of O(1)), and could raise a spurious RuntimeError if another
10745 thread mutated the dict during __delitem__, or if a comparison function
10746 mutated it. It also neglected to raise KeyError when the key wasn't
10747 present; didn't raise TypeError when the key wasn't of a weakly
10748 referencable type; and broke various more-or-less obscure dict
10749 invariants by using a sequence of equality comparisons over the whole
10750 set of dict keys instead of computing the key's hash code to narrow
10751 the search to those keys with the same hash code. All of these are
10752 considered to be bugs. A new implementation of __delitem__ repairs all
10753 that, but note that fixing these bugs may change visible behavior in
10754 code relying (whether intentionally or accidentally) on old behavior.
10755
10756- SF bug 734869: Fixed a compiler bug that caused a fatal error when
10757 compiling a list comprehension that contained another list comprehension
10758 embedded in a lambda expression.
10759
10760- SF bug 705231: builtin pow() no longer lets the platform C pow()
10761 raise -1.0 to integer powers, because (at least) glibc gets it wrong
10762 in some cases. The result should be -1.0 if the power is odd and 1.0
10763 if the power is even, and any float with a sufficiently large exponent
10764 is (mathematically) an exact even integer.
10765
10766- SF bug 759227: A new-style class that implements __nonzero__() must
10767 return a bool or int (but not an int subclass) from that method. This
10768 matches the restriction on classic classes.
10769
10770- The encoding attribute has been added for file objects, and set to
10771 the terminal encoding on Unix and Windows.
10772
10773- The softspace attribute of file objects became read-only by oversight.
10774 It's writable again.
10775
10776- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
10777 tuple. By default, the iterators now access data elements directly
10778 instead of going through __getitem__. If __getitem__ access is
10779 preferred, then __iter__ can be overridden.
10780
10781- SF bug 735247: The staticmethod and super types participate in
10782 garbage collection. Before this change, it was possible for leaks to
10783 occur in functions with non-global free variables that used these types.
10784
10785Extension modules
10786-----------------
10787
10788- the socket module has a new exception, socket.timeout, to allow
10789 timeouts to be handled separately from other socket errors.
10790
10791- SF bug 751276: cPickle has fixed to propagate exceptions raised in
10792 user code. In earlier versions, cPickle caught and ignored any
10793 exception when it performed operations that it expected to raise
10794 specific exceptions like AttributeError.
10795
10796- cPickle Pickler and Unpickler objects now participate in garbage
10797 collection.
10798
10799- mimetools.choose_boundary() could return duplicate strings at times,
10800 especially likely on Windows. The strings returned are now guaranteed
10801 unique within a single program run.
10802
10803- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
10804 dummy_thread has also been modified to try to simulate the behavior.
10805
10806- array.array.insert() now treats negative indices as being relative
10807 to the end of the array, just like list.insert() does. (SF bug #739313)
10808
10809- The datetime module classes datetime, time, and timedelta are now
10810 properly subclassable.
10811
10812- _tkinter.{get|set}busywaitinterval was added.
10813
10814- itertools.islice() now accepts stop=None as documented.
10815 Fixes SF bug #730685.
10816
10817- the bsddb185 module is built in one restricted instance -
10818 /usr/include/db.h exists and defines HASHVERSION to be 2. This is true
10819 for many BSD-derived systems.
10820
10821
10822Library
10823-------
10824
10825- Some happy doctest extensions from Jim Fulton have been added to
10826 doctest.py. These are already being used in Zope3. The two
10827 primary ones:
10828
10829 doctest.debug(module, name) extracts the doctests from the named object
10830 in the given module, puts them in a temp file, and starts pdb running
10831 on that file. This is great when a doctest fails.
10832
10833 doctest.DocTestSuite(module=None) returns a synthesized unittest
10834 TestSuite instance, to be run by the unittest framework, which
10835 runs all the doctests in the module. This allows writing tests in
10836 doctest style (which can be clearer and shorter than writing tests
10837 in unittest style), without losing unittest's powerful testing
10838 framework features (which doctest lacks).
10839
10840- For compatibility with doctests created before 2.3, if an expected
10841 output block consists solely of "1" and the actual output block
10842 consists solely of "True", it's accepted as a match; similarly
10843 for "0" and "False". This is quite un-doctest-like, but is practical.
10844 The behavior can be disabled by passing the new doctest module
10845 constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
10846 argument.
10847
10848- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
10849 a bare except caught to much and reported all errors as a problem
10850 in the archive.
10851
10852- The logging module now has a new function, makeLogRecord() making
10853 LogHandler easier to interact with DatagramHandler and SocketHandler.
10854
10855- The cgitb module has been extended to support plain text display (SF patch
10856 569574).
10857
10858- A brand new version of IDLE (from the IDLEfork project at
10859 SourceForge) is now included as Lib/idlelib. The old Tools/idle is
10860 no more.
10861
10862- Added a new module: trace (documentation missing). This module used
10863 to be distributed in Tools/scripts. It uses sys.settrace() to trace
10864 code execution -- either function calls or individual lines. It can
10865 generate tracing output during execution or a post-mortem report of
10866 code coverage.
10867
10868- The threading module has new functions settrace() and setprofile()
10869 that cooperate with the functions of the same name in the sys
10870 module. A function registered with the threading module will
10871 be used for all threads it creates. The new trace module uses this
10872 to provide tracing for code running in threads.
10873
10874- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
10875 Taschuk. Copying a new-style class that had a reference to itself
10876 didn't work. (The same thing worked fine for old-style classes.)
10877 Builtin functions are now treated as atomic, fixing bug #746304.
10878
10879- difflib.py has two new functions: context_diff() and unified_diff().
10880
10881- More fixes to urllib (SF 549151): (a) When redirecting, always use
10882 GET. This is common practice and more-or-less sanctioned by the
10883 HTTP standard. (b) Add a handler for 307 redirection, which becomes
10884 an error for POST, but a regular redirect for GET and HEAD
10885
10886- Added optional 'onerror' argument to os.walk(), to control error
10887 handling.
10888
10889- inspect.is{method|data}descriptor was added, to allow pydoc display
10890 __doc__ of data descriptors.
10891
10892- Fixed socket speed loss caused by use of the _socketobject wrapper class
10893 in socket.py.
10894
10895- timeit.py now checks the current directory for imports.
10896
10897- urllib2.py now knows how to order proxy classes, so the user doesn't
10898 have to insert it in front of other classes, nor do dirty tricks like
10899 inserting a "dummy" HTTPHandler after a ProxyHandler when building an
10900 opener with proxy support.
10901
10902- Iterators have been added for dbm keys.
10903
10904- random.Random objects can now be pickled.
10905
10906Tools/Demos
10907-----------
10908
10909- pydoc now offers help on keywords and topics.
10910
10911- Tools/idle is gone; long live Lib/idlelib.
10912
10913- diff.py prints file diffs in context, unified, or ndiff formats,
10914 providing a command line interface to difflib.py.
10915
10916- texcheck.py is a new script for making a rough validation of Python LaTeX
10917 files.
10918
10919Build
10920-----
10921
10922- Setting DESTDIR during 'make install' now allows specifying a
10923 different root directory.
10924
10925C API
10926-----
10927
10928- PyType_Ready(): If a type declares that it participates in gc
10929 (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
10930 tp_free slot is the default _PyObject_Del, and type does not define
10931 a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
10932 Previously _PyObject_Del was inherited, which could at best lead to a
10933 segfault. In addition, if even after this magic the type's tp_free
10934 slot is _PyObject_Del or NULL, and the type is a base type
10935 (Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
10936 type, its dealloc function must call type->tp_free, and since the type
10937 is gc'able, tp_free must not be NULL or _PyObject_Del.
10938
10939- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
10940 from C) to interrupt a thread by sending it an exception. It is
10941 intentional that you have to write your own C extension to call it
10942 from Python.
10943
10944
10945New platforms
10946-------------
10947
10948None this time.
10949
10950Tests
10951-----
10952
10953- test_imp rewritten so that it doesn't raise RuntimeError if run as a
10954 side effect of being imported ("import test.autotest").
10955
10956Windows
10957-------
10958
10959- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
10960
10961- The installer always suggested that Python be installed on the C:
10962 drive, due to a hardcoded "C:" generated by the Wise installation
10963 wizard. People with machines where C: is not the system drive
10964 usually want Python installed on whichever drive is their system drive
10965 instead. We removed the hardcoded "C:", and two testers on machines
10966 where C: is not the system drive report that the installer now
10967 suggests their system drive. Note that you can always select the
10968 directory you want in the "Select Destination Directory" dialog --
10969 that's what it's for.
10970
10971Mac
10972---
10973
10974- There's a new module called "autoGIL", which offers a mechanism to
10975 automatically release the Global Interpreter Lock when an event loop
10976 goes to sleep, allowing other threads to run. It's currently only
10977 supported on OSX, in the Mach-O version.
10978- The OSA modules now allow direct access to properties of the
10979 toplevel application class (in AppleScript terminology).
10980- The Package Manager can now update itself.
10981
10982SourceForge Bugs and Patches Applied
10983------------------------------------
10984
10985430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
10986598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
10987622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
10988661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
10989683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
10990697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
10991713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
10992724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
10993727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
10994729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
10995730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
10996731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
10997732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
10998733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
10999735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
11000740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
11001744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
11002745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
11003747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
11004749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
11005751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
11006753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
11007755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
11008757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
11009760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
11010
11011
11012What's New in Python 2.3 beta 1?
11013================================
11014
11015*Release date: 25-Apr-2003*
11016
11017Core and builtins
11018-----------------
11019
11020- New format codes B, H, I, k and K have been implemented for
11021 PyArg_ParseTuple and PyBuild_Value.
11022
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011023- New built-in function sum(seq, start=0) returns the sum of all the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011024 items in iterable object seq, plus start (items are normally numbers,
11025 and cannot be strings).
11026
11027- bool() called without arguments now returns False rather than
11028 raising an exception. This is consistent with calling the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011029 constructors for the other built-in types -- called without argument
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011030 they all return the false value of that type. (SF patch #724135)
11031
11032- In support of PEP 269 (making the pgen parser generator accessible
11033 from Python), some changes to the pgen code structure were made; a
11034 few files that used to be linked only with pgen are now linked with
11035 Python itself.
11036
11037- The repr() of a weakref object now shows the __name__ attribute of
11038 the referenced object, if it has one.
11039
11040- super() no longer ignores data descriptors, except __class__. See
11041 the thread started at
11042 http://mail.python.org/pipermail/python-dev/2003-April/034338.html
11043
11044- list.insert(i, x) now interprets negative i as it would be
11045 interpreted by slicing, so negative values count from the end of the
11046 list. This was the only place where such an interpretation was not
11047 placed on a list index.
11048
11049- range() now works even if the arguments are longs with magnitude
11050 larger than sys.maxint, as long as the total length of the sequence
11051 fits. E.g., range(2**100, 2**101, 2**100) is the following list:
11052 [1267650600228229401496703205376L]. (SF patch #707427.)
11053
11054- Some horridly obscure problems were fixed involving interaction
11055 between garbage collection and old-style classes with "ambitious"
11056 getattr hooks. If an old-style instance didn't have a __del__ method,
11057 but did have a __getattr__ hook, and the instance became reachable
11058 only from an unreachable cycle, and the hook resurrected or deleted
11059 unreachable objects when asked to resolve "__del__", anything up to
11060 a segfault could happen. That's been repaired.
11061
11062- dict.pop now takes an optional argument specifying a default
11063 value to return if the key is not in the dict. If a default is not
11064 given and the key is not found, a KeyError will still be raised.
11065 Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
11066 [SF patch #693753] (contributed by Michael Stone.)
11067
11068- sys.getfilesystemencoding() was added to expose
11069 Py_FileSystemDefaultEncoding.
11070
11071- New function sys.exc_clear() clears the current exception. This is
11072 rarely needed, but can sometimes be useful to release objects
11073 referenced by the traceback held in sys.exc_info()[2]. (SF patch
11074 #693195.)
11075
11076- On 64-bit systems, a dictionary could contain duplicate long/int keys
11077 if the key value was larger than 2**32. See SF bug #689659.
11078
11079- Fixed SF bug #663074. The codec system was using global static
11080 variables to store internal data. As a result, any attempts to use the
11081 unicode system with multiple active interpreters, or successive
11082 interpreter executions, would fail.
11083
11084- "%c" % u"a" now returns a unicode string instead of raising a
11085 TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
11086 of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
11087
11088Extension modules
11089-----------------
11090
11091- The socket module now provides the functions inet_pton and inet_ntop
11092 for converting between string and packed representation of IP
11093 addresses. There is also a new module variable, has_ipv6, which is
11094 True iff the current Python has IPv6 support. See SF patch #658327.
11095
11096- Tkinter wrappers around Tcl variables now pass objects directly
11097 to Tcl, instead of first converting them to strings.
11098
11099- The .*? pattern in the re module is now special-cased to avoid the
11100 recursion limit. (SF patch #720991 -- many thanks to Gary Herron
11101 and Greg Chapman.)
11102
11103- New function sys.call_tracing() allows pdb to debug code
11104 recursively.
11105
11106- New function gc.get_referents(obj) returns a list of objects
11107 directly referenced by obj. In effect, it exposes what the object's
11108 tp_traverse slot does, and can be helpful when debugging memory
11109 leaks.
11110
11111- The iconv module has been removed from this release.
11112
11113- The platform-independent routines for packing floats in IEEE formats
11114 (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
11115 pickling of floats) ignored that rounding can cause a carry to
11116 propagate. The worst consequence was that, in rare cases, <f and >f
11117 could produce strings that, when unpacked again, were a factor of 2
11118 away from the original float. This has been fixed. See SF bug
11119 #705836.
11120
11121- New function time.tzset() provides access to the C library tzset()
11122 function, if supported. (SF patch #675422.)
11123
11124- Using createfilehandler, deletefilehandler, createtimerhandler functions
11125 on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
11126 See SF bug #692416.
11127
11128- Modified the fcntl.ioctl() function to allow modification of a passed
11129 mutable buffer (for details see the reference documentation).
11130
11131- Made user requested changes to the itertools module.
11132 Subsumed the times() function into repeat().
11133 Added chain() and cycle().
11134
11135- The rotor module is now deprecated; the encryption algorithm it uses
11136 is not believed to be secure, and including crypto code with Python
11137 has implications for exporting and importing it in various countries.
11138
11139- The socket module now always uses the _socketobject wrapper class, even on
11140 platforms which have dup(2). The makefile() method is built directly
11141 on top of the socket without duplicating the file descriptor, allowing
11142 timeouts to work properly.
11143
11144Library
11145-------
11146
11147- New generator function os.walk() is an easy-to-use alternative to
11148 os.path.walk(). See os module docs for details. os.path.walk()
11149 isn't deprecated at this time, but may become deprecated in a
11150 future release.
11151
11152- Added new module "platform" which provides a wide range of tools
11153 for querying platform dependent features.
11154
11155- netrc now allows ASCII punctuation characters in passwords.
11156
11157- shelve now supports the optional writeback argument, and exposes
11158 pickle protocol versions.
11159
11160- Several methods of nntplib.NNTP have grown an optional file argument
11161 which specifies a file where to divert the command's output
11162 (already supported by the body() method). (SF patch #720468)
11163
11164- The self-documenting XML server library DocXMLRPCServer was added.
11165
11166- Support for internationalized domain names has been added through
11167 the 'idna' and 'punycode' encodings, the 'stringprep' module, the
11168 'mkstringprep' tool, and enhancements to the socket and httplib
11169 modules.
11170
11171- htmlentitydefs has two new dictionaries: name2codepoint maps
11172 HTML entity names to Unicode codepoints (as integers).
11173 codepoint2name is the reverse mapping. See SF patch #722017.
11174
11175- pdb has a new command, "debug", which lets you step through
11176 arbitrary code from the debugger's (pdb) prompt.
11177
11178- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
11179 return 'not a == b' rather than 'a != b'. This gives the desired
11180 result for classes that define __eq__ without defining __ne__.
11181
11182- sgmllib now supports SGML marked sections, in particular the
11183 MS Office extensions.
11184
11185- The urllib module now offers support for the iterator protocol.
11186 SF patch 698520 contributed by Brett Cannon.
11187
11188- New module timeit provides a simple framework for timing the
11189 execution speed of expressions and statements.
11190
11191- sets.Set objects now support mixed-type __eq__ and __ne__, instead
11192 of raising TypeError. If x is a Set object and y is a non-Set object,
11193 x == y is False, and x != y is True. This is akin to the change made
11194 for mixed-type comparisons of datetime objects in 2.3a2; more info
11195 about the rationale is in the NEWS entry for that. See also SF bug
11196 report <http://www.python.org/sf/693121>.
11197
11198- On Unix platforms, if os.listdir() is called with a Unicode argument,
11199 it now returns Unicode strings. (This behavior was added earlier
11200 to the Windows NT/2k/XP version of os.listdir().)
11201
11202- Distutils: both 'py_modules' and 'packages' keywords can now be specified
11203 in core.setup(). Previously you could supply one or the other, but
11204 not both of them. (SF patch #695090 from Bernhard Herzog)
11205
11206- New csv package makes it easy to read/write CSV files.
11207
11208- Module shlex has been extended to allow posix-like shell parsings,
11209 including a split() function for easy spliting of quoted strings and
11210 commands. An iterator interface was also implemented.
11211
11212Tools/Demos
11213-----------
11214
11215- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
11216 See the module docstring for details.
11217
11218Build
11219-----
11220
11221- Fix problem building on OSF1 because the compiler only accepted
11222 preprocessor directives that start in column 1. (SF bug #691793.)
11223
11224C API
11225-----
11226
11227- Added PyGC_Collect(), equivalent to calling gc.collect().
11228
11229- PyThreadState_GetDict() was changed not to raise an exception or
11230 issue a fatal error when no current thread state is available. This
11231 makes it possible to print dictionaries when no thread is active.
11232
11233- LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
11234 need compatibility with previous versions can use this:
11235
11236 #ifndef PY_LONG_LONG
11237 #define PY_LONG_LONG LONG_LONG
11238 #endif
11239
11240- Added PyObject_SelfIter() to fill the tp_iter slot for the
11241 typical case where the method returns its self argument.
11242
11243- The extended type structure used for heap types (new-style
11244 classes defined by Python code using a class statement) is now
11245 exported from object.h as PyHeapTypeObject. (SF patch #696193.)
11246
11247New platforms
11248-------------
11249
11250None this time.
11251
11252Tests
11253-----
11254
11255- test_timeout now requires -u network to be passed to regrtest to run.
11256 See SF bug #692988.
11257
11258Windows
11259-------
11260
11261- os.fsync() now exists on Windows, and calls the Microsoft _commit()
11262 function.
11263
11264- New function winsound.MessageBeep() wraps the Win32 API
11265 MessageBeep().
11266
11267Mac
11268---
11269
11270- os.listdir() now returns Unicode strings on MacOS X when called with
11271 a Unicode argument. See the general news item under "Library".
11272
11273- A new method MacOS.WMAvailable() returns true if it is safe to access
11274 the window manager, false otherwise.
11275
11276- EasyDialogs dialogs are now movable-modal, and if the application is
11277 currently in the background they will ask to be moved to the foreground
11278 before displaying.
11279
11280- OSA Scripting support has improved a lot, and gensuitemodule.py can now
11281 be used by mere mortals. The documentation is now also more or less
11282 complete.
11283
11284- The IDE (in a framework build) now includes introductory documentation
11285 in Apple Help Viewer format.
11286
11287
11288What's New in Python 2.3 alpha 2?
11289=================================
11290
11291*Release date: 19-Feb-2003*
11292
11293Core and builtins
11294-----------------
11295
11296- Negative positions returned from PEP 293 error callbacks are now
11297 treated as being relative to the end of the input string. Positions
11298 that are out of bounds raise an IndexError.
11299
11300- sys.path[0] (the directory from which the script is loaded) is now
11301 turned into an absolute pathname, unless it is the empty string.
11302 (SF patch #664376.)
11303
11304- Finally fixed the bug in compile() and exec where a string ending
11305 with an indented code block but no newline would raise SyntaxError.
11306 This would have been a four-line change in parsetok.c... Except
11307 codeop.py depends on this behavior, so a compilation flag had to be
11308 invented that causes the tokenizer to revert to the old behavior;
11309 this required extra changes to 2 .h files, 2 .c files, and 2 .py
11310 files. (Fixes SF bug #501622.)
11311
11312- If a new-style class defines neither __new__ nor __init__, its
11313 constructor would ignore all arguments. This is changed now: the
11314 constructor refuses arguments in this case. This might break code
11315 that worked under Python 2.2. The simplest fix is to add a no-op
11316 __init__: ``def __init__(self, *args, **kw): pass``.
11317
11318- Through a bytecode optimizer bug (and I bet you didn't even know
11319 Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
11320 with a leading minus sign would come out with the wrong sign.
11321 ("Unsigned" hex/oct constants are those with a face value in the
11322 range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
11323 always been interpreted as negative numbers through sign folding.)
11324 E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
11325 come out as -4294967295. This was the case in Python 2.2 through
11326 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
11327 value, but according to PEP 237 it really needs to be 1 now. This
11328 will be backported to Python 2.2.3 a well. (SF #660455)
11329
11330- int(s, base) sometimes sign-folds hex and oct constants; it only
11331 does this when base is 0 and s.strip() starts with a '0'. When the
11332 sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
11333 machine, which returns -1, a FutureWarning is now issued; in Python
11334 2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
11335 int("0xffffffff", 16) right now. (PEP 347)
11336
11337- super(X, x): x may now be a proxy for an X instance, i.e.
11338 issubclass(x.__class__, X) but not issubclass(type(x), X).
11339
11340- isinstance(x, X): if X is a new-style class, this is now equivalent
11341 to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
11342 only type(x) was tested. (For classic classes this was already the
11343 case.)
11344
11345- compile(), eval() and the exec statement now fully support source code
11346 passed as unicode strings.
11347
11348- int subclasses can be initialized with longs if the value fits in an int.
11349 See SF bug #683467.
11350
11351- long(string, base) takes time linear in len(string) when base is a power
11352 of 2 now. It used to take time quadratic in len(string).
11353
11354- filter returns now Unicode results for Unicode arguments.
11355
11356- raw_input can now return Unicode objects.
11357
11358- List objects' sort() method now accepts None as the comparison function.
11359 Passing None is semantically identical to calling sort() with no
11360 arguments.
11361
11362- Fixed crash when printing a subclass of str and __str__ returned self.
11363 See SF bug #667147.
11364
11365- Fixed an invalid RuntimeWarning and an undetected error when trying
11366 to convert a long integer into a float which couldn't fit.
11367 See SF bug #676155.
11368
11369- Function objects now have a __module__ attribute that is bound to
11370 the name of the module in which the function was defined. This
11371 applies for C functions and methods as well as functions and methods
11372 defined in Python. This attribute is used by pickle.whichmodule(),
11373 which changes the behavior of whichmodule slightly. In Python 2.2
11374 whichmodule() returns "__main__" for functions that are not defined
11375 at the top-level of a module (examples: methods, nested functions).
11376 Now whichmodule() will return the proper module name.
11377
11378Extension modules
11379-----------------
11380
11381- operator.isNumberType() now checks that the object has a nb_int or
11382 nb_float slot, rather than simply checking whether it has a non-NULL
11383 tp_as_number pointer.
11384
11385- The imp module now has ways to acquire and release the "import
11386 lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
11387 reentrant lock, so releasing the lock only truly releases it when
11388 this is the last release_lock() call. You can check with
11389 imp.lock_held(). (SF bug #580952 and patch #683257.)
11390
11391- Change to cPickle to match pickle.py (see below and PEP 307).
11392
11393- Fix some bugs in the parser module. SF bug #678518.
11394
11395- Thanks to Scott David Daniels, a subtle bug in how the zlib
11396 extension implemented flush() was fixed. Scott also rewrote the
11397 zlib test suite using the unittest module. (SF bug #640230 and
11398 patch #678531.)
11399
11400- Added an itertools module containing high speed, memory efficient
11401 looping constructs inspired by tools from Haskell and SML.
11402
11403- The SSL module now handles sockets with a timeout set correctly (SF
11404 patch #675750, fixing SF bug #675552).
11405
11406- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
11407
11408- Fixed broken threadstate swap in readline that could cause fatal
11409 errors when a readline hook was being invoked while a background
11410 thread was active. (SF bugs #660476 and #513033.)
11411
11412- fcntl now exposes the strops.h I_* constants.
11413
11414- Fix a crash on Solaris that occurred when calling close() on
11415 an mmap'ed file which was already closed. (SF patch #665913)
11416
11417- Fixed several serious bugs in the zipimport implementation.
11418
11419- datetime changes:
11420
11421 The date class is now properly subclassable. (SF bug #720908)
11422
11423 The datetime and datetimetz classes have been collapsed into a single
11424 datetime class, and likewise the time and timetz classes into a single
11425 time class. Previously, a datetimetz object with tzinfo=None acted
11426 exactly like a datetime object, and similarly for timetz. This wasn't
11427 enough of a difference to justify distinct classes, and life is simpler
11428 now.
11429
11430 today() and now() now round system timestamps to the closest
11431 microsecond <http://www.python.org/sf/661086>. This repairs an
11432 irritation most likely seen on Windows systems.
11433
11434 In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
11435 ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
11436 as 0 instead, but a tzinfo subclass wishing to participate in
11437 time zone conversion has to take a stand on whether it supports
11438 DST; if you don't care about DST, then code dst() to return 0 minutes,
11439 meaning that DST is never in effect).
11440
11441 The tzinfo methods utcoffset() and dst() must return a timedelta object
11442 (or None) now. In 2.3a1 they could also return an int or long, but that
11443 was an unhelpfully redundant leftover from an earlier version wherein
11444 they couldn't return a timedelta. TOOWTDI.
11445
11446 The example tzinfo class for local time had a bug. It was replaced
11447 by a later example coded by Guido.
11448
11449 datetime.astimezone(tz) no longer raises an exception when the
11450 input datetime has no UTC equivalent in tz. For typical "hybrid" time
11451 zones (a single tzinfo subclass modeling both standard and daylight
11452 time), this case can arise one hour per year, at the hour daylight time
11453 ends. See new docs for details. In short, the new behavior mimics
11454 the local wall clock's behavior of repeating an hour in local time.
11455
11456 dt.astimezone() can no longer be used to convert between naive and aware
11457 datetime objects. If you merely want to attach, or remove, a tzinfo
11458 object, without any conversion of date and time members, use
11459 dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
11460 tzinfo subclass instance.
11461
11462 A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
11463 to give complete control over how a UTC time is to be converted to
11464 a local time. The default astimezone() implementation calls fromutc()
11465 as its last step, so a tzinfo subclass can affect that too by overriding
11466 fromutc(). It's expected that the default fromutc() implementation will
11467 be suitable as-is for "almost all" time zone subclasses, but the
11468 creativity of political time zone fiddling appears unbounded -- fromutc()
11469 allows the highly motivated to emulate any scheme expressible in Python.
11470
11471 datetime.now(): The optional tzinfo argument was undocumented (that's
11472 repaired), and its name was changed to tz ("tzinfo" is overloaded enough
11473 already). With a tz argument, now(tz) used to return the local date
11474 and time, and attach tz to it, without any conversion of date and time
11475 members. This was less than useful. Now now(tz) returns the current
11476 date and time as local time in tz's time zone, akin to ::
11477
11478 tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
11479
11480 where "utc" is an instance of a tzinfo subclass modeling UTC. Without
11481 a tz argument, now() continues to return the current local date and time,
11482 as a naive datetime object.
11483
11484 datetime.fromtimestamp(): Like datetime.now() above, this had less than
11485 useful behavior when the optional tinzo argument was specified. See
11486 also SF bug report <http://www.python.org/sf/660872>.
11487
11488 date and datetime comparison: In order to prevent comparison from
11489 falling back to the default compare-object-addresses strategy, these
11490 raised TypeError whenever they didn't understand the other object type.
11491 They still do, except when the other object has a "timetuple" attribute,
11492 in which case they return NotImplemented now. This gives other
11493 datetime objects (e.g., mxDateTime) a chance to intercept the
11494 comparison.
11495
11496 date, time, datetime and timedelta comparison: When the exception
11497 for mixed-type comparisons in the last paragraph doesn't apply, if
11498 the comparison is == then False is returned, and if the comparison is
11499 != then True is returned. Because dict lookup and the "in" operator
11500 only invoke __eq__, this allows, for example, ::
11501
11502 if some_datetime in some_sequence:
11503
11504 and ::
11505
11506 some_dict[some_timedelta] = whatever
11507
11508 to work as expected, without raising TypeError just because the
11509 sequence is heterogeneous, or the dict has mixed-type keys. [This
11510 seems like a good idea to implement for all mixed-type comparisons
11511 that don't want to allow falling back to address comparison.]
11512
11513 The constructors building a datetime from a timestamp could raise
11514 ValueError if the platform C localtime()/gmtime() inserted "leap
11515 seconds". Leap seconds are ignored now. On such platforms, it's
11516 possible to have timestamps that differ by a second, yet where
11517 datetimes constructed from them are equal.
11518
11519 The pickle format of date, time and datetime objects has changed
11520 completely. The undocumented pickler and unpickler functions no
11521 longer exist. The undocumented __setstate__() and __getstate__()
11522 methods no longer exist either.
11523
11524Library
11525-------
11526
11527- The logging module was updated slightly; the WARN level was renamed
11528 to WARNING, and the matching function/method warn() to warning().
11529
11530- The pickle and cPickle modules were updated with a new pickling
11531 protocol (documented by pickletools.py, see below) and several
11532 extensions to the pickle customization API (__reduce__, __setstate__
11533 etc.). The copy module now uses more of the pickle customization
11534 API to copy objects that don't implement __copy__ or __deepcopy__.
11535 See PEP 307 for details.
11536
11537- The distutils "register" command now uses http://www.python.org/pypi
11538 as the default repository. (See PEP 301.)
11539
Skip Montanaro7a98be22007-08-16 14:35:24 +000011540- the platform dependent path related variables sep, altsep,
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011541 pathsep, curdir, pardir and defpath are now defined in the platform
11542 dependent path modules (e.g. ntpath.py) rather than os.py, so these
11543 variables are now available via os.path. They continue to be
11544 available from the os module.
11545 (see <http://www.python.org/sf/680789>).
11546
11547- array.array was added to the types repr.py knows about (see
11548 <http://www.python.org/sf/680789>).
11549
11550- The new pickletools.py contains lots of documentation about pickle
11551 internals, and supplies some helpers for working with pickles, such as
11552 a symbolic pickle disassembler.
11553
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011554- xmlrpclib.py now supports the built-in boolean type.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011555
11556- py_compile has a new 'doraise' flag and a new PyCompileError
11557 exception.
11558
11559- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
11560 class.
11561
11562- The sets module now raises TypeError in __cmp__, to clarify that
11563 sets are not intended to be three-way-compared; the comparison
11564 operators are overloaded as subset/superset tests.
11565
11566- Bastion.py and rexec.py are disabled. These modules are not safe in
11567 Python 2.2. or 2.3.
11568
11569- realpath is now exported when doing ``from poxixpath import *``.
11570 It is also exported for ntpath, macpath, and os2emxpath.
11571 See SF bug #659228.
11572
11573- New module tarfile from Lars Gustäbel provides a comprehensive interface
11574 to tar archive files with transparent gzip and bzip2 compression.
11575 See SF patch #651082.
11576
11577- urlparse can now parse imap:// URLs. See SF feature request #618024.
11578
11579- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
11580 the gain value which is passed to Tk. SF bug# 602259.
11581
11582- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
11583 See SF patch #642974.
11584
11585- The dospath module was deleted. Use the ntpath module when manipulating
11586 DOS paths from other platforms.
11587
11588Tools/Demos
11589-----------
11590
11591- Two new scripts (db2pickle.py and pickle2db.py) were added to the
11592 Tools/scripts directory to facilitate conversion from the old bsddb module
11593 to the new one. While the user-visible API of the new module is
11594 compatible with the old one, it's likely that the version of the
11595 underlying database library has changed. To convert from the old library,
11596 run the db2pickle.py script using the old version of Python to convert it
11597 to a pickle file. After upgrading Python, run the pickle2db.py script
11598 using the new version of Python to reconstitute your database. For
11599 example:
11600
11601 % python2.2 db2pickle.py -h some.db > some.pickle
11602 % python2.3 pickle2db.py -h some.db.new < some.pickle
11603
11604 Run the scripts without any args to get a usage message.
11605
11606
11607Build
11608-----
11609
11610- The audio driver tests (test_ossaudiodev.py and
11611 test_linuxaudiodev.py) are no longer run by default. This is
11612 because they don't always work, depending on your hardware and
11613 software. To run these tests, you must use an invocation like ::
11614
11615 ./python Lib/test/regrtest.py -u audio test_ossaudiodev
11616
11617- On systems which build using the configure script, compiler flags which
11618 used to be lumped together using the OPT flag have been split into two
11619 groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
11620 debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
11621 compiler flags that are required to get a clean compile. On some
11622 platforms (many Linux flavors in particular) BASECFLAGS will be empty by
11623 default. On others, such as Mac OS X and SCO, it will contain required
11624 flags. This change allows people building Python to override OPT without
11625 fear of clobbering compiler flags which are required to get a clean build.
11626
11627- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
11628 relevant search lists in setup.py. This allows users building Python to
11629 take advantage of the many packages available from the fink project
11630 <http://fink.sf.net/>.
11631
11632- A new Makefile target, scriptsinstall, installs a number of useful scripts
11633 from the Tools/scripts directory.
11634
11635C API
11636-----
11637
11638- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
11639 instead of a plain ``PyObject *``. (SF patch #686601.)
11640
11641- PyNumber_Check() now checks that the object has a nb_int or nb_float
11642 slot, rather than simply checking whether it has a non-NULL
11643 tp_as_number pointer.
11644
11645- A C type that inherits from a base type that defines tp_as_buffer
11646 will now inherit the tp_as_buffer pointer if it doesn't define one.
11647 (SF #681367)
11648
11649- The PyArg_Parse functions now issue a DeprecationWarning if a float
11650 argument is provided when an integer is specified (this affects the 'b',
11651 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
11652 raise a TypeError.
11653
11654Tests
11655-----
11656
11657- Several tests weren't being run from regrtest.py (test_timeout.py,
11658 test_tarfile.py, test_netrc.py, test_multifile.py,
11659 test_importhooks.py and test_imp.py). Now they are. (Note to
11660 developers: please read Lib/test/README when creating a new test, to
11661 make sure to do it right! All tests need to use either unittest or
11662 pydoc.)
11663
11664- Added test_posix.py, a test suite for the posix module.
11665
11666- Added test_hexoct.py, a test suite for hex/oct constant folding.
11667
11668Windows
11669-------
11670
11671- The timeout code for socket connect() didn't work right; this has
11672 now been fixed. test_timeout.py should pass (at least most of the
11673 time).
11674
11675- distutils' msvccompiler class now passes the preprocessor options to
11676 the resource compiler. See SF patch #669198.
11677
11678- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
11679 release without strong cryptography.
11680
11681- sys.path[0], if it contains a directory name, is now always an
11682 absolute pathname. (SF patch #664376.)
11683
11684- The new logging package is now installed by the Windows installer. It
11685 wasn't in 2.3a1 due to oversight.
11686
11687Mac
11688---
11689
11690- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
11691 and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
11692
11693- Most of the standard library now uses pathnames or FSRefs in preference
11694 of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
11695 in stead of macfs. macfs will probably be deprecated in the future.
11696
11697- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
11698 This also makes macfs.FSSpec.SetDates() work again.
11699
11700- There is a new module pimp, the package install manager for Python, and
11701 accompanying applet PackageManager. These allow you to easily download
11702 and install pretested extension packages either in source or binary
11703 form. Only in MacPython-OSX.
11704
11705- Applets are now built with bundlebuilder in MacPython-OSX, which should make
11706 them more robust and also provides a path towards BuildApplication. The
11707 downside of this change is that applets can no longer be run from the
11708 Terminal window, this will hopefully be fixed in the 2.3b1.
11709
11710
11711What's New in Python 2.3 alpha 1?
11712=================================
11713
11714*Release date: 31-Dec-2002*
11715
11716Type/class unification and new-style classes
11717--------------------------------------------
11718
11719- One can now assign to __bases__ and __name__ of new-style classes.
11720
11721- dict() now accepts keyword arguments so that dict(one=1, two=2)
11722 is the equivalent of {"one": 1, "two": 2}. Accordingly,
11723 the existing (but undocumented) 'items' keyword argument has
11724 been eliminated. This means that dict(items=someMapping) now has
11725 a different meaning than before.
11726
11727- int() now returns a long object if the argument is outside the
11728 integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
11729 all return long objects instead of raising an OverflowError.
11730
11731- Assignment to __class__ is disallowed if either the old or the new
11732 class is a statically allocated type object (such as defined by an
11733 extension module). This prevents anomalies like 2.__class__ = bool.
11734
11735- New-style object creation and deallocation have been sped up
11736 significantly; they are now faster than classic instance creation
11737 and deallocation.
11738
11739- The __slots__ variable can now mention "private" names, and the
11740 right thing will happen (e.g. __slots__ = ["__foo"]).
11741
11742- The built-ins slice() and buffer() are now callable types. The
11743 types classobj (formerly class), code, function, instance, and
11744 instancemethod (formerly instance-method), which have no built-in
11745 names but are accessible through the types module, are now also
11746 callable. The type dict-proxy is renamed to dictproxy.
11747
11748- Cycles going through the __class__ link of a new-style instance are
11749 now detected by the garbage collector.
11750
11751- Classes using __slots__ are now properly garbage collected.
11752 [SF bug 519621]
11753
11754- Tightened the __slots__ rules: a slot name must be a valid Python
11755 identifier.
11756
11757- The constructor for the module type now requires a name argument and
11758 takes an optional docstring argument. Previously, this constructor
11759 ignored its arguments. As a consequence, deriving a class from a
11760 module (not from the module type) is now illegal; previously this
11761 created an unnamed module, just like invoking the module type did.
11762 [SF bug 563060]
11763
11764- A new type object, 'basestring', is added. This is a common base type
11765 for 'str' and 'unicode', and can be used instead of
11766 types.StringTypes, e.g. to test whether something is "a string":
11767 isinstance(x, basestring) is True for Unicode and 8-bit strings. This
11768 is an abstract base class and cannot be instantiated directly.
11769
11770- Changed new-style class instantiation so that when C's __new__
11771 method returns something that's not a C instance, its __init__ is
11772 not called. [SF bug #537450]
11773
11774- Fixed super() to work correctly with class methods. [SF bug #535444]
11775
11776- If you try to pickle an instance of a class that has __slots__ but
11777 doesn't define or override __getstate__, a TypeError is now raised.
11778 This is done by adding a bozo __getstate__ to the class that always
11779 raises TypeError. (Before, this would appear to be pickled, but the
11780 state of the slots would be lost.)
11781
11782Core and builtins
11783-----------------
11784
11785- Import from zipfiles is now supported. The name of a zipfile placed
11786 on sys.path causes the import statement to look for importable Python
11787 modules (with .py, pyc and .pyo extensions) and packages inside the
11788 zipfile. The zipfile import follows the specification (though not
11789 the sample implementation) of PEP 273. The semantics of __path__ are
11790 compatible with those that have been implemented in Jython since
11791 Jython 2.1.
11792
11793- PEP 302 has been accepted. Although it was initially developed to
11794 support zipimport, it offers a new, general import hook mechanism.
11795 Several new variables have been added to the sys module:
11796 sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
11797 make extending the import statement much more convenient than
11798 overriding the __import__ built-in function. For a description of
11799 these, see PEP 302.
11800
11801- A frame object's f_lineno attribute can now be written to from a
11802 trace function to change which line will execute next. A command to
11803 exploit this from pdb has been added. [SF patch #643835]
11804
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011805- The _codecs support module for codecs.py was turned into a built-in
11806 module to assure that at least the built-in codecs are available
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011807 to the Python parser for source code decoding according to PEP 263.
11808
11809- issubclass now supports a tuple as the second argument, just like
11810 isinstance does. ``issubclass(X, (A, B))`` is equivalent to
11811 ``issubclass(X, A) or issubclass(X, B)``.
11812
11813- Thanks to Armin Rigo, the last known way to provoke a system crash
11814 by cleverly arranging for a comparison function to mutate a list
11815 during a list.sort() operation has been fixed. The effect of
11816 attempting to mutate a list, or even to inspect its contents or
11817 length, while a sort is in progress, is not defined by the language.
11818 The C implementation of Python 2.3 attempts to detect mutations,
11819 and raise ValueError if one occurs, but there's no guarantee that
11820 all mutations will be caught, or that any will be caught across
11821 releases or implementations.
11822
11823- Unicode file name processing for Windows (PEP 277) is implemented.
11824 All platforms now have an os.path.supports_unicode_filenames attribute,
11825 which is set to True on Windows NT/2000/XP, and False elsewhere.
11826
11827- Codec error handling callbacks (PEP 293) are implemented.
11828 Error handling in unicode.encode or str.decode can now be customized.
11829
11830- A subtle change to the semantics of the built-in function intern():
11831 interned strings are no longer immortal. You must keep a reference
11832 to the return value intern() around to get the benefit.
11833
11834- Use of 'None' as a variable, argument or attribute name now
11835 issues a SyntaxWarning. In the future, None may become a keyword.
11836
11837- SET_LINENO is gone. co_lnotab is now consulted to determine when to
11838 call the trace function. C code that accessed f_lineno should call
11839 PyCode_Addr2Line instead (f_lineno is still there, but only kept up
11840 to date when there is a trace function set).
11841
11842- There's a new warning category, FutureWarning. This is used to warn
11843 about a number of situations where the value or sign of an integer
11844 result will change in Python 2.4 as a result of PEP 237 (integer
11845 unification). The warnings implement stage B0 mentioned in that
11846 PEP. The warnings are about the following situations:
11847
11848 - Octal and hex literals without 'L' prefix in the inclusive range
11849 [0x80000000..0xffffffff]; these are currently negative ints, but
11850 in Python 2.4 they will be positive longs with the same bit
11851 pattern.
11852
11853 - Left shifts on integer values that cause the outcome to lose
11854 bits or have a different sign than the left operand. To be
11855 precise: x<<n where this currently doesn't yield the same value
11856 as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
11857
11858 - Conversions from ints to string that show negative values as
11859 unsigned ints in the inclusive range [0x80000000..0xffffffff];
11860 this affects the functions hex() and oct(), and the string
11861 formatting codes %u, %o, %x, and %X. In Python 2.4, these will
11862 show signed values (e.g. hex(-1) currently returns "0xffffffff";
11863 in Python 2.4 it will return "-0x1").
11864
11865- The bits manipulated under the cover by sys.setcheckinterval() have
11866 been changed. Both the check interval and the ticker used to be
11867 per-thread values. They are now just a pair of global variables.
11868 In addition, the default check interval was boosted from 10 to 100
11869 bytecode instructions. This may have some effect on systems that
11870 relied on the old default value. In particular, in multi-threaded
11871 applications which try to be highly responsive, response time will
11872 increase by some (perhaps imperceptible) amount.
11873
11874- When multiplying very large integers, a version of the so-called
11875 Karatsuba algorithm is now used. This is most effective if the
11876 inputs have roughly the same size. If they both have about N digits,
11877 Karatsuba multiplication has O(N**1.58) runtime (the exponent is
11878 log_base_2(3)) instead of the previous O(N**2). Measured results may
11879 be better or worse than that, depending on platform quirks. Besides
11880 the O() improvement in raw instruction count, the Karatsuba algorithm
11881 appears to have much better cache behavior on extremely large integers
11882 (starting in the ballpark of a million bits). Note that this is a
11883 simple implementation, and there's no intent here to compete with,
11884 e.g., GMP. It gives a very nice speedup when it applies, but a package
11885 devoted to fast large-integer arithmetic should run circles around it.
11886
11887- u'%c' will now raise a ValueError in case the argument is an
11888 integer outside the valid range of Unicode code point ordinals.
11889
11890- The tempfile module has been overhauled for enhanced security. The
11891 mktemp() function is now deprecated; new, safe replacements are
11892 mkstemp() (for files) and mkdtemp() (for directories), and the
11893 higher-level functions NamedTemporaryFile() and TemporaryFile().
11894 Use of some global variables in this module is also deprecated; the
11895 new functions have keyword arguments to provide the same
11896 functionality. All Lib, Tools and Demo modules that used the unsafe
11897 interfaces have been updated to use the safe replacements. Thanks
11898 to Zack Weinberg!
11899
11900- When x is an object whose class implements __mul__ and __rmul__,
11901 1.0*x would correctly invoke __rmul__, but 1*x would erroneously
11902 invoke __mul__. This was due to the sequence-repeat code in the int
11903 type. This has been fixed now.
11904
11905- Previously, "str1 in str2" required str1 to be a string of length 1.
11906 This restriction has been relaxed to allow str1 to be a string of
11907 any length. Thus "'el' in 'hello world'" returns True now.
11908
11909- File objects are now their own iterators. For a file f, iter(f) now
11910 returns f (unless f is closed), and f.next() is similar to
11911 f.readline() when EOF is not reached; however, f.next() uses a
11912 readahead buffer that messes up the file position, so mixing
11913 f.next() and f.readline() (or other methods) doesn't work right.
11914 Calling f.seek() drops the readahead buffer, but other operations
11915 don't. It so happens that this gives a nice additional speed boost
11916 to "for line in file:"; the xreadlines method and corresponding
11917 module are now obsolete. Thanks to Oren Tirosh!
11918
11919- Encoding declarations (PEP 263, phase 1) have been implemented. A
11920 comment of the form "# -*- coding: <encodingname> -*-" in the first
11921 or second line of a Python source file indicates the encoding.
11922
11923- list.sort() has a new implementation. While cross-platform results
11924 may vary, and in data-dependent ways, this is much faster on many
11925 kinds of partially ordered lists than the previous implementation,
11926 and reported to be just as fast on randomly ordered lists on
11927 several major platforms. This sort is also stable (if A==B and A
11928 precedes B in the list at the start, A precedes B after the sort too),
11929 although the language definition does not guarantee stability. A
11930 potential drawback is that list.sort() may require temp space of
11931 len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
11932 for list.sort() to raise MemoryError now, even if a comparison function
11933 does not. See <http://www.python.org/sf/587076> for full details.
11934
11935- All standard iterators now ensure that, once StopIteration has been
11936 raised, all future calls to next() on the same iterator will also
11937 raise StopIteration. There used to be various counterexamples to
11938 this behavior, which could caused confusion or subtle program
11939 breakage, without any benefits. (Note that this is still an
11940 iterator's responsibility; the iterator framework does not enforce
11941 this.)
11942
11943- Ctrl+C handling on Windows has been made more consistent with
11944 other platforms. KeyboardInterrupt can now reliably be caught,
11945 and Ctrl+C at an interactive prompt no longer terminates the
11946 process under NT/2k/XP (it never did under Win9x). Ctrl+C will
11947 interrupt time.sleep() in the main thread, and any child processes
11948 created via the popen family (on win2k; we can't make win9x work
11949 reliably) are also interrupted (as generally happens on for Linux/Unix.)
11950 [SF bugs 231273, 439992 and 581232]
11951
11952- sys.getwindowsversion() has been added on Windows. This
11953 returns a tuple with information about the version of Windows
11954 currently running.
11955
11956- Slices and repetitions of buffer objects now consistently return
11957 a string. Formerly, strings would be returned most of the time,
11958 but a buffer object would be returned when the repetition count
11959 was one or when the slice range was all inclusive.
11960
11961- Unicode objects in sys.path are no longer ignored but treated
11962 as directory names.
11963
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011964- Fixed string.startswith and string.endswith built-in methods
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011965 so they accept negative indices. [SF bug 493951]
11966
11967- Fixed a bug with a continue inside a try block and a yield in the
11968 finally clause. [SF bug 567538]
11969
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011970- Most built-in sequences now support "extended slices", i.e. slices
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011971 with a third "stride" parameter. For example, "hello world"[::-1]
11972 gives "dlrow olleh".
11973
11974- A new warning PendingDeprecationWarning was added to provide
11975 direction on features which are in the process of being deprecated.
11976 The warning will not be printed by default. To see the pending
11977 deprecations, use -Walways::PendingDeprecationWarning::
11978 as a command line option or warnings.filterwarnings() in code.
11979
11980- Deprecated features of xrange objects have been removed as
11981 promised. The start, stop, and step attributes and the tolist()
11982 method no longer exist. xrange repetition and slicing have been
11983 removed.
11984
Georg Brandl93dc9eb2010-03-14 10:56:14 +000011985- New built-in function enumerate(x), from PEP 279. Example:
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011986 enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
11987 The argument can be an arbitrary iterable object.
11988
11989- The assert statement no longer tests __debug__ at runtime. This means
11990 that assert statements cannot be disabled by assigning a false value
11991 to __debug__.
11992
11993- A method zfill() was added to str and unicode, that fills a numeric
11994 string to the left with zeros. For example,
11995 "+123".zfill(6) -> "+00123".
11996
11997- Complex numbers supported divmod() and the // and % operators, but
11998 these make no sense. Since this was documented, they're being
11999 deprecated now.
12000
12001- String and unicode methods lstrip(), rstrip() and strip() now take
12002 an optional argument that specifies the characters to strip. For
12003 example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
12004
12005- There's a new dictionary constructor (a class method of the dict
12006 class), dict.fromkeys(iterable, value=None). It constructs a
12007 dictionary with keys taken from the iterable and all values set to a
12008 single value. It can be used for building sets and for removing
12009 duplicates from sequences.
12010
12011- Added a new dict method pop(key). This removes and returns the
12012 value corresponding to key. [SF patch #539949]
12013
12014- A new built-in type, bool, has been added, as well as built-in
12015 names for its two values, True and False. Comparisons and sundry
12016 other operations that return a truth value have been changed to
12017 return a bool instead. Read PEP 285 for an explanation of why this
12018 is backward compatible.
12019
12020- Fixed two bugs reported as SF #535905: under certain conditions,
12021 deallocating a deeply nested structure could cause a segfault in the
12022 garbage collector, due to interaction with the "trashcan" code;
12023 access to the current frame during destruction of a local variable
12024 could access a pointer to freed memory.
12025
12026- The optional object allocator ("pymalloc") has been enabled by
12027 default. The recommended practice for memory allocation and
12028 deallocation has been streamlined. A header file is included,
12029 Misc/pymemcompat.h, which can be bundled with 3rd party extensions
12030 and lets them use the same API with Python versions from 1.5.2
12031 onwards.
12032
12033- PyErr_Display will provide file and line information for all exceptions
12034 that have an attribute print_file_and_line, not just SyntaxErrors.
12035
12036- The UTF-8 codec will now encode and decode Unicode surrogates
12037 correctly and without raising exceptions for unpaired ones.
12038
12039- Universal newlines (PEP 278) is implemented. Briefly, using 'U'
12040 instead of 'r' when opening a text file for reading changes the line
12041 ending convention so that any of '\r', '\r\n', and '\n' is
12042 recognized (even mixed in one file); all three are converted to
12043 '\n', the standard Python line end character.
12044
12045- file.xreadlines() now raises a ValueError if the file is closed:
12046 Previously, an xreadlines object was returned which would raise
12047 a ValueError when the xreadlines.next() method was called.
12048
12049- sys.exit() inadvertently allowed more than one argument.
12050 An exception will now be raised if more than one argument is used.
12051
12052- Changed evaluation order of dictionary literals to conform to the
12053 general left to right evaluation order rule. Now {f1(): f2()} will
12054 evaluate f1 first.
12055
12056- Fixed bug #521782: when a file was in non-blocking mode, file.read()
12057 could silently lose data or wrongly throw an unknown error.
12058
12059- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
12060 slots are now always tried after trying the corresponding nb_* slots.
12061 This fixes a number of minor bugs (see bug #624807).
12062
12063- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
12064
12065Extension modules
12066-----------------
12067
12068- Added three operators to the operator module:
12069 operator.pow(a,b) which is equivalent to: a**b.
12070 operator.is_(a,b) which is equivalent to: a is b.
12071 operator.is_not(a,b) which is equivalent to: a is not b.
12072
12073- posix.openpty now works on all systems that have /dev/ptmx.
12074
12075- A module zipimport exists to support importing code from zip
12076 archives.
12077
12078- The new datetime module supplies classes for manipulating dates and
12079 times. The basic design came from the Zope "fishbowl process", and
12080 favors practical commercial applications over calendar esoterica. See
12081
12082 http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
12083
12084- _tkinter now returns Tcl objects, instead of strings. Objects which
12085 have Python equivalents are converted to Python objects, other objects
12086 are wrapped. This can be configured through the wantobjects method,
12087 or Tkinter.wantobjects.
12088
12089- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
12090 been added as the package bsddb. The traditional bsddb module is
12091 still available in source code, but not built automatically anymore,
12092 and is now named bsddb185. This supports Berkeley DB versions from
12093 3.0 to 4.1. For help converting your databases from the old module (which
12094 probably used an obsolete version of Berkeley DB) to the new module, see
12095 the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
12096 section above.
12097
12098- unicodedata was updated to Unicode 3.2. It supports normalization
12099 and names for Hangul syllables and CJK unified ideographs.
12100
12101- resource.getrlimit() now returns longs instead of ints.
12102
12103- readline now dynamically adjusts its input/output stream if
12104 sys.stdin/stdout changes.
12105
12106- The _tkinter module (and hence Tkinter) has dropped support for
12107 Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
12108 supported.
12109
12110- cPickle.BadPickleGet is now a class.
12111
12112- The time stamps in os.stat_result are floating point numbers
12113 after stat_float_times has been called.
12114
12115- If the size passed to mmap.mmap() is larger than the length of the
12116 file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
12117
12118- The xreadlines module is slated for obsolescence.
12119
12120- The strptime function in the time module is now always available (a
12121 Python implementation is used when the C library doesn't define it).
12122
12123- The 'new' module is no longer an extension, but a Python module that
12124 only exists for backwards compatibility. Its contents are no longer
12125 functions but callable type objects.
12126
12127- The bsddb.*open functions can now take 'None' as a filename.
12128 This will create a temporary in-memory bsddb that won't be
12129 written to disk.
12130
12131- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
12132 posix.getpgid have been added where available.
12133
12134- The locale module now exposes the C library's gettext interface. It
12135 also has a new function getpreferredencoding.
12136
12137- A security hole ("double free") was found in zlib-1.1.3, a popular
12138 third party compression library used by some Python modules. The
12139 hole was quickly plugged in zlib-1.1.4, and the Windows build of
12140 Python now ships with zlib-1.1.4.
12141
12142- pwd, grp, and resource return enhanced tuples now, with symbolic
12143 field names.
12144
12145- array.array is now a type object. A new format character
12146 'u' indicates Py_UNICODE arrays. For those, .tounicode and
12147 .fromunicode methods are available. Arrays now support __iadd__
12148 and __imul__.
12149
12150- dl now builds on every system that has dlfcn.h. Failure in case
12151 of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
12152 is called.
12153
12154- The sys module acquired a new attribute, api_version, which evaluates
12155 to the value of the PYTHON_API_VERSION macro with which the
12156 interpreter was compiled.
12157
12158- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
12159 when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
12160 returns (None, None, 'ab'), as expected. Also fixed handling of
12161 lastindex/lastgroup match attributes in similar cases. For example,
12162 when running the expression r'(a)(b)?b' over 'ab', lastindex must be
12163 1, not 2.
12164
12165- Fixed bug #581080: sre scanner was not checking the buffer limit
12166 before increasing the current pointer. This was creating an infinite
12167 loop in the search function, once the pointer exceeded the buffer
12168 limit.
12169
12170- The os.fdopen function now enforces a file mode starting with the
12171 letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
12172 bug #623464.
12173
12174- The linuxaudiodev module is now deprecated; it is being replaced by
12175 ossaudiodev. The interface has been extended to cover a lot more of
12176 OSS (see www.opensound.com), including most DSP ioctls and the
12177 OSS mixer API. Documentation forthcoming in 2.3a2.
12178
12179Library
12180-------
12181
12182- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
12183
12184- Freeze's modulefinder.py has been moved to the standard library;
12185 slightly improved so it will issue less false missing submodule
12186 reports (see sf path #643711 for details). Documentation will follow
12187 with Python 2.3a2.
12188
12189- os.path exposes getctime.
12190
12191- unittest.py now has two additional methods called assertAlmostEqual()
12192 and failIfAlmostEqual(). They implement an approximate comparison
12193 by rounding the difference between the two arguments and comparing
12194 the result to zero. Approximate comparison is essential for
12195 unit tests of floating point results.
12196
12197- calendar.py now depends on the new datetime module rather than
12198 the time module. As a result, the range of allowable dates
12199 has been increased.
12200
12201- pdb has a new 'j(ump)' command to select the next line to be
12202 executed.
12203
12204- The distutils created windows installers now can run a
12205 postinstallation script.
12206
12207- doctest.testmod can now be called without argument, which means to
12208 test the current module.
12209
12210- When canceling a server that implemented threading with a keyboard
12211 interrupt, the server would shut down but not terminate (waiting on
12212 client threads). A new member variable, daemon_threads, was added to
12213 the ThreadingMixIn class in SocketServer.py to make it explicit that
12214 this behavior needs to be controlled.
12215
12216- A new module, optparse, provides a fancy alternative to getopt for
12217 command line parsing. It is a slightly modified version of Greg
12218 Ward's Optik package.
12219
12220- UserDict.py now defines a DictMixin class which defines all dictionary
12221 methods for classes that already have a minimum mapping interface.
12222 This greatly simplifies writing classes that need to be substitutable
12223 for dictionaries (such as the shelve module).
12224
12225- shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
12226 all dictionary methods. This eases the transition to persistent
12227 storage for scripts originally written with dictionaries in mind.
12228
12229- shelve.open and the various classes in shelve.py now accept an optional
12230 binary flag, which defaults to False. If True, the values stored in the
12231 shelf are binary pickles.
12232
12233- A new package, logging, implements the logging API defined by PEP
12234 282. The code is written by Vinay Sajip.
12235
12236- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
12237 modules are iterators now.
12238
12239- gzip.py now handles files exceeding 2GB. Files over 4GB also work
12240 now (provided the OS supports it, and Python is configured with large
12241 file support), but in that case the underlying gzip file format can
12242 record only the least-significant 32 bits of the file size, so that
12243 some tools working with gzipped files may report an incorrect file
12244 size.
12245
12246- xml.sax.saxutils.unescape has been added, to replace entity references
12247 with their entity value.
12248
12249- Queue.Queue.{put,get} now support an optional timeout argument.
12250
12251- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
12252 option of tkFileDialog is exposed as function askopenfile{,name}s.
12253
12254- Various configure methods of Tkinter have been stream-lined, so that
12255 tag_configure, image_configure, window_configure now return a
12256 dictionary when invoked with no argument.
12257
12258- Importing the readline module now no longer has the side effect of
12259 calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
12260 whatever locale is explicitly set by the user, is preserved. If you
12261 want repr() of 8-bit strings in your preferred encoding to preserve
12262 all printable characters of that encoding, you have to add the
12263 following code to your $PYTHONSTARTUP file or to your application's
12264 main():
12265
12266 import locale
12267 locale.setlocale(locale.LC_CTYPE, "")
12268
12269- shutil.move was added. shutil.copytree now reports errors as an
12270 exception at the end, instead of printing error messages.
12271
12272- Encoding name normalization was generalized to not only
12273 replace hyphens with underscores, but also all other non-alphanumeric
12274 characters (with the exception of the dot which is used for Python
12275 package names during lookup). The aliases.py mapping was updated
12276 to the new standard.
12277
12278- mimetypes has two new functions: guess_all_extensions() which
12279 returns a list of all known extensions for a mime type, and
12280 add_type() which adds one mapping between a mime type and
12281 an extension to the database.
12282
12283- New module: sets, defines the class Set that implements a mutable
12284 set type using the keys of a dict to represent the set. There's
12285 also a class ImmutableSet which is useful when you need sets of sets
12286 or when you need to use sets as dict keys, and a class BaseSet which
12287 is the base class of the two.
12288
12289- Added random.sample(population,k) for random sampling without replacement.
12290 Returns a k length list of unique elements chosen from the population.
12291
12292- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
12293 OverflowError. That is, it now accepts any combination of 'start'
12294 and 'stop' arguments so long as each is in the range of Python's
12295 bounded integers.
12296
12297- Thanks to Raymond Hettinger, random.random() now uses a new core
12298 generator. The Mersenne Twister algorithm is implemented in C,
12299 threadsafe, faster than the previous generator, has an astronomically
12300 large period (2**19937-1), creates random floats to full 53-bit
12301 precision, and may be the most widely tested random number generator
12302 in existence.
12303
12304 The random.jumpahead(n) method has different semantics for the new
12305 generator. Instead of jumping n steps ahead, it uses n and the
12306 existing state to create a new state. This means that jumpahead()
12307 continues to support multi-threaded code needing generators of
12308 non-overlapping sequences. However, it will break code which relies
12309 on jumpahead moving a specific number of steps forward.
12310
12311 The attributes random.whseed and random.__whseed have no meaning for
12312 the new generator. Code using these attributes should switch to a
12313 new class, random.WichmannHill which is provided for backward
12314 compatibility and to make an alternate generator available.
12315
12316- New "algorithms" module: heapq, implements a heap queue. Thanks to
12317 Kevin O'Connor for the code and François Pinard for an entertaining
12318 write-up explaining the theory and practical uses of heaps.
12319
12320- New encoding for the Palm OS character set: palmos.
12321
12322- binascii.crc32() and the zipfile module had problems on some 64-bit
12323 platforms. These have been fixed. On a platform with 8-byte C longs,
12324 crc32() now returns a signed-extended 4-byte result, so that its value
12325 as a Python int is equal to the value computed a 32-bit platform.
12326
12327- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
12328 argument.
12329
12330- Some fixes in the copy module: when an object is copied through its
12331 __reduce__ method, there was no check for a __setstate__ method on
12332 the result [SF patch 565085]; deepcopy should treat instances of
12333 custom metaclasses the same way it treats instances of type 'type'
12334 [SF patch 560794].
12335
12336- Sockets now support timeout mode. After s.settimeout(T), where T is
12337 a float expressing seconds, subsequent operations raise an exception
12338 if they cannot be completed within T seconds. To disable timeout
12339 mode, use s.settimeout(None). There's also a module function,
12340 socket.setdefaulttimeout(T), which sets the default for all sockets
12341 created henceforth.
12342
12343- getopt.gnu_getopt was added. This supports GNU-style option
12344 processing, where options can be mixed with non-option arguments.
12345
12346- Stop using strings for exceptions. String objects used for
12347 exceptions are now classes deriving from Exception. The objects
12348 changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
12349 tabnanny.NannyNag, and xdrlib.Error.
12350
12351- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
12352 BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
12353 Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
12354 big endian systems were added to the codecs module. The old names
12355 BOM32_* and BOM64_* were off by a factor of 2.
12356
12357- Added conversion functions math.degrees() and math.radians().
12358
12359- math.log() now takes an optional argument: math.log(x[, base]).
12360
12361- ftplib.retrlines() now tests for callback is None rather than testing
12362 for False. Was causing an error when given a callback object which
12363 was callable but also returned len() as zero. The change may
12364 create new breakage if the caller relied on the undocumented behavior
12365 and called with callback set to [] or some other False value not
12366 identical to None.
12367
12368- random.gauss() uses a piece of hidden state used by nothing else,
12369 and the .seed() and .whseed() methods failed to reset it. In other
12370 words, setting the seed didn't completely determine the sequence of
12371 results produced by random.gauss(). It does now. Programs repeatedly
12372 mixing calls to a seed method with calls to gauss() may see different
12373 results now.
12374
12375- The pickle.Pickler class grew a clear_memo() method to mimic that
12376 provided by cPickle.Pickler.
12377
12378- difflib's SequenceMatcher class now does a dynamic analysis of
12379 which elements are so frequent as to constitute noise. For
12380 comparing files as sequences of lines, this generally works better
12381 than the IS_LINE_JUNK function, and function ndiff's linejunk
12382 argument defaults to None now as a result. A happy benefit is
12383 that SequenceMatcher may run much faster now when applied
12384 to large files with many duplicate lines (for example, C program
12385 text with lots of repeated "}" and "return NULL;" lines).
12386
12387- New Text.dump() method in Tkinter module.
12388
12389- New distutils commands for building packagers were added to
12390 support pkgtool on Solaris and swinstall on HP-UX.
12391
12392- distutils now has a new abstract binary packager base class
12393 command/bdist_packager, which simplifies writing packagers.
12394 This will hopefully provide the missing bits to encourage
12395 people to submit more packagers, e.g. for Debian, FreeBSD
12396 and other systems.
12397
12398- The UTF-16, -LE and -BE stream readers now raise a
12399 NotImplementedError for all calls to .readline(). Previously, they
12400 used to just produce garbage or fail with an encoding error --
12401 UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
12402 work well with these.
12403
12404- compileall now supports quiet operation.
12405
12406- The BaseHTTPServer now implements optional HTTP/1.1 persistent
12407 connections.
12408
12409- socket module: the SSL support was broken out of the main
12410 _socket module C helper and placed into a new _ssl helper
12411 which now gets imported by socket.py if available and working.
12412
12413- encodings package: added aliases for all supported IANA character
12414 sets
12415
12416- ftplib: to safeguard the user's privacy, anonymous login will use
12417 "anonymous@" as default password, rather than the real user and host
12418 name.
12419
12420- webbrowser: tightened up the command passed to os.system() so that
12421 arbitrary shell code can't be executed because a bogus URL was
12422 passed in.
12423
12424- gettext.translation has an optional fallback argument, and
12425 gettext.find an optional all argument. Translations will now fallback
12426 on a per-message basis. The module supports plural forms, by means
12427 of gettext.[d]ngettext and Translation.[u]ngettext.
12428
12429- distutils bdist commands now offer a --skip-build option.
12430
12431- warnings.warn now accepts a Warning instance as first argument.
12432
12433- The xml.sax.expatreader.ExpatParser class will no longer create
12434 circular references by using itself as the locator that gets passed
12435 to the content handler implementation. [SF bug #535474]
12436
12437- The email.Parser.Parser class now properly parses strings regardless
12438 of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
12439 or CRLF). Also, the Header class's constructor default arguments
12440 has changed slightly so that an explicit maxlinelen value is always
12441 honored, and so unicode conversion error handling can be specified.
12442
12443- distutils' build_ext command now links C++ extensions with the C++
12444 compiler available in the Makefile or CXX environment variable, if
12445 running under \*nix.
12446
12447- New module bz2: provides a comprehensive interface for the bz2 compression
12448 library. It implements a complete file interface, one-shot (de)compression
12449 functions, and types for sequential (de)compression.
12450
12451- New pdb command 'pp' which is like 'p' except that it pretty-prints
12452 the value of its expression argument.
12453
12454- Now bdist_rpm distutils command understands a verify_script option in
12455 the config file, including the contents of the referred filename in
12456 the "%verifyscript" section of the rpm spec file.
12457
12458- Fixed bug #495695: webbrowser module would run graphic browsers in a
12459 unix environment even if DISPLAY was not set. Also, support for
12460 skipstone browser was included.
12461
12462- Fixed bug #636769: rexec would run unallowed code if subclasses of
12463 strings were used as parameters for certain functions.
12464
12465Tools/Demos
12466-----------
12467
12468- pygettext.py now supports globbing on Windows, and accepts module
12469 names in addition to accepting file names.
12470
12471- The SGI demos (Demo/sgi) have been removed. Nobody thought they
12472 were interesting any more. (The SGI library modules and extensions
12473 are still there; it is believed that at least some of these are
12474 still used and useful.)
12475
12476- IDLE supports the new encoding declarations (PEP 263); it can also
12477 deal with legacy 8-bit files if they use the locale's encoding. It
12478 allows non-ASCII strings in the interactive shell and executes them
12479 in the locale's encoding.
12480
12481- freeze.py now produces binaries which can import shared modules,
12482 unlike before when this failed due to missing symbol exports in
12483 the generated binary.
12484
12485Build
12486-----
12487
12488- On Unix, IDLE is now installed automatically.
12489
12490- The fpectl module is not built by default; it's dangerous or useless
12491 except in the hands of experts.
12492
12493- The public Python C API will generally be declared using PyAPI_FUNC
12494 and PyAPI_DATA macros, while Python extension module init functions
12495 will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
12496 are deprecated.
12497
12498- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
12499 get into infinite loops, when a new-style class got garbage-collected.
12500 Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
12501 that new-style classes be immortal in COUNT_ALLOCS builds. Note that
12502 COUNT_ALLOCS is not enabled by default, in either release or debug
12503 builds, and that new-style classes are immortal only in COUNT_ALLOCS
12504 builds.
12505
12506- Compiling out the cyclic garbage collector is no longer an option.
12507 The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
12508 that it's always defined (for the benefit of any extension modules
12509 that may be conditionalizing on it). A bonus is that any extension
12510 type participating in cyclic gc can choose to participate in the
12511 Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
12512 to require editing the core to teach the trashcan mechanism about the
12513 new type.
12514
12515- According to Annex F of the current C standard,
12516
12517 The Standard C macro HUGE_VAL and its float and long double analogs,
12518 HUGE_VALF and HUGE_VALL, expand to expressions whose values are
12519 positive infinities.
12520
12521 Python only uses the double HUGE_VAL, and only to #define its own symbol
12522 Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
12523 pyport.h used to try to worm around that, but the workarounds triggered
12524 other bugs on other platforms, so we gave up. If your platform defines
12525 HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
12526 that works on your platform. The only instance of this I'm sure about
12527 is on an unknown subset of Cray systems, described here:
12528
12529 http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
12530
12531 Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
12532
12533- The configure option --without-doc-strings can be used to remove the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012534 doc strings from the built-in functions and modules; this reduces the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000012535 size of the executable.
12536
12537- The universal newlines option (PEP 278) is on by default. On Unix
12538 it can be disabled by passing --without-universal-newlines to the
12539 configure script. On other platforms, remove
12540 WITH_UNIVERSAL_NEWLINES from pyconfig.h.
12541
12542- On Unix, a shared libpython2.3.so can be created with --enable-shared.
12543
12544- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
12545 preprocessor symbols were eliminated. The internal decisions they
12546 controlled stopped being experimental long ago.
12547
12548- The tools used to build the documentation now work under Cygwin as
12549 well as Unix.
12550
12551- The bsddb and dbm module builds have been changed to try and avoid version
12552 skew problems and disable linkage with Berkeley DB 1.85 unless the
12553 installer knows what s/he's doing. See the section on building these
12554 modules in the README file for details.
12555
12556C API
12557-----
12558
12559- PyNumber_Check() now returns true for string and unicode objects.
12560 This is a result of these types having a partially defined
12561 tp_as_number slot. (This is not a feature, but an indication that
12562 PyNumber_Check() is not very useful to determine numeric behavior.
12563 It may be deprecated.)
12564
12565- The string object's layout has changed: the pointer member
12566 ob_sinterned has been replaced by an int member ob_sstate. On some
12567 platforms (e.g. most 64-bit systems) this may change the offset of
12568 the ob_sval member, so as a precaution the API_VERSION has been
12569 incremented. The apparently unused feature of "indirect interned
12570 strings", supported by the ob_sinterned member, is gone. Interned
12571 strings are now usually mortal; there is a new API,
12572 PyString_InternImmortal() that creates immortal interned strings.
12573 (The ob_sstate member can only take three values; however, while
12574 making it a char saves a few bytes per string object on average, in
12575 it also slowed things down a bit because ob_sval was no longer
12576 aligned.)
12577
12578- The Py_InitModule*() functions now accept NULL for the 'methods'
12579 argument. Modules without global functions are becoming more common
12580 now that factories can be types rather than functions.
12581
12582- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
12583 level.
12584
12585- New functions PyErr_SetExcFromWindowsErr() and
12586 PyErr_SetExcFromWindowsErrWithFilename(). Similar to
12587 PyErr_SetFromWindowsErrWithFilename() and
12588 PyErr_SetFromWindowsErr(), but they allow to specify
12589 the exception type to raise. Available on Windows.
12590
12591- Py_FatalError() is now declared as taking a const char* argument. It
12592 was previously declared without const. This should not affect working
12593 code.
12594
12595- Added new macro PySequence_ITEM(o, i) that directly calls
12596 sq_item without rechecking that o is a sequence and without
12597 adjusting for negative indices.
12598
12599- PyRange_New() now raises ValueError if the fourth argument is not 1.
12600 This is part of the removal of deprecated features of the xrange
12601 object.
12602
12603- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
12604 coercion if both arguments have the same type but this type has the
12605 CHECKTYPES flag set. This is to better support proxies.
12606
12607- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
12608 "``void (*)(void *)``".
12609
12610- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
12611
12612- A type can now inherit its metatype from its base type. Previously,
12613 when PyType_Ready() was called, if ob_type was found to be NULL, it
12614 was always set to &PyType_Type; now it is set to base->ob_type,
12615 where base is tp_base, defaulting to &PyObject_Type.
12616
12617- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
12618
12619- The PyCore_* family of APIs have been removed.
12620
12621- The "u#" parser marker will now pass through Unicode objects as-is
12622 without going through the buffer API.
12623
12624- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
12625
12626- An old #define of ANY as void has been removed from pyport.h. This
12627 hasn't been used since Python's pre-ANSI days, and the #define has
12628 been marked as obsolete since then. SF bug 495548 says it created
12629 conflicts with other packages, so keeping it around wasn't harmless.
12630
12631- Because Python's magic number scheme broke on January 1st, we decided
12632 to stop Python development. Thanks for all the fish!
12633
12634- Some of us don't like fish, so we changed Python's magic number
12635 scheme to a new one. See Python/import.c for details.
12636
12637New platforms
12638-------------
12639
12640- OpenVMS is now supported.
12641
12642- AtheOS is now supported.
12643
12644- the EMX runtime environment on OS/2 is now supported.
12645
12646- GNU/Hurd is now supported.
12647
12648Tests
12649-----
12650
12651- The regrtest.py script's -u option now provides a way to say "allow
12652 all resources except this one." For example, to allow everything
12653 except bsddb, give the option '-uall,-bsddb'.
12654
12655Windows
12656-------
12657
12658- The Windows distribution now ships with version 4.0.14 of the
12659 Sleepycat Berkeley database library. This should be a huge
12660 improvement over the previous Berkeley DB 1.85, which had many
12661 bugs.
12662 XXX What are the licensing issues here?
12663 XXX If a user has a database created with a previous version of
12664 XXX Python, what must they do to convert it?
12665 XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
12666 XXX The version # is likely to change before 2.3a1.
12667
12668- The Windows distribution now ships with a Secure Sockets Library (SLL)
12669 module (_ssl.pyd)
12670
12671- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
12672 previously shipped with Tcl/Tk 8.3.2).
12673
12674- When Python is built under a Microsoft compiler, sys.version now
12675 includes the compiler version number (_MSC_VER). For example, under
12676 MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
12677 the value of _MSC_VER under MSVC 6.
12678
12679- Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
12680 of that has been fixed in the installer (disabled Wise's "delete in-
12681 use files" uninstall option).
12682
12683- Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
12684
12685- The installer now installs Start menu shortcuts under (the local
12686 equivalent of) "All Users" when doing an Admin install.
12687
12688- file.truncate([newsize]) now works on Windows for all newsize values.
12689 It used to fail if newsize didn't fit in 32 bits, reflecting a
12690 limitation of MS _chsize (which is no longer used).
12691
12692- os.waitpid() is now implemented for Windows, and can be used to block
12693 until a specified process exits. This is similar to, but not exactly
12694 the same as, os.waitpid() on POSIX systems. If you're waiting for
12695 a specific process whose pid was obtained from one of the spawn()
12696 functions, the same Python os.waitpid() code works across platforms.
12697 See the docs for details. The docs were changed to clarify that
12698 spawn functions return, and waitpid requires, a process handle on
12699 Windows (not the same thing as a Windows process id).
12700
12701- New tempfile.TemporaryFile implementation for Windows: this doesn't
12702 need a TemporaryFileWrapper wrapper anymore, and should be immune
12703 to a nasty problem: before 2.3, if you got a temp file on Windows, it
12704 got wrapped in an object whose close() method first closed the
12705 underlying file, then deleted the file. This usually worked fine.
12706 However, the spawn family of functions on Windows create (at a low C
12707 level) the same set of open files in the spawned process Q as were
12708 open in the spawning process P. If a temp file f was among them, then
12709 doing f.close() in P first closed P's C-level file handle on f, but Q's
12710 C-level file handle on f remained open, so the attempt in P to delete f
12711 blew up with a "Permission denied" error (Windows doesn't allow
12712 deleting open files). This was surprising, subtle, and difficult to
12713 work around.
12714
12715- The os module now exports all the symbolic constants usable with the
12716 low-level os.open() on Windows: the new constants in 2.3 are
12717 O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
12718 The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
12719 O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
12720 to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
12721 (so specify both if you want both; note that neither is useful unless
12722 specified with O_CREAT too).
12723
12724Mac
12725----
12726
12727- Mac/Relnotes is gone, the release notes are now here.
12728
12729- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
12730 version) now fully supports unicode strings as arguments to various file
12731 system calls, eg. open(), file(), os.stat() and os.listdir().
12732
12733- The current naming convention for Python on the Macintosh is that MacPython
12734 refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
12735 CFM-based version that runs on both OS9 and OSX.
12736
12737- All MacPython-OS9 functionality is now available in an OSX unix build,
12738 including the Carbon modules, the IDE, OSA support, etc. A lot of this
12739 will only work correctly in a framework build, though, because you cannot
12740 talk to the window manager unless your application is run from a .app
12741 bundle. There is a command line tool "pythonw" that runs your script
12742 with an interpreter living in such a .app bundle, this interpreter should
12743 be used to run any Python script using the window manager (including
12744 Tkinter or wxPython scripts).
12745
12746- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
12747 MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
12748 are specifically for MacPython-OS9 (CFM support, preference resources, etc).
12749
12750- A new utility PythonLauncher will start a Python interpreter when a .py or
12751 .pyw script is double-clicked in the Finder. By default .py scripts are
12752 run with a normal Python interpreter in a Terminal window and .pyw
12753 files are run with a window-aware pythonw interpreter without a Terminal
12754 window, but all this can be customized.
12755
12756- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
12757 possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
12758 releases.
12759
12760- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
12761 line interface too.
12762
12763- All the Carbon classes are now PEP253 compliant, meaning that you can
12764 subclass them from Python. Most of the attributes have gone, you should
12765 now use the accessor function call API, which is also what Apple's
12766 documentation uses. Some attributes such as grafport.visRgn are still
12767 available for convenience.
12768
12769- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012770 and Folder (APIs from Folders.h). The old macfs built-in module is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000012771 gone, and replaced by a Python wrapper around the new modules.
12772
12773- Pathname handling should now be fully consistent: MacPython-OSX always uses
12774 unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
12775 (also when running on Mac OS X).
12776
12777- New Carbon modules Help and AH give access to the Carbon Help Manager.
12778 There are hooks in the IDE to allow accessing the Python documentation
12779 (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
12780 See Mac/OSX/README for converting the Python documentation to a
12781 Help Viewer compatible form and installing it.
12782
12783- OSA support has been redesigned and the generated Python classes now
12784 mirror the inheritance defined by the underlying OSA classes.
12785
12786- MacPython no longer maps both \r and \n to \n on input for any text file.
12787 This feature has been replaced by universal newline support (PEP278).
12788
12789- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
12790 mac-roman (or whatever your local Mac encoding was) but "ascii", like on
12791 other platforms. If you really need sourcefiles with Mac characters in them
12792 you can change this in site.py.
12793
12794
12795What's New in Python 2.2 final?
12796===============================
12797
12798*Release date: 21-Dec-2001*
12799
12800Type/class unification and new-style classes
12801--------------------------------------------
12802
12803- pickle.py, cPickle: allow pickling instances of new-style classes
12804 with a custom metaclass.
12805
12806Core and builtins
12807-----------------
12808
12809- weakref proxy object: when comparing, unwrap both arguments if both
12810 are proxies.
12811
12812Extension modules
12813-----------------
12814
12815- binascii.b2a_base64(): fix a potential buffer overrun when encoding
12816 very short strings.
12817
12818- cPickle: the obscure "fast" mode was suspected of causing stack
12819 overflows on the Mac. Hopefully fixed this by setting the recursion
12820 limit much smaller. If the limit is too low (it only affects
12821 performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
12822 when compiling cPickle.c (or in pyconfig.h).
12823
12824Library
12825-------
12826
12827- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
12828 close or delete time).
12829
12830- rfc822.py: fixed a bug where the address '<>' was converted to None
12831 instead of an empty string (also fixes the email.Utils module).
12832
12833- xmlrpclib.py: version 1.0.0; uses precision for doubles.
12834
12835- test suite: the pickle and cPickle tests were not executing any code
12836 when run from the standard regression test.
12837
12838Tools/Demos
12839-----------
12840
12841Build
12842-----
12843
12844C API
12845-----
12846
12847New platforms
12848-------------
12849
12850Tests
12851-----
12852
12853Windows
12854-------
12855
12856- distutils package: fixed broken Windows installers (bdist_wininst).
12857
12858- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
12859 instances are deleted at process exit time.
12860
12861- socket.py: prevent mysterious warnings when socket instances are
12862 deleted at process exit time.
12863
12864- posixmodule.c: fix a Windows crash with stat() of a filename ending
12865 in backslash.
12866
12867Mac
12868----
12869
12870- The Carbon toolbox modules have been upgraded to Universal Headers
12871 3.4, and experimental CoreGraphics and CarbonEvents modules have
12872 been added. All only for framework-enabled MacOSX.
12873
12874
12875What's New in Python 2.2c1?
12876===========================
12877
12878*Release date: 14-Dec-2001*
12879
12880Type/class unification and new-style classes
12881--------------------------------------------
12882
12883- Guido's tutorial introduction to the new type/class features has
12884 been extensively updated. See
12885
12886 http://www.python.org/2.2/descrintro.html
12887
12888 That remains the primary documentation in this area.
12889
12890- Fixed a leak: instance variables declared with __slots__ were never
12891 deleted!
12892
12893- The "delete attribute" method of descriptor objects is called
12894 __delete__, not __del__. In previous releases, it was mistakenly
12895 called __del__, which created an unfortunate overloading condition
12896 with finalizers. (The "get attribute" and "set attribute" methods
12897 are still called __get__ and __set__, respectively.)
12898
12899- Some subtle issues with the super built-in were fixed:
12900
12901 (a) When super itself is subclassed, its __get__ method would still
12902 return an instance of the base class (i.e., of super).
12903
12904 (b) super(C, C()).__class__ would return C rather than super. This
12905 is confusing. To fix this, I decided to change the semantics of
12906 super so that it only applies to code attributes, not to data
12907 attributes. After all, overriding data attributes is not
12908 supported anyway.
12909
12910 (c) The __get__ method didn't check whether the argument was an
12911 instance of the type used in creation of the super instance.
12912
12913- Previously, hash() of an instance of a subclass of a mutable type
12914 (list or dictionary) would return some value, rather than raising
12915 TypeError. This has been fixed. Also, directly calling
12916 dict.__hash__ and list.__hash__ now raises the same TypeError
12917 (previously, these were the same as object.__hash__).
12918
12919- New-style objects now support deleting their __dict__. This is for
12920 all intents and purposes equivalent to assigning a brand new empty
12921 dictionary, but saves space if the object is not used further.
12922
12923Core and builtins
12924-----------------
12925
12926- -Qnew now works as documented in PEP 238: when -Qnew is passed on
12927 the command line, all occurrences of "/" use true division instead
12928 of classic division. See the PEP for details. Note that "all"
12929 means all instances in library and 3rd-party modules, as well as in
12930 your own code. As the PEP says, -Qnew is intended for use only in
12931 educational environments with control over the libraries in use.
12932 Note that test_coercion.py in the standard Python test suite fails
12933 under -Qnew; this is expected, and won't be repaired until true
12934 division becomes the default (in the meantime, test_coercion is
12935 testing the current rules).
12936
12937- complex() now only allows the first argument to be a string
12938 argument, and raises TypeError if either the second arg is a string
12939 or if the second arg is specified when the first is a string.
12940
12941Extension modules
12942-----------------
12943
12944- gc.get_referents was renamed to gc.get_referrers.
12945
12946Library
12947-------
12948
12949- Functions in the os.spawn() family now release the global interpreter
12950 lock around calling the platform spawn. They should always have done
12951 this, but did not before 2.2c1. Multithreaded programs calling
12952 an os.spawn function with P_WAIT will no longer block all Python threads
12953 until the spawned program completes. It's possible that some programs
12954 relies on blocking, although more likely by accident than by design.
12955
12956- webbrowser defaults to netscape.exe on OS/2 now.
12957
12958- Tix.ResizeHandle exposes detach_widget, hide, and show.
12959
12960- The charset alias windows_1252 has been added.
12961
12962- types.StringTypes is a tuple containing the defined string types;
12963 usually this will be (str, unicode), but if Python was compiled
12964 without Unicode support it will be just (str,).
12965
12966- The pulldom and minidom modules were synchronized to PyXML.
12967
12968Tools/Demos
12969-----------
12970
12971- A new script called Tools/scripts/google.py was added, which fires
12972 off a search on Google.
12973
12974Build
12975-----
12976
12977- Note that release builds of Python should arrange to define the
12978 preprocessor symbol NDEBUG on the command line (or equivalent).
12979 In the 2.2 pre-release series we tried to define this by magic in
12980 Python.h instead, but it proved to cause problems for extension
12981 authors. The Unix, Windows and Mac builds now all define NDEBUG in
12982 release builds via cmdline (or equivalent) instead. Ports to
12983 other platforms should do likewise.
12984
12985- It is no longer necessary to use --with-suffix when building on a
12986 case-insensitive file system (such as Mac OS X HFS+). In the build
12987 directory an extension is used, but not in the installed python.
12988
12989C API
12990-----
12991
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012992- New function PyDict_MergeFromSeq2() exposes the built-in dict
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000012993 constructor's logic for updating a dictionary from an iterable object
12994 producing key-value pairs.
12995
12996- PyArg_ParseTupleAndKeywords() requires that the number of entries in
12997 the keyword list equal the number of argument specifiers. This
12998 wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
12999 dump core in some bad cases. This has been repaired. As a result,
13000 PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
13001 previously went unchallenged.
13002
13003New platforms
13004-------------
13005
13006Tests
13007-----
13008
13009Windows
13010-------
13011
13012Mac
13013----
13014
13015- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
13016 without any trailing digits.
13017
13018- Changed logic for finding python home in Mac OS X framework Pythons.
13019 Now sys.executable points to the executable again, in stead of to
13020 the shared library. The latter is used only for locating the python
13021 home.
13022
13023
13024What's New in Python 2.2b2?
13025===========================
13026
13027*Release date: 16-Nov-2001*
13028
13029Type/class unification and new-style classes
13030--------------------------------------------
13031
13032- Multiple inheritance mixing new-style and classic classes in the
13033 list of base classes is now allowed, so this works now:
13034
13035 class Classic: pass
13036 class Mixed(Classic, object): pass
13037
13038 The MRO (method resolution order) for each base class is respected
13039 according to its kind, but the MRO for the derived class is computed
13040 using new-style MRO rules if any base class is a new-style class.
13041 This needs to be documented.
13042
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013043- The new built-in dictionary() constructor, and dictionary type, have
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013044 been renamed to dict. This reflects a decade of common usage.
13045
13046- dict() now accepts an iterable object producing 2-sequences. For
13047 example, dict(d.items()) == d for any dictionary d. The argument,
13048 and the elements of the argument, can be any iterable objects.
13049
13050- New-style classes can now have a __del__ method, which is called
13051 when the instance is deleted (just like for classic classes).
13052
13053- Assignment to object.__dict__ is now possible, for objects that are
13054 instances of new-style classes that have a __dict__ (unless the base
13055 class forbids it).
13056
13057- Methods of built-in types now properly check for keyword arguments
13058 (formerly these were silently ignored). The only built-in methods
13059 that take keyword arguments are __call__, __init__ and __new__.
13060
13061- The socket function has been converted to a type; see below.
13062
13063Core and builtins
13064-----------------
13065
13066- Assignment to __debug__ raises SyntaxError at compile-time. This
13067 was promised when 2.1c1 was released as "What's New in Python 2.1c1"
13068 (see below) says.
13069
13070- Clarified the error messages for unsupported operands to an operator
13071 (like 1 + '').
13072
13073Extension modules
13074-----------------
13075
13076- mmap has a new keyword argument, "access", allowing a uniform way for
13077 both Windows and Unix users to create read-only, write-through and
13078 copy-on-write memory mappings. This was previously possible only on
13079 Unix. A new keyword argument was required to support this in a
13080 uniform way because the mmap() signatures had diverged across
13081 platforms. Thanks to Jay T Miller for repairing this!
13082
13083- By default, the gc.garbage list now contains only those instances in
13084 unreachable cycles that have __del__ methods; in 2.1 it contained all
13085 instances in unreachable cycles. "Instances" here has been generalized
13086 to include instances of both new-style and old-style classes.
13087
13088- The socket module defines a new method for socket objects,
13089 sendall(). This is like send() but may make multiple calls to
13090 send() until all data has been sent. Also, the socket function has
13091 been converted to a subclassable type, like list and tuple (etc.)
13092 before it; socket and SocketType are now the same thing.
13093
13094- Various bugfixes to the curses module. There is now a test suite
13095 for the curses module (you have to run it manually).
13096
13097- binascii.b2a_base64 no longer places an arbitrary restriction of 57
13098 bytes on its input.
13099
13100Library
13101-------
13102
13103- tkFileDialog exposes a Directory class and askdirectory
13104 convenience function.
13105
13106- Symbolic group names in regular expressions must be unique. For
13107 example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
13108 single name can't mean both "group 1" and "group 2" simultaneously.
13109 Python 2.2 detects this error at regexp compilation time;
13110 previously, the error went undetected, and results were
13111 unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
13112 pattern.subn() methods have been rewritten in C. Also, an
13113 experimental function/method finditer() has been added, which works
13114 like findall() but returns an iterator.
13115
13116- Tix exposes more commands through the classes DirSelectBox,
13117 DirSelectDialog, ListNoteBook, Meter, CheckList, and the
13118 methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
13119 tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
13120
13121- Traceback objects are now scanned by cyclic garbage collection, so
13122 cycles created by casual use of sys.exc_info() no longer cause
13123 permanent memory leaks (provided garbage collection is enabled).
13124
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013125- mimetypes.py has optional support for non-standard, but commonly
13126 found types. guess_type() and guess_extension() now accept an
13127 optional 'strict' flag, defaulting to true, which controls whether
13128 recognize non-standard types or not. A few non-standard types we
13129 know about have been added. Also, when run as a script, there are
13130 new -l and -e options.
13131
13132- statcache is now deprecated.
13133
13134- email.Utils.formatdate() now produces the preferred RFC 2822 style
13135 dates with numeric timezones (it used to produce obsolete dates
13136 hard coded to "GMT" timezone). An optional 'localtime' flag is
13137 added to produce dates in the local timezone, with daylight savings
13138 time properly taken into account.
13139
13140- In pickle and cPickle, instead of masking errors in load() by
13141 transforming them into SystemError, we let the original exception
13142 propagate out. Also, implement support for __safe_for_unpickling__
13143 in pickle, as it already was supported in cPickle.
13144
13145Tools/Demos
13146-----------
13147
13148Build
13149-----
13150
13151- The dbm module is built using libdb1 if available. The bsddb module
13152 is built with libdb3 if available.
13153
13154- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
13155
13156C API
13157-----
13158
13159- New function PySequence_Fast_GET_SIZE() returns the size of a non-
13160 NULL result from PySequence_Fast(), more quickly than calling
13161 PySequence_Size().
13162
13163- New argument unpacking function PyArg_UnpackTuple() added.
13164
13165- New functions PyObject_CallFunctionObjArgs() and
13166 PyObject_CallMethodObjArgs() have been added to make it more
13167 convenient and efficient to call functions and methods from C.
13168
13169- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
13170 possible that this will propagate errors it didn't before.
13171
13172- New function PyObject_CheckReadBuffer(), which returns true if its
13173 argument supports the single-segment readable buffer interface.
13174
13175New platforms
13176-------------
13177
13178- We've finally confirmed that this release builds on HP-UX 11.00,
13179 *with* threads, and passes the test suite.
13180
13181- Thanks to a series of patches from Michael Muller, Python may build
13182 again under OS/2 Visual Age C++.
13183
13184- Updated RISCOS port by Dietmar Schwertberger.
13185
13186Tests
13187-----
13188
13189- Added a test script for the curses module. It isn't run automatically;
13190 regrtest.py must be run with '-u curses' to enable it.
13191
13192Windows
13193-------
13194
13195Mac
13196----
13197
13198- PythonScript has been moved to unsupported and is slated to be
13199 removed completely in the next release.
13200
13201- It should now be possible to build applets that work on both OS9 and
13202 OSX.
13203
13204- The core is now linked with CoreServices not Carbon; as a side
13205 result, default 8bit encoding on OSX is now ASCII.
13206
13207- Python should now build on OSX 10.1.1
13208
13209
13210What's New in Python 2.2b1?
13211===========================
13212
13213*Release date: 19-Oct-2001*
13214
13215Type/class unification and new-style classes
13216--------------------------------------------
13217
13218- New-style classes are now always dynamic (except for built-in and
13219 extension types). There is no longer a performance penalty, and I
13220 no longer see another reason to keep this baggage around. One relic
13221 remains: the __dict__ of a new-style class is a read-only proxy; you
13222 must set the class's attribute to modify it. As a consequence, the
13223 __defined__ attribute of new-style types no longer exists, for lack
13224 of need: there is once again only one __dict__ (although in the
13225 future a __cache__ may be resurrected with a similar function, if I
13226 can prove that it actually speeds things up).
13227
13228- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
13229 always returned None, even when there was a class docstring).
13230
13231- doctest now finds and runs docstrings attached to new-style classes,
13232 class methods, static methods, and properties.
13233
13234Core and builtins
13235-----------------
13236
13237- A very subtle syntactical pitfall in list comprehensions was fixed.
13238 For example: [a+b for a in 'abc', for b in 'def']. The comma in
13239 this example is a mistake. Previously, this would silently let 'a'
13240 iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
13241 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
13242 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
13243 Note that [a for a in <singleton>] is a convoluted way to say
13244 [<singleton>] anyway, so it's not like any expressiveness is lost.
13245
13246- getattr(obj, name, default) now only catches AttributeError, as
13247 documented, rather than returning the default value for all
13248 exceptions (which could mask bugs in a __getattr__ hook, for
13249 example).
13250
13251- Weak reference objects are now part of the core and offer a C API.
13252 A bug which could allow a core dump when binary operations involved
13253 proxy reference has been fixed. weakref.ReferenceError is now a
13254 built-in exception.
13255
13256- unicode(obj) now behaves more like str(obj), accepting arbitrary
13257 objects, and calling a __unicode__ method if it exists.
13258 unicode(obj, encoding) and unicode(obj, encoding, errors) still
13259 require an 8-bit string or character buffer argument.
13260
13261- isinstance() now allows any object as the first argument and a
13262 class, a type or something with a __bases__ tuple attribute for the
13263 second argument. The second argument may also be a tuple of a
13264 class, type, or something with __bases__, in which case isinstance()
13265 will return true if the first argument is an instance of any of the
13266 things contained in the second argument tuple. E.g.
13267
13268 isinstance(x, (A, B))
13269
13270 returns true if x is an instance of A or B.
13271
13272Extension modules
13273-----------------
13274
13275- thread.start_new_thread() now returns the thread ID (previously None).
13276
13277- binascii has now two quopri support functions, a2b_qp and b2a_qp.
13278
13279- readline now supports setting the startup_hook and the
13280 pre_event_hook, and adds the add_history() function.
13281
13282- os and posix supports chroot(), setgroups() and unsetenv() where
13283 available. The stat(), fstat(), statvfs() and fstatvfs() functions
13284 now return "pseudo-sequences" -- the various fields can now be
13285 accessed as attributes (e.g. os.stat("/").st_mtime) but for
13286 backwards compatibility they also behave as a fixed-length sequence.
13287 Some platform-specific fields (e.g. st_rdev) are only accessible as
13288 attributes.
13289
13290- time: localtime(), gmtime() and strptime() now return a
13291 pseudo-sequence similar to the os.stat() return value, with
13292 attributes like tm_year etc.
13293
13294- Decompression objects in the zlib module now accept an optional
13295 second parameter to decompress() that specifies the maximum amount
13296 of memory to use for the uncompressed data.
13297
13298- optional SSL support in the socket module now exports OpenSSL
13299 functions RAND_add(), RAND_egd(), and RAND_status(). These calls
13300 are useful on platforms like Solaris where OpenSSL does not
13301 automatically seed its PRNG. Also, the keyfile and certfile
13302 arguments to socket.ssl() are now optional.
13303
13304- posixmodule (and by extension, the os module on POSIX platforms) now
13305 exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
13306
13307Library
13308-------
13309
13310- doctest now excludes functions and classes not defined by the module
13311 being tested, thanks to Tim Hochberg.
13312
13313- HotShot, a new profiler implemented using a C-based callback, has
13314 been added. This substantially reduces the overhead of profiling,
13315 but it is still quite preliminary. Support modules and
13316 documentation will be added in upcoming releases (before 2.2 final).
13317
13318- profile now produces correct output in situations where an exception
13319 raised in Python is cleared by C code (e.g. hasattr()). This used
13320 to cause wrong output, including spurious claims of recursive
13321 functions and attribution of time spent to the wrong function.
13322
13323 The code and documentation for the derived OldProfile and HotProfile
13324 profiling classes was removed. The code hasn't worked for years (if
13325 you tried to use them, they raised exceptions). OldProfile
13326 intended to reproduce the behavior of the profiler Python used more
13327 than 7 years ago, and isn't interesting anymore. HotProfile intended
13328 to provide a faster profiler (but producing less information), and
13329 that's a worthy goal we intend to meet via a different approach (but
13330 without losing information).
13331
13332- Profile.calibrate() has a new implementation that should deliver
13333 a much better system-specific calibration constant. The constant can
13334 now be specified in an instance constructor, or as a Profile class or
13335 instance variable, instead of by editing profile.py's source code.
13336 Calibration must still be done manually (see the docs for the profile
13337 module).
13338
13339 Note that Profile.calibrate() must be overridden by subclasses.
13340 Improving the accuracy required exploiting detailed knowledge of
13341 profiler internals; the earlier method abstracted away the details
13342 and measured a simplified model instead, but consequently computed
13343 a constant too small by a factor of 2 on some modern machines.
13344
13345- quopri's encode and decode methods take an optional header parameter,
13346 which indicates whether output is intended for the header 'Q'
13347 encoding.
13348
13349- The SocketServer.ThreadingMixIn class now closes the request after
13350 finish_request() returns. (Not when it errors out though.)
13351
13352- The nntplib module's NNTP.body() method has grown a 'file' argument
13353 to allow saving the message body to a file.
13354
13355- The email package has added a class email.Parser.HeaderParser which
13356 only parses headers and does not recurse into the message's body.
13357 Also, the module/class MIMEAudio has been added for representing
13358 audio data (contributed by Anthony Baxter).
13359
13360- ftplib should be able to handle files > 2GB.
13361
13362- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
13363 ON, and OFF.
13364
13365- xml.dom.minidom NodeList objects now support the length attribute
13366 and item() method as required by the DOM specifications.
13367
13368Tools/Demos
13369-----------
13370
13371- Demo/dns was removed. It no longer serves any purpose; a package
13372 derived from it is now maintained by Anthony Baxter, see
13373 http://PyDNS.SourceForge.net.
13374
13375- The freeze tool has been made more robust, and two new options have
13376 been added: -X and -E.
13377
13378Build
13379-----
13380
13381- configure will use CXX in LINKCC if CXX is used to build main() and
13382 the system requires to link a C++ main using the C++ compiler.
13383
13384C API
13385-----
13386
13387- The documentation for the tp_compare slot is updated to require that
13388 the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
13389 not correct. This is not yet enforced but will be enforced in
13390 Python 2.3; even later, we may use -2 to indicate errors and +2 for
13391 "NotImplemented". Right now, -1 should be used for an error return.
13392
13393- PyLong_AsLongLong() now accepts int (as well as long) arguments.
13394 Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
13395 as long) arguments.
13396
13397- PyThread_start_new_thread() now returns a long int giving the thread
13398 ID, if one can be calculated; it returns -1 for error, 0 if no
13399 thread ID is calculated (this is an incompatible change, but only
13400 the thread module used this API). This code has only really been
13401 tested on Linux and Windows; other platforms please beware (and
13402 report any bugs or strange behavior).
13403
13404- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
13405 input.
13406
13407New platforms
13408-------------
13409
13410Tests
13411-----
13412
13413Windows
13414-------
13415
13416- Installer: If you install IDLE, and don't disable file-extension
13417 registration, a new "Edit with IDLE" context (right-click) menu entry
13418 is created for .py and .pyw files.
13419
13420- The signal module now supports SIGBREAK on Windows, thanks to Steven
13421 Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
13422 action remains to call Win32 ExitProcess(). This can be changed via
13423 signal.signal(). For example::
13424
13425 # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
13426 # (SIGINT) behavior.
13427 import signal
13428 signal.signal(signal.SIGBREAK, signal.default_int_handler)
13429
13430 try:
13431 while 1:
13432 pass
13433 except KeyboardInterrupt:
13434 # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
13435 # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
13436 # program without the possibility for any Python-level cleanup).
13437 print "Clean exit"
13438
13439
13440What's New in Python 2.2a4?
13441===========================
13442
13443*Release date: 28-Sep-2001*
13444
13445Type/class unification and new-style classes
13446--------------------------------------------
13447
13448- pydoc and inspect are now aware of new-style classes;
13449 e.g. help(list) at the interactive prompt now shows proper
13450 documentation for all operations on list objects.
13451
13452- Applications using Jim Fulton's ExtensionClass module can now safely
13453 be used with Python 2.2. In particular, Zope 2.4.1 now works with
13454 Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
13455 examples also work again. It is hoped that Gtk and Boost also work
13456 with 2.2a4 and beyond. (If you can confirm this, please write
13457 webmaster@python.org; if there are still problems, please open a bug
13458 report on SourceForge.)
13459
13460- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
13461 These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
13462 in the constructed property object. fget, fset and fdel weren't
13463 discoverable from Python in 2.2a3. __doc__ is new, and allows to
13464 associate a docstring with a property.
13465
13466- Comparison overloading is now more completely implemented. For
13467 example, a str subclass instance can properly be compared to a str
13468 instance, and it can properly overload comparison. Ditto for most
13469 other built-in object types.
13470
13471- The repr() of new-style classes has changed; instead of <type
13472 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
13473 *except* for built-in types, which are still rendered as <type
13474 'Foo'> (to avoid upsetting existing code that might parse or
13475 otherwise rely on repr() of certain type objects).
13476
13477- The repr() of new-style objects is now always <Foo object at XXX>;
13478 previously, it was sometimes <Foo instance at XXX>.
13479
13480- For new-style classes, what was previously called __getattr__ is now
13481 called __getattribute__. This method, if defined, is called for
13482 *every* attribute access. A new __getattr__ hook more similar to the
13483 one in classic classes is defined which is called only if regular
13484 attribute access raises AttributeError; to catch *all* attribute
13485 access, you can use __getattribute__ (for new-style classes). If
13486 both are defined, __getattribute__ is called first, and if it raises
13487 AttributeError, __getattr__ is called.
13488
13489- The __class__ attribute of new-style objects can be assigned to.
13490 The new class must have the same C-level object layout as the old
13491 class.
13492
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013493- The built-in file type can be subclassed now. In the usual pattern,
13494 "file" is the name of the built-in type, and file() is a new built-in
13495 constructor, with the same signature as the built-in open() function.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013496 file() is now the preferred way to open a file.
13497
13498- Previously, __new__ would only see sequential arguments passed to
13499 the type in a constructor call; __init__ would see both sequential
13500 and keyword arguments. This made no sense whatsoever any more, so
13501 now both __new__ and __init__ see all arguments.
13502
13503- Previously, hash() applied to an instance of a subclass of str or
13504 unicode always returned 0. This has been repaired.
13505
13506- Previously, an operation on an instance of a subclass of an
13507 immutable type (int, long, float, complex, tuple, str, unicode),
13508 where the subtype didn't override the operation (and so the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013509 operation was handled by the built-in type), could return that
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013510 instance instead a value of the base type. For example, if s was of
13511 a str subclass type, s[:] returned s as-is. Now it returns a str
13512 with the same value as s.
13513
13514- Provisional support for pickling new-style objects has been added.
13515
13516Core
13517----
13518
13519- file.writelines() now accepts any iterable object producing strings.
13520
13521- PyUnicode_FromEncodedObject() now works very much like
13522 PyObject_Str(obj) in that it tries to use __str__/tp_str
13523 on the object if the object is not a string or buffer. This
13524 makes unicode() behave like str() when applied to non-string/buffer
13525 objects.
13526
13527- PyFile_WriteObject now passes Unicode objects to the file's write
13528 method. As a result, all file-like objects which may be the target
13529 of a print statement must support Unicode objects, i.e. they must
13530 at least convert them into ASCII strings.
13531
13532- Thread scheduling on Solaris should be improved; it is no longer
13533 necessary to insert a small sleep at the start of a thread in order
13534 to let other runnable threads be scheduled.
13535
13536Library
13537-------
13538
13539- StringIO.StringIO instances and cStringIO.StringIO instances support
13540 read character buffer compatible objects for their .write() methods.
13541 These objects are converted to strings and then handled as such
13542 by the instances.
13543
13544- The "email" package has been added. This is basically a port of the
13545 mimelib package <http://sf.net/projects/mimelib> with API changes
13546 and some implementations updated to use iterators and generators.
13547
13548- difflib.ndiff() and difflib.Differ.compare() are generators now. This
13549 restores the ability of Tools/scripts/ndiff.py to start producing output
13550 before the entire comparison is complete.
13551
13552- StringIO.StringIO instances and cStringIO.StringIO instances support
13553 iteration just like file objects (i.e. their .readline() method is
13554 called for each iteration until it returns an empty string).
13555
13556- The codecs module has grown four new helper APIs to access
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013557 built-in codecs: getencoder(), getdecoder(), getreader(),
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013558 getwriter().
13559
13560- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
13561 simplifies writing XML RPC servers.
13562
13563- os.path.realpath(): a new function that returns the absolute pathname
13564 after interpretation of symbolic links. On non-Unix systems, this
13565 is an alias for os.path.abspath().
13566
13567- operator.indexOf() (PySequence_Index() in the C API) now works with any
13568 iterable object.
13569
13570- smtplib now supports various authentication and security features of
13571 the SMTP protocol through the new login() and starttls() methods.
13572
13573- hmac: a new module implementing keyed hashing for message
13574 authentication.
13575
13576- mimetypes now recognizes more extensions and file types. At the
13577 same time, some mappings not sanctioned by IANA were removed.
13578
13579- The "compiler" package has been brought up to date to the state of
13580 Python 2.2 bytecode generation. It has also been promoted from a
13581 Tool to a standard library package. (Tools/compiler still exists as
13582 a sample driver.)
13583
13584Build
13585-----
13586
13587- Large file support (LFS) is now automatic when the platform supports
13588 it; no more manual configuration tweaks are needed. On Linux, at
13589 least, it's possible to have a system whose C library supports large
13590 files but whose kernel doesn't; in this case, large file support is
13591 still enabled but doesn't do you any good unless you upgrade your
13592 kernel or share your Python executable with another system whose
13593 kernel has large file support.
13594
13595- The configure script now supplies plausible defaults in a
13596 cross-compilation environment. This doesn't mean that the supplied
13597 values are always correct, or that cross-compilation now works
13598 flawlessly -- but it's a first step (and it shuts up most of
13599 autoconf's warnings about AC_TRY_RUN).
13600
13601- The Unix build is now a bit less chatty, courtesy of the parser
13602 generator. The build is completely silent (except for errors) when
13603 using "make -s", thanks to a -q option to setup.py.
13604
13605C API
13606-----
13607
13608- The "structmember" API now supports some new flag bits to deny read
13609 and/or write access to attributes in restricted execution mode.
13610
13611New platforms
13612-------------
13613
13614- Compaq's iPAQ handheld, running the "familiar" Linux distribution
13615 (http://familiar.handhelds.org).
13616
13617Tests
13618-----
13619
13620- The "classic" standard tests, which work by comparing stdout to
13621 an expected-output file under Lib/test/output/, no longer stop at
13622 the first mismatch. Instead the test is run to completion, and a
13623 variant of ndiff-style comparison is used to report all differences.
13624 This is much easier to understand than the previous style of reporting.
13625
13626- The unittest-based standard tests now use regrtest's test_main()
13627 convention, instead of running as a side-effect of merely being
13628 imported. This allows these tests to be run in more natural and
13629 flexible ways as unittests, outside the regrtest framework.
13630
13631- regrtest.py is much better integrated with unittest and doctest now,
13632 especially in regard to reporting errors.
13633
13634Windows
13635-------
13636
13637- Large file support now also works for files > 4GB, on filesystems
13638 that support it (NTFS under Windows 2000). See "What's New in
13639 Python 2.2a3" for more detail.
13640
13641
13642What's New in Python 2.2a3?
13643===========================
13644
13645*Release Date: 07-Sep-2001*
13646
13647Core
13648----
13649
13650- Conversion of long to float now raises OverflowError if the long is too
13651 big to represent as a C double.
13652
13653- The 3-argument builtin pow() no longer allows a third non-None argument
13654 if either of the first two arguments is a float, or if both are of
13655 integer types and the second argument is negative (in which latter case
13656 the arguments are converted to float, so this is really the same
13657 restriction).
13658
13659- The builtin dir() now returns more information, and sometimes much
13660 more, generally naming all attributes of an object, and all attributes
13661 reachable from the object via its class, and from its class's base
13662 classes, and so on from them too. Example: in 2.2a2, dir([]) returned
13663 an empty list. In 2.2a3,
13664
13665 >>> dir([])
13666 ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
13667 '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
13668 '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
13669 '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
13670 '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
13671 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
13672 'reverse', 'sort']
13673
13674 dir(module) continues to return only the module's attributes, though.
13675
13676- Overflowing operations on plain ints now return a long int rather
13677 than raising OverflowError. This is a partial implementation of PEP
13678 237. You can use -Wdefault::OverflowWarning to enable a warning for
13679 this situation, and -Werror::OverflowWarning to revert to the old
13680 OverflowError exception.
13681
13682- A new command line option, -Q<arg>, is added to control run-time
13683 warnings for the use of classic division. (See PEP 238.) Possible
13684 values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
13685 -Qold, meaning the / operator has its classic meaning and no
13686 warnings are issued. Using -Qwarn issues a run-time warning about
13687 all uses of classic division for int and long arguments; -Qwarnall
13688 also warns about classic division for float and complex arguments
13689 (for use with fixdiv.py).
13690 [Note: the remainder of this item (preserved below) became
13691 obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
13692
13693 Using -Qnew is questionable; it turns on new division by default, but
13694 only in the __main__ module. You can usefully combine -Qwarn or
13695 -Qwarnall and -Qnew: this gives the __main__ module new division, and
13696 warns about classic division everywhere else.
13697
13698- Many built-in types can now be subclassed. This applies to int,
13699 long, float, str, unicode, and tuple. (The types complex, list and
13700 dictionary can also be subclassed; this was introduced earlier.)
13701 Note that restrictions apply when subclassing immutable built-in
13702 types: you can only affect the value of the instance by overloading
13703 __new__. You can add mutable attributes, and the subclass instances
13704 will have a __dict__ attribute, but you cannot change the "value"
13705 (as implemented by the base class) of an immutable subclass instance
13706 once it is created.
13707
13708- The dictionary constructor now takes an optional argument, a
13709 mapping-like object, and initializes the dictionary from its
13710 (key, value) pairs.
13711
13712- A new built-in type, super, has been added. This facilitates making
13713 "cooperative super calls" in a multiple inheritance setting. For an
13714 explanation, see http://www.python.org/2.2/descrintro.html#cooperation
13715
13716- A new built-in type, property, has been added. This enables the
13717 creation of "properties". These are attributes implemented by
13718 getter and setter functions (or only one of these for read-only or
13719 write-only attributes), without the need to override __getattr__.
13720 See http://www.python.org/2.2/descrintro.html#property
13721
13722- The syntax of floating-point and imaginary literals has been
13723 liberalized, to allow leading zeroes. Examples of literals now
13724 legal that were SyntaxErrors before:
13725
13726 00.0 0e3 0100j 07.5 00000000000000000008.
13727
13728- An old tokenizer bug allowed floating point literals with an incomplete
13729 exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
13730
13731Library
13732-------
13733
13734- telnetlib includes symbolic names for the options, and support for
13735 setting an option negotiation callback. It also supports processing
13736 of suboptions.
13737
13738- The new C standard no longer requires that math libraries set errno to
13739 ERANGE on overflow. For platform libraries that exploit this new
13740 freedom, Python's overflow-checking was wholly broken. A new overflow-
13741 checking scheme attempts to repair that, but may not be reliable on all
13742 platforms (C doesn't seem to provide anything both useful and portable
13743 in this area anymore).
13744
13745- Asynchronous timeout actions are available through the new class
13746 threading.Timer.
13747
13748- math.log and math.log10 now return sensible results for even huge
13749 long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
13750
13751- A new function, imp.lock_held(), returns 1 when the import lock is
13752 currently held. See the docs for the imp module.
13753
13754- pickle, cPickle and marshal on 32-bit platforms can now correctly read
13755 dumps containing ints written on platforms where Python ints are 8 bytes.
13756 When read on a box where Python ints are 4 bytes, such values are
13757 converted to Python longs.
13758
13759- In restricted execution mode (using the rexec module), unmarshalling
13760 code objects is no longer allowed. This plugs a security hole.
13761
13762- unittest.TestResult instances no longer store references to tracebacks
13763 generated by test failures. This prevents unexpected dangling references
13764 to objects that should be garbage collected between tests.
13765
13766Tools
13767-----
13768
13769- Tools/scripts/fixdiv.py has been added which can be used to fix
13770 division operators as per PEP 238.
13771
13772Build
13773-----
13774
13775- If you are an adventurous person using Mac OS X you may want to look at
13776 Mac/OSX. There is a Makefile there that will build Python as a real Mac
13777 application, which can be used for experimenting with Carbon or Cocoa.
13778 Discussion of this on pythonmac-sig, please.
13779
13780C API
13781-----
13782
13783- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
13784
13785- Note that PyLong_AsDouble can fail! This has always been true, but no
13786 callers checked for it. It's more likely to fail now, because overflow
13787 errors are properly detected now. The proper way to check::
13788
13789 double x = PyLong_AsDouble(some_long_object);
13790 if (x == -1.0 && PyErr_Occurred()) {
13791 /* The conversion failed. */
13792 }
13793
13794- The GC API has been changed. Extensions that use the old API will still
13795 compile but will not participate in GC. To upgrade an extension
13796 module:
13797
13798 - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
13799
13800 - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
13801 PyObject_GC_Del to deallocate them
13802
13803 - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
13804 to PyObject_GC_UnTrack
13805
13806 - remove PyGC_HEAD_SIZE from object size calculations
13807
13808 - remove calls to PyObject_AS_GC and PyObject_FROM_GC
13809
13810- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
13811 These can be used safely to construct string objects from a
13812 sprintf-style format string (similar to the format string supported
13813 by PyErr_Format()).
13814
13815New platforms
13816-------------
13817
13818- Stephen Hansen contributed patches sufficient to get a clean compile
13819 under Borland C (Windows), but he reports problems running it and ran
13820 out of time to complete the port. Volunteers? Expect a MemoryError
13821 when importing the types module; this is probably shallow, and
13822 causing later failures too.
13823
13824Tests
13825-----
13826
13827Windows
13828-------
13829
13830- Large file support is now enabled on Win32 platforms as well as on
13831 Win64. This means that, for example, you can use f.tell() and f.seek()
13832 to manipulate files larger than 2 gigabytes (provided you have enough
13833 disk space, and are using a Windows filesystem that supports large
13834 partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
13835 filesize limit, and large file support makes no difference there.
13836 FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
13837 NTFS has no practical limit on file size, and files of any size can be
13838 used from Python now.
13839
13840- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
13841 points to command.com (patch from Brian Quinlan).
13842
13843
13844What's New in Python 2.2a2?
13845===========================
13846
13847*Release Date: 22-Aug-2001*
13848
13849Build
13850-----
13851
13852- Tim Peters developed a brand new Windows installer using Wise 8.1,
13853 generously donated to us by Wise Solutions.
13854
13855- configure supports a new option --enable-unicode, with the values
13856 ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
13857 type and supporting code is completely removed from the interpreter.
13858
13859- A new configure option --enable-framework builds a Mac OS X framework,
13860 which "make frameworkinstall" will install. This provides a starting
13861 point for more mac-like functionality, join pythonmac-sig@python.org
13862 if you are interested in helping.
13863
13864- The NeXT platform is no longer supported.
13865
13866- The 'new' module is now statically linked.
13867
13868Tools
13869-----
13870
13871- The new Tools/scripts/cleanfuture.py can be used to automatically
13872 edit out obsolete future statements from Python source code. See
13873 the module docstring for details.
13874
13875Tests
13876-----
13877
13878- regrtest.py now knows which tests are expected to be skipped on some
13879 platforms, allowing to give clearer test result output. regrtest
13880 also has optional --use/-u switch to run normally disabled tests
13881 which require network access or consume significant disk resources.
13882
13883- Several new tests in the standard test suite, with special thanks to
13884 Nick Mathewson.
13885
13886Core
13887----
13888
13889- The floor division operator // has been added as outlined in PEP
13890 238. The / operator still provides classic division (and will until
13891 Python 3.0) unless "from __future__ import division" is included, in
13892 which case the / operator will provide true division. The operator
13893 module provides truediv() and floordiv() functions. Augmented
13894 assignment variants are included, as are the equivalent overloadable
13895 methods and C API methods. See the PEP for a full discussion:
13896 <http://python.sf.net/peps/pep-0238.html>
13897
13898- Future statements are now effective in simulated interactive shells
13899 (like IDLE). This should "just work" by magic, but read Michael
13900 Hudson's "Future statements in simulated shells" PEP 264 for full
13901 details: <http://python.sf.net/peps/pep-0264.html>.
13902
13903- The type/class unification (PEP 252-253) was integrated into the
13904 trunk and is not so tentative any more (the exact specification of
13905 some features is still tentative). A lot of work has done on fixing
13906 bugs and adding robustness and features (performance still has to
13907 come a long way).
13908
13909- Warnings about a mismatch in the Python API during extension import
13910 now use the Python warning framework (which makes it possible to
13911 write filters for these warnings).
13912
13913- A function's __dict__ (aka func_dict) will now always be a
13914 dictionary. It used to be possible to delete it or set it to None,
13915 but now both actions raise TypeErrors. It is still legal to set it
13916 to a dictionary object. Getting func.__dict__ before any attributes
13917 have been assigned now returns an empty dictionary instead of None.
13918
13919- A new command line option, -E, was added which disables the use of
13920 all environment variables, or at least those that are specifically
13921 significant to Python. Usually those have a name starting with
13922 "PYTHON". This was used to fix a problem where the tests fail if
13923 the user happens to have PYTHONHOME or PYTHONPATH pointing to an
13924 older distribution.
13925
13926Library
13927-------
13928
13929- New class Differ and new functions ndiff() and restore() in difflib.py.
13930 These package the algorithms used by the popular Tools/scripts/ndiff.py,
13931 for programmatic reuse.
13932
13933- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
13934 value using the minimal quoting required for the value; more
13935 reliable than using xml.sax.saxutils.escape() for attribute values.
13936
13937- Readline completion support for cmd.Cmd was added.
13938
13939- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
13940
13941- Added function threading.BoundedSemaphore()
13942
13943- Added Ka-Ping Yee's cgitb.py module.
13944
13945- The 'new' module now exposes the CO_xxx flags.
13946
13947- The gc module offers the get_referents function.
13948
13949New platforms
13950-------------
13951
13952C API
13953-----
13954
13955- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
13956 which provide a cross-platform implementations for the
13957 relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
13958 the standard sprintf() and vsprintf() C lib APIs, these versions
13959 apply bounds checking on the used buffer which enhances protection
13960 against buffer overruns.
13961
13962- Unicode APIs now use name mangling to assure that mixing interpreters
13963 and extensions using different Unicode widths is rendered next to
13964 impossible. Trying to import an incompatible Unicode-aware extension
13965 will result in an ImportError. Unicode extensions writers must make
13966 sure to check the Unicode width compatibility in their extensions by
13967 using at least one of the mangled Unicode APIs in the extension.
13968
13969- Two new flags METH_NOARGS and METH_O are available in method definition
13970 tables to simplify implementation of methods with no arguments and a
13971 single untyped argument. Calling such methods is more efficient than
13972 calling corresponding METH_VARARGS methods. METH_OLDARGS is now
13973 deprecated.
13974
13975Windows
13976-------
13977
13978- "import module" now compiles module.pyw if it exists and nothing else
13979 relevant is found.
13980
13981
13982What's New in Python 2.2a1?
13983===========================
13984
13985*Release date: 18-Jul-2001*
13986
13987Core
13988----
13989
13990- TENTATIVELY, a large amount of code implementing much of what's
13991 described in PEP 252 (Making Types Look More Like Classes) and PEP
13992 253 (Subtyping Built-in Types) was added. This will be released
13993 with Python 2.2a1. Documentation will be provided separately
13994 through http://www.python.org/2.2/. The purpose of releasing this
13995 with Python 2.2a1 is to test backwards compatibility. It is
13996 possible, though not likely, that a decision is made not to release
13997 this code as part of 2.2 final, if any serious backwards
13998 incompatibilities are found during alpha testing that cannot be
13999 repaired.
14000
14001- Generators were added; this is a new way to create an iterator (see
14002 below) using what looks like a simple function containing one or
14003 more 'yield' statements. See PEP 255. Since this adds a new
14004 keyword to the language, this feature must be enabled by including a
14005 future statement: "from __future__ import generators" (see PEP 236).
14006 Generators will become a standard feature in a future release
14007 (probably 2.3). Without this future statement, 'yield' remains an
14008 ordinary identifier, but a warning is issued each time it is used.
14009 (These warnings currently don't conform to the warnings framework of
14010 PEP 230; we intend to fix this in 2.2a2.)
14011
14012- The UTF-16 codec was modified to be more RFC compliant. It will now
14013 only remove BOM characters at the start of the string and then
14014 only if running in native mode (UTF-16-LE and -BE won't remove a
14015 leading BMO character).
14016
14017- Strings now have a new method .decode() to complement the already
14018 existing .encode() method. These two methods provide direct access
14019 to the corresponding decoders and encoders of the registered codecs.
14020
14021 To enhance the usability of the .encode() method, the special
14022 casing of Unicode object return values was dropped (Unicode objects
14023 were auto-magically converted to string using the default encoding).
14024
14025 Both methods will now return whatever the codec in charge of the
14026 requested encoding returns as object, e.g. Unicode codecs will
14027 return Unicode objects when decoding is requested ("äöü".decode("latin-1")
14028 will return u"äöü"). This enables codec writer to create codecs
14029 for various simple to use conversions.
14030
14031 New codecs were added to demonstrate these new features (the .encode()
14032 and .decode() columns indicate the type of the returned objects):
14033
14034 +---------+-----------+-----------+-----------------------------+
14035 |Name | .encode() | .decode() | Description |
14036 +=========+===========+===========+=============================+
14037 |uu | string | string | UU codec (e.g. for email) |
14038 +---------+-----------+-----------+-----------------------------+
14039 |base64 | string | string | base64 codec |
14040 +---------+-----------+-----------+-----------------------------+
14041 |quopri | string | string | quoted-printable codec |
14042 +---------+-----------+-----------+-----------------------------+
14043 |zlib | string | string | zlib compression |
14044 +---------+-----------+-----------+-----------------------------+
14045 |hex | string | string | 2-byte hex codec |
14046 +---------+-----------+-----------+-----------------------------+
14047 |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
14048 +---------+-----------+-----------+-----------------------------+
14049
14050- Some operating systems now support the concept of a default Unicode
14051 encoding for file system operations. Notably, Windows supports 'mbcs'
14052 as the default. The Macintosh will also adopt this concept in the medium
14053 term, although the default encoding for that platform will be other than
14054 'mbcs'.
14055
14056 On operating system that support non-ASCII filenames, it is common for
14057 functions that return filenames (such as os.listdir()) to return Python
14058 string objects pre-encoded using the default file system encoding for
14059 the platform. As this encoding is likely to be different from Python's
14060 default encoding, converting this name to a Unicode object before passing
14061 it back to the Operating System would result in a Unicode error, as Python
14062 would attempt to use its default encoding (generally ASCII) rather than
14063 the default encoding for the file system.
14064
14065 In general, this change simply removes surprises when working with
14066 Unicode and the file system, making these operations work as you expect,
14067 increasing the transparency of Unicode objects in this context.
14068 See [????] for more details, including examples.
14069
14070- Float (and complex) literals in source code were evaluated to full
14071 precision only when running from a .py file; the same code loaded from a
14072 .pyc (or .pyo) file could suffer numeric differences starting at about the
14073 12th significant decimal digit. For example, on a machine with IEEE-754
14074 floating arithmetic,
14075
14076 x = 9007199254740992.0
14077 print long(x)
14078
14079 printed 9007199254740992 if run directly from .py, but 9007199254740000
14080 if from a compiled (.pyc or .pyo) file. This was due to marshal using
14081 str(float) instead of repr(float) when building code objects. marshal
14082 now uses repr(float) instead, which should reproduce floats to full
14083 machine precision (assuming the platform C float<->string I/O conversion
14084 functions are of good quality).
14085
14086 This may cause floating-point results to change in some cases, and
14087 usually for the better, but may also cause numerically unstable
14088 algorithms to break.
14089
14090- The implementation of dicts suffers fewer collisions, which has speed
14091 benefits. However, the order in which dict entries appear in dict.keys(),
14092 dict.values() and dict.items() may differ from previous releases for a
14093 given dict. Nothing is defined about this order, so no program should
14094 rely on it. Nevertheless, it's easy to write test cases that rely on the
14095 order by accident, typically because of printing the str() or repr() of a
14096 dict to an "expected results" file. See Lib/test/test_support.py's new
14097 sortdict(dict) function for a simple way to display a dict in sorted
14098 order.
14099
14100- Many other small changes to dicts were made, resulting in faster
14101 operation along the most common code paths.
14102
14103- Dictionary objects now support the "in" operator: "x in dict" means
14104 the same as dict.has_key(x).
14105
14106- The update() method of dictionaries now accepts generic mapping
14107 objects. Specifically the argument object must support the .keys()
14108 and __getitem__() methods. This allows you to say, for example,
14109 {}.update(UserDict())
14110
14111- Iterators were added; this is a generalized way of providing values
14112 to a for loop. See PEP 234. There's a new built-in function iter()
14113 to return an iterator. There's a new protocol to get the next value
14114 from an iterator using the next() method (in Python) or the
14115 tp_iternext slot (in C). There's a new protocol to get iterators
14116 using the __iter__() method (in Python) or the tp_iter slot (in C).
14117 Iterating (i.e. a for loop) over a dictionary generates its keys.
14118 Iterating over a file generates its lines.
14119
14120- The following functions were generalized to work nicely with iterator
14121 arguments::
14122
14123 map(), filter(), reduce(), zip()
14124 list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
14125 max(), min()
14126 join() method of strings
14127 extend() method of lists
14128 'x in y' and 'x not in y' (PySequence_Contains() in C API)
14129 operator.countOf() (PySequence_Count() in C API)
14130 right-hand side of assignment statements with multiple targets, such as ::
14131 x, y, z = some_iterable_object_returning_exactly_3_values
14132
14133- Accessing module attributes is significantly faster (for example,
14134 random.random or os.path or yourPythonModule.yourAttribute).
14135
14136- Comparing dictionary objects via == and != is faster, and now works even
14137 if the keys and values don't support comparisons other than ==.
14138
14139- Comparing dictionaries in ways other than == and != is slower: there were
14140 insecurities in the dict comparison implementation that could cause Python
14141 to crash if the element comparison routines for the dict keys and/or
14142 values mutated the dicts. Making the code bulletproof slowed it down.
14143
14144- Collisions in dicts are resolved via a new approach, which can help
14145 dramatically in bad cases. For example, looking up every key in a dict
14146 d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
14147 faster now. Thanks to Christian Tismer for pointing out the cause and
14148 the nature of an effective cure (last December! better late than never).
14149
14150- repr() is much faster for large containers (dict, list, tuple).
14151
14152
14153Library
14154-------
14155
14156- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
14157 were added to the string module. These a locale-independent
14158 constants, unlike letters, lowercase, and uppercase. These are now
14159 use in appropriate locations in the standard library.
14160
14161- The flags used in dlopen calls can now be configured using
14162 sys.setdlopenflags and queried using sys.getdlopenflags.
14163
14164- Fredrik Lundh's xmlrpclib is now a standard library module. This
14165 provides full client-side XML-RPC support. In addition,
14166 Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
14167 one asyncore-based). Thanks to Eric Raymond for the documentation.
14168
14169- The xrange() object is simplified: it no longer supports slicing,
14170 repetition, comparisons, efficient 'in' checking, the tolist()
14171 method, or the start, stop and step attributes. See PEP 260.
14172
14173- A new function fnmatch.filter to filter lists of file names was added.
14174
14175- calendar.py uses month and day names based on the current locale.
14176
14177- strop is now *really* obsolete (this was announced before with 1.6),
14178 and issues DeprecationWarning when used (except for the four items
14179 that are still imported into string.py).
14180
14181- Cookie.py now sorts key+value pairs by key in output strings.
14182
14183- pprint.isrecursive(object) didn't correctly identify recursive objects.
14184 Now it does.
14185
14186- pprint functions now much faster for large containers (tuple, list, dict).
14187
14188- New 'q' and 'Q' format codes in the struct module, corresponding to C
14189 types "long long" and "unsigned long long" (on Windows, __int64). In
14190 native mode, these can be used only when the platform C compiler supports
14191 these types (when HAVE_LONG_LONG is #define'd by the Python config
14192 process), and then they inherit the sizes and alignments of the C types.
14193 In standard mode, 'q' and 'Q' are supported on all platforms, and are
14194 8-byte integral types.
14195
14196- The site module installs a new built-in function 'help' that invokes
14197 pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
14198 it displays a message reminding the user to use 'help()' or
14199 'help(object)'.
14200
14201Tests
14202-----
14203
14204- New test_mutants.py runs dict comparisons where the key and value
14205 comparison operators mutate the dicts randomly during comparison. This
14206 rapidly causes Python to crash under earlier releases (not for the faint
14207 of heart: it can also cause Win9x to freeze or reboot!).
14208
14209- New test_pprint.py verifies that pprint.isrecursive() and
14210 pprint.isreadable() return sensible results. Also verifies that simple
14211 cases produce correct output.
14212
14213C API
14214-----
14215
14216- Removed the unused last_is_sticky argument from the internal
14217 _PyTuple_Resize(). If this affects you, you were cheating.
14218
Skip Montanaro4cb22042002-09-17 20:55:31 +000014219What's New in Python 2.1 (final)?
14220=================================
14221
14222We only changed a few things since the last release candidate, all in
14223Python library code:
14224
14225- A bug in the locale module was fixed that affected locales which
14226 define no grouping for numeric formatting.
14227
14228- A few bugs in the weakref module's implementations of weak
14229 dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
14230 and the test suite was updated to check for these bugs.
14231
14232- An old bug in the os.path.walk() function (introduced in Python
14233 2.0!) was fixed: a non-existent file would cause an exception
14234 instead of being ignored.
14235
14236- Fixed a few bugs in the new symtable module found by Neil Norwitz's
14237 PyChecker.
14238
14239
14240What's New in Python 2.1c2?
14241===========================
14242
14243A flurry of small changes, and one showstopper fixed in the nick of
14244time made it necessary to release another release candidate. The list
14245here is the *complete* list of patches (except version updates):
14246
14247Core
14248
14249- Tim discovered a nasty bug in the dictionary code, caused by
14250 PyDict_Next() calling dict_resize(), and the GC code's use of
14251 PyDict_Next() violating an assumption in dict_items(). This was
14252 fixed with considerable amounts of band-aid, but the net effect is a
14253 saner and more robust implementation.
14254
14255- Made a bunch of symbols static that were accidentally global.
14256
14257Build and Ports
14258
14259- The setup.py script didn't check for a new enough version of zlib
14260 (1.1.3 is needed). Now it does.
14261
14262- Changed "make clean" target to also remove shared libraries.
14263
14264- Added a more general warning about the SGI Irix optimizer to README.
14265
14266Library
14267
14268- Fix a bug in urllib.basejoin("http://host", "../file.html") which
14269 omitted the slash between host and file.html.
14270
14271- The mailbox module's _Mailbox class contained a completely broken
14272 and undocumented seek() method. Ripped it out.
14273
14274- Fixed a bunch of typos in various library modules (urllib2, smtpd,
14275 sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
14276
14277- Fixed a few last-minute bugs in unittest.
14278
14279Extensions
14280
14281- Reverted the patch to the OpenSSL code in socketmodule.c to support
14282 RAND_status() and the EGD, and the subsequent patch that tried to
14283 fix it for pre-0.9.5 versions; the problem with the patch is that on
14284 some systems it issues a warning whenever socket is imported, and
14285 that's unacceptable.
14286
14287Tests
14288
14289- Fixed the pickle tests to work with "import test.test_pickle".
14290
14291- Tweaked test_locale.py to actually run the test Windows.
14292
14293- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
14294 not "wb" (which is not a valid mode at all).
14295
14296- Fix pstats browser crashes. Import readline if it exists to make
14297 the user interface nicer.
14298
14299- Add "import thread" to the top of test modules that import the
14300 threading module (test_asynchat and test_threadedtempfile). This
14301 prevents test failures caused by a broken threading module resulting
14302 from a previously caught failed import.
14303
14304- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
14305 needed on some platforms (e.g. Solaris 8) when the tests are run
14306 twice in succession.
14307
14308- Skip rather than fail test_sunaudiodev if no audio device is found.
14309
14310
14311What's New in Python 2.1c1?
14312===========================
14313
14314This list was significantly updated when 2.1c2 was released; the 2.1c1
14315release didn't mention most changes that were actually part of 2.1c1:
14316
14317Legal
14318
14319- Copyright was assigned to the Python Software Foundation (PSF) and a
14320 PSF license (very similar to the CNRI license) was added.
14321
14322- The CNRI copyright notice was updated to include 2001.
14323
14324Core
14325
14326- After a public outcry, assignment to __debug__ is no longer illegal;
14327 instead, a warning is issued. It will become illegal in 2.2.
14328
14329- Fixed a core dump with "%#x" % 0, and changed the semantics so that
14330 "%#x" now always prepends "0x", even if the value is zero.
14331
14332- Fixed some nits in the bytecode compiler.
14333
14334- Fixed core dumps when calling certain kinds of non-functions.
14335
14336- Fixed various core dumps caused by reference count bugs.
14337
14338Build and Ports
14339
14340- Use INSTALL_SCRIPT to install script files.
14341
14342- New port: SCO Unixware 7, by Billy G. Allie.
14343
14344- Updated RISCOS port.
14345
14346- Updated BeOS port and notes.
14347
14348- Various other porting problems resolved.
14349
14350Library
14351
14352- The TERMIOS and SOCKET modules are now truly obsolete and
14353 unnecessary. Their symbols are incorporated in the termios and
14354 socket modules.
14355
14356- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
14357 better tests for pickling.
14358
14359- threading: make Condition.wait() robust against KeyboardInterrupt.
14360
14361- zipfile: add support to zipfile to support opening an archive
14362 represented by an open file rather than a file name. Fix bug where
14363 the archive was not properly closed. Fixed a bug in this bugfix
14364 where flush() was called for a read-only file.
14365
14366- imputil: added an uninstall() method to the ImportManager.
14367
14368- Canvas: fixed bugs in lower() and tkraise() methods.
14369
14370- SocketServer: API change (added overridable close_request() method)
14371 so that the TCP server can explicitly close the request.
14372
14373- pstats: Eric Raymond added a simple interactive statistics browser,
14374 invoked when the module is run as a script.
14375
14376- locale: fixed a problem in format().
14377
14378- webbrowser: made it work when the BROWSER environment variable has a
14379 value like "/usr/bin/netscape". Made it auto-detect Konqueror for
14380 KDE 2. Fixed some other nits.
14381
14382- unittest: changes to allow using a different exception than
14383 AssertionError, and added a few more function aliases. Some other
14384 small changes.
14385
14386- urllib, urllib2: fixed redirect problems and a coupleof other nits.
14387
14388- asynchat: fixed a critical bug in asynchat that slipped through the
14389 2.1b2 release. Fixed another rare bug.
14390
14391- Fix some unqualified except: clauses (always a bad code example).
14392
14393XML
14394
14395- pyexpat: new API get_version_string().
14396
14397- Fixed some minidom bugs.
14398
14399Extensions
14400
14401- Fixed a core dump in _weakref. Removed the weakref.mapping()
14402 function (it adds nothing to the API).
14403
14404- Rationalized the use of header files in the readline module, to make
14405 it compile (albeit with some warnings) with the very recent readline
14406 4.2, without breaking for earlier versions.
14407
14408- Hopefully fixed a buffering problem in linuxaudiodev.
14409
14410- Attempted a fix to make the OpenSSL support in the socket module
14411 work again with pre-0.9.5 versions of OpenSSL.
14412
14413Tests
14414
14415- Added a test case for asynchat and asyncore.
14416
14417- Removed coupling between tests where one test failing could break
14418 another.
14419
14420Tools
14421
14422- Ping added an interactive help browser to pydoc, fixed some nits
14423 in the rest of the pydoc code, and added some features to his
14424 inspect module.
14425
14426- An updated python-mode.el version 4.1 which integrates Ken
14427 Manheimer's pdbtrack.el. This makes debugging Python code via pdb
14428 much nicer in XEmacs and Emacs. When stepping through your program
14429 with pdb, in either the shell window or the *Python* window, the
14430 source file and line will be tracked by an arrow. Very cool!
14431
14432- IDLE: syntax warnings in interactive mode are changed into errors.
14433
14434- Some improvements to Tools/webchecker (ignore some more URL types,
14435 follow some more links).
14436
14437- Brought the Tools/compiler package up to date.
14438
14439
14440What's New in Python 2.1 beta 2?
14441================================
14442
14443(Unlisted are many fixed bugs, more documentation, etc.)
14444
14445Core language, builtins, and interpreter
14446
14447- The nested scopes work (enabled by "from __future__ import
14448 nested_scopes") is completed; in particular, the future now extends
14449 into code executed through exec, eval() and execfile(), and into the
14450 interactive interpreter.
14451
14452- When calling a base class method (e.g. BaseClass.__init__(self)),
14453 this is now allowed even if self is not strictly spoken a class
14454 instance (e.g. when using metaclasses or the Don Beaudry hook).
14455
14456- Slice objects are now comparable but not hashable; this prevents
14457 dict[:] from being accepted but meaningless.
14458
14459- Complex division is now calculated using less braindead algorithms.
14460 This doesn't change semantics except it's more likely to give useful
14461 results in extreme cases. Complex repr() now uses full precision
14462 like float repr().
14463
14464- sgmllib.py now calls handle_decl() for simple <!...> declarations.
14465
14466- It is illegal to assign to the name __debug__, which is set when the
14467 interpreter starts. It is effectively a compile-time constant.
14468
14469- A warning will be issued if a global statement for a variable
14470 follows a use or assignment of that variable.
14471
14472Standard library
14473
14474- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
14475 inspired by JUnit), is now part of the standard library. You now
14476 have a choice of two testing frameworks: unittest requires you to
14477 write testcases as separate code, doctest gathers them from
14478 docstrings. Both approaches have their advantages and
14479 disadvantages.
14480
14481- A new module Tix was added, which wraps the Tix extension library
14482 for Tk. With that module, it is not necessary to statically link
14483 Tix with _tkinter, since Tix will be loaded with Tcl's "package
14484 require" command. See Demo/tix/.
14485
14486- tzparse.py is now obsolete.
14487
14488- In gzip.py, the seek() and tell() methods are removed -- they were
14489 non-functional anyway, and it's better if callers can test for their
14490 existence with hasattr().
14491
14492Python/C API
14493
14494- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
14495 that's already in the dictionary during a PyDict_Next() iteration.
14496 This used to fail occasionally when a dictionary resize operation
14497 could be triggered that would rehash all the keys. All other
14498 modifications to the dictionary are still off-limits during a
14499 PyDict_Next() iteration!
14500
14501- New extended APIs related to passing compiler variables around.
14502
14503- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
14504 implement isinstance() and issubclass().
14505
14506- Py_BuildValue() now has a "D" conversion to create a Python complex
14507 number from a Py_complex C value.
14508
14509- Extensions types which support weak references must now set the
14510 field allocated for the weak reference machinery to NULL themselves;
14511 this is done to avoid the cost of checking each object for having a
14512 weakly referencable type in PyObject_INIT(), since most types are
14513 not weakly referencable.
14514
14515- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
14516 free variables and cell variables to and from the frame's f_locals.
14517
14518- Variants of several functions defined in pythonrun.h have been added
14519 to support the nested_scopes future statement. The variants all end
14520 in Flags and take an extra argument, a PyCompilerFlags *; examples:
14521 PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
14522 variants may be removed in Python 2.2, when nested scopes are
14523 mandatory.
14524
14525Distutils
14526
14527- the sdist command now writes a PKG-INFO file, as described in PEP 241,
14528 into the release tree.
14529
14530- several enhancements to the bdist_wininst command from Thomas Heller
14531 (an uninstaller, more customization of the installer's display)
14532
14533- from Jack Jansen: added Mac-specific code to generate a dialog for
14534 users to specify the command-line (because providing a command-line with
14535 MacPython is awkward). Jack also made various fixes for the Mac
14536 and the Metrowerks compiler.
14537
14538- added 'platforms' and 'keywords' to the set of metadata that can be
14539 specified for a distribution.
14540
14541- applied patches from Jason Tishler to make the compiler class work with
14542 Cygwin.
14543
14544
14545What's New in Python 2.1 beta 1?
14546================================
14547
14548Core language, builtins, and interpreter
14549
14550- Following an outcry from the community about the amount of code
14551 broken by the nested scopes feature introduced in 2.1a2, we decided
14552 to make this feature optional, and to wait until Python 2.2 (or at
14553 least 6 months) to make it standard. The option can be enabled on a
14554 per-module basis by adding "from __future__ import nested_scopes" at
14555 the beginning of a module (before any other statements, but after
14556 comments and an optional docstring). See PEP 236 (Back to the
14557 __future__) for a description of the __future__ statement. PEP 227
14558 (Statically Nested Scopes) has been updated to reflect this change,
14559 and to clarify the semantics in a number of endcases.
14560
14561- The nested scopes code, when enabled, has been hardened, and most
14562 bugs and memory leaks in it have been fixed.
14563
14564- Compile-time warnings are now generated for a number of conditions
14565 that will break or change in meaning when nested scopes are enabled:
14566
14567 - Using "from...import *" or "exec" without in-clause in a function
14568 scope that also defines a lambda or nested function with one or
14569 more free (non-local) variables. The presence of the import* or
14570 bare exec makes it impossible for the compiler to determine the
14571 exact set of local variables in the outer scope, which makes it
14572 impossible to determine the bindings for free variables in the
14573 inner scope. To avoid the warning about import *, change it into
14574 an import of explicitly name object, or move the import* statement
14575 to the global scope; to avoid the warning about bare exec, use
14576 exec...in... (a good idea anyway -- there's a possibility that
14577 bare exec will be deprecated in the future).
14578
14579 - Use of a global variable in a nested scope with the same name as a
14580 local variable in a surrounding scope. This will change in
14581 meaning with nested scopes: the name in the inner scope will
14582 reference the variable in the outer scope rather than the global
14583 of the same name. To avoid the warning, either rename the outer
14584 variable, or use a global statement in the inner function.
14585
14586- An optional object allocator has been included. This allocator is
14587 optimized for Python objects and should be faster and use less memory
14588 than the standard system allocator. It is not enabled by default
14589 because of possible thread safety problems. The allocator is only
14590 protected by the Python interpreter lock and it is possible that some
14591 extension modules require a thread safe allocator. The object
14592 allocator can be enabled by providing the "--with-pymalloc" option to
14593 configure.
14594
14595Standard library
14596
14597- pyexpat now detects the expat version if expat.h defines it. A
14598 number of additional handlers are provided, which are only available
14599 since expat 1.95. In addition, the methods SetParamEntityParsing and
14600 GetInputContext of Parser objects are available with 1.95.x
14601 only. Parser objects now provide the ordered_attributes and
14602 specified_attributes attributes. A new module expat.model was added,
14603 which offers a number of additional constants if 1.95.x is used.
14604
14605- xml.dom offers the new functions registerDOMImplementation and
14606 getDOMImplementation.
14607
14608- xml.dom.minidom offers a toprettyxml method. A number of DOM
14609 conformance issues have been resolved. In particular, Element now
14610 has an hasAttributes method, and the handling of namespaces was
14611 improved.
14612
14613- Ka-Ping Yee contributed two new modules: inspect.py, a module for
14614 getting information about live Python code, and pydoc.py, a module
14615 for interactively converting docstrings to HTML or text.
14616 Tools/scripts/pydoc, which is now automatically installed into
14617 <prefix>/bin, uses pydoc.py to display documentation; try running
14618 "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
14619 lets you browse the module docstrings using a web browser.
14620
14621- New library module difflib.py, primarily packaging the SequenceMatcher
14622 class at the heart of the popular ndiff.py file-comparison tool.
14623
14624- doctest.py (a framework for verifying Python code examples in docstrings)
14625 is now part of the std library.
14626
14627Windows changes
14628
14629- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
14630 small GUI that lets you browse the module docstrings using your
14631 default web browser.
14632
14633- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
14634 Platforms) is implemented. See
14635
14636 http://python.sourceforge.net/peps/pep-0235.html
14637
14638 for full details, especially the "Current Lower-Left Semantics" section.
14639 The new Windows import rules are simpler than before:
14640
14641 A. If the PYTHONCASEOK environment variable exists, same as
14642 before: silently accept the first case-insensitive match of any
14643 kind; raise ImportError if none found.
14644
14645 B. Else search sys.path for the first case-sensitive match; raise
14646 ImportError if none found.
14647
14648 The same rules have been implemented on other platforms with case-
14649 insensitive but case-preserving filesystems too (including Cygwin, and
14650 several flavors of Macintosh operating systems).
14651
14652- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
14653 what it's supposed to do (and does do under NT and 2000) via direct
14654 port manipulation. It's unknown whether this will work on all systems,
14655 but it does work on my Win98SE systems now and was known to be useless on
14656 all Win9x systems before.
14657
14658- Build: Subproject _test (effectively) renamed to _testcapi.
14659
14660New platforms
14661
14662- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
14663 Thanks to Steven Majewski!
14664
14665- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
14666 Tishler!
14667
14668- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
14669 Schwertberger! See RISCOS/README for more information -- it seems
14670 that because of the bizarre filename conventions on RISCOS, no port
14671 to that platform is easy.
14672
14673
14674What's New in Python 2.1 alpha 2?
14675=================================
14676
14677Core language, builtins, and interpreter
14678
14679- Scopes nest. If a name is used in a function or class, but is not
14680 local, the definition in the nearest enclosing function scope will
14681 be used. One consequence of this change is that lambda statements
14682 could reference variables in the namespaces where the lambda is
14683 defined. In some unusual cases, this change will break code.
14684
14685 In all previous version of Python, names were resolved in exactly
14686 three namespaces -- the local namespace, the global namespace, and
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014687 the builtins namespace. According to this old definition, if a
Skip Montanaro4cb22042002-09-17 20:55:31 +000014688 function A is defined within a function B, the names bound in B are
14689 not visible in A. The new rules make names bound in B visible in A,
14690 unless A contains a name binding that hides the binding in B.
14691
14692 Section 4.1 of the reference manual describes the new scoping rules
14693 in detail. The test script in Lib/test/test_scope.py demonstrates
14694 some of the effects of the change.
14695
14696 The new rules will cause existing code to break if it defines nested
14697 functions where an outer function has local variables with the same
14698 name as globals or builtins used by the inner function. Example:
14699
14700 def munge(str):
14701 def helper(x):
14702 return str(x)
14703 if type(str) != type(''):
14704 str = helper(str)
14705 return str.strip()
14706
14707 Under the old rules, the name str in helper() is bound to the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014708 built-in function str(). Under the new rules, it will be bound to
Skip Montanaro4cb22042002-09-17 20:55:31 +000014709 the argument named str and an error will occur when helper() is
14710 called.
14711
14712- The compiler will report a SyntaxError if "from ... import *" occurs
14713 in a function or class scope. The language reference has documented
14714 that this case is illegal, but the compiler never checked for it.
14715 The recent introduction of nested scope makes the meaning of this
14716 form of name binding ambiguous. In a future release, the compiler
14717 may allow this form when there is no possibility of ambiguity.
14718
14719- repr(string) is easier to read, now using hex escapes instead of octal,
14720 and using \t, \n and \r instead of \011, \012 and \015 (respectively):
14721
14722 >>> "\texample \r\n" + chr(0) + chr(255)
14723 '\texample \r\n\x00\xff' # in 2.1
14724 '\011example \015\012\000\377' # in 2.0
14725
14726- Functions are now compared and hashed by identity, not by value, since
14727 the func_code attribute is writable.
14728
14729- Weak references (PEP 205) have been added. This involves a few
14730 changes in the core, an extension module (_weakref), and a Python
14731 module (weakref). The weakref module is the public interface. It
14732 includes support for "explicit" weak references, proxy objects, and
14733 mappings with weakly held values.
14734
14735- A 'continue' statement can now appear in a try block within the body
14736 of a loop. It is still not possible to use continue in a finally
14737 clause.
14738
14739Standard library
14740
14741- mailbox.py now has a new class, PortableUnixMailbox which is
14742 identical to UnixMailbox but uses a more portable scheme for
14743 determining From_ separators. Also, the constructors for all the
14744 classes in this module have a new optional `factory' argument, which
14745 is a callable used when new message classes must be instantiated by
14746 the next() method.
14747
14748- random.py is now self-contained, and offers all the functionality of
14749 the now-deprecated whrandom.py. See the docs for details. random.py
14750 also supports new functions getstate() and setstate(), for saving
14751 and restoring the internal state of the generator; and jumpahead(n),
14752 for quickly forcing the internal state to be the same as if n calls to
14753 random() had been made. The latter is particularly useful for multi-
14754 threaded programs, creating one instance of the random.Random() class for
14755 each thread, then using .jumpahead() to force each instance to use a
14756 non-overlapping segment of the full period.
14757
14758- random.py's seed() function is new. For bit-for-bit compatibility with
14759 prior releases, use the whseed function instead. The new seed function
14760 addresses two problems: (1) The old function couldn't produce more than
14761 about 2**24 distinct internal states; the new one about 2**45 (the best
14762 that can be done in the Wichmann-Hill generator). (2) The old function
14763 sometimes produced identical internal states when passed distinct
14764 integers, and there was no simple way to predict when that would happen;
14765 the new one guarantees to produce distinct internal states for all
14766 arguments in [0, 27814431486576L).
14767
14768- The socket module now supports raw packets on Linux. The socket
14769 family is AF_PACKET.
14770
14771- test_capi.py is a start at running tests of the Python C API. The tests
14772 are implemented by the new Modules/_testmodule.c.
14773
14774- A new extension module, _symtable, provides provisional access to the
14775 internal symbol table used by the Python compiler. A higher-level
14776 interface will be added on top of _symtable in a future release.
14777
14778- Removed the obsolete soundex module.
14779
14780- xml.dom.minidom now uses the standard DOM exceptions. Node supports
14781 the isSameNode method; NamedNodeMap the get method.
14782
14783- xml.sax.expatreader supports the lexical handler property; it
14784 generates comment, startCDATA, and endCDATA events.
14785
14786Windows changes
14787
14788- Build procedure: the zlib project is built in a different way that
14789 ensures the zlib header files used can no longer get out of synch with
14790 the zlib binary used. See PCbuild\readme.txt for details. Your old
14791 zlib-related directories can be deleted; you'll need to download fresh
14792 source for zlib and unpack it into a new directory.
14793
14794- Build: New subproject _test for the benefit of test_capi.py (see above).
14795
14796- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
14797 interface to some Python compiler internals).
14798
14799- Build: Subproject ucnhash is gone, since the code was folded into the
14800 unicodedata subproject.
14801
14802What's New in Python 2.1 alpha 1?
14803=================================
14804
14805Core language, builtins, and interpreter
14806
14807- There is a new Unicode companion to the PyObject_Str() API
14808 called PyObject_Unicode(). It behaves in the same way as the
14809 former, but assures that the returned value is an Unicode object
14810 (applying the usual coercion if necessary).
14811
14812- The comparison operators support "rich comparison overloading" (PEP
14813 207). C extension types can provide a rich comparison function in
14814 the new tp_richcompare slot in the type object. The cmp() function
14815 and the C function PyObject_Compare() first try the new rich
14816 comparison operators before trying the old 3-way comparison. There
14817 is also a new C API PyObject_RichCompare() (which also falls back on
14818 the old 3-way comparison, but does not constrain the outcome of the
14819 rich comparison to a Boolean result).
14820
14821 The rich comparison function takes two objects (at least one of
14822 which is guaranteed to have the type that provided the function) and
14823 an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
14824 Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
14825 object, which may be NotImplemented (in which case the tp_compare
14826 slot function is used as a fallback, if defined).
14827
14828 Classes can overload individual comparison operators by defining one
14829 or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
14830 __ge__. There are no explicit "reflected argument" versions of
14831 these; instead, __lt__ and __gt__ are each other's reflection,
14832 likewise for__le__ and __ge__; __eq__ and __ne__ are their own
14833 reflection (similar at the C level). No other implications are
14834 made; in particular, Python does not assume that == is the Boolean
14835 inverse of !=, or that < is the Boolean inverse of >=. This makes
14836 it possible to define types with partial orderings.
14837
14838 Classes or types that want to implement (in)equality tests but not
14839 the ordering operators (i.e. unordered types) should implement ==
14840 and !=, and raise an error for the ordering operators.
14841
14842 It is possible to define types whose rich comparison results are not
14843 Boolean; e.g. a matrix type might want to return a matrix of bits
14844 for A < B, giving elementwise comparisons. Such types should ensure
14845 that any interpretation of their value in a Boolean context raises
14846 an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
14847 at the C level) to always raise an exception.
14848
14849- Complex numbers use rich comparisons to define == and != but raise
14850 an exception for <, <=, > and >=. Unfortunately, this also means
14851 that cmp() of two complex numbers raises an exception when the two
14852 numbers differ. Since it is not mathematically meaningful to compare
14853 complex numbers except for equality, I hope that this doesn't break
14854 too much code.
14855
14856- The outcome of comparing non-numeric objects of different types is
14857 not defined by the language, other than that it's arbitrary but
14858 consistent (see the Reference Manual). An implementation detail changed
14859 in 2.1a1 such that None now compares less than any other object. Code
14860 relying on this new behavior (like code that relied on the previous
14861 behavior) does so at its own risk.
14862
14863- Functions and methods now support getting and setting arbitrarily
14864 named attributes (PEP 232). Functions have a new __dict__
14865 (a.k.a. func_dict) which hold the function attributes. Methods get
14866 and set attributes on their underlying im_func. It is a TypeError
14867 to set an attribute on a bound method.
14868
14869- The xrange() object implementation has been improved so that
14870 xrange(sys.maxint) can be used on 64-bit platforms. There's still a
14871 limitation that in this case len(xrange(sys.maxint)) can't be
14872 calculated, but the common idiom "for i in xrange(sys.maxint)" will
14873 work fine as long as the index i doesn't actually reach 2**31.
14874 (Python uses regular ints for sequence and string indices; fixing
14875 that is much more work.)
14876
14877- Two changes to from...import:
14878
14879 1) "from M import X" now works even if (after loading module M)
14880 sys.modules['M'] is not a real module; it's basically a getattr()
14881 operation with AttributeError exceptions changed into ImportError.
14882
14883 2) "from M import *" now looks for M.__all__ to decide which names to
14884 import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
14885 filters out names starting with '_' as before. Whether or not
14886 __all__ exists, there's no restriction on the type of M.
14887
14888- File objects have a new method, xreadlines(). This is the fastest
14889 way to iterate over all lines in a file:
14890
14891 for line in file.xreadlines():
14892 ...do something to line...
14893
14894 See the xreadlines module (mentioned below) for how to do this for
14895 other file-like objects.
14896
14897- Even if you don't use file.xreadlines(), you may expect a speedup on
14898 line-by-line input. The file.readline() method has been optimized
14899 quite a bit in platform-specific ways: on systems (like Linux) that
14900 support flockfile(), getc_unlocked(), and funlockfile(), those are
14901 used by default. On systems (like Windows) without getc_unlocked(),
14902 a complicated (but still thread-safe) method using fgets() is used by
14903 default.
14904
14905 You can force use of the fgets() method by #define'ing
14906 USE_FGETS_IN_GETLINE at build time (it may be faster than
14907 getc_unlocked()).
14908
14909 You can force fgets() not to be used by #define'ing
14910 DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
14911 test_bufio.py fails -- and let us know if it does!).
14912
14913- In addition, the fileinput module, while still slower than the other
14914 methods on most platforms, has been sped up too, by using
14915 file.readlines(sizehint).
14916
14917- Support for run-time warnings has been added, including a new
14918 command line option (-W) to specify the disposition of warnings.
14919 See the description of the warnings module below.
14920
14921- Extensive changes have been made to the coercion code. This mostly
14922 affects extension modules (which can now implement mixed-type
14923 numerical operators without having to use coercion), but
14924 occasionally, in boundary cases the coercion semantics have changed
14925 subtly. Since this was a terrible gray area of the language, this
14926 is considered an improvement. Also note that __rcmp__ is no longer
14927 supported -- instead of calling __rcmp__, __cmp__ is called with
14928 reflected arguments.
14929
14930- In connection with the coercion changes, a new built-in singleton
14931 object, NotImplemented is defined. This can be returned for
14932 operations that wish to indicate they are not implemented for a
14933 particular combination of arguments. From C, this is
14934 Py_NotImplemented.
14935
14936- The interpreter accepts now bytecode files on the command line even
14937 if they do not have a .pyc or .pyo extension. On Linux, after executing
14938
14939import imp,sys,string
14940magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
14941reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
14942open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
14943
14944 any byte code file can be used as an executable (i.e. as an argument
14945 to execve(2)).
14946
14947- %[xXo] formats of negative Python longs now produce a sign
14948 character. In 1.6 and earlier, they never produced a sign,
14949 and raised an error if the value of the long was too large
14950 to fit in a Python int. In 2.0, they produced a sign if and
14951 only if too large to fit in an int. This was inconsistent
14952 across platforms (because the size of an int varies across
14953 platforms), and inconsistent with hex() and oct(). Example:
14954
14955 >>> "%x" % -0x42L
14956 '-42' # in 2.1
14957 'ffffffbe' # in 2.0 and before, on 32-bit machines
14958 >>> hex(-0x42L)
14959 '-0x42L' # in all versions of Python
14960
14961 The behavior of %d formats for negative Python longs remains
14962 the same as in 2.0 (although in 1.6 and before, they raised
14963 an error if the long didn't fit in a Python int).
14964
14965 %u formats don't make sense for Python longs, but are allowed
14966 and treated the same as %d in 2.1. In 2.0, a negative long
14967 formatted via %u produced a sign if and only if too large to
14968 fit in an int. In 1.6 and earlier, a negative long formatted
14969 via %u raised an error if it was too big to fit in an int.
14970
14971- Dictionary objects have an odd new method, popitem(). This removes
14972 an arbitrary item from the dictionary and returns it (in the form of
14973 a (key, value) pair). This can be useful for algorithms that use a
14974 dictionary as a bag of "to do" items and repeatedly need to pick one
14975 item. Such algorithms normally end up running in quadratic time;
14976 using popitem() they can usually be made to run in linear time.
14977
14978Standard library
14979
14980- In the time module, the time argument to the functions strftime,
14981 localtime, gmtime, asctime and ctime is now optional, defaulting to
14982 the current time (in the local timezone).
14983
14984- The ftplib module now defaults to passive mode, which is deemed a
14985 more useful default given that clients are often inside firewalls
14986 these days. Note that this could break if ftplib is used to connect
14987 to a *server* that is inside a firewall, from outside; this is
14988 expected to be a very rare situation. To fix that, you can call
14989 ftp.set_pasv(0).
14990
14991- The module site now treats .pth files not only for path configuration,
14992 but also supports extensions to the initialization code: Lines starting
14993 with import are executed.
14994
14995- There's a new module, warnings, which implements a mechanism for
14996 issuing and filtering warnings. There are some new built-in
14997 exceptions that serve as warning categories, and a new command line
14998 option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
14999 turns warnings into errors). warnings.warn(message[, category])
15000 issues a warning message; this can also be called from C as
15001 PyErr_Warn(category, message).
15002
15003- A new module xreadlines was added. This exports a single factory
15004 function, xreadlines(). The intention is that this code is the
15005 absolutely fastest way to iterate over all lines in an open
15006 file(-like) object:
15007
15008 import xreadlines
15009 for line in xreadlines.xreadlines(file):
15010 ...do something to line...
15011
15012 This is equivalent to the previous the speed record holder using
15013 file.readlines(sizehint). Note that if file is a real file object
15014 (as opposed to a file-like object), this is equivalent:
15015
15016 for line in file.xreadlines():
15017 ...do something to line...
15018
15019- The bisect module has new functions bisect_left, insort_left,
15020 bisect_right and insort_right. The old names bisect and insort
15021 are now aliases for bisect_right and insort_right. XXX_right
15022 and XXX_left methods differ in what happens when the new element
15023 compares equal to one or more elements already in the list: the
15024 XXX_left methods insert to the left, the XXX_right methods to the
15025 right. Code that doesn't care where equal elements end up should
15026 continue to use the old, short names ("bisect" and "insort").
15027
15028- The new curses.panel module wraps the panel library that forms part
15029 of SYSV curses and ncurses. Contributed by Thomas Gellekum.
15030
15031- The SocketServer module now sets the allow_reuse_address flag by
15032 default in the TCPServer class.
15033
15034- A new function, sys._getframe(), returns the stack frame pointer of
15035 the caller. This is intended only as a building block for
15036 higher-level mechanisms such as string interpolation.
15037
15038- The pyexpat module supports a number of new handlers, which are
15039 available only in expat 1.2. If invocation of a callback fails, it
15040 will report an additional frame in the traceback. Parser objects
15041 participate now in garbage collection. If expat reports an unknown
15042 encoding, pyexpat will try to use a Python codec; that works only
15043 for single-byte charsets. The parser type objects is exposed as
15044 XMLParserObject.
15045
15046- xml.dom now offers standard definitions for symbolic node type and
15047 exception code constants, and a hierarchy of DOM exceptions. minidom
15048 was adjusted to use them.
15049
15050- The conformance of xml.dom.minidom to the DOM specification was
15051 improved. It detects a number of additional error cases; the
15052 previous/next relationship works even when the tree is modified;
15053 Node supports the normalize() method; NamedNodeMap, DocumentType and
15054 DOMImplementation classes were added; Element supports the
15055 hasAttribute and hasAttributeNS methods; and Text supports the splitText
15056 method.
15057
15058Build issues
15059
15060- For Unix (and Unix-compatible) builds, configuration and building of
15061 extension modules is now greatly automated. Rather than having to
15062 edit the Modules/Setup file to indicate which modules should be
15063 built and where their include files and libraries are, a
15064 distutils-based setup.py script now takes care of building most
15065 extension modules. All extension modules built this way are built
15066 as shared libraries. Only a few modules that must be linked
15067 statically are still listed in the Setup file; you won't need to
15068 edit their configuration.
15069
15070- Python should now build out of the box on Cygwin. If it doesn't,
15071 mail to Jason Tishler (jlt63 at users.sourceforge.net).
15072
15073- Python now always uses its own (renamed) implementation of getopt()
15074 -- there's too much variation among C library getopt()
15075 implementations.
15076
15077- C++ compilers are better supported; the CXX macro is always set to a
15078 C++ compiler if one is found.
15079
15080Windows changes
15081
15082- select module: By default under Windows, a select() call
15083 can specify no more than 64 sockets. Python now boosts
15084 this Microsoft default to 512. If you need even more than
15085 that, see the MS docs (you'll need to #define FD_SETSIZE
15086 and recompile Python from source).
15087
15088- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
15089 subdirectory is no more!
15090
15091
15092What's New in Python 2.0?
15093=========================
15094
15095Below is a list of all relevant changes since release 1.6. Older
15096changes are in the file HISTORY. If you are making the jump directly
15097from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
15098HISTORY file! Many important changes listed there.
15099
15100Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
15101the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000015102http://www.amk.ca/python/2.0/.
Skip Montanaro4cb22042002-09-17 20:55:31 +000015103
15104--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
15105
15106======================================================================
15107
15108What's new in 2.0 (since release candidate 1)?
15109==============================================
15110
15111Standard library
15112
15113- The copy_reg module was modified to clarify its intended use: to
15114 register pickle support for extension types, not for classes.
15115 pickle() will raise a TypeError if it is passed a class.
15116
15117- Fixed a bug in gettext's "normalize and expand" code that prevented
15118 it from finding an existing .mo file.
15119
15120- Restored support for HTTP/0.9 servers in httplib.
15121
15122- The math module was changed to stop raising OverflowError in case of
15123 underflow, and return 0 instead in underflow cases. Whether Python
15124 used to raise OverflowError in case of underflow was platform-
15125 dependent (it did when the platform math library set errno to ERANGE
15126 on underflow).
15127
15128- Fixed a bug in StringIO that occurred when the file position was not
15129 at the end of the file and write() was called with enough data to
15130 extend past the end of the file.
15131
15132- Fixed a bug that caused Tkinter error messages to get lost on
15133 Windows. The bug was fixed by replacing direct use of
15134 interp->result with Tcl_GetStringResult(interp).
15135
15136- Fixed bug in urllib2 that caused it to fail when it received an HTTP
15137 redirect response.
15138
15139- Several changes were made to distutils: Some debugging code was
15140 removed from util. Fixed the installer used when an external zip
15141 program (like WinZip) is not found; the source code for this
15142 installer is in Misc/distutils. check_lib() was modified to behave
15143 more like AC_CHECK_LIB by add other_libraries() as a parameter. The
15144 test for whether installed modules are on sys.path was changed to
15145 use both normcase() and normpath().
15146
15147- Several minor bugs were fixed in the xml package (the minidom,
15148 pulldom, expatreader, and saxutils modules).
15149
15150- The regression test driver (regrtest.py) behavior when invoked with
15151 -l changed: It now reports a count of objects that are recognized as
15152 garbage but not freed by the garbage collector.
15153
15154- The regression test for the math module was changed to test
15155 exceptional behavior when the test is run in verbose mode. Python
15156 cannot yet guarantee consistent exception behavior across platforms,
15157 so the exception part of test_math is run only in verbose mode, and
15158 may fail on your platform.
15159
15160Internals
15161
15162- PyOS_CheckStack() has been disabled on Win64, where it caused
15163 test_sre to fail.
15164
15165Build issues
15166
15167- Changed compiler flags, so that gcc is always invoked with -Wall and
15168 -Wstrict-prototypes. Users compiling Python with GCC should see
15169 exactly one warning, except if they have passed configure the
15170 --with-pydebug flag. The expected warning is for getopt() in
15171 Modules/main.c. This warning will be fixed for Python 2.1.
15172
15173- Fixed configure to add -threads argument during linking on OSF1.
15174
15175Tools and other miscellany
15176
15177- The compiler in Tools/compiler was updated to support the new
15178 language features introduced in 2.0: extended print statement, list
15179 comprehensions, and augmented assignments. The new compiler should
15180 also be backwards compatible with Python 1.5.2; the compiler will
15181 always generate code for the version of the interpreter it runs
15182 under.
15183
15184What's new in 2.0 release candidate 1 (since beta 2)?
15185=====================================================
15186
15187What is release candidate 1?
15188
15189We believe that release candidate 1 will fix all known bugs that we
15190intend to fix for the 2.0 final release. This release should be a bit
15191more stable than the previous betas. We would like to see even more
15192widespread testing before the final release, so we are producing this
15193release candidate. The final release will be exactly the same unless
15194any show-stopping (or brown bag) bugs are found by testers of the
15195release candidate.
15196
15197All the changes since the last beta release are bug fixes or changes
15198to support building Python for specific platforms.
15199
15200Core language, builtins, and interpreter
15201
15202- A bug that caused crashes when __coerce__ was used with augmented
15203 assignment, e.g. +=, was fixed.
15204
15205- Raise ZeroDivisionError when raising zero to a negative number,
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015206 e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the built-in
Skip Montanaro4cb22042002-09-17 20:55:31 +000015207 power operator and the result of math.pow(0.0, -2.0) will vary by
15208 platform. On Linux, it raises a ValueError.
15209
15210- A bug in Unicode string interpolation was fixed that occasionally
15211 caused errors with formats including "%%". For example, the
15212 following expression "%% %s" % u"abc" no longer raises a TypeError.
15213
15214- Compilation of deeply nested expressions raises MemoryError instead
15215 of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
15216
15217- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
15218 rendering them useless. They are now written in binary mode again.
15219
15220Standard library
15221
15222- Keyword arguments are now accepted for most pattern and match object
15223 methods in SRE, the standard regular expression engine.
15224
15225- In SRE, fixed error with negative lookahead and lookbehind that
15226 manifested itself as a runtime error in patterns like "(?<!abc)(def)".
15227
15228- Several bugs in the Unicode handling and error handling in _tkinter
15229 were fixed.
15230
15231- Fix memory management errors in Merge() and Tkapp_Call() routines.
15232
15233- Several changes were made to cStringIO to make it compatible with
15234 the file-like object interface and with StringIO. If operations are
15235 performed on a closed object, an exception is raised. The truncate
15236 method now accepts a position argument and readline accepts a size
15237 argument.
15238
15239- There were many changes made to the linuxaudiodev module and its
15240 test suite; as a result, a short, unexpected audio sample should now
15241 play when the regression test is run.
15242
15243 Note that this module is named poorly, because it should work
15244 correctly on any platform that supports the Open Sound System
15245 (OSS).
15246
15247 The module now raises exceptions when errors occur instead of
15248 crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
15249 audio) and defines a getptr() method that calls the
15250 SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
15251
15252- The library_version attribute, introduced in an earlier beta, was
15253 removed because it can not be supported with early versions of the C
15254 readline library, which provides no way to determine the version at
15255 compile-time.
15256
15257- The binascii module is now enabled on Win64.
15258
15259- tokenize.py no longer suffers "recursion depth" errors when parsing
15260 programs with very long string literals.
15261
15262Internals
15263
15264- Fixed several buffer overflow vulnerabilities in calculate_path(),
15265 which is called when the interpreter starts up to determine where
15266 the standard library is installed. These vulnerabilities affect all
15267 previous versions of Python and can be exploited by setting very
15268 long values for PYTHONHOME or argv[0]. The risk is greatest for a
15269 setuid Python script, although use of the wrapper in
15270 Misc/setuid-prog.c will eliminate the vulnerability.
15271
15272- Fixed garbage collection bugs in instance creation that were
15273 triggered when errors occurred during initialization. The solution,
15274 applied in cPickle and in PyInstance_New(), is to call
15275 PyObject_GC_Init() after the initialization of the object's
15276 container attributes is complete.
15277
15278- pyexpat adds definitions of PyModule_AddStringConstant and
15279 PyModule_AddObject if the Python version is less than 2.0, which
15280 provides compatibility with PyXML on Python 1.5.2.
15281
15282- If the platform has a bogus definition for LONG_BIT (the number of
15283 bits in a long), an error will be reported at compile time.
15284
15285- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
15286 collection crashes and possibly other, unreported crashes.
15287
15288- Fixed a memory leak in _PyUnicode_Fini().
15289
15290Build issues
15291
15292- configure now accepts a --with-suffix option that specifies the
15293 executable suffix. This is useful for builds on Cygwin and Mac OS
15294 X, for example.
15295
15296- The mmap.PAGESIZE constant is now initialized using sysconf when
15297 possible, which eliminates a dependency on -lucb for Reliant UNIX.
15298
15299- The md5 file should now compile on all platforms.
15300
15301- The select module now compiles on platforms that do not define
15302 POLLRDNORM and related constants.
15303
15304- Darwin (Mac OS X): Initial support for static builds on this
15305 platform.
15306
15307- BeOS: A number of changes were made to the build and installation
15308 process. ar-fake now operates on a directory of object files.
15309 dl_export.h is gone, and its macros now appear on the mwcc command
15310 line during build on PPC BeOS.
15311
15312- Platform directory in lib/python2.0 is "plat-beos5" (or
15313 "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
15314
15315- Cygwin: Support for shared libraries, Tkinter, and sockets.
15316
15317- SunOS 4.1.4_JL: Fix test for directory existence in configure.
15318
15319Tools and other miscellany
15320
15321- Removed debugging prints from main used with freeze.
15322
15323- IDLE auto-indent no longer crashes when it encounters Unicode
15324 characters.
15325
15326What's new in 2.0 beta 2 (since beta 1)?
15327========================================
15328
15329Core language, builtins, and interpreter
15330
15331- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
15332 "%d" % 2L**64 == "18446744073709551616".
15333
15334- Add -h and -V command line options to print the usage message and
15335 Python version number and exit immediately.
15336
15337- eval() and exec accept Unicode objects as code parameters.
15338
15339- getattr() and setattr() now also accept Unicode objects for the
15340 attribute name, which are converted to strings using the default
15341 encoding before lookup.
15342
15343- Multiplication on string and Unicode now does proper bounds
15344 checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
15345 string is too long."
15346
15347- Better error message when continue is found in try statement in a
15348 loop.
15349
15350
15351Standard library and extensions
15352
15353- socket module: the OpenSSL code now adds support for RAND_status()
15354 and EGD (Entropy Gathering Device).
15355
15356- array: reverse() method of array now works. buffer_info() now does
15357 argument checking; it still takes no arguments.
15358
15359- asyncore/asynchat: Included most recent version from Sam Rushing.
15360
15361- cgi: Accept '&' or ';' as separator characters when parsing form data.
15362
15363- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
15364
15365- ConfigParser: When reading the file, options spelled in upper case
15366 letters are now correctly converted to lowercase.
15367
15368- copy: Copy Unicode objects atomically.
15369
15370- cPickle: Fail gracefully when copy_reg can't be imported.
15371
15372- cStringIO: Implemented readlines() method.
15373
15374- dbm: Add get() and setdefault() methods to dbm object. Add constant
15375 `library' to module that names the library used. Added doc strings
15376 and method names to error messages. Uses configure to determine
15377 which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
15378 now available options.
15379
15380- distutils: Update to version 0.9.3.
15381
15382- dl: Add several dl.RTLD_ constants.
15383
15384- fpectl: Now supported on FreeBSD.
15385
15386- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
15387 found by the collector will be saved in gc.garbage. This is useful
15388 for debugging a program that creates reference cycles.
15389
15390- httplib: Three changes: Restore support for set_debuglevel feature
15391 of HTTP class. Do not close socket on zero-length response. Do not
15392 crash when server sends invalid content-length header.
15393
15394- mailbox: Mailbox class conforms better to qmail specifications.
15395
15396- marshal: When reading a short, sign-extend on platforms where shorts
15397 are bigger than 16 bits. When reading a long, repair the unportable
15398 sign extension that was being done for 64-bit machines. (It assumed
15399 that signed right shift sign-extends.)
15400
15401- operator: Add contains(), invert(), __invert__() as aliases for
15402 __contains__(), inv(), and __inv__() respectively.
15403
15404- os: Add support for popen2() and popen3() on all platforms where
15405 fork() exists. (popen4() is still in the works.)
15406
15407- os: (Windows only:) Add startfile() function that acts like double-
15408 clicking on a file in Explorer (or passing the file name to the
15409 DOS "start" command).
15410
15411- os.path: (Windows, DOS:) Treat trailing colon correctly in
15412 os.path.join. os.path.join("a:", "b") yields "a:b".
15413
15414- pickle: Now raises ValueError when an invalid pickle that contains
15415 a non-string repr where a string repr was expected. This behavior
15416 matches cPickle.
15417
15418- posixfile: Remove broken __del__() method.
15419
15420- py_compile: support CR+LF line terminators in source file.
15421
15422- readline: Does not immediately exit when ^C is hit when readline and
15423 threads are configured. Adds definition of rl_library_version. (The
15424 latter addition requires GNU readline 2.2 or later.)
15425
15426- rfc822: Domain literals returned by AddrlistClass method
15427 getdomainliteral() are now properly wrapped in brackets.
15428
15429- site: sys.setdefaultencoding() should only be called in case the
15430 standard default encoding ("ascii") is changed. This saves quite a
15431 few cycles during startup since the first call to
15432 setdefaultencoding() will initialize the codec registry and the
15433 encodings package.
15434
15435- socket: Support for size hint in readlines() method of object returned
15436 by makefile().
15437
15438- sre: Added experimental expand() method to match objects. Does not
15439 use buffer interface on Unicode strings. Does not hang if group id
15440 is followed by whitespace.
15441
15442- StringIO: Size hint in readlines() is now supported as documented.
15443
15444- struct: Check ranges for bytes and shorts.
15445
15446- urllib: Improved handling of win32 proxy settings. Fixed quote and
15447 quote_plus functions so that the always encode a comma.
15448
15449- Tkinter: Image objects are now guaranteed to have unique ids. Set
15450 event.delta to zero if Tk version doesn't support mousewheel.
15451 Removed some debugging prints.
15452
15453- UserList: now implements __contains__().
15454
15455- webbrowser: On Windows, use os.startfile() instead of os.popen(),
15456 which works around a bug in Norton AntiVirus 2000 that leads directly
15457 to a Blue Screen freeze.
15458
15459- xml: New version detection code allows PyXML to override standard
15460 XML package if PyXML version is greater than 0.6.1.
15461
15462- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
15463 (conventional DOM), and xml.dom.pulldom, which allows building the DOM
15464 tree only for nodes which are sufficiently interesting to a specific
15465 application. Does not provide the HTML-specific extensions. Still
15466 undocumented.
15467
15468- xml.sax: SAX 2 support for Python, including all the handler
15469 interfaces needed to process XML 1.0 compliant XML. Some
15470 documentation is already available.
15471
15472- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
15473 packagized XML support.
15474
15475
15476C API
15477
15478- Add three new convenience functions for module initialization --
15479 PyModule_AddObject(), PyModule_AddIntConstant(), and
15480 PyModule_AddStringConstant().
15481
15482- Cleaned up definition of NULL in C source code; all definitions were
15483 removed and add #error to Python.h if NULL isn't defined after
15484 #include of stdio.h.
15485
15486- Py_PROTO() macros that were removed in 2.0b1 have been restored for
15487 backwards compatibility (at the source level) with old extensions.
15488
15489- A wrapper API was added for signal() and sigaction(). Instead of
15490 either function, always use PyOS_getsig() to get a signal handler
15491 and PyOS_setsig() to set one. A new convenience typedef
15492 PyOS_sighandler_t is defined for the type of signal handlers.
15493
15494- Add PyString_AsStringAndSize() function that provides access to the
15495 internal data buffer and size of a string object -- or the default
15496 encoded version of a Unicode object.
15497
15498- PyString_Size() and PyString_AsString() accept Unicode objects.
15499
15500- The standard header <limits.h> is now included by Python.h (if it
15501 exists). INT_MAX and LONG_MAX will always be defined, even if
15502 <limits.h> is not available.
15503
15504- PyFloat_FromString takes a second argument, pend, that was
15505 effectively useless. It is now officially useless but preserved for
15506 backwards compatibility. If the pend argument is not NULL, *pend is
15507 set to NULL.
15508
15509- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
15510 for the attribute name. See note on getattr() above.
15511
15512- A few bug fixes to argument processing for Unicode.
15513 PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
15514 PyArg_Parse() special cases "s#" for Unicode objects; it returns a
15515 pointer to the default encoded string data instead of to the raw
15516 UTF-16.
15517
15518- Py_BuildValue accepts B format (for bgen-generated code).
15519
15520
15521Internals
15522
15523- On Unix, fix code for finding Python installation directory so that
15524 it works when argv[0] is a relative path.
15525
15526- Added a true unicode_internal_encode() function and fixed the
15527 unicode_internal_decode function() to support Unicode objects directly
15528 rather than by generating a copy of the object.
15529
15530- Several of the internal Unicode tables are much smaller now, and
15531 the source code should be much friendlier to weaker compilers.
15532
15533- In the garbage collector: Fixed bug in collection of tuples. Fixed
15534 bug that caused some instances to be removed from the container set
15535 while they were still live. Fixed parsing in gc.set_debug() for
15536 platforms where sizeof(long) > sizeof(int).
15537
15538- Fixed refcount problem in instance deallocation that only occurred
15539 when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
15540
15541- On Windows, getpythonregpath is now protected against null data in
15542 registry key.
15543
15544- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
15545 condition.
15546
15547
15548Build and platform-specific issues
15549
15550- Better support of GNU Pth via --with-pth configure option.
15551
15552- Python/C API now properly exposed to dynamically-loaded extension
15553 modules on Reliant UNIX.
15554
15555- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
15556 Don't define MS_SYNC to be zero when it is undefined. Added missing
15557 prototypes in posixmodule.c.
15558
15559- Improved support for HP-UX build. Threads should now be correctly
15560 configured (on HP-UX 10.20 and 11.00).
15561
15562- Fix largefile support on older NetBSD systems and OpenBSD by adding
15563 define for TELL64.
15564
15565
15566Tools and other miscellany
15567
15568- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
15569
15570- freeze: The modulefinder now works with 2.0 opcodes.
15571
15572- IDLE:
15573 Move hackery of sys.argv until after the Tk instance has been
15574 created, which allows the application-specific Tkinter
15575 initialization to be executed if present; also pass an explicit
15576 className parameter to the Tk() constructor.
15577
15578
15579What's new in 2.0 beta 1?
15580=========================
15581
15582Source Incompatibilities
15583------------------------
15584
15585None. Note that 1.6 introduced several incompatibilities with 1.5.2,
15586such as single-argument append(), connect() and bind(), and changes to
15587str(long) and repr(float).
15588
15589
15590Binary Incompatibilities
15591------------------------
15592
15593- Third party extensions built for Python 1.5.x or 1.6 cannot be used
15594with Python 2.0; these extensions will have to be rebuilt for Python
155952.0.
15596
15597- On Windows, attempting to import a third party extension built for
15598Python 1.5.x or 1.6 results in an immediate crash; there's not much we
15599can do about this. Check your PYTHONPATH environment variable!
15600
15601- Python bytecode files (*.pyc and *.pyo) are not compatible between
15602releases.
15603
15604
15605Overview of Changes Since 1.6
15606-----------------------------
15607
15608There are many new modules (including brand new XML support through
15609the xml package, and i18n support through the gettext module); a list
15610of all new modules is included below. Lots of bugs have been fixed.
15611
15612The process for making major new changes to the language has changed
15613since Python 1.6. Enhancements must now be documented by a Python
15614Enhancement Proposal (PEP) before they can be accepted.
15615
15616There are several important syntax enhancements, described in more
15617detail below:
15618
15619 - Augmented assignment, e.g. x += 1
15620
15621 - List comprehensions, e.g. [x**2 for x in range(10)]
15622
15623 - Extended import statement, e.g. import Module as Name
15624
15625 - Extended print statement, e.g. print >> file, "Hello"
15626
15627Other important changes:
15628
15629 - Optional collection of cyclical garbage
15630
15631Python Enhancement Proposal (PEP)
15632---------------------------------
15633
15634PEP stands for Python Enhancement Proposal. A PEP is a design
15635document providing information to the Python community, or describing
15636a new feature for Python. The PEP should provide a concise technical
15637specification of the feature and a rationale for the feature.
15638
15639We intend PEPs to be the primary mechanisms for proposing new
15640features, for collecting community input on an issue, and for
15641documenting the design decisions that have gone into Python. The PEP
15642author is responsible for building consensus within the community and
15643documenting dissenting opinions.
15644
15645The PEPs are available at http://python.sourceforge.net/peps/.
15646
15647Augmented Assignment
15648--------------------
15649
15650This must have been the most-requested feature of the past years!
15651Eleven new assignment operators were added:
15652
15653 += -= *= /= %= **= <<= >>= &= ^= |=
15654
15655For example,
15656
15657 A += B
15658
15659is similar to
15660
15661 A = A + B
15662
15663except that A is evaluated only once (relevant when A is something
15664like dict[index].attr).
15665
15666However, if A is a mutable object, A may be modified in place. Thus,
15667if A is a number or a string, A += B has the same effect as A = A+B
15668(except A is only evaluated once); but if a is a list, A += B has the
15669same effect as A.extend(B)!
15670
15671Classes and built-in object types can override the new operators in
15672order to implement the in-place behavior; the not-in-place behavior is
15673used automatically as a fallback when an object doesn't implement the
15674in-place behavior. For classes, the method name is derived from the
15675method name for the corresponding not-in-place operator by inserting
15676an 'i' in front of the name, e.g. __iadd__ implements in-place
15677__add__.
15678
15679Augmented assignment was implemented by Thomas Wouters.
15680
15681
15682List Comprehensions
15683-------------------
15684
15685This is a flexible new notation for lists whose elements are computed
15686from another list (or lists). The simplest form is:
15687
15688 [<expression> for <variable> in <sequence>]
15689
15690For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
15691This is more efficient than a for loop with a list.append() call.
15692
15693You can also add a condition:
15694
15695 [<expression> for <variable> in <sequence> if <condition>]
15696
15697For example, [w for w in words if w == w.lower()] would yield the list
15698of words that contain no uppercase characters. This is more efficient
15699than a for loop with an if statement and a list.append() call.
15700
15701You can also have nested for loops and more than one 'if' clause. For
15702example, here's a function that flattens a sequence of sequences::
15703
15704 def flatten(seq):
15705 return [x for subseq in seq for x in subseq]
15706
15707 flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
15708
15709This prints
15710
15711 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
15712
15713List comprehensions originated as a patch set from Greg Ewing; Skip
15714Montanaro and Thomas Wouters also contributed. Described by PEP 202.
15715
15716
15717Extended Import Statement
15718-------------------------
15719
15720Many people have asked for a way to import a module under a different
15721name. This can be accomplished like this:
15722
15723 import foo
15724 bar = foo
15725 del foo
15726
15727but this common idiom gets old quickly. A simple extension of the
15728import statement now allows this to be written as follows:
15729
15730 import foo as bar
15731
15732There's also a variant for 'from ... import':
15733
15734 from foo import bar as spam
15735
15736This also works with packages; e.g. you can write this:
15737
15738 import test.regrtest as regrtest
15739
15740Note that 'as' is not a new keyword -- it is recognized only in this
15741context (this is only possible because the syntax for the import
15742statement doesn't involve expressions).
15743
15744Implemented by Thomas Wouters. Described by PEP 221.
15745
15746
15747Extended Print Statement
15748------------------------
15749
15750Easily the most controversial new feature, this extension to the print
15751statement adds an option to make the output go to a different file
15752than the default sys.stdout.
15753
15754For example, to write an error message to sys.stderr, you can now
15755write:
15756
15757 print >> sys.stderr, "Error: bad dog!"
15758
15759As a special feature, if the expression used to indicate the file
15760evaluates to None, the current value of sys.stdout is used. Thus:
15761
15762 print >> None, "Hello world"
15763
15764is equivalent to
15765
15766 print "Hello world"
15767
15768Design and implementation by Barry Warsaw. Described by PEP 214.
15769
15770
15771Optional Collection of Cyclical Garbage
15772---------------------------------------
15773
15774Python is now equipped with a garbage collector that can hunt down
15775cyclical references between Python objects. It's no replacement for
15776reference counting; in fact, it depends on the reference counts being
15777correct, and decides that a set of objects belong to a cycle if all
15778their reference counts can be accounted for from their references to
15779each other. This devious scheme was first proposed by Eric Tiedemann,
15780and brought to implementation by Neil Schemenauer.
15781
15782There's a module "gc" that lets you control some parameters of the
15783garbage collection. There's also an option to the configure script
15784that lets you enable or disable the garbage collection. In 2.0b1,
15785it's on by default, so that we (hopefully) can collect decent user
15786experience with this new feature. There are some questions about its
15787performance. If it proves to be too much of a problem, we'll turn it
15788off by default in the final 2.0 release.
15789
15790
15791Smaller Changes
15792---------------
15793
15794A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
15795map(None, seq1, seq2, ...) when the sequences have the same length;
15796i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
15797the lists are not all the same length, the shortest list wins:
15798zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
15799
15800sys.version_info is a tuple (major, minor, micro, level, serial).
15801
15802Dictionaries have an odd new method, setdefault(key, default).
15803dict.setdefault(key, default) returns dict[key] if it exists; if not,
15804it sets dict[key] to default and returns that value. Thus:
15805
15806 dict.setdefault(key, []).append(item)
15807
15808does the same work as this common idiom:
15809
15810 if not dict.has_key(key):
15811 dict[key] = []
15812 dict[key].append(item)
15813
15814There are two new variants of SyntaxError that are raised for
15815indentation-related errors: IndentationError and TabError.
15816
15817Changed \x to consume exactly two hex digits; see PEP 223. Added \U
15818escape that consumes exactly eight hex digits.
15819
15820The limits on the size of expressions and file in Python source code
15821have been raised from 2**16 to 2**32. Previous versions of Python
15822were limited because the maximum argument size the Python VM accepted
15823was 2**16. This limited the size of object constructor expressions,
15824e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
15825limit was raised thanks to a patch by Charles Waldman that effectively
15826fixes the problem. It is now much more likely that you will be
15827limited by available memory than by an arbitrary limit in Python.
15828
15829The interpreter's maximum recursion depth can be modified by Python
15830programs using sys.getrecursionlimit and sys.setrecursionlimit. This
15831limit is the maximum number of recursive calls that can be made by
15832Python code. The limit exists to prevent infinite recursion from
15833overflowing the C stack and causing a core dump. The default value is
158341000. The maximum safe value for a particular platform can be found
Georg Brandl93d15cd2009-10-11 21:24:34 +000015835by running Tools/scripts/find_recursionlimit.py.
Skip Montanaro4cb22042002-09-17 20:55:31 +000015836
15837New Modules and Packages
15838------------------------
15839
15840atexit - for registering functions to be called when Python exits.
15841
15842imputil - Greg Stein's alternative API for writing custom import
15843hooks.
15844
15845pyexpat - an interface to the Expat XML parser, contributed by Paul
15846Prescod.
15847
15848xml - a new package with XML support code organized (so far) in three
15849subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
15850would fill a volume. There's a special feature whereby a
15851user-installed package named _xmlplus overrides the standard
15852xmlpackage; this is intended to give the XML SIG a hook to distribute
15853backwards-compatible updates to the standard xml package.
15854
15855webbrowser - a platform-independent API to launch a web browser.
15856
15857
15858Changed Modules
15859---------------
15860
15861array -- new methods for array objects: count, extend, index, pop, and
15862remove
15863
15864binascii -- new functions b2a_hex and a2b_hex that convert between
15865binary data and its hex representation
15866
15867calendar -- Many new functions that support features including control
15868over which day of the week is the first day, returning strings instead
15869of printing them. Also new symbolic constants for days of week,
15870e.g. MONDAY, ..., SUNDAY.
15871
15872cgi -- FieldStorage objects have a getvalue method that works like a
15873dictionary's get method and returns the value attribute of the object.
15874
15875ConfigParser -- The parser object has new methods has_option,
15876remove_section, remove_option, set, and write. They allow the module
15877to be used for writing config files as well as reading them.
15878
15879ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
15880optionally support the RFC 959 REST command.
15881
15882gzip -- readline and readlines now accept optional size arguments
15883
15884httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
15885the module doc strings for details.
15886
15887locale -- implement getdefaultlocale for Win32 and Macintosh
15888
15889marshal -- no longer dumps core when marshaling deeply nested or
15890recursive data structures
15891
15892os -- new functions isatty, seteuid, setegid, setreuid, setregid
15893
15894os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
15895support under Unix.
15896
15897os/pty -- support for openpty and forkpty
15898
15899os.path -- fix semantics of os.path.commonprefix
15900
15901smtplib -- support for sending very long messages
15902
15903socket -- new function getfqdn()
15904
15905readline -- new functions to read, write and truncate history files.
15906The readline section of the library reference manual contains an
15907example.
15908
15909select -- add interface to poll system call
15910
15911shutil -- new copyfileobj function
15912
15913SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
15914HTTP server.
15915
15916Tkinter -- optimization of function flatten
15917
15918urllib -- scans environment variables for proxy configuration,
15919e.g. http_proxy.
15920
15921whichdb -- recognizes dumbdbm format
15922
15923
15924Obsolete Modules
15925----------------
15926
15927None. However note that 1.6 made a whole slew of modules obsolete:
15928stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
15929poly, zmod, strop, util, whatsound.
15930
15931
15932Changed, New, Obsolete Tools
15933----------------------------
15934
15935None.
15936
15937
15938C-level Changes
15939---------------
15940
15941Several cleanup jobs were carried out throughout the source code.
15942
15943All C code was converted to ANSI C; we got rid of all uses of the
15944Py_PROTO() macro, which makes the header files a lot more readable.
15945
15946Most of the portability hacks were moved to a new header file,
15947pyport.h; several other new header files were added and some old
15948header files were removed, in an attempt to create a more rational set
15949of header files. (Few of these ever need to be included explicitly;
15950they are all included by Python.h.)
15951
15952Trent Mick ensured portability to 64-bit platforms, under both Linux
15953and Win64, especially for the new Intel Itanium processor. Mick also
15954added large file support for Linux64 and Win64.
15955
15956The C APIs to return an object's size have been update to consistently
15957use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
15958previous versions, the abstract interfaces used PyXXX_Length and the
15959concrete interfaces used PyXXX_Size. The old names,
15960e.g. PyObject_Length, are still available for backwards compatibility
15961at the API level, but are deprecated.
15962
15963The PyOS_CheckStack function has been implemented on Windows by
15964Fredrik Lundh. It prevents Python from failing with a stack overflow
15965on Windows.
15966
15967The GC changes resulted in creation of two new slots on object,
15968tp_traverse and tp_clear. The augmented assignment changes result in
15969the creation of a new slot for each in-place operator.
15970
15971The GC API creates new requirements for container types implemented in
15972C extension modules. See Include/objimpl.h for details.
15973
15974PyErr_Format has been updated to automatically calculate the size of
15975the buffer needed to hold the formatted result string. This change
15976prevents crashes caused by programmer error.
15977
15978New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
15979
15980PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
15981that are the same as their non-Ex counterparts except they take an
15982extra flag argument that tells them to close the file when done.
15983
15984XXX There were other API changes that should be fleshed out here.
15985
15986
15987Windows Changes
15988---------------
15989
15990New popen2/popen3/peopen4 in os module (see Changed Modules above).
15991
15992os.popen is much more usable on Windows 95 and 98. See Microsoft
15993Knowledge Base article Q150956. The Win9x workaround described there
15994is implemented by the new w9xpopen.exe helper in the root of your
15995Python installation. Note that Python uses this internally; it is not
15996a standalone program.
15997
15998Administrator privileges are no longer required to install Python
15999on Windows NT or Windows 2000. If you have administrator privileges,
16000Python's registry info will be written under HKEY_LOCAL_MACHINE.
16001Otherwise the installer backs off to writing Python's registry info
16002under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
16003uses of Python, but will prevent some advanced uses from working
16004(for example, running a Python script as an NT service, or possibly
16005from CGI).
16006
16007[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
16008installer; instead, it installs the needed Tcl/Tk files directly in the
16009Python directory. If you already have a Tcl/Tk installation, this
16010wastes some disk space (about 4 Megs) but avoids problems with
16011conflicting Tcl/Tk installations, and makes it much easier for Python
16012to ensure that Tcl/Tk can find all its files.
16013
16014[This was new in 1.6] The Windows installer now installs by default in
16015\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
16016
16017
16018Updates to the changes between 1.5.2 and 1.6
16019--------------------------------------------
16020
16021The 1.6 NEWS file can't be changed after the release is done, so here
16022is some late-breaking news:
16023
16024New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
16025and changes to getlocale() and setlocale().
16026
16027The new module is now enabled per default.
16028
16029It is not true that the encodings codecs cannot be used for normal
16030strings: the string.encode() (which is also present on 8-bit strings
16031!) allows using them for 8-bit strings too, e.g. to convert files from
16032cp1252 (Windows) to latin-1 or vice-versa.
16033
16034Japanese codecs are available from Tamito KAJIYAMA:
16035http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
16036
16037
16038======================================================================
16039
16040
Guido van Rossumf2eac992000-09-04 17:24:24 +000016041=======================================
16042==> Release 1.6 (September 5, 2000) <==
16043=======================================
16044
Guido van Rossuma598c932000-09-04 16:26:03 +000016045What's new in release 1.6?
16046==========================
16047
16048Below is a list of all relevant changes since release 1.5.2.
16049
16050
16051Source Incompatibilities
16052------------------------
16053
16054Several small incompatible library changes may trip you up:
16055
16056 - The append() method for lists can no longer be invoked with more
16057 than one argument. This used to append a single tuple made out of
16058 all arguments, but was undocumented. To append a tuple, use
16059 e.g. l.append((a, b, c)).
16060
16061 - The connect(), connect_ex() and bind() methods for sockets require
16062 exactly one argument. Previously, you could call s.connect(host,
16063 port), but this was undocumented. You must now write
16064 s.connect((host, port)).
16065
16066 - The str() and repr() functions are now different more often. For
16067 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
16068 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
16069 For floats, repr() now gives 17 digits of precision, to ensure no
16070 precision is lost (on all current hardware).
16071
16072 - The -X option is gone. Built-in exceptions are now always
16073 classes. Many more library modules also have been converted to
16074 class-based exceptions.
16075
16076
16077Binary Incompatibilities
16078------------------------
16079
16080- Third party extensions built for Python 1.5.x cannot be used with
16081Python 1.6; these extensions will have to be rebuilt for Python 1.6.
16082
16083- On Windows, attempting to import a third party extension built for
16084Python 1.5.x results in an immediate crash; there's not much we can do
16085about this. Check your PYTHONPATH environment variable!
16086
16087
16088Overview of Changes since 1.5.2
16089-------------------------------
16090
16091For this overview, I have borrowed from the document "What's New in
16092Python 2.0" by Andrew Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000016093http://www.amk.ca/python/2.0/ .
Guido van Rossuma598c932000-09-04 16:26:03 +000016094
16095There are lots of new modules and lots of bugs have been fixed. A
16096list of all new modules is included below.
16097
16098Probably the most pervasive change is the addition of Unicode support.
16099We've added a new fundamental datatype, the Unicode string, a new
16100build-in function unicode(), an numerous C APIs to deal with Unicode
16101and encodings. See the file Misc/unicode.txt for details, or
16102http://starship.python.net/crew/lemburg/unicode-proposal.txt.
16103
16104Two other big changes, related to the Unicode support, are the
16105addition of string methods and (yet another) new regular expression
16106engine.
16107
16108 - String methods mean that you can now say s.lower() etc. instead of
16109 importing the string module and saying string.lower(s) etc. One
16110 peculiarity is that the equivalent of string.join(sequence,
16111 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
16112 the effect of string.join(sequence); to make this more readable, try
16113 space=" " first. Note that the maxsplit argument defaults in
16114 split() and replace() have changed from 0 to -1.
16115
16116 - The new regular expression engine, SRE by Fredrik Lundh, is fully
16117 backwards compatible with the old engine, and is in fact invoked
16118 using the same interface (the "re" module). You can explicitly
16119 invoke the old engine by import pre, or the SRE engine by importing
16120 sre. SRE is faster than pre, and supports Unicode (which was the
16121 main reason to put effort in yet another new regular expression
16122 engine -- this is at least the fourth!).
16123
16124
16125Other Changes
16126-------------
16127
16128Other changes that won't break code but are nice to know about:
16129
16130Deleting objects is now safe even for deeply nested data structures.
16131
16132Long/int unifications: long integers can be used in seek() calls, as
16133slice indexes.
16134
16135String formatting (s % args) has a new formatting option, '%r', which
16136acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
16137alpha 1.)
16138
16139Greg Ward's "distutils" package is included: this will make
16140installing, building and distributing third party packages much
16141simpler.
16142
16143There's now special syntax that you can use instead of the apply()
16144function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
16145You can also use variations f(a1, a2, *args, **kwds) and you can leave
16146one or the other out: f(*args), f(**kwds).
16147
16148The built-ins int() and long() take an optional second argument to
16149indicate the conversion base -- of course only if the first argument
16150is a string. This makes string.atoi() and string.atol() obsolete.
16151(string.atof() was already obsolete).
16152
16153When a local variable is known to the compiler but undefined when
16154used, a new exception UnboundLocalError is raised. This is a class
16155derived from NameError so code catching NameError should still work.
16156The purpose is to provide better diagnostics in the following example:
16157 x = 1
16158 def f():
16159 print x
16160 x = x+1
16161This used to raise a NameError on the print statement, which confused
16162even experienced Python programmers (especially if there are several
16163hundreds of lines of code between the reference and the assignment to
16164x :-).
16165
16166You can now override the 'in' operator by defining a __contains__
16167method. Note that it has its arguments backwards: x in a causes
16168a.__contains__(x) to be called. That's why the name isn't __in__.
16169
16170The exception AttributeError will have a more friendly error message,
16171e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
16172<b>break code</b> that expects the message to be exactly the attribute
16173name.
16174
16175
16176New Modules in 1.6
16177------------------
16178
16179UserString - base class for deriving from the string type.
16180
16181distutils - tools for distributing Python modules.
16182
16183robotparser - parse a robots.txt file, for writing web spiders.
16184(Moved from Tools/webchecker/.)
16185
16186linuxaudiodev - audio for Linux.
16187
16188mmap - treat a file as a memory buffer. (Windows and Unix.)
16189
16190sre - regular expressions (fast, supports unicode). Currently, this
16191code is very rough. Eventually, the re module will be reimplemented
16192using sre (without changes to the re API).
16193
16194filecmp - supersedes the old cmp.py and dircmp.py modules.
16195
16196tabnanny - check Python sources for tab-width dependance. (Moved from
16197Tools/scripts/.)
16198
16199urllib2 - new and improved but incompatible version of urllib (still
16200experimental).
16201
16202zipfile - read and write zip archives.
16203
16204codecs - support for Unicode encoders/decoders.
16205
16206unicodedata - provides access to the Unicode 3.0 database.
16207
16208_winreg - Windows registry access.
16209
16210encodings - package which provides a large set of standard codecs --
16211currently only for the new Unicode support. It has a drop-in extension
16212mechanism which allows you to add new codecs by simply copying them
16213into the encodings package directory. Asian codec support will
16214probably be made available as separate distribution package built upon
16215this technique and the new distutils package.
16216
16217
16218Changed Modules
16219---------------
16220
16221readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
16222chunk, wave, random, shelve, nntplib - minor enhancements.
16223
16224socket, httplib, urllib - optional OpenSSL support (Unix only).
16225
16226_tkinter - support for 8.0 up to 8.3. Support for versions older than
162278.0 has been dropped.
16228
16229string - most of this module is deprecated now that strings have
16230methods. This no longer uses the built-in strop module, but takes
16231advantage of the new string methods to provide transparent support for
16232both Unicode and ordinary strings.
16233
16234
16235Changes on Windows
16236------------------
16237
16238The installer no longer runs a separate Tcl/Tk installer; instead, it
16239installs the needed Tcl/Tk files directly in the Python directory. If
16240you already have a Tcl/Tk installation, this wastes some disk space
16241(about 4 Megs) but avoids problems with conflincting Tcl/Tk
16242installations, and makes it much easier for Python to ensure that
16243Tcl/Tk can find all its files. Note: the alpha installers don't
16244include the documentation.
16245
16246The Windows installer now installs by default in \Python16\ on the
16247default volume, instead of \Program Files\Python-1.6\.
16248
16249
16250Changed Tools
16251-------------
16252
16253IDLE - complete overhaul. See the <a href="../idle/">IDLE home
16254page</a> for more information. (Python 1.6 alpha 1 will come with
16255IDLE 0.6.)
16256
16257Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
16258text extraction tool used for internationalizing applications written
16259in Python.
16260
16261
16262Obsolete Modules
16263----------------
16264
16265stdwin and everything that uses it. (Get Python 1.5.2 if you need
16266it. :-)
16267
16268soundex. (Skip Montanaro has a version in Python but it won't be
16269included in the Python release.)
16270
16271cmp, cmpcache, dircmp. (Replaced by filecmp.)
16272
16273dump. (Use pickle.)
16274
16275find. (Easily coded using os.walk().)
16276
16277grep. (Not very useful as a library module.)
16278
16279packmail. (No longer has any use.)
16280
16281poly, zmod. (These were poor examples at best.)
16282
16283strop. (No longer needed by the string module.)
16284
16285util. (This functionality was long ago built in elsewhere).
16286
16287whatsound. (Use sndhdr.)
16288
16289
16290Detailed Changes from 1.6b1 to 1.6
16291----------------------------------
16292
16293- Slight changes to the CNRI license. A copyright notice has been
16294added; the requirement to indicate the nature of modifications now
16295applies when making a derivative work available "to others" instead of
16296just "to the public"; the version and date are updated. The new
16297license has a new handle.
16298
16299- Added the Tools/compiler package. This is a project led by Jeremy
16300Hylton to write the Python bytecode generator in Python.
16301
16302- The function math.rint() is removed.
16303
16304- In Python.h, "#define _GNU_SOURCE 1" was added.
16305
16306- Version 0.9.1 of Greg Ward's distutils is included (instead of
16307version 0.9).
16308
16309- A new version of SRE is included. It is more stable, and more
16310compatible with the old RE module. Non-matching ranges are indicated
16311by -1, not None. (The documentation said None, but the PRE
16312implementation used -1; changing to None would break existing code.)
16313
16314- The winreg module has been renamed to _winreg. (There are plans for
16315a higher-level API called winreg, but this has not yet materialized in
16316a form that is acceptable to the experts.)
16317
16318- The _locale module is enabled by default.
16319
16320- Fixed the configuration line for the _curses module.
16321
16322- A few crashes have been fixed, notably <file>.writelines() with a
16323list containing non-string objects would crash, and there were
16324situations where a lost SyntaxError could dump core.
16325
16326- The <list>.extend() method now accepts an arbitrary sequence
16327argument.
16328
16329- If __str__() or __repr__() returns a Unicode object, this is
16330converted to an 8-bit string.
16331
16332- Unicode string comparisons is no longer aware of UTF-16
16333encoding peculiarities; it's a straight 16-bit compare.
16334
16335- The Windows installer now installs the LICENSE file and no longer
16336registers the Python DLL version in the registry (this is no longer
16337needed). It now uses Tcl/Tk 8.3.2.
16338
16339- A few portability problems have been fixed, in particular a
16340compilation error involving socklen_t.
16341
16342- The PC configuration is slightly friendlier to non-Microsoft
16343compilers.
16344
16345
16346======================================================================
16347
16348
Guido van Rossumf2eac992000-09-04 17:24:24 +000016349======================================
16350==> Release 1.5.2 (April 13, 1999) <==
16351======================================
16352
Guido van Rossum2001da42000-09-01 22:26:44 +000016353From 1.5.2c1 to 1.5.2 (final)
16354=============================
16355
16356Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16357
16358 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
16359
16360 * PCbuild/python15.dsp: Added shamodule.c
16361
16362 * PC/config.c: Added sha module!
16363
16364 * README, Include/patchlevel.h: Prepare for final release.
16365
16366 * Misc/ACKS:
16367 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
16368
16369 * Python/thread_solaris.h:
16370 While I can't really test this thoroughly, Pat Knight and the Solaris
16371 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
16372 the flags on thr_create(), and that there really isn't a downside, so
16373 I'll do that.
16374
16375 * Misc/ACKS:
16376 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
16377
16378 * PC/python_nt.rc:
16379 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
16380 (I can't even display this on NT, maybe Win/98 can?)
16381
16382 * Lib/pstats.py:
16383 Fix mysterious references to jprofile that were in the source since
16384 its creation. I'm assuming these were once valid references to "Jim
16385 Roskind's profile"...
16386
16387 * Lib/Attic/threading_api.py:
16388 Removed; since long subsumed in Doc/lib/libthreading.tex
16389
16390 * Modules/socketmodule.c:
16391 Put back __osf__ support for gethostbyname_r(); the real bug was that
16392 it was being used even without threads. This of course might be an
16393 all-platform problem so now we only use the _r variant when we are
16394 using threads.
16395
16396Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16397
16398 * Modules/cPickle.c:
16399 Fix accidentally reversed NULL test in load_mark(). Suggested by
16400 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
16401 returns NULL.)
16402
16403 * README:
16404 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
16405
16406 * README: Add note about -D_REENTRANT for HP-UX 10.20.
16407
16408 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
16409
16410 * PC/Attic/vc40.mak, PC/readme.txt:
16411 Remove all VC++ info (except VC 1.5) from readme.txt;
16412 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
16413
16414 * README: Clarify PC build instructions (point to PCbuild).
16415
16416 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
16417
16418 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
16419 Forgot to add this file. CDROM device parameters.
16420
16421 * Lib/gzip.py: Two different changes.
16422
16423 1. Jack Jansen reports that on the Mac, the time may be negative, and
16424 solves this by adding a write32u() function that writes an unsigned
16425 long.
16426
16427 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
16428 casting both values to be compared to "unsigned long" i.e. modulo
16429 0x100000000L.
16430
16431Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16432
16433 * PC/Attic/_tkinter.def: No longer needed.
16434
16435 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
16436
16437 * README: Add DEC Ultrix notes (from Donn Cave's email).
16438
16439 * configure: The usual
16440
16441 * configure.in:
16442 Quote a bunch of shell variables used in test, related to long-long.
16443
16444 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
16445 casts for picky compilers.
16446
16447 * Modules/socketmodule.c:
16448 3-arg gethostbyname_r doesn't really work on OSF/1.
16449
16450 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
16451 Avoid totally empty files.
16452
16453Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16454
16455 * Tools/scripts/fixps.py: Use re instead of regex.
16456 Don't rewrite the file in place.
16457 (Reported by Andy Dustman.)
16458
16459 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
16460
16461Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16462
16463 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
16464 Add a variable %_TCL_% that makes it easier to switch to a different version.
16465
16466
16467======================================================================
16468
16469
16470From 1.5.2b2 to 1.5.2c1
16471=======================
16472
16473Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16474
16475 * PCbuild/python15.wse:
16476 Release 1.5.2c1. Add IDLE and Uninstall to program group.
16477 Don't distribute zlib.dll. Tweak some comments.
16478
16479 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
16480
16481 * 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:
16482 The usual
16483
16484 * Include/patchlevel.h: Release 1.5.2c1
16485
16486 * README: Release 1.5.2c1.
16487
16488 * Misc/NEWS: News for the 1.5.2c1 release.
16489
16490 * Lib/test/test_strftime.py:
16491 On Windows, we suddenly find, strftime() may return "" for an
16492 unsupported format string. (I guess this is because the logic for
16493 deciding whether to reallocate the buffer or not has been improved.)
16494 This caused the test code to crash on result[0]. Fix this by assuming
16495 an empty result also means the format is not supported.
16496
16497 * Demo/tkinter/matt/window-creation-w-location.py:
16498 This demo imported some private code from Matt. Make it cripple along.
16499
16500 * Lib/lib-tk/Tkinter.py:
16501 Delete an accidentally checked-in feature that actually broke more
16502 than was worth it: when deleting a canvas item, it would try to
16503 automatically delete the bindings for that item. Since there's
16504 nothing that says you can't reuse the tag and still have the bindings,
16505 this is not correct. Also, it broke at least one demo
16506 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
16507
16508 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
16509
16510Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16511
16512 * Modules/zlibmodule.c:
16513 Patch by Andrew Kuchling to unflush() (flush() for deflating).
16514 Without this, if inflate() returned Z_BUF_ERROR asking for more output
16515 space, we would report the error; now, we increase the buffer size and
16516 try again, just as for Z_OK.
16517
16518 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
16519
16520 * Tools/idle/ChangeLog: New change log.
16521
16522 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
16523
16524 * Python/pythonrun.c:
16525 Alas, get rid of the Win specific hack to ask the user to press Return
16526 before exiting when an error happened. This didn't work right when
16527 Python is invoked from a daemon.
16528
16529 * Tools/idle/idlever.py: Version bump awaiting impending new release.
16530 (Not much has changed :-( )
16531
16532 * Lib/lib-tk/Tkinter.py:
16533 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
16534 so the preferred name for them is tag_lower, tag_raise
16535 (similar to tag_bind, and similar to the Text widget);
16536 unfortunately can't delete the old ones yet (maybe in 1.6)
16537
16538 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
16539 Changes by Mark Hammond for Windows CE. Mostly of the form
16540 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
16541
16542 * Python/bltinmodule.c:
16543 Remove unused variable from complex_from_string() code.
16544
16545 * Include/patchlevel.h:
16546 Add the possibility of a gamma release (release candidate).
16547 Add '+' to string version number to indicate we're beyond b2 now.
16548
16549 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
16550
16551 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
16552
16553 Per writes:
16554
16555 """
16556 The application where Signum Support uses smtplib needs to be able to
16557 report good error messages to the user when sending email fails. To
16558 help in diagnosing problems it is useful to be able to report the
16559 entire message sent by the server, not only the SMTP error code of the
16560 offending command.
16561
16562 A lot of the functions in sendmail.py unfortunately discards the
16563 message, leaving only the code. The enclosed patch fixes that
16564 problem.
16565
16566 The enclosed patch also introduces a base class for exceptions that
16567 include an SMTP error code and error message, and make the code and
16568 message available on separate attributes, so that surrounding code can
16569 deal with them in whatever way it sees fit. I've also added some
16570 documentation to the exception classes.
16571
16572 The constructor will now raise an exception if it cannot connect to
16573 the SMTP server.
16574
16575 The data() method will raise an SMTPDataError if it doesn't receive
16576 the expected 354 code in the middle of the exchange.
16577
16578 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
16579 text, including no text at all" after the error code. If the response
16580 of a HELO command contains no text self.helo_resp will be set to the
16581 empty string (""). The patch fixes the test in the sendmail() method
16582 so that helo_resp is tested against None; if it has the empty string
16583 as value the sendmail() method would invoke the helo() method again.
16584
16585 The code no longer accepts a -1 reply from the ehlo() method in
16586 sendmail().
16587
16588 [Text about removing SMTPRecipientsRefused deleted --GvR]
16589 """
16590
16591 and also:
16592
16593 """
16594 smtplib.py appends an extra blank line to the outgoing mail if the
16595 `msg' argument to the sendmail method already contains a trailing
16596 newline. This patch should fix the problem.
16597 """
16598
16599 The Dragon writes:
16600
16601 """
16602 Mostly I just re-added the SMTPRecipientsRefused exception
16603 (the exeption object now has the appropriate info in it ) [Per had
16604 removed this in his patch --GvR] and tweaked the behavior of the
16605 sendmail method whence it throws the newly added SMTPHeloException (it
16606 was closing the connection, which it shouldn't. whatever catches the
16607 exception should do that. )
16608
16609 I pondered the change of the return values to tuples all around,
16610 and after some thinking I decided that regularizing the return values was
16611 too much of the Right Thing (tm) to not do.
16612
16613 My one concern is that code expecting an integer & getting a tuple
16614 may fail silently.
16615
16616 (i.e. if it's doing :
16617
16618 x.somemethod() >= 400:
16619 expecting an integer, the expression will always be true if it gets a
16620 tuple instead. )
16621
16622 However, most smtplib code I've seen only really uses the
16623 sendmail() method, so this wouldn't bother it. Usually code I've seen
16624 that calls the other methods usually only calls helo() and ehlo() for
16625 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
16626 and thus I would think not much code uses it yet.
16627 """
16628
16629Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16630
16631 * Lib/test/test_ntpath.py:
16632 Fix the tests now that splitdrive() no longer treats UNC paths special.
16633 (Some tests converted to splitunc() tests.)
16634
16635 * Lib/ntpath.py:
16636 Withdraw the UNC support from splitdrive(). Instead, a new function
16637 splitunc() parses UNC paths. The contributor of the UNC parsing in
16638 splitdrive() doesn't like it, but I haven't heard a good reason to
16639 keep it, and it causes some problems. (I think there's a
16640 philosophical problem -- to me, the split*() functions are purely
16641 syntactical, and the fact that \\foo is not a valid path doesn't mean
16642 that it shouldn't be considered an absolute path.)
16643
16644 Also (quite separately, but strangely related to the philosophical
16645 issue above) fix abspath() so that if win32api exists, it doesn't fail
16646 when the path doesn't actually exist -- if GetFullPathName() fails,
Mark Dickinson934896d2009-02-21 20:59:32 +000016647 fall back on the old strategy (join with getcwd() if necessary, and
Guido van Rossum2001da42000-09-01 22:26:44 +000016648 then use normpath()).
16649
16650 * configure.in, configure, config.h.in, acconfig.h:
16651 For BeOS PowerPC. Chris Herborth.
16652
16653Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16654
16655 * Modules/timemodule.c:
16656 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
16657 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
16658
16659 * Misc/ACKS:
16660 Bunch of new contributors, including 9 who contributed to the Docs,
16661 reported by Fred.
16662
16663Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
16664
16665 * Lib/gzip.py:
16666 Oops, missed mode parameter to open().
16667
16668 * Lib/gzip.py:
16669 Made the default mode 'rb' instead of 'r', for better cross-platform
16670 support. (Based on comment on the documentation by Bernhard Reiter
16671 <bernhard@csd.uwm.edu>).
16672
16673Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16674
16675 * Tools/scripts/dutree.py:
16676 For reasons I dare not explain, this script should always execute
16677 main() when imported (in other words, it is not usable as a module).
16678
16679Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16680
16681 * Lib/test/test_cpickle.py: Jonathan Giddy write:
16682
16683 In test_cpickle.py, the module os got imported, but the line to remove
16684 the temp file has gone missing.
16685
16686Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16687
16688 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
16689
16690 If you send something like "PUT / HTTP/1.0" to something derived from
16691 BaseHTTPServer that doesn't define do_PUT, you will get a response
16692 that begins like this:
16693
16694 HTTP/1.0 501 Unsupported method ('do_PUT')
16695 Server: SimpleHTTP/0.3 Python/1.5
16696 Date: Tue, 30 Mar 1999 18:53:53 GMT
16697
16698 The server should complain about 'PUT' instead of 'do_PUT'. This
16699 patch should fix the problem.
16700
16701Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16702
16703 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
16704
16705 """
16706 - It needlessly used the makefile() method for each response that is
16707 read from the SMTP server.
16708
16709 - If the remote SMTP server closes the connection unexpectedly the
16710 code raised an IndexError. It now raises an SMTPServerDisconnected
16711 exception instead.
16712
16713 - The code now checks that all lines in a multiline response actually
16714 contains an error code.
16715 """
16716
16717 The Dragon approves.
16718
16719Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
16720
16721 * Lib/compileall.py:
16722 When run as a script, report failures in the exit code as well.
16723 Patch largely based on changes by Andrew Dalke, as discussed in the
16724 distutils-sig.
16725
16726Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16727
16728 * Lib/urllib.py:
16729 Hack so that if a 302 or 301 redirect contains a relative URL, the
16730 right thing "just happens" (basejoin() with old URL).
16731
16732 * Modules/cPickle.c:
16733 Protection against picling to/from closed (real) file.
16734 The problem was reported by Moshe Zadka.
16735
16736 * Lib/test/test_cpickle.py:
16737 Test protection against picling to/from closed (real) file.
16738
16739 * Modules/timemodule.c: Chris Lawrence writes:
16740
16741 """
16742 The GNU folks, in their infinite wisdom, have decided not to implement
16743 altzone in libc6; this would not be horrible, except that timezone
16744 (which is implemented) includes the current DST setting (i.e. timezone
16745 for Central is 18000 in summer and 21600 in winter). So Python's
16746 timezone and altzone variables aren't set correctly during DST.
16747
16748 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
16749 show the "right" thing on Linux (by using the tm_gmtoff stuff
16750 available in BSD, which is how the GLIBC manual claims things should
16751 be done) and (b) should cope with the southern hemisphere. In pursuit
16752 of (b), I also took the liberty of renaming the "summer" and "winter"
16753 variables to "july" and "jan". This patch should also make certain
16754 time calculations on Linux actually work right (like the tz-aware
16755 functions in the rfc822 module).
16756
16757 (It's hard to find DST that's currently being used in the southern
16758 hemisphere; I tested using Africa/Windhoek.)
16759 """
16760
16761 * Lib/test/output/test_gzip:
16762 Jonathan Giddy discovered this file was missing.
16763
16764 * Modules/shamodule.c:
16765 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
16766 middlename) Marangozov, patch coded by Greg Stein.
16767
16768 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
16769 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
16770
16771Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16772
16773 * Tools/scripts/ndiff.py: Tim Peters writes:
16774
16775 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
16776 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
16777 for recreating the original files from ndiff's output. That's attached, if
16778 you're game! Us Windows guys don't usually have a sed sitting around
16779 <wink>.
16780
16781Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16782
16783 * Tools/scripts/ndiff.py: Tim Peters writes:
16784
16785 Attached is a cleaned-up version of ndiff (added useful module
16786 docstring, now echo'ed in case of cmd line mistake); added -q option
16787 to suppress initial file identification lines; + other minor cleanups,
16788 & a slightly faster match engine.
16789
16790Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
16791
16792 * Tools/scripts/dutree.py:
16793 During display, if EPIPE is raised, it's probably because a pager was
16794 killed. Discard the error in that case, but propogate it otherwise.
16795
16796Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16797
16798 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
16799 Test suite for UserList.
16800
16801 * Lib/UserList.py: Use isinstance() where appropriate.
16802 Reformatted with 4-space indent.
16803
16804Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
16805
16806 * Tools/pynche/PyncheWidget.py:
16807 Helpwin.__init__(): The text widget should get focus.
16808
16809 * Tools/pynche/pyColorChooser.py:
16810 Removed unnecessary import `from PyncheWidget import PyncheWidget'
16811
16812Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16813
16814 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
16815 Test suite for UserDict
16816
16817 * Lib/UserDict.py: Improved a bunch of things.
16818 The constructor now takes an optional dictionary.
16819 Use isinstance() where appropriate.
16820
16821Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16822
16823 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
16824 Basic regr tests for pickle/cPickle
16825
16826 * Lib/pickle.py:
16827 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
16828 points out) it doesn't work in JPython Applets.
16829
16830Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
16831
16832 * Lib/test/test_gzip.py:
16833 Added a simple test suite for gzip. It simply opens a temp file,
16834 writes a chunk of compressed data, closes it, writes another chunk, and
16835 reads the contents back to verify that they are the same.
16836
16837 * Lib/gzip.py:
16838 Based on a suggestion from bruce@hams.com, make a trivial change to
16839 allow using the 'a' flag as a mode for opening a GzipFile. gzip
16840 files, surprisingly enough, can be concatenated and then decompressed;
16841 the effect is to concatenate the two chunks of data.
16842
16843 If we support it on writing, it should also be supported on reading.
16844 This *wasn't* trivial, and required rearranging the code in the
16845 reading path, particularly the _read() method.
16846
16847 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
16848 and 'Unknown compression method'
16849
16850Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16851
16852 * Lib/test/test_b1.py:
16853 Add tests for float() and complex() with string args (Nick/Stephanie
16854 Lockwood).
16855
16856Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
16857
16858 * Modules/zlibmodule.c:
16859 Add an .unused_data attribute to decompressor objects. If .unused_data
16860 is not an empty string, this means that you have arrived at the
16861 end of the stream of compressed data, and the contents of .unused_data are
16862 whatever follows the compressed stream.
16863
16864Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16865
16866 * Python/bltinmodule.c:
16867 Patch by Nick and Stephanie Lockwood to implement complex() with a string
16868 argument. This closes TODO item 2.19.
16869
16870Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16871
16872 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
16873 Unfortunately his code breaks wcgui.py in a way that's not easy
16874 to fix. I expect that this is a temporary situation --
16875 eventually Sam's changes will be merged back in.
16876 (The changes add a -t option to specify exceptions to the -x
16877 option, and explicit checking for #foo style fragment ids.)
16878
16879 * Objects/dictobject.c:
16880 Vladimir Marangozov contributed updated comments.
16881
16882 * Objects/bufferobject.c: Folded long lines.
16883
16884 * Lib/test/output/test_sha, Lib/test/test_sha.py:
16885 Added Jeremy's test code for the sha module.
16886
16887 * Modules/shamodule.c, Modules/Setup.in:
16888 Added Greg Stein and Andrew Kuchling's sha module.
16889 Fix comments about zlib version and URL.
16890
16891 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
16892
16893 * Include/pythread.h: Conform to standard boilerplate.
16894
16895 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
16896 Chris Herborth: the new compiler in R4.1 needs some new options to work...
16897
16898 * Modules/socketmodule.c:
16899 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
16900 data struct before calling gethostby{name,addr}_r(); (2) ignore the
16901 3/5/6 args determinations made by the configure script and switch on
16902 platform identifiers instead:
16903
16904 AIX, OSF have 3 args
16905 Sun, SGI have 5 args
16906 Linux has 6 args
16907
16908 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
16909
16910 * Modules/socketmodule.c:
16911 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
16912
16913 * Lib/mailbox.py:
16914 Add readlines() to _Subfile class. Not clear who would need it, but
16915 Chris Lawrence sent me a broken version; this one is a tad simpler and
16916 more conforming to the standard.
16917
16918Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
16919
16920 * Lib/gzip.py: use struct instead of bit-manipulate in Python
16921
16922Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16923
16924 * Modules/Makefile.pre.in:
16925 Add $(EXE) to various occurrences of python so it will work on Cygwin
16926 with egcs (after setting EXE=.exe). Patch by Norman Vine.
16927
16928 * configure, configure.in:
16929 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
16930
16931Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16932
16933 * Include/thread.h:
16934 Adding thread.h -- unused but for b/w compatibility.
16935 As requested by Bill Janssen.
16936
16937 * configure.in, configure:
16938 Add code to test for all sorts of gethostbyname_r variants,
16939 donated by David Arnold.
16940
16941 * config.h.in, acconfig.h:
16942 Add symbols for gethostbyname_r variants (sigh).
16943
16944 * Modules/socketmodule.c: Clean up pass for the previous patches.
16945
16946 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
16947 glibc2.
16948
16949 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
16950 don't know what code should be used.
16951
16952 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
16953
16954 - Modify the gethostbyaddr() code to also hold on to the lock until
16955 after it is safe to release, overlapping with the Python lock.
16956
16957 (Note: I think that it could in theory be possible that Python code
16958 executed while gethostbyname_lock is held could attempt to reacquire
16959 the lock -- e.g. in a signal handler or destructor. I will simply say
16960 "don't do that then.")
16961
16962 * Modules/socketmodule.c: Jonathan Giddy writes:
16963
16964 Here's a patch to fix the race condition, which wasn't fixed by Rob's
16965 patch. It holds the gethostbyname lock until the results are copied out,
16966 which means that this lock and the Python global lock are held at the same
16967 time. This shouldn't be a problem as long as the gethostbyname lock is
16968 always acquired when the global lock is not held.
16969
16970Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
16971
16972 * Modules/zlibmodule.c:
16973 Fixed the flush() method of compression objects; the test for
16974 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
16975 Logic cleaned up and commented.
16976
16977 * Lib/test/test_zlib.py:
16978 Added simple test for the flush() method of compression objects, trying the
16979 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
16980
16981Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16982
16983 * Lib/shlex.py:
16984 Bug reported by Tobias Thelen: missing "self." in assignment target.
16985
16986Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
16987
16988 * Modules/arraymodule.c:
16989 Use an unsigned cast to avoid a warning in VC++.
16990
16991 * Lib/dospath.py, Lib/ntpath.py:
16992 New code for split() by Tim Peters, behaves more like posixpath.split().
16993
16994 * Objects/floatobject.c:
16995 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
16996 a block cannot be freed, add its free items back to the free list.
16997 This is necessary to avoid leaking when Python is reinitialized later.
16998
16999 * Objects/intobject.c:
17000 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
17001 a block cannot be freed, add its free items back to the free list, and
17002 add its valid ints back to the small_ints array if they are in range.
17003 This is necessary to avoid leaking when Python is reinitialized later.
17004
17005 * Lib/types.py:
17006 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
17007
17008 * Python/bltinmodule.c:
17009 New builtin buffer() creates a derived read-only buffer from any
17010 object that supports the buffer interface (e.g. strings, arrays).
17011
17012 * Objects/bufferobject.c:
17013 Added check for negative offset for PyBuffer_FromObject and check for
17014 negative size for PyBuffer_FromMemory. Greg Stein.
17015
17016Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17017
17018 * Lib/urlparse.py: Sjoerd Mullender writes:
17019
17020 If a filename on Windows starts with \\, it is converted to a URL
17021 which starts with ////. If this URL is passed to urlparse.urlparse
17022 you get a path that starts with // (and an empty netloc). If you pass
17023 the result back to urlparse.urlunparse, you get a URL that starts with
17024 //, which is parsed differently by urlparse.urlparse. The fix is to
17025 add the (empty) netloc with accompanying slashes if the path in
17026 urlunparse starts with //. Do this for all schemes that use a netloc.
17027
17028 * Lib/nturl2path.py: Sjoerd Mullender writes:
17029
17030 Pathnames of files on other hosts in the same domain
17031 (\\host\path\to\file) are not translated correctly to URLs and back.
17032 The URL should be something like file:////host/path/to/file.
17033 Note that a combination of drive letter and remote host is not
17034 possible.
17035
17036Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17037
17038 * Lib/urlparse.py:
17039 Delete non-standard-conforming code in urljoin() that would use the
17040 netloc from the base url as the default netloc for the resulting url
17041 even if the schemes differ.
17042
17043 Once upon a time, when the web was wild, this was a valuable hack
17044 because some people had a URL referencing an ftp server colocated with
17045 an http server without having the host in the ftp URL (so they could
17046 replicate it or change the hostname easily).
17047
17048 More recently, after the file: scheme got added back to the list of
17049 schemes that accept a netloc, it turns out that this caused weirdness
17050 when joining an http: URL with a file: URL -- the resulting file: URL
17051 would always inherit the host from the http: URL because the file:
17052 scheme supports a netloc but in practice never has one.
17053
17054 There are two reasons to get rid of the old, once-valuable hack,
17055 instead of removing the file: scheme from the uses_netloc list. One,
17056 the RFC says that file: uses the netloc syntax, and does not endorse
17057 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
17058 hack.
17059
17060 * Include/ceval.h, Include/abstract.h:
17061 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
17062
17063Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17064
17065 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
17066
17067 An attempt to execute grid_slaves with arguments (0,0) results in
17068 *all* of the slaves being returned, not just the slave associated with
17069 row 0, column 0. This is because the test for arguments in the method
17070 does not test to see if row (and column) does not equal None, but
17071 rather just whether is evaluates to non-false. A value of 0 fails
17072 this test.
17073
17074Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
17075
17076 * Modules/cmathmodule.c:
17077 Docstring fix: acosh() returns the hyperbolic arccosine, not the
17078 hyperbolic cosine. Problem report via David Ascher by one of his
17079 students.
17080
17081Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17082
17083 * configure.in:
17084 Should test for gethost*by*name_r, not for gethostname_r (which
17085 doesn't exist and doesn't make sense).
17086
17087 * Modules/socketmodule.c:
17088 Patch by Rob Riggs for Linux -- glibc2 has a different argument
17089 converntion for gethostbyname_r() etc. than Solaris!
17090
17091 * Python/thread_pthread.h: Rob Riggs wrote:
17092
17093 """
17094 Spec says that on success pthread_create returns 0. It does not say
17095 that an error code will be < 0. Linux glibc2 pthread_create() returns
17096 ENOMEM (12) when one exceed process limits. (It looks like it should
17097 return EAGAIN, but that's another story.)
17098
17099 For reference, see:
17100 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
17101 """
17102
17103 [I have a feeling that similar bugs were fixed before; perhaps someone
17104 could check that all error checks no check for != 0?]
17105
17106 * Tools/bgen/bgen/bgenObjectDefinition.py:
17107 New mixin class that defines cmp and hash that use
17108 the ob_itself pointer. This allows (when using the mixin)
17109 different Python objects pointing to the same C object and
17110 behaving well as dictionary keys.
17111
17112 Or so sez Jack Jansen...
17113
17114 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
17115
17116 Don't convert URLs to URLs using pathname2url.
17117
17118Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17119
17120 * Lib/cmd.py: Patch by Michael Scharf. He writes:
17121
17122 The module cmd requires for each do_xxx command a help_xxx
17123 function. I think this is a little old fashioned.
17124
17125 Here is a patch: use the docstring as help if no help_xxx
17126 function can be found.
17127
17128 [I'm tempted to rip out all the help_* functions from pdb, but I'll
17129 resist it. Any takers? --Guido]
17130
17131 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
17132
17133 Under Windows, python freeze.py -o hello hello.py
17134 creates all the correct files in the hello subdirectory, but the
17135 Makefile has the directory prefix in it for frozen_extensions.c
17136 nmake fails because it tries to locate hello/frozen_extensions.c
17137
17138 (His fix adds a call to os.path.basename() in the appropriate place.)
17139
17140 * Objects/floatobject.c, Objects/intobject.c:
17141 Vladimir has restructured his code somewhat so that the blocks are now
17142 represented by an explicit structure. (There are still too many casts
17143 in the code, but that may be unavoidable.)
17144
17145 Also added code so that with -vv it is very chatty about what it does.
17146
17147 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
17148 Change #! line to modern usage; also chmod +x
17149
17150 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
17151 Change #! line to modern usage
17152
17153 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
17154
17155 The filename to URL conversion didn't properly quote special
17156 characters.
17157 The URL to filename didn't properly unquote special chatacters.
17158
17159 * Objects/floatobject.c:
17160 OK, try again. Vladimir gave me a fix for the alignment bus error,
17161 so here's his patch again. This time it works (at least on Solaris,
17162 Linux and Irix).
17163
17164Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17165
17166 * Tools/idle/PathBrowser.py:
17167 Don't crash when sys.path contains an empty string.
17168
17169 * Tools/idle/PathBrowser.py:
17170 - Don't crash in the case where a superclass is a string instead of a
17171 pyclbr.Class object; this can happen when the superclass is
17172 unrecognizable (to pyclbr), e.g. when module renaming is used.
17173
17174 - Show a watch cursor when calling pyclbr (since it may take a while
17175 recursively parsing imported modules!).
17176
17177Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
17178
17179 * Lib/mimetypes.py:
17180 Added .rdf and .xsl as application/xml types. (.rdf is for the
17181 Resource Description Framework, a metadata encoding, and .xsl is for
17182 the Extensible Stylesheet Language.)
17183
17184Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17185
17186 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
17187 Test for popen2 module, by Chris Tismer.
17188
17189 * Objects/floatobject.c:
17190 Alas, Vladimir's patch caused a bus error (probably double
17191 alignment?), and I didn't test it. Withdrawing it for now.
17192
17193Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17194
17195 * Objects/floatobject.c:
17196 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
17197 floats on finalization.
17198
17199 * Objects/intobject.c:
17200 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
17201 integers on finalization.
17202
17203 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
17204 Add PathBrowser to File module
17205
17206 * Tools/idle/PathBrowser.py:
17207 "Path browser" - 4 scrolled lists displaying:
17208 directories on sys.path
17209 modules in selected directory
17210 classes in selected module
17211 methods of selected class
17212
17213 Sinlge clicking in a directory, module or class item updates the next
17214 column with info about the selected item. Double clicking in a
17215 module, class or method item opens the file (and selects the clicked
17216 item if it is a class or method).
17217
17218 I guess eventually I should be using a tree widget for this, but the
17219 ones I've seen don't work well enough, so for now I use the old
17220 Smalltalk or NeXT style multi-column hierarchical browser.
17221
17222 * Tools/idle/MultiScrolledLists.py:
17223 New utility: multiple scrolled lists in parallel
17224
17225 * Tools/idle/ScrolledList.py: - White background.
17226 - Display "(None)" (or text of your choosing) when empty.
17227 - Don't set the focus.
17228
17229Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17230
17231 * Lib/urllib.py:
17232 open_http also had the 'data is None' test backwards. don't call with the
17233 extra argument if data is None.
17234
17235 * Demo/embed/demo.c:
17236 Call Py_SetProgramName() instead of redefining getprogramname(),
17237 reflecting changes in the runtime around 1.5 or earlier.
17238
17239 * Python/ceval.c:
17240 Always test for an error return (usually NULL or -1) without setting
17241 an exception.
17242
17243 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
17244 He writes:
17245
17246 I had an off-by-1000 error in floatsleep(),
17247 and the problem with time.clock() is that it's not implemented properly
17248 on QNX... ANSI says it's supposed to return _CPU_ time used by the
17249 process, but on QNX it returns the amount of real time used... so I was
17250 confused.
17251
17252 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
17253 Test for self.returntype behaving like OSErr rather than being it.
17254
17255Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
17256
17257 * Lib/urllib.py:
17258 http_error had the 'data is None' test backwards. don't call with the
17259 extra argument if data is None.
17260
17261 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
17262
17263 * Lib/urllib.py: pleasing the tabnanny
17264
17265Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
17266
17267 * Lib/colorsys.py:
17268 Oops, one more "x, y, z" to convert...
17269
17270 * Lib/colorsys.py:
17271 Adjusted comment at the top to be less confusing, following Fredrik
17272 Lundh's example.
17273
17274 Converted comment to docstring.
17275
17276Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
17277
17278 * Lib/toaiff.py:
17279 Use sndhdr instead of the obsolete whatsound module.
17280
17281Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
17282
17283 * Lib/urllib.py:
17284 When performing a POST request, i.e. when the second argument to
17285 urlopen is used to specify form data, make sure the second argument is
17286 threaded through all of the http_error_NNN calls. This allows error
17287 handlers like the redirect and authorization handlers to properly
17288 re-start the connection.
17289
17290Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17291
17292 * Lib/mhlib.py: Patch by Lars Wirzenius:
17293
17294 o the initial comment is wrong: creating messages is already
17295 implemented
17296
17297 o Message.getbodytext: if the mail or it's part contains an
17298 empty content-transfer-encoding header, the code used to
17299 break; the change below treats an empty encoding value the same
17300 as the other types that do not need decoding
17301
17302 o SubMessage.getbodytext was missing the decode argument; the
17303 change below adds it; I also made it unconditionally return
17304 the raw text if decoding was not desired, because my own
17305 routines needed that (and it was easier than rewriting my
17306 own routines ;-)
17307
17308Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
17309
17310 * Python/bltinmodule.c (initerrors):
17311 Make sure that the exception tuples ("base-classes" when
17312 string-based exceptions are used) reflect the real class hierarchy,
17313 i.e. that SystemExit derives from Exception not StandardError.
17314
17315 * Lib/exceptions.py:
17316 Document the correct class hierarchy for SystemExit. It is not an
17317 error and so it derives from Exception and not SystemError. The
17318 docstring was incorrect but the implementation was fine.
17319
17320Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17321
17322 * Lib/shutil.py:
17323 Add import sys, needed by reference to sys.exc_info() in rmtree().
17324 Discovered by Mitch Chapman.
17325
17326 * config.h.in:
17327 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
17328 disappears. It wasn't used anywhere anyway...
17329
17330 * Modules/arraymodule.c:
17331 Carefully check for overflow when allocating the memory for fromfile
17332 -- someone tried to pass in sys.maxint and got bitten by the bogus
17333 calculations.
17334
17335 * configure.in:
17336 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
17337 LIBM (from --with-libm=...); this actually broke the customizability
17338 offered by the latter option. Thanks go to Clay Spence for reporting
17339 this.
17340
17341 * Lib/test/test_dl.py:
17342 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
17343 2. When no test case worked, raise ImportError instead of failing.
17344
17345 * Python/bltinmodule.c:
17346 Patch by Tim Peters to improve the range checks for range() and
17347 xrange(), especially for platforms where int and long are different
17348 sizes (so sys.maxint isn't actually the theoretical limit for the
17349 length of a list, but the largest C int is -- sys.maxint is the
17350 largest Python int, which is actually a C long).
17351
17352 * Makefile.in:
17353 1. Augment the DG/UX rule so it doesn't break the BeOS build.
17354 2. Add $(EXE) to various occurrences of python so it will work on
17355 Cygwin with egcs (after setting EXE=.exe). These patches by
17356 Norman Vine.
17357
17358 * Lib/posixfile.py:
17359 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
17360 list (of bsd variants that have a different lock structure).
17361
17362 * Lib/test/test_fcntl.py:
17363 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
17364
17365 * Modules/timemodule.c:
17366 Patch by Tadayoshi Funaba (with some changes) to be smarter about
17367 guessing what happened when strftime() returns 0. Is it buffer
17368 overflow or was the result simply 0 bytes long? (This happens for an
17369 empty format string, or when the format string is a single %Z and the
17370 timezone is unknown.) if the buffer is at least 256 times as long as
17371 the format, assume the latter.
17372
17373Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17374
17375 * Lib/urllib.py:
17376 As Des Barry points out, we need to call pathname2url(file) in two
17377 calls to addinfourl() in open_file().
17378
17379 * Modules/Setup.in: Document *static* -- in two places!
17380
17381 * Modules/timemodule.c:
17382 We don't support leap seconds, so the seconds field of a time 9-tuple
17383 should be in the range [0-59]. Noted by Tadayoshi Funaba.
17384
17385 * Modules/stropmodule.c:
17386 In atoi(), don't use isxdigit() to test whether the last character
17387 converted was a "digit" -- use isalnum(). This test is there only to
17388 guard against "+" or "-" being interpreted as a valid int literal.
17389 Reported by Takahiro Nakayama.
17390
17391 * Lib/os.py:
17392 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
17393 so they don't need to be treated specially here.
17394
17395Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
17396
17397 * Misc/NEWS:
17398 Typo: "apparentlt" --> "apparently"
17399
17400Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
17401
17402 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
17403
17404 * Modules/posixmodule.c:
17405 The docstring for ttyname(..) claims a second "mode" argument. The
17406 actual code does not allow such an argument. (Finn Bock.)
17407
17408 * Lib/lib-old/poly.py:
17409 Dang. Even though this is obsolete code, somebody found a bug, and I
17410 fix it. Oh well.
17411
17412Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
17413
17414 * Lib/pyclbr.py:
17415 Bow to font-lock at the end of the docstring, since it throws stuff
17416 off.
17417
17418 Make sure the path paramter to readmodule() is a list before adding it
17419 with sys.path, or the addition could fail.
17420
17421
17422======================================================================
17423
17424
17425From 1.5.2b1 to 1.5.2b2
17426=======================
17427
17428General
17429-------
17430
17431- Many memory leaks fixed.
17432
17433- Many small bugs fixed.
17434
17435- Command line option -OO (or -O -O) suppresses inclusion of doc
17436strings in resulting bytecode.
17437
17438Windows-specific changes
17439------------------------
17440
17441- New built-in module winsound provides an interface to the Win32
17442PlaySound() call.
17443
17444- Re-enable the audioop module in the config.c file.
17445
17446- On Windows, support spawnv() and associated P_* symbols.
17447
17448- Fixed the conversion of times() return values on Windows.
17449
17450- Removed freeze from the installer -- it doesn't work without the
17451source tree. (See FAQ 8.11.)
17452
17453- On Windows 95/98, the Tkinter module now is smart enough to find
17454Tcl/Tk even when the PATH environment variable hasn't been set -- when
17455the import of _tkinter fails, it searches in a standard locations,
17456patches os.environ["PATH"], and tries again. When it still fails, a
17457clearer error message is produced. This should avoid most
17458installation problems with Tkinter use (e.g. in IDLE).
17459
17460- The -i option doesn't make any calls to set[v]buf() for stdin --
17461this apparently screwed up _kbhit() and the _tkinter main loop.
17462
17463- The ntpath module (and hence, os.path on Windows) now parses out UNC
17464paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
17465splitdrive() will \\host\mountpoint as the drive and \dir\file as the
17466path. ** EXPERIMENTAL **
17467
17468- Added a hack to the exit code so that if (1) the exit status is
17469nonzero and (2) we think we have our own DOS box (i.e. we're not
17470started from a command line shell), we print a message and wait for
17471the user to hit a key before the DOS box is closed.
17472
17473- Updated the installer to WISE 5.0g. Added a dialog warning about
17474the imminent Tcl installation. Added a dialog to specify the program
17475group name in the start menu. Upgraded the Tcl installer to Tcl
174768.0.4.
17477
17478Changes to intrinsics
17479---------------------
17480
17481- The repr() or str() of a module object now shows the __file__
17482attribute (i.e., the file which it was loaded), or the string
17483"(built-in)" if there is no __file__ attribute.
17484
17485- The range() function now avoids overflow during its calculations (if
17486at all possible).
17487
17488- New info string sys.hexversion, which is an integer encoding the
17489version in hexadecimal. In other words, hex(sys.hexversion) ==
174900x010502b2 for Python 1.5.2b2.
17491
17492New or improved ports
17493---------------------
17494
17495- Support for Nextstep descendants (future Mac systems).
17496
17497- Improved BeOS support.
17498
17499- Support dynamic loading of shared libraries on NetBSD platforms that
17500use ELF (i.e., MIPS and Alpha systems).
17501
17502Configuration/build changes
17503---------------------------
17504
17505- The Lib/test directory is no longer included in the default module
17506search path (sys.path) -- "test" has been a package ever since 1.5.
17507
17508- Now using autoconf 2.13.
17509
17510New library modules
17511-------------------
17512
17513- New library modules asyncore and asynchat: these form Sam Rushing's
17514famous asynchronous socket library. Sam has gracefully allowed me to
17515incorporate these in the standard Python library.
17516
17517- New module statvfs contains indexing constants for [f]statvfs()
17518return tuple.
17519
17520Changes to the library
17521----------------------
17522
17523- The wave module (platform-independent support for Windows sound
17524files) has been fixed to actually make it work.
17525
17526- The sunau module (platform-independent support for Sun/NeXT sound
17527files) has been fixed to work across platforms. Also, a weird
17528encoding bug in the header of the audio test data file has been
17529corrected.
17530
17531- Fix a bug in the urllib module that occasionally tripped up
17532webchecker and other ftp retrieves.
17533
17534- ConfigParser's get() method now accepts an optional keyword argument
17535(vars) that is substituted on top of the defaults that were setup in
17536__init__. You can now also have recusive references in your
17537configuration file.
17538
17539- Some improvements to the Queue module, including a put_nowait()
17540module and an optional "block" second argument, to get() and put(),
17541defaulting to 1.
17542
17543- The updated xmllib module is once again compatible with the version
17544present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
17545
17546- The bdb module (base class for the debugger) now supports
17547canonicalizing pathnames used in breakpoints. The derived class must
17548override the new canonical() method for this to work. Also changed
17549clear_break() to the backwards compatible old signature, and added
17550clear_bpbynumber() for the new functionality.
17551
17552- In sgmllib (and hence htmllib), recognize attributes even if they
17553don't have space in front of them. I.e. '<a
17554name="foo"href="bar.html">' will now have two attributes recognized.
17555
17556- In the debugger (pdb), change clear syntax to support three
17557alternatives: clear; clear file:line; clear bpno bpno ...
17558
17559- The os.path module now pretends to be a submodule within the os
17560"package", so you can do things like "from os.path import exists".
17561
17562- The standard exceptions now have doc strings.
17563
17564- In the smtplib module, exceptions are now classes. Also avoid
17565inserting a non-standard space after "TO" in rcpt() command.
17566
17567- The rfc822 module's getaddrlist() method now uses all occurrences of
17568the specified header instead of just the first. Some other bugfixes
17569too (to handle more weird addresses found in a very large test set,
17570and to avoid crashes on certain invalid dates), and a small test
17571module has been added.
17572
17573- Fixed bug in urlparse in the common-case code for HTTP URLs; it
17574would lose the query, fragment, and/or parameter information.
17575
17576- The sndhdr module no longer supports whatraw() -- it depended on a
17577rare extenral program.
17578
17579- The UserList module/class now supports the extend() method, like
17580real list objects.
17581
17582- The uu module now deals better with trailing garbage generated by
17583some broke uuencoders.
17584
17585- The telnet module now has an my_interact() method which uses threads
17586instead of select. The interact() method uses this by default on
17587Windows (where the single-threaded version doesn't work).
17588
17589- Add a class to mailbox.py for dealing with qmail directory
17590mailboxes. The test code was extended to notice these being used as
17591well.
17592
17593Changes to extension modules
17594----------------------------
17595
17596- Support for the [f]statvfs() system call, where it exists.
17597
17598- Fixed some bugs in cPickle where bad input could cause it to dump
17599core.
17600
17601- Fixed cStringIO to make the writelines() function actually work.
17602
17603- Added strop.expandtabs() so string.expandtabs() is now much faster.
17604
17605- Added fsync() and fdatasync(), if they appear to exist.
17606
17607- Support for "long files" (64-bit seek pointers).
17608
17609- Fixed a bug in the zlib module's flush() function.
17610
17611- Added access() system call. It returns 1 if access granted, 0 if
17612not.
17613
17614- The curses module implements an optional nlines argument to
17615w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
17616
17617Changes to tools
17618----------------
17619
17620- Some changes to IDLE; see Tools/idle/NEWS.txt.
17621
17622- Latest version of Misc/python-mode.el included.
17623
17624Changes to Tkinter
17625------------------
17626
17627- Avoid tracebacks when an image is deleted after its root has been
17628destroyed.
17629
17630Changes to the Python/C API
17631---------------------------
17632
17633- When parentheses are used in a PyArg_Parse[Tuple]() call, any
17634sequence is now accepted, instead of requiring a tuple. This is in
17635line with the general trend towards accepting arbitrary sequences.
17636
17637- Added PyModule_GetFilename().
17638
17639- In PyNumber_Power(), remove unneeded and even harmful test for float
17640to the negative power (which is already and better done in
17641floatobject.c).
17642
17643- New version identification symbols; read patchlevel.h for info. The
17644version numbers are now exported by Python.h.
17645
17646- Rolled back the API version change -- it's back to 1007!
17647
17648- The frozenmain.c function calls PyInitFrozenExtensions().
17649
17650- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
17651INCREF.
17652
17653
17654======================================================================
17655
17656
17657From 1.5.2a2 to 1.5.2b1
17658=======================
17659
17660Changes to intrinsics
17661---------------------
17662
17663- New extension NotImplementedError, derived from RuntimeError. Not
17664used, but recommended use is for "abstract" methods to raise this.
17665
17666- The parser will now spit out a warning or error when -t or -tt is
17667used for parser input coming from a string, too.
17668
17669- The code generator now inserts extra SET_LINENO opcodes when
17670compiling multi-line argument lists.
17671
17672- When comparing bound methods, use identity test on the objects, not
17673equality test.
17674
17675New or improved ports
17676---------------------
17677
17678- Chris Herborth has redone his BeOS port; it now works on PowerPC
17679(R3/R4) and x86 (R4 only). Threads work too in this port.
17680
17681Renaming
17682--------
17683
17684- Thanks to Chris Herborth, the thread primitives now have proper Py*
17685names in the source code (they already had those for the linker,
17686through some smart macros; but the source still had the old, un-Py
17687names).
17688
17689Configuration/build changes
17690---------------------------
17691
17692- Improved support for FreeBSD/3.
17693
17694- Check for pthread_detach instead of pthread_create in libc.
17695
17696- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
17697
17698- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
17699Otherwise modules such as thread didn't get incorporated in extensions.
17700
17701New library modules
17702-------------------
17703
17704- shlex.py by Eric Raymond provides a lexical analyzer class for
17705simple shell-like syntaxes.
17706
17707- netrc.py by Eric Raymond provides a parser for .netrc files. (The
17708undocumented Netrc class in ftplib.py is now obsolete.)
17709
17710- codeop.py is a new module that contains the compile_command()
17711function that was previously in code.py. This is so that JPython can
17712provide its own version of this function, while still sharing the
17713higher-level classes in code.py.
17714
17715- turtle.py is a new module for simple turtle graphics. I'm still
17716working on it; let me know if you use this to teach Python to children
17717or other novices without prior programming experience.
17718
17719Obsoleted library modules
17720-------------------------
17721
17722- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
17723their status of obsoleteness. They don't do a particularly good job
17724and don't seem particularly relevant to the Python core.
17725
17726New tools
17727---------
17728
17729- I've added IDLE: my Integrated DeveLopment Environment for Python.
17730Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
17731work on Macintosh, but I haven't been able to test it there; it does
17732depend on new features in 1.5.2 and perhaps even new features in
177331.5.2b1, especially the new code module). This is very much a work in
17734progress. I'd like to hear how people like it compared to PTUI (or
17735any other IDE they are familiar with).
17736
17737- New tools by Barry Warsaw:
17738
17739 = audiopy: controls the Solaris Audio device
17740 = pynche: The PYthonically Natural Color and Hue Editor
17741 = world: Print mappings between country names and DNS country codes
17742
17743New demos
17744---------
17745
17746- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
17747song.
17748
17749- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
17750Tkinter. (By Fredrik Lundh -- not by me!)
17751
17752Changes to the library
17753----------------------
17754
17755- compileall.py now avoids recompiling .py files that haven't changed;
17756it adds a -f option to force recompilation.
17757
17758- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
17759patches).
17760
17761- nntplib.py: statparse() no longer lowercases the message-id.
17762
17763- types.py: use type(__stdin__) for FileType.
17764
17765- urllib.py: fix translations for filenames with "funny" characters.
17766Patch by Sjoerd Mullender. Note that if you subclass one of the
17767URLopener classes, and you have copied code from the old urllib.py,
17768your subclass may stop working. A long-term solution is to provide
17769more methods so that you don't have to copy code.
17770
17771- cgi.py: In read_multi, allow a subclass to override the class we
17772instantiate when we create a recursive instance, by setting the class
17773variable 'FieldStorageClass' to the desired class. By default, this
17774is set to None, in which case we use self.__class__ (as before).
17775Also, a patch by Jim Fulton to pass additional arguments to recursive
17776calls to the FieldStorage constructor from its read_multi method.
17777
17778- UserList.py: In __getslice__, use self.__class__ instead of
17779UserList.
17780
17781- In SimpleHTTPServer.py, the server specified in test() should be
17782BaseHTTPServer.HTTPServer, in case the request handler should want to
17783reference the two attributes added by BaseHTTPServer.server_bind. (By
17784Jeff Rush, for Bobo). Also open the file in binary mode, so serving
17785images from a Windows box might actually work.
17786
17787- In CGIHTTPServer.py, the list of acceptable formats is -split-
17788on spaces but -joined- on commas, resulting in double commas
17789in the joined text. (By Jeff Rush.)
17790
17791- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
17792new threaded versions of Unix Server classes, using the ThreadingMixIn
17793class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
17794
17795- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
17796method do_delete(); do_clear() was meant. By Greg Ward.
17797
17798- getopt.py: accept a non-list sequence for the long options (request
17799by Jack Jansen). Because it might be a common mistake to pass a
17800single string, this situation is treated separately. Also added
17801docstrings (copied from the library manual) and removed the (now
17802redundant) module comments.
17803
17804- tempfile.py: improvements to avoid security leaks.
17805
17806- code.py: moved compile_command() to new module codeop.py.
17807
17808- pickle.py: support pickle format 1.3 (binary float added). By Jim
17809Fulton. Also get rid of the undocumented obsolete Pickler dump_special
17810method.
17811
17812- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
17813
17814- imaplib.py: fix problem with some versions of IMAP4 servers that
17815choose to mix the case in their CAPABILITIES response.
17816
17817- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
17818by Fredrik Lundh.
17819
17820Changes to extension modules
17821----------------------------
17822
17823- More doc strings for several modules were contributed by Chris
17824Petrilli: math, cmath, fcntl.
17825
17826- Fixed a bug in zlibmodule.c that could cause core dumps on
17827decompression of rarely occurring input.
17828
17829- cPickle.c: new version from Jim Fulton, with Open Source copyright
17830notice. Also, initialize self->safe_constructors early on to prevent
17831crash in early dealloc.
17832
17833- cStringIO.c: new version from Jim Fulton, with Open Source copyright
17834notice. Also fixed a core dump in cStringIO.c when doing seeks.
17835
17836- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
17837
17838- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
17839modifies its argument string (bad function!), so we make a temporary
17840copy.
17841
17842- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
17843control pseudo-device, per audio(7I).
17844
17845Changes to tools
17846----------------
17847
17848- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
17849support for Emacs).
17850
17851- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
17852only the names of offending files to be printed.
17853
17854- freeze: when printing missing modules, also print the module they
17855were imported from.
17856
17857- untabify.py: patch by Detlef Lannert to implement -t option
17858(set tab size).
17859
17860Changes to Tkinter
17861------------------
17862
17863- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
17864row2?
17865
17866- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
17867doesn't work when running in a non-threaded environment. He added
17868some #ifdefs that fix this.
17869
17870Changes to the Python/C API
17871---------------------------
17872
17873- Bumped API version number to 1008 -- enough things have changed!
17874
17875- There's a new macro, PyThreadState_GET(), which does the same work
17876as PyThreadState_Get() without the overhead of a function call (it
17877also avoids the error check). The two top calling locations of
17878PyThreadState_Get() have been changed to use this macro.
17879
17880- All symbols intended for export from a DLL or shared library are now
17881marked as such (with the DL_IMPORT() macro) in the header file that
17882declares them. This was needed for the BeOS port, and should also
17883make some other ports easier. The PC port no longer needs the file
17884with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
17885macro which is only used for init methods in extension modules, and
17886for Py_Main().
17887
17888Invisible changes to internals
17889------------------------------
17890
17891- Fixed a bug in new_buffersize() in fileobject.c which could
17892return a buffer size that was way too large.
17893
17894- Use PySys_WriteStderr instead of fprintf in most places.
17895
17896- dictobject.c: remove dead code discovered by Vladimir Marangozov.
17897
17898- tupleobject.c: make tuples less hungry -- an extra item was
17899allocated but never used. Tip by Vladimir Marangozov.
17900
17901- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
17902Jansen)
17903
17904- import.c: Jim Fulton fixes a reference count bug in
17905PyEval_GetGlobals.
17906
17907- glmodule.c: check in the changed version after running the stubber
17908again -- this solves the conflict with curses over the 'clear' entry
17909point much nicer. (Jack Jansen had checked in the changes to cstubs
17910eons ago, but I never regenrated glmodule.c :-( )
17911
17912- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
17913Marangozov.
17914
17915- stropmodule.c: add a missing DECREF in an error exit. Submitted by
17916Jonathan Giddy.
17917
17918
17919======================================================================
17920
17921
17922From 1.5.2a1 to 1.5.2a2
17923=======================
17924
17925General
17926-------
17927
17928- It is now a syntax error to have a function argument without a
17929default following one with a default.
17930
17931- __file__ is now set to the .py file if it was parsed (it used to
17932always be the .pyc/.pyo file).
17933
17934- Don't exit with a fatal error during initialization when there's a
17935problem with the exceptions.py module.
17936
17937- New environment variable PYTHONOPTIMIZE can be used to set -O.
17938
17939- New version of python-mode.el for Emacs.
17940
17941Miscellaneous fixed bugs
17942------------------------
17943
17944- No longer print the (confusing) error message about stack underflow
17945while compiling.
17946
17947- Some threading and locking bugs fixed.
17948
17949- When errno is zero, report "Error", not "Success".
17950
17951Documentation
17952-------------
17953
17954- Documentation will be released separately.
17955
17956- Doc strings added to array and md5 modules by Chris Petrilli.
17957
17958Ports and build procedure
17959-------------------------
17960
17961- Stop installing when a move or copy fails.
17962
17963- New version of the OS/2 port code by Jeff Rush.
17964
17965- The makesetup script handles absolute filenames better.
17966
17967- The 'new' module is now enabled by default in the Setup file.
17968
17969- I *think* I've solved the problem with the Linux build blowing up
17970sometimes due to a conflict between sigcheck/intrcheck and
17971signalmodule.
17972
17973Built-in functions
17974------------------
17975
17976- The second argument to apply() can now be any sequence, not just a
17977tuple.
17978
17979Built-in types
17980--------------
17981
17982- Lists have a new method: L1.extend(L2) is equivalent to the common
17983idiom L1[len(L1):] = L2.
17984
17985- Better error messages when a sequence is indexed with a non-integer.
17986
17987- Bettter error message when calling a non-callable object (include
17988the type in the message).
17989
17990Python services
17991---------------
17992
17993- New version of cPickle.c fixes some bugs.
17994
17995- pickle.py: improved instantiation error handling.
17996
17997- code.py: reworked quite a bit. New base class
17998InteractiveInterpreter and derived class InteractiveConsole. Fixed
17999several problems in compile_command().
18000
18001- py_compile.py: print error message and continue on syntax errors.
18002Also fixed an old bug with the fstat code (it was never used).
18003
18004- pyclbr.py: support submodules of packages.
18005
18006String Services
18007---------------
18008
18009- StringIO.py: raise the right exception (ValueError) for attempted
18010I/O on closed StringIO objects.
18011
18012- re.py: fixed a bug in subn(), which caused .groups() to fail inside
18013the replacement function called by sub().
18014
18015- The struct module has a new format 'P': void * in native mode.
18016
18017Generic OS Services
18018-------------------
18019
18020- Module time: Y2K robustness. 2-digit year acceptance depends on
18021value of time.accept2dyear, initialized from env var PYTHONY2K,
18022default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
18023(POSIX or X/Open recommendation).
18024
18025- os.path: normpath(".//x") should return "x", not "/x".
18026
18027- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
18028doesn't work.
18029
18030- tempfile.py: regenerate the template after a fork() call.
18031
18032Optional OS Services
18033--------------------
18034
18035- In the signal module, disable restarting interrupted system calls
18036when we have siginterrupt().
18037
18038Debugger
18039--------
18040
18041- No longer set __args__; this feature is no longer supported and can
18042affect the debugged code.
18043
18044- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
18045added aliases and some other useful new features, e.g. much better
18046breakpoint support: temporary breakpoint, disabled breakpoints,
18047breakpoints with ignore counts, and conditions; breakpoints can be set
18048on a file before it is loaded.
18049
18050Profiler
18051--------
18052
18053- Changes so that JPython can use it. Also fix the calibration code
18054so it actually works again
18055.
18056Internet Protocols and Support
18057------------------------------
18058
18059- imaplib.py: new version from Piers Lauder.
18060
18061- smtplib.py: change sendmail() method to accept a single string or a
18062list or strings as the destination (commom newbie mistake).
18063
18064- poplib.py: LIST with a msg argument fixed.
18065
18066- urlparse.py: some optimizations for common case (http).
18067
18068- urllib.py: support content-length in info() for ftp protocol;
18069support for a progress meter through a third argument to
18070urlretrieve(); commented out gopher test (the test site is dead).
18071
18072Internet Data handling
18073----------------------
18074
18075- sgmllib.py: support tags with - or . in their name.
18076
18077- mimetypes.py: guess_type() understands 'data' URLs.
18078
18079Restricted Execution
18080--------------------
18081
18082- The classes rexec.RModuleLoader and rexec.RModuleImporter no
18083longer exist.
18084
18085Tkinter
18086-------
18087
18088- When reporting an exception, store its info in sys.last_*. Also,
18089write all of it to stderr.
18090
18091- Added NS, EW, and NSEW constants, for grid's sticky option.
18092
18093- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
18094
18095- Make bind variants without a sequence return a tuple of sequences
18096(formerly it returned a string, which wasn't very convenient).
18097
18098- Add image commands to the Text widget (these are new in Tk 8.0).
18099
18100- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
18101
18102- Improved the thread code (but you still can't call update() from
18103another thread on Windows).
18104
18105- Fixed unnecessary references to _default_root in the new dialog
18106modules.
18107
18108- Miscellaneous problems fixed.
18109
18110
18111Windows General
18112---------------
18113
18114- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
18115search for dependent dlls in the directory containing the .pyd.
18116
18117- In debugging mode, call DebugBreak() in Py_FatalError().
18118
18119Windows Installer
18120-----------------
18121
18122- Install zlib.dll in the DLLs directory instead of in the win32
18123system directory, to avoid conflicts with other applications that have
18124their own zlib.dll.
18125
18126Test Suite
18127----------
18128
18129- test_long.py: new test for long integers, by Tim Peters.
18130
18131- regrtest.py: improved so it can be used for other test suites as
18132well.
18133
18134- test_strftime.py: use re to compare test results, to support legal
18135variants (e.g. on Linux).
18136
18137Tools and Demos
18138---------------
18139
18140- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
18141remove/add Windows style '\r\n' line endings), untabify.py (to remove
18142tabs), and rgrep.yp (reverse grep).
18143
18144- Improvements to Tools/freeze/. Each Python module is now written to
18145its own C file. This prevents some compilers or assemblers from
18146blowing up on large frozen programs, and saves recompilation time if
18147only a few modules are changed. Other changes too, e.g. new command
18148line options -x and -i.
18149
18150- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
18151
18152Python/C API
18153------------
18154
18155- New mechanism to support extensions of the type object while
18156remaining backward compatible with extensions compiled for previous
18157versions of Python 1.5. A flags field indicates presence of certain
18158fields.
18159
18160- Addition to the buffer API to differentiate access to bytes and
181618-bit characters (in anticipation of Unicode characters).
18162
18163- New argument parsing format t# ("text") to indicate 8-bit
18164characters; s# simply means 8-bit bytes, for backwards compatibility.
18165
18166- New object type, bufferobject.c is an example and can be used to
18167create buffers from memory.
18168
18169- Some support for 64-bit longs, including some MS platforms.
18170
18171- Many calls to fprintf(stderr, ...) have been replaced with calls to
18172PySys_WriteStderr(...).
18173
18174- The calling context for PyOS_Readline() has changed: it must now be
18175called with the interpreter lock held! It releases the lock around
18176the call to the function pointed to by PyOS_ReadlineFunctionPointer
18177(default PyOS_StdioReadline()).
18178
18179- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
18180
18181- Renamed header file "thread.h" to "pythread.h".
18182
18183- The code string of code objects may now be anything that supports the
18184buffer API.
18185
18186
18187======================================================================
18188
18189
18190From 1.5.1 to 1.5.2a1
18191=====================
18192
18193General
18194-------
18195
18196- When searching for the library, a landmark that is a compiled module
18197(string.pyc or string.pyo) is also accepted.
18198
18199- When following symbolic links to the python executable, use a loop
18200so that a symlink to a symlink can work.
18201
18202- Added a hack so that when you type 'quit' or 'exit' at the
18203interpreter, you get a friendly explanation of how to press Ctrl-D (or
18204Ctrl-Z) to exit.
18205
18206- New and improved Misc/python-mode.el (Python mode for Emacs).
18207
18208- Revert a new feature in Unix dynamic loading: for one or two
18209revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
18210out to be a bad idea.
18211
18212Miscellaneous fixed bugs
18213------------------------
18214
18215- All patches on the patch page have been integrated. (But much more
18216has been done!)
18217
18218- Several memory leaks plugged (e.g. the one for classes with a
18219__getattr__ method).
18220
18221- Removed the only use of calloc(). This triggered an obscure bug on
18222multiprocessor Sparc Solaris 2.6.
18223
18224- Fix a peculiar bug that would allow "import sys.time" to succeed
18225(believing the built-in time module to be a part of the sys package).
18226
18227- Fix a bug in the overflow checking when converting a Python long to
18228a C long (failed to convert -2147483648L, and some other cases).
18229
18230Documentation
18231-------------
18232
18233- Doc strings have been added to many extension modules: __builtin__,
18234errno, select, signal, socket, sys, thread, time. Also to methods of
18235list objects (try [].append.__doc__). A doc string on a type will now
18236automatically be propagated to an instance if the instance has methods
18237that are accessed in the usual way.
18238
18239- The documentation has been expanded and the formatting improved.
18240(Remember that the documentation is now unbundled and has its own
18241release cycle though; see http://www.python.org/doc/.)
18242
18243- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
18244
18245Ports and build procedure
18246-------------------------
18247
18248- The BeOS port is now integrated. Courtesy Chris Herborth.
18249
18250- Symbol files for FreeBSD 2.x and 3.x have been contributed
18251(Lib/plat-freebsd[23]/*).
18252
18253- Support HPUX 10.20 DCE threads.
18254
18255- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
18256works, it won't also use -Olimit 1500 (which gives a warning for every
18257file). Also support the SGI_ABI environment variable better.
18258
18259- The makesetup script now understands absolute pathnames ending in .o
18260in the module -- it assumes it's a file for which we have no source.
18261
18262- Other miscellaneous improvements to the configure script and
18263Makefiles.
18264
18265- The test suite now uses a different sound sample.
18266
18267Built-in functions
18268------------------
18269
18270- Better checks for invalid input to int(), long(), string.atoi(),
18271string.atol(). (Formerly, a sign without digits would be accepted as
18272a legal ways to spell zero.)
18273
18274- Changes to map() and filter() to use the length of a sequence only
18275as a hint -- if an IndexError happens earlier, take that. (Formerly,
18276this was considered an error.)
18277
18278- Experimental feature in getattr(): a third argument can specify a
18279default (instead of raising AttributeError).
18280
18281- Implement round() slightly different, so that for negative ndigits
18282no additional errors happen in the last step.
18283
18284- The open() function now adds the filename to the exception when it
18285fails.
18286
18287Built-in exceptions
18288-------------------
18289
18290- New standard exceptions EnvironmentError and PosixError.
18291EnvironmentError is the base class for IOError and PosixError;
18292PosixError is the same as os.error. All this so that either exception
18293class can be instantiated with a third argument indicating a filename.
18294The built-in function open() and most os/posix functions that take a
18295filename argument now use this.
18296
18297Built-in types
18298--------------
18299
18300- List objects now have an experimental pop() method; l.pop() returns
18301and removes the last item; l.pop(i) returns and removes the item at
18302i. Also, the sort() method is faster again. Sorting is now also
18303safer: it is impossible for the sorting function to modify the list
18304while the sort is going on (which could cause core dumps).
18305
18306- Changes to comparisons: numbers are now smaller than any other type.
18307This is done to prevent the circularity where [] < 0L < 1 < [] is
18308true. As a side effect, cmp(None, 0) is now positive instead of
18309negative. This *shouldn't* affect any working code, but I've found
18310that the change caused several "sleeping" bugs to become active, so
18311beware!
18312
18313- Instance methods may now have other callable objects than just
18314Python functions as their im_func. Use new.instancemethod() or write
18315your own C code to create them; new.instancemethod() may be called
18316with None for the instance to create an unbound method.
18317
18318- Assignment to __name__, __dict__ or __bases__ of a class object is
18319now allowed (with stringent type checks); also allow assignment to
18320__getattr__ etc. The cached values for __getattr__ etc. are
18321recomputed after such assignments (but not for derived classes :-( ).
18322
18323- Allow assignment to some attributes of function objects: func_code,
18324func_defaults and func_doc / __doc__. (With type checks except for
18325__doc__ / func_doc .)
18326
18327Python services
18328---------------
18329
18330- New tests (in Lib/test): reperf.py (regular expression benchmark),
18331sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
18332for the MimeWriter module).
18333
18334- Generalized test/regrtest.py so that it is useful for testing other
18335packages.
18336
18337- The ihooks.py module now understands package imports.
18338
18339- In code.py, add a class that subsumes Fredrik Lundh's
18340PythonInterpreter class. The interact() function now uses this.
18341
18342- In rlcompleter.py, in completer(), return None instead of raising an
18343IndexError when there are no more completions left.
18344
18345- Fixed the marshal module to test for certain common kinds of invalid
18346input. (It's still not foolproof!)
18347
18348- In the operator module, add an alias (now the preferred name)
18349"contains" for "sequenceincludes".
18350
18351String Services
18352---------------
18353
18354- In the string and strop modules, in the replace() function, treat an
18355empty pattern as an error (since it's not clear what was meant!).
18356
18357- Some speedups to re.py, especially the string substitution and split
18358functions. Also added new function/method findall(), to find all
18359occurrences of a given substring.
18360
18361- In cStringIO, add better argument type checking and support the
18362readonly 'closed' attribute (like regular files).
18363
18364- In the struct module, unsigned 1-2 byte sized formats no longer
18365result in long integer values.
18366
18367Miscellaneous services
18368----------------------
18369
18370- In whrandom.py, added new method and function randrange(), same as
18371choice(range(start, stop, step)) but faster. This addresses the
18372problem that randint() was accidentally defined as taking an inclusive
18373range. Also, randint(a, b) is now redefined as randrange(a, b+1),
18374adding extra range and type checking to its arguments!
18375
18376- Add some semi-thread-safety to random.gauss() (it used to be able to
18377crash when invoked from separate threads; now the worst it can do is
18378give a duplicate result occasionally).
18379
18380- Some restructuring and generalization done to cmd.py.
18381
18382- Major upgrade to ConfigParser.py; converted to using 're', added new
18383exceptions, support underscore in section header and option name. No
18384longer add 'name' option to every section; instead, add '__name__'.
18385
18386- In getpass.py, don't use raw_input() to ask for the password -- we
18387don't want it to show up in the readline history! Also don't catch
18388interrupts (the try-finally already does all necessary cleanup).
18389
18390Generic OS Services
18391-------------------
18392
18393- New functions in os.py: makedirs(), removedirs(), renames(). New
18394variable: linesep (the line separator as found in binary files,
18395i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
18396this with files opened in (default) text mode; the line separator used
18397will always be '\n'!
18398
18399- Changes to the 'os.path' submodule of os.py: added getsize(),
18400getmtime(), getatime() -- these fetch the most popular items from the
18401stat return tuple.
18402
18403- In the time module, add strptime(), if it exists. (This parses a
18404time according to a format -- the inverse of strftime().) Also,
18405remove the call to mktime() from strftime() -- it messed up the
18406formatting of some non-local times.
18407
18408- In the socket module, added a new function gethostbyname_ex().
18409Also, don't use #ifdef to test for some symbols that are enums on some
18410platforms (and should exist everywhere).
18411
18412Optional OS Services
18413--------------------
18414
18415- Some fixes to gzip.py. In particular, the readlines() method now
18416returns the lines *with* trailing newline characters, like readlines()
18417of regular file objects. Also, it didn't work together with cPickle;
18418fixed that.
18419
18420- In whichdb.py, support byte-swapped dbhash (bsddb) files.
18421
18422- In anydbm.py, look at the type of an existing database to determine
18423which module to use to open it. (The anydbm.error exception is now a
18424tuple.)
18425
18426Unix Services
18427-------------
18428
18429- In the termios module, in tcsetattr(), initialize the structure vy
18430calling tcgetattr().
18431
18432- Added some of the "wait status inspection" macros as functions to
18433the posix module (and thus to the os module): WEXITSTATUS(),
18434WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
18435
18436- In the syslog module, make the default facility more intuitive
18437(matching the docs).
18438
18439Debugger
18440--------
18441
18442- In pdb.py, support for setting breaks on files/modules that haven't
18443been loaded yet.
18444
18445Internet Protocols and Support
18446------------------------------
18447
18448- Changes in urllib.py; sped up unquote() and quote(). Fixed an
18449obscure bug in quote_plus(). Added urlencode(dict) -- convenience
18450function for sending a POST request with urlopen(). Use the getpass
18451module to ask for a password. Rewrote the (test) main program so that
18452when used as a script, it can retrieve one or more URLs to stdout.
18453Use -t to run the self-test. Made the proxy code work again.
18454
18455- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
18456fail when someone asks for their HEAD. Also, for POST, set the
18457default content-type to application/x-www-form-urlencoded. Also, in
18458FieldStorage.__init__(), when method='GET', always get the query
18459string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
18460explicitly passed in fp.
18461
18462- The smtplib.py module now supports ESMTP and has improved standard
18463compliance, for picky servers.
18464
18465- Improved imaplib.py.
18466
18467- Fixed UDP support in SocketServer.py (it never worked).
18468
18469- Fixed a small bug in CGIHTTPServer.py.
18470
18471Internet Data handling
18472----------------------
18473
18474- In rfc822.py, add a new class AddressList. Also support a new
18475overridable method, isheader(). Also add a get() method similar to
18476dictionaries (and make getheader() an alias for it). Also, be smarter
18477about seekable (test whether fp.tell() works) and test for presence of
18478unread() method before trying seeks.
18479
18480- In sgmllib.py, restore the call to report_unbalanced() that was lost
18481long ago. Also some other improvements: handle <? processing
18482instructions >, allow . and - in entity names, and allow \r\n as line
18483separator.
18484
18485- Some restructuring and generalization done to multifile.py; support
18486a 'seekable' flag.
18487
18488Restricted Execution
18489--------------------
18490
18491- Improvements to rexec.py: package support; support a (minimal)
18492sys.exc_info(). Also made the (test) main program a bit fancier (you
18493can now use it to run arbitrary Python scripts in restricted mode).
18494
18495Tkinter
18496-------
18497
18498- On Unix, Tkinter can now safely be used from a multi-threaded
18499application. (Formerly, no threads would make progress while
18500Tkinter's mainloop() was active, because it didn't release the Python
18501interpreter lock.) Unfortunately, on Windows, threads other than the
18502main thread should not call update() or update_idletasks() because
18503this will deadlock the application.
18504
18505- An interactive interpreter that uses readline and Tkinter no longer
18506uses up all available CPU time.
18507
18508- Even if readline is not used, Tk windows created in an interactive
18509interpreter now get continuously updated. (This even works in Windows
18510as long as you don't hit a key.)
18511
18512- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
18513
18514- No longer register Tcl_finalize() as a low-level exit handler. It
18515may call back into Python, and that's a bad idea.
18516
18517- Allow binding of Tcl commands (given as a string).
18518
18519- Some minor speedups; replace explicitly coded getint() with int() in
18520most places.
18521
18522- In FileDialog.py, remember the directory of the selected file, if
18523given.
18524
18525- Change the names of all methods in the Wm class: they are now
18526wm_title(), etc. The old names (title() etc.) are still defined as
18527aliases.
18528
18529- Add a new method of interpreter objects, interpaddr(). This returns
18530the address of the Tcl interpreter object, as an integer. Not very
18531useful for the Python programmer, but this can be called by another C
18532extension that needs to make calls into the Tcl/Tk C API and needs to
18533get the address of the Tcl interpreter object. A simple cast of the
18534return value to (Tcl_Interp *) will do the trick.
18535
18536Windows General
18537---------------
18538
18539- Don't insist on proper case for module source files if the filename
18540is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
18541doesn't). This should address problems with this feature on
18542oldfashioned filesystems (Novell servers?).
18543
18544Windows Library
18545---------------
18546
18547- os.environ is now all uppercase, but accesses are case insensitive,
18548and the putenv() calls made as a side effect of changing os.environ
18549are case preserving.
18550
18551- Removed samefile(), sameopenfile(), samestat() from os.path (aka
18552ntpath.py) -- these cannot be made to work reliably (at least I
18553wouldn't know how).
18554
18555- Fixed os.pipe() so that it returns file descriptors acceptable to
18556os.read() and os.write() (like it does on Unix), rather than Windows
18557file handles.
18558
18559- Added a table of WSA error codes to socket.py.
18560
18561- In the select module, put the (huge) file descriptor arrays on the
18562heap.
18563
18564- The getpass module now raises KeyboardInterrupt when it sees ^C.
18565
18566- In mailbox.py, fix tell/seek when using files opened in text mode.
18567
18568- In rfc822.py, fix tell/seek when using files opened in text mode.
18569
18570- In the msvcrt extension module, release the interpreter lock for
18571calls that may block: _locking(), _getch(), _getche(). Also fix a
18572bogus error return when open_osfhandle() doesn't have the right
18573argument list.
18574
18575Windows Installer
18576-----------------
18577
18578- The registry key used is now "1.5" instead of "1.5.x" -- so future
18579versions of 1.5 and Mark Hammond's win32all installer don't need to be
18580resynchronized.
18581
18582Windows Tools
18583-------------
18584
18585- Several improvements to freeze specifically for Windows.
18586
18587Windows Build Procedure
18588-----------------------
18589
18590- The VC++ project files and the WISE installer have been moved to the
18591PCbuild subdirectory, so they are distributed in the same subdirectory
18592where they must be used. This avoids confusion.
18593
18594- New project files for Windows 3.1 port by Jim Ahlstrom.
18595
18596- Got rid of the obsolete subdirectory PC/setup_nt/.
18597
18598- The projects now use distinct filenames for the .exe, .dll, .lib and
18599.pyd files built in debug mode (by appending "_d" to the base name,
18600before the extension). This makes it easier to switch between the two
18601and get the right versions. There's a pragma in config.h that directs
18602the linker to include the appropriate .lib file (so python15.lib no
18603longer needs to be explicit in your project).
18604
18605- The installer now installs more files (e.g. config.h). The idea is
18606that you shouldn't need the source distribution if you want build your
18607own extensions in C or C++.
18608
18609Tools and Demos
18610---------------
18611
18612- New script nm2def.py by Marc-Andre Lemburg, to construct
18613PC/python_nt.def automatically (some hand editing still required).
18614
18615- New tool ndiff.py: Tim Peters' text diffing tool.
18616
18617- Various and sundry improvements to the freeze script.
18618
18619- The script texi2html.py (which was part of the Doc tree but is no
18620longer used there) has been moved to the Tools/scripts subdirectory.
18621
18622- Some generalizations in the webchecker code. There's now a
18623primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
18624
18625- The ftpmirror.py script now handles symbolic links properly, and
18626also files with multiple spaces in their names.
18627
18628- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
18629last line is both indented and lacks a newline. This is now fixed.
18630
18631Python/C API
18632------------
18633
18634- Added missing prototypes for PyEval_CallFunction() and
18635PyEval_CallMethod().
18636
18637- New macro PyList_SET_ITEM().
18638
18639- New macros to access object members for PyFunction, PyCFunction
18640objects.
18641
18642- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
18643dynamically add one or many entries to the table of built-in modules.
18644
18645- New macro Py_InitModule3(name, methods, doc) which calls
18646Py_InitModule4() with appropriate arguments. (The -4 variant requires
18647you to pass an obscure version number constant which is always the same.)
18648
18649- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
18650sys.stdout or sys.stderr using a printf-like interface. (Used in
18651_tkinter.c, for example.)
18652
18653- New APIs for conversion between Python longs and C 'long long' if
18654your compiler supports it.
18655
18656- PySequence_In() is now called PySequence_Contains().
18657(PySequence_In() is still supported for b/w compatibility; it is
18658declared obsolete because its argument order is confusing.)
18659
18660- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
18661*never* raise an exception -- (even if the hash() fails, simply clear
18662the error). This was necessary because there is lots of code out
18663there that already assumes this.
18664
18665- Changes to PySequence_Tuple() and PySequence_List() to use the
18666length of a sequence only as a hint -- if an IndexError happens
18667earlier, take that. (Formerly, this was considered an error.)
18668
18669- Reformatted abstract.c to give it a more familiar "look" and fixed
18670many error checking bugs.
18671
18672- Add NULL pointer checks to all calls of a C function through a type
18673object and extensions (e.g. nb_add).
18674
18675- The code that initializes sys.path now calls Py_GetPythonHome()
18676instead of getenv("PYTHONHOME"). This, together with the new API
18677Py_SetPythonHome(), makes it easier for embedding applications to
18678change the notion of Python's "home" directory (where the libraries
18679etc. are sought).
18680
18681- Fixed a very old bug in the parsing of "O?" format specifiers.
18682
18683
18684======================================================================
18685
18686
Guido van Rossumf2eac992000-09-04 17:24:24 +000018687========================================
18688==> Release 1.5.1 (October 31, 1998) <==
18689========================================
18690
Guido van Rossum439d1fa1998-12-21 21:41:14 +000018691From 1.5 to 1.5.1
18692=================
18693
18694General
18695-------
18696
18697- The documentation is now unbundled. It has also been extensively
18698modified (mostly to implement a new and more uniform formatting
18699style). We figure that most people will prefer to download one of the
18700preformatted documentation sets (HTML, PostScript or PDF) and that
18701only a minority have a need for the LaTeX or FrameMaker sources. Of
18702course, the unbundled documentation sources still released -- just not
18703in the same archive file, and perhaps not on the same date.
18704
18705- All bugs noted on the errors page (and many unnoted) are fixed. All
18706new bugs take their places.
18707
18708- No longer a core dump when attempting to print (or repr(), or str())
18709a list or dictionary that contains an instance of itself; instead, the
18710recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
18711Py_ReprLeave() below. Comparisons of such objects still go beserk,
18712since this requires a different kind of fix; fortunately, this is a
18713less common scenario in practice.
18714
18715Syntax change
18716-------------
18717
18718- The raise statement can now be used without arguments, to re-raise
18719a previously set exception. This should be used after catching an
18720exception with an except clause only, either in the except clause or
18721later in the same function.
18722
18723Import and module handling
18724--------------------------
18725
18726- The implementation of import has changed to use a mutex (when
18727threading is supported). This means that when two threads
18728simultaneously import the same module, the import statements are
18729serialized. Recursive imports are not affected.
18730
18731- Rewrote the finalization code almost completely, to be much more
18732careful with the order in which modules are destroyed. Destructors
18733will now generally be able to reference built-in names such as None
18734without trouble.
18735
18736- Case-insensitive platforms such as Mac and Windows require the case
18737of a module's filename to match the case of the module name as
18738specified in the import statement (see below).
18739
18740- The code for figuring out the default path now distinguishes between
18741files, modules, executable files, and directories. When expecting a
18742module, we also look for the .pyc or .pyo file.
18743
18744Parser/tokenizer changes
18745------------------------
18746
18747- The tokenizer can now warn you when your source code mixes tabs and
18748spaces for indentation in a manner that depends on how much a tab is
18749worth in spaces. Use "python -t" or "python -v" to enable this
18750option. Use "python -tt" to turn the warnings into errors. (See also
18751tabnanny.py and tabpolice.py below.)
18752
18753- Return unsigned characters from tok_nextc(), so '\377' isn't
18754mistaken for an EOF character.
18755
18756- Fixed two pernicious bugs in the tokenizer that only affected AIX.
18757One was actually a general bug that was triggered by AIX's smaller I/O
18758buffer size. The other was a bug in the AIX optimizer's loop
18759unrolling code; swapping two statements made the problem go away.
18760
18761Tools, demos and miscellaneous files
18762------------------------------------
18763
18764- There's a new version of Misc/python-mode.el (the Emacs mode for
18765Python) which is much smarter about guessing the indentation style
18766used in a particular file. Lots of other cool features too!
18767
18768- There are two new tools in Tools/scripts: tabnanny.py and
18769tabpolice.py, implementing two different ways of checking whether a
18770file uses indentation in a way that is sensitive to the interpretation
18771of a tab. The preferred module is tabnanny.py (by Tim Peters).
18772
18773- Some new demo programs:
18774
18775 Demo/tkinter/guido/paint.py -- Dave Mitchell
18776 Demo/sockets/unixserver.py -- Piet van Oostrum
18777
18778
18779- Much better freeze support. The freeze script can now freeze
18780hierarchical module names (with a corresponding change to import.c),
18781and has a few extra options (e.g. to suppress freezing specific
18782modules). It also does much more on Windows NT.
18783
18784- Version 1.0 of the faq wizard is included (only very small changes
18785since version 0.9.0).
18786
18787- New feature for the ftpmirror script: when removing local files
18788(i.e., only when -r is used), do a recursive delete.
18789
18790Configuring and building Python
18791-------------------------------
18792
18793- Get rid of the check for -linet -- recent Sequent Dynix systems don't
18794need this any more and apparently it screws up their configuration.
18795
18796- Some changes because gcc on SGI doesn't support '-all'.
18797
18798- Changed the build rules to use $(LIBRARY) instead of
18799 -L.. -lpython$(VERSION)
18800since the latter trips up the SunOS 4.1.x linker (sigh).
18801
18802- Fix the bug where the '# dgux is broken' comment in the Makefile
18803tripped over Make on some platforms.
18804
18805- Changes for AIX: install the python.exp file; properly use
18806$(srcdir); the makexp_aix script now removes C++ entries of the form
18807Class::method.
18808
18809- Deleted some Makefile targets only used by the (long obsolete)
18810gMakefile hacks.
18811
18812Extension modules
18813-----------------
18814
18815- Performance and threading improvements to the socket and bsddb
18816modules, by Christopher Lindblad of Infoseek.
18817
18818- Added operator.__not__ and operator.not_.
18819
18820- In the thread module, when a thread exits due to an unhandled
18821exception, don't store the exception information in sys.last_*; it
18822prevents proper calling of destructors of local variables.
18823
18824- Fixed a number of small bugs in the cPickle module.
18825
18826- Changed find() and rfind() in the strop module so that
18827find("x","",2) returns -1, matching the implementation in string.py.
18828
18829- In the time module, be more careful with the result of ctime(), and
18830test for HAVE_MKTIME before usinmg mktime().
18831
18832- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
18833modules.
18834
18835- Added the LOG_SYSLOG constant to the syslog module, if defined.
18836
18837Standard library modules
18838------------------------
18839
18840- All standard library modules have been converted to an indentation
18841style using either only tabs or only spaces -- never a mixture -- if
18842they weren't already consistent according to tabnanny. This means
18843that the new -t option (see above) won't complain about standard
18844library modules.
18845
18846- New standard library modules:
18847
18848 threading -- GvR and the thread-sig
18849 Java style thread objects -- USE THIS!!!
18850
18851 getpass -- Piers Lauder
18852 simple utilities to prompt for a password and to
18853 retrieve the current username
18854
18855 imaplib -- Piers Lauder
18856 interface for the IMAP4 protocol
18857
18858 poplib -- David Ascher, Piers Lauder
18859 interface for the POP3 protocol
18860
18861 smtplib -- Dragon De Monsyne
18862 interface for the SMTP protocol
18863
18864- Some obsolete modules moved to a separate directory (Lib/lib-old)
18865which is *not* in the default module search path:
18866
18867 Para
18868 addpack
18869 codehack
18870 fmt
18871 lockfile
18872 newdir
18873 ni
18874 rand
18875 tb
18876
18877- New version of the PCRE code (Perl Compatible Regular Expressions --
18878the re module and the supporting pcre extension) by Andrew Kuchling.
18879Incompatible new feature in re.sub(): the handling of escapes in the
18880replacement string has changed.
18881
18882- Interface change in the copy module: a __deepcopy__ method is now
18883called with the memo dictionary as an argument.
18884
18885- Feature change in the tokenize module: differentiate between NEWLINE
18886token (an official newline) and NL token (a newline that the grammar
18887ignores).
18888
18889- Several bugfixes to the urllib module. It is now truly thread-safe,
18890and several bugs and a portability problem have been fixed. New
18891features, all due to Sjoerd Mullender: When creating a temporary file,
18892it gives it an appropriate suffix. Support the "data:" URL scheme.
18893The open() method uses the tempcache.
18894
18895- New version of the xmllib module (this time with a test suite!) by
18896Sjoerd Mullender.
18897
18898- Added debugging code to the telnetlib module, to be able to trace
18899the actual traffic.
18900
18901- In the rfc822 module, added support for deleting a header (still no
18902support for adding headers, though). Also fixed a bug where an
18903illegal address would cause a crash in getrouteaddr(), fixed a
18904sign reversal in mktime_tz(), and use the local timezone by default
18905(the latter two due to Bill van Melle).
18906
18907- The normpath() function in the dospath and ntpath modules no longer
18908does case normalization -- for that, use the separate function
18909normcase() (which always existed); normcase() has been sped up and
18910fixed (it was the cause of a crash in Mark Hammond's installer in
18911certain locales).
18912
18913- New command supported by the ftplib module: rmd(); also fixed some
18914minor bugs.
18915
18916- The profile module now uses a different timer function by default --
18917time.clock() is generally better than os.times(). This makes it work
18918better on Windows NT, too.
18919
18920- The tempfile module now recovers when os.getcwd() raises an
18921exception.
18922
18923- Fixed some bugs in the random module; gauss() was subtly wrong, and
18924vonmisesvariate() should return a full circle. Courtesy Mike Miller,
18925Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
18926
18927- Better default seed in the whrandom module, courtesy Andrew Kuchling.
18928
18929- Fix slow close() in shelve module.
18930
18931- The Unix mailbox class in the mailbox module is now more robust when
18932a line begins with the string "From " but is definitely not the start
18933of a new message. The pattern used can be changed by overriding a
18934method or class variable.
18935
18936- Added a rmtree() function to the copy module.
18937
18938- Fixed several typos in the pickle module. Also fixed problems when
18939unpickling in restricted execution environments.
18940
18941- Added docstrings and fixed a typo in the py_compile and compileall
18942modules. At Mark Hammond's repeated request, py_compile now append a
18943newline to the source if it needs one. Both modules support an extra
18944parameter to specify the purported source filename (to be used in
18945error messages).
18946
18947- Some performance tweaks by Jeremy Hylton to the gzip module.
18948
18949- Fixed a bug in the merge order of dictionaries in the ConfigParser
18950module. Courtesy Barry Warsaw.
18951
18952- In the multifile module, support the optional second parameter to
18953seek() when possible.
18954
18955- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
18956urlparse now correctly handles Gopher URLs with query strings.
18957
18958- Fixed a tiny bug in format_exception() in the traceback module.
18959Also rewrite tb_lineno() to be compatible with JPython (and not
18960disturb the current exception!); by Jim Hugunin.
18961
18962- The httplib module is more robust when servers send a short response
18963-- courtesy Tim O'Malley.
18964
18965Tkinter and friends
18966-------------------
18967
18968- Various typos and bugs fixed.
18969
18970- New module Tkdnd implements a drag-and-drop protocol (within one
18971application only).
18972
18973- The event_*() widget methods have been restructured slightly -- they
18974no longer use the default root.
18975
18976- The interfaces for the bind*() and unbind() widget methods have been
18977redesigned; the bind*() methods now return the name of the Tcl command
18978created for the callback, and this can be passed as a optional
18979argument to unbind() in order to delete the command (normally, such
18980commands are automatically unbound when the widget is destroyed, but
18981for some applications this isn't enough).
18982
18983- Variable objects now have trace methods to interface to Tcl's
18984variable tracing facilities.
18985
18986- Image objects now have an optional keyword argument, 'master', to
18987specify a widget (tree) to which they belong. The image_names() and
18988image_types() calls are now also widget methods.
18989
18990- There's a new global call, Tkinter.NoDefaultRoot(), which disables
18991all use of the default root by the Tkinter library. This is useful to
18992debug applications that are in the process of being converted from
18993relying on the default root to explicit specification of the root
18994widget.
18995
18996- The 'exit' command is deleted from the Tcl interpreter, since it
18997provided a loophole by which one could (accidentally) exit the Python
18998interpreter without invoking any cleanup code.
18999
19000- Tcl_Finalize() is now registered as a Python low-level exit handle,
19001so Tcl will be finalized when Python exits.
19002
19003The Python/C API
19004----------------
19005
19006- New function PyThreadState_GetDict() returns a per-thread dictionary
19007intended for storing thread-local global variables.
19008
19009- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
19010dictionary to allow recursive container types to detect recursion in
19011their repr(), str() and print implementations.
19012
19013- New function PyObject_Not(x) calculates (not x) according to Python's
19014standard rules (basically, it negates the outcome PyObject_IsTrue(x).
19015
19016- New function _PyModule_Clear(), which clears a module's dictionary
19017carefully without removing the __builtins__ entry. This is implied
19018when a module object is deallocated (this used to clear the dictionary
19019completely).
19020
19021- New function PyImport_ExecCodeModuleEx(), which extends
19022PyImport_ExecCodeModule() by adding an extra parameter to pass it the
19023true file.
19024
19025- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
19026allow embedded applications to force a different value for PYTHONHOME.
19027
19028- New global flag Py_FrozenFlag is set when this is a "frozen" Python
19029binary; it suppresses warnings about not being able to find the
19030standard library directories.
19031
19032- New global flag Py_TabcheckFlag is incremented by the -t option and
19033causes the tokenizer to issue warnings or errors about inconsistent
19034mixing of tabs and spaces for indentation.
19035
19036Miscellaneous minor changes and bug fixes
19037-----------------------------------------
19038
19039- Improved the error message when an attribute of an attribute-less
19040object is requested -- include the name of the attribute and the type
19041of the object in the message.
19042
19043- Sped up int(), long(), float() a bit.
19044
19045- Fixed a bug in list.sort() that would occasionally dump core.
19046
19047- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
19048when taken tothe real power.
19049
19050- Fixed a number of bugs in the file reading code, at least one of
19051which could cause a core dump on NT, and one of which would
19052occasionally cause file.read() to return less than the full contents
19053of the file.
19054
19055- Performance hack by Vladimir Marangozov for stack frame creation.
19056
19057- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
19058
19059Windows 95/NT
19060-------------
19061
19062- The .lib files are now part of the distribution; they are collected
19063in the subdirectory "libs" of the installation directory.
19064
19065- The extension modules (.pyd files) are now collected in a separate
19066subdirectory of the installation directory named "DLLs".
19067
19068- The case of a module's filename must now match the case of the
19069module name as specified in the import statement. This is an
19070experimental feature -- if it turns out to break in too many
19071situations, it will be removed (or disabled by default) in the future.
19072It can be disabled on a per-case basis by setting the environment
19073variable PYTHONCASEOK (to any value).
19074
19075
19076======================================================================
19077
19078
Guido van Rossumf2eac992000-09-04 17:24:24 +000019079=====================================
19080==> Release 1.5 (January 3, 1998) <==
19081=====================================
19082
19083
Guido van Rossum439d1fa1998-12-21 21:41:14 +000019084From 1.5b2 to 1.5
19085=================
19086
19087- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
19088
19089- Added doc strings to string.py, stropmodule.c, structmodule.c,
19090thanks to Charles Waldman.
19091
19092- Many nits fixed in the manuals, thanks to Fred Drake and many others
19093(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
19094HTML markup instead of inline GIF images for tables; only two images
19095are left (for obsure bits of math). The index of the HTML version has
19096also been much improved. Finally, it is once again possible to
19097generate an Emacs info file from the library manual (but I don't
19098commit to supporting this in future versions).
19099
19100- New module: telnetlib.py (a simple telnet client library).
19101
19102- New tool: Tools/versioncheck/, by Jack Jansen.
19103
19104- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
19105DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
19106extension modules.
19107
19108- Many small changes again to Tkinter.py -- mostly bugfixes and adding
19109missing routines. Thanks to Greg McFarlane for reporting a bunch of
19110problems and proofreading my fixes.
19111
19112- The re module and its documentation are up to date with the latest
19113version released to the string-sig (Dec. 22).
19114
19115- Stop test_grp.py from failing when the /etc/group file is empty
19116(yes, this happens!).
19117
19118- Fix bug in integer conversion (mystrtoul.c) that caused
191194294967296==0 to be true!
19120
19121- The VC++ 4.2 project file should be complete again.
19122
19123- In tempfile.py, use a better template on NT, and add a new optional
19124argument "suffix" with default "" to specify a specific extension for
19125the temporary filename (needed sometimes on NT but perhaps also handy
19126elsewhere).
19127
19128- Fixed some bugs in the FAQ wizard, and converted it to use re
19129instead of regex.
19130
19131- Fixed a mysteriously undetected error in dlmodule.c (it was using a
19132totally bogus routine name to raise an exception).
19133
19134- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
19135
19136- Hopefully harmless changes to the build process to support shared
19137libraries on DG/UX. This adds a target to create
19138libpython$(VERSION).so; however this target is *only* for DG/UX.
19139
19140- Fixed a bug in the new format string error checking in getargs.c.
19141
19142- A simple fix for infinite recursion when printing __builtins__:
19143reset '_' to None before printing and set it to the printed variable
19144*after* printing (and only when printing is successful).
19145
19146- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
19147parent window is not (Skip Montanaro).
19148
19149- Fixed the two most annoying problems with ftp URLs in
19150urllib.urlopen(); an empty file now correctly raises an error, and it
19151is no longer required to explicitly close the returned "file" object
19152before opening another ftp URL to the same host and directory.
19153
19154
19155======================================================================
19156
19157
19158From 1.5b1 to 1.5b2
19159===================
19160
19161- Fixed a bug in cPickle.c that caused it to crash right away because
19162the version string had a different format.
19163
19164- Changes in pickle.py and cPickle.c: when unpickling an instance of a
19165class that doesn't define the __getinitargs__() method, the __init__()
19166constructor is no longer called. This makes a much larger group of
19167classes picklable by default, but may occasionally change semantics.
19168To force calling __init__() on unpickling, define a __getinitargs__()
19169method. Other changes too, in particular cPickle now handles classes
19170defined in packages correctly. The same change applies to copying
19171instances with copy.py. The cPickle.c changes and some pickle.py
19172changes are courtesy Jim Fulton.
19173
19174- Locale support in he "re" (Perl regular expressions) module. Use
19175the flag re.L (or re.LOCALE) to enable locale-specific matching
19176rules for \w and \b. The in-line syntax for this flag is (?L).
19177
19178- The built-in function isinstance(x, y) now also succeeds when y is
19179a type object and type(x) is y.
19180
19181- repr() and str() of class and instance objects now reflect the
19182package/module in which the class is defined.
19183
19184- Module "ni" has been removed. (If you really need it, it's been
19185renamed to "ni1". Let me know if this causes any problems for you.
19186Package authors are encouraged to write __init__.py files that
19187support both ni and 1.5 package support, so the same version can be
19188used with Python 1.4 as well as 1.5.)
19189
19190- The thread module is now automatically included when threads are
19191configured. (You must remove it from your existing Setup file,
19192since it is now in its own Setup.thread file.)
19193
19194- New command line option "-x" to skip the first line of the script;
19195handy to make executable scripts on non-Unix platforms.
19196
19197- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
19198haven't checked how this affects things, but it should make symbols
19199in one shared library available to the next one.
19200
19201- The Windows installer now installs in the "Program Files" folder on
19202the proper volume by default.
19203
19204- The Windows configuration adds a new main program, "pythonw", and
19205registers a new extension, ".pyw" that invokes this. This is a
19206pstandard Python interpreter that does not pop up a console window;
19207handy for pure Tkinter applications. All output to the original
19208stdout and stderr is lost; reading from the original stdin yields
19209EOF. Also, both python.exe and pythonw.exe now have a pretty icon
19210(a green snake in a box, courtesy Mark Hammond).
19211
19212- Lots of improvements to emacs-mode.el again. See Barry's web page:
19213http://www.python.org/ftp/emacs/pmdetails.html.
19214
19215- Lots of improvements and additions to the library reference manual;
19216many by Fred Drake.
19217
19218- Doc strings for the following modules: rfc822.py, posixpath.py,
19219ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
19220
19221- Some more regression testing.
19222
19223- An optional 4th (maxsplit) argument to strop.replace().
19224
19225- Fixed handling of maxsplit in string.splitfields().
19226
19227- Tweaked os.environ so it can be pickled and copied.
19228
19229- The portability problems caused by indented preprocessor commands
19230and C++ style comments should be gone now.
19231
19232- In random.py, added Pareto and Weibull distributions.
19233
19234- The crypt module is now disabled in Modules/Setup.in by default; it
19235is rarely needed and causes errors on some systems where users often
19236don't know how to deal with those.
19237
19238- Some improvements to the _tkinter build line suggested by Case Roole.
19239
19240- A full suite of platform specific files for NetBSD 1.x, submitted by
19241Anders Andersen.
19242
19243- New Solaris specific header STROPTS.py.
19244
19245- Moved a confusing occurrence of *shared* from the comments in
19246Modules/Setup.in (people would enable this one instead of the real
19247one, and get disappointing results).
19248
19249- Changed the default mode for directories to be group-writable when
19250the installation process creates them.
19251
19252- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
19253shared libraries for both.
19254
19255- Support FreeBSD and NetBSD in posixfile.py.
19256
19257- Support for the "event" command, new in Tk 4.2. By Case Roole.
19258
19259- Add Tix_SafeInit() support to tkappinit.c.
19260
19261- Various bugs fixed in "re.py" and "pcre.c".
19262
19263- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
19264
19265- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
19266is set.
19267
19268- Provide default blocksize for retrbinary in ftplib.py (Skip
19269Montanaro).
19270
19271- In NT, pick the username up from different places in user.py (Jeff
19272Bauer).
19273
19274- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
19275
19276- Many small improvements to Jeff Rush' OS/2 support.
19277
19278- ospath.py is gone; it's been obsolete for so many years now...
19279
19280- The reference manual is now set up to prepare better HTML (still
19281using webmaker, alas).
19282
19283- Add special handling to /Tools/freeze for Python modules that are
19284imported implicitly by the Python runtime: 'site' and 'exceptions'.
19285
19286- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
19287inside <PRE>, by "Scott".
19288
19289- Added ConfigParser.py, a generic parser for sectioned configuration
19290files.
19291
19292- In _localemodule.c, LC_MESSAGES is not always defined; put it
19293between #ifdefs.
19294
19295- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
19296
19297- Demo/scripts/newslist.py: Fix the way the version number is gotten
19298out of the RCS revision.
19299
19300- PyArg_Parse[Tuple] now explicitly check for bad characters at the
19301end of the format string.
19302
19303- Revamped PC/example_nt to support VC++ 5.x.
19304
19305- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
19306after studying the GNU libg++ quicksort. This should be much faster
19307if there are lots of duplicates, and otherwise at least as good.
19308
19309- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
19310uudecode bug where it complaints about trailing garbage is still there
19311:-( ).
19312
19313- pickle.py requires integers in text mode to be in decimal notation
19314(it used to accept octal and hex, even though it would only generate
19315decimal numbers).
19316
19317- In string.atof(), don't fail when the "re" module is unavailable.
19318Plug the ensueing security leak by supplying an empty __builtins__
19319directory to eval().
19320
19321- A bunch of small fixes and improvements to Tkinter.py.
19322
19323- Fixed a buffer overrun in PC/getpathp.c.
19324
19325
19326======================================================================
19327
19328
19329From 1.5a4 to 1.5b1
19330===================
19331
19332- The Windows NT/95 installer now includes full HTML of all manuals.
19333It also has a checkbox that lets you decide whether to install the
19334interpreter and library. The WISE installer script for the installer
19335is included in the source tree as PC/python15.wse, and so are the
19336icons used for Python files. The config.c file for the Windows build
19337is now complete with the pcre module.
19338
19339- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
19340evaluated for the prompt.
19341
19342- The reference manual is brought up to date (more or less -- it still
19343needs work, e.g. in the area of package import).
19344
19345- The icons used by latex2html are now included in the Doc
19346subdirectory (mostly so that tarring up the HTML files can be fully
19347automated). A simple index.html is also added to Doc (it only works
19348after you have successfully run latex2html).
19349
19350- For all you would-be proselytizers out there: a new version of
19351Misc/BLURB describes Python more concisely, and Misc/comparisons
19352compares Python to several other languages. Misc/BLURB.WINDOWS
19353contains a blurb specifically aimed at Windows programmers (by Mark
19354Hammond).
19355
19356- A new version of the Python mode for Emacs is included as
19357Misc/python-mode.el. There are too many new features to list here.
19358See http://www.python.org/ftp/emacs/pmdetails.html for more info.
19359
19360- New module fileinput makes iterating over the lines of a list of
19361files easier. (This still needs some more thinking to make it more
19362extensible.)
19363
19364- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
19365version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
19366Age C++ compiler. I expect that Jeff will also provide a binary
19367release for this platform.
19368
19369- On Linux, the configure script now uses '-Xlinker -export-dynamic'
19370instead of '-rdynamic' to link the main program so that it exports its
19371symbols to shared libraries it loads dynamically. I hope this doesn't
19372break on older Linux versions; it is needed for mklinux and appears to
19373work on Linux 2.0.30.
19374
19375- Some Tkinter resstructuring: the geometry methods that apply to a
19376master are now properly usable on toplevel master widgets. There's a
19377new (internal) widget class, BaseWidget. New, longer "official" names
19378for the geometry manager methods have been added,
19379e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
19380shorter names still work, and where there's ambiguity, pack wins over
19381place wins over grid. Also, the bind_class method now returns its
19382value.
19383
19384- New, RFC-822 conformant parsing of email addresses and address lists
19385in the rfc822 module, courtesy Ben Escoto.
19386
19387- New, revamped tkappinit.c with support for popular packages (PIL,
19388TIX, BLT, TOGL). For the last three, you need to execute the Tcl
19389command "load {} Tix" (or Blt, or Togl) to gain access to them.
19390The Modules/Setup line for the _tkinter module has been rewritten
19391using the cool line-breaking feature of most Bourne shells.
19392
19393- New socket method connect_ex() returns the error code from connect()
19394instead of raising an exception on errors; this makes the logic
19395required for asynchronous connects simpler and more efficient.
19396
19397- New "locale" module with (still experimental) interface to the
Antoine Pitroufbd4f802012-08-11 16:51:50 +020019398standard C library locale interface, courtesy Martin von Löwis. This
Guido van Rossum439d1fa1998-12-21 21:41:14 +000019399does not repeat my mistake in 1.5a4 of always calling
19400setlocale(LC_ALL, ""). In fact, we've pretty much decided that
19401Python's standard numerical formatting operations should always use
19402the conventions for the C locale; the locale module contains utility
19403functions to format numbers according to the user specified locale.
19404(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
19405"C") after locale-changing calls.) See the library manual. (Alas, the
19406promised changes to the "re" module for locale support have not been
19407materialized yet. If you care, volunteer!)
19408
19409- Memory leak plugged in Py_BuildValue when building a dictionary.
19410
19411- Shared modules can now live inside packages (hierarchical module
19412namespaces). No changes to the shared module itself are needed.
19413
19414- Improved policy for __builtins__: this is a module in __main__ and a
19415dictionary everywhere else.
19416
19417- Python no longer catches SIGHUP and SIGTERM by default. This was
19418impossible to get right in the light of thread contexts. If you want
19419your program to clean up when a signal happens, use the signal module
19420to set up your own signal handler.
19421
19422- New Python/C API PyNumber_CoerceEx() does not return an exception
19423when no coercion is possible. This is used to fix a problem where
19424comparing incompatible numbers for equality would raise an exception
19425rather than return false as in Python 1.4 -- it once again will return
19426false.
19427
19428- The errno module is changed again -- the table of error messages
19429(errorstr) is removed. Instead, you can use os.strerror(). This
19430removes redundance and a potential locale dependency.
19431
19432- New module xmllib, to parse XML files. By Sjoerd Mullender.
19433
19434- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
19435It resets the signal module's notion of what the current process ID
19436and thread are, so that signal handlers will work after (and across)
19437calls to os.fork().
19438
19439- Fixed most occurrences of fatal errors due to missing thread state.
19440
19441- For vgrind (a flexible source pretty printer) fans, there's a simple
19442Python definition in Misc/vgrindefs, courtesy Neale Pickett.
19443
19444- Fixed memory leak in exec statement.
19445
19446- The test.pystone module has a new function, pystones(loops=LOOPS),
19447which returns a (benchtime, stones) tuple. The main() function now
19448calls this and prints the report.
19449
19450- Package directories now *require* the presence of an __init__.py (or
19451__init__.pyc) file before they are considered as packages. This is
19452done to prevent accidental subdirectories with common names from
19453overriding modules with the same name.
19454
19455- Fixed some strange exceptions in __del__ methods in library modules
Georg Brandl93dc9eb2010-03-14 10:56:14 +000019456(e.g. urllib). This happens because the built-in names are already
Guido van Rossum439d1fa1998-12-21 21:41:14 +000019457deleted by the time __del__ is called. The solution (a hack, but it
19458works) is to set some instance variables to 0 instead of None.
19459
19460- The table of built-in module initializers is replaced by a pointer
19461variable. This makes it possible to switch to a different table at
19462run time, e.g. when a collection of modules is loaded from a shared
19463library. (No example code of how to do this is given, but it is
19464possible.) The table is still there of course, its name prefixed with
19465an underscore and used to initialize the pointer.
19466
19467- The warning about a thread still having a frame now only happens in
19468verbose mode.
19469
19470- Change the signal finialization so that it also resets the signal
19471handlers. After this has been called, our signal handlers are no
19472longer active!
19473
19474- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
19475literals. There's now also a test fort this module.
19476
19477- The copy module now also uses __dict__.update(state) instead of
19478going through individual attribute assignments, for class instances
19479without a __setstate__ method.
19480
19481- New module reconvert translates old-style (regex module) regular
19482expressions to new-style (re module, Perl-style) regular expressions.
19483
19484- Most modules that used to use the regex module now use the re
19485module. The grep module has a new pgrep() function which uses
19486Perl-style regular expressions.
19487
19488- The (very old, backwards compatibility) regexp.py module has been
19489deleted.
19490
19491- Restricted execution (rexec): added the pcre module (support for the
19492re module) to the list of trusted extension modules.
19493
19494- New version of Jim Fulton's CObject object type, adds
19495PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
19496
19497- Some patches to Lee Busby's fpectl mods that accidentally didn't
19498make it into 1.5a4.
19499
19500- In the string module, add an optional 4th argument to count(),
19501matching find() etc.
19502
19503- Patch for the nntplib module by Charles Waldman to add optional user
19504and password arguments to NNTP.__init__(), for nntp servers that need
19505them.
19506
19507- The str() function for class objects now returns
19508"modulename.classname" instead of returning the same as repr().
19509
19510- The parsing of \xXX escapes no longer relies on sscanf().
19511
19512- The "sharedmodules" subdirectory of the installation is renamed to
19513"lib-dynload". (You may have to edit your Modules/Setup file to fix
19514this in an existing installation!)
19515
19516- Fixed Don Beaudry's mess-up with the OPT test in the configure
19517script. Certain SGI platforms will still issue a warning for each
19518compile; there's not much I can do about this since the compiler's
19519exit status doesn't indicate that I was using an obsolete option.
19520
19521- Fixed Barry's mess-up with {}.get(), and added test cases for it.
19522
19523- Shared libraries didn't quite work under AIX because of the change
19524in status of the GNU readline interface. Fix due to by Vladimir
19525Marangozov.
19526
19527
19528======================================================================
19529
19530
19531From 1.5a3 to 1.5a4
19532===================
19533
19534- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
19535feature; better install instructions; removed faqmain.py (which was an
19536older version).
19537
19538- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
19539about the treatment of lines starting with '.'. Added a minimal test
19540function.
19541
19542- struct module: ignore most whitespace in format strings.
19543
19544- urllib.py: close the socket and temp file in URLopener.retrieve() so
19545that multiple retrievals using the same connection work.
19546
19547- All standard exceptions are now classes by default; use -X to make
19548them strings (for backward compatibility only).
19549
19550- There's a new standard exception hierarchy, defined in the standard
19551library module exceptions.py (which you never need to import
19552explicitly). See
19553http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
19554more info.
19555
19556- Three new C API functions:
19557
19558 - int PyErr_GivenExceptionMatches(obj1, obj2)
19559
19560 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
19561 instance of type obj2, or of a class derived from obj2
19562
19563 - int PyErr_ExceptionMatches(obj)
19564
19565 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
19566 PyErr_Occurred() as obj1. This will be the more commonly called
19567 function.
19568
19569 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
19570
19571 Normalizes exceptions, and places the normalized values in the
19572 arguments. If type is not a class, this does nothing. If type is a
19573 class, then it makes sure that value is an instance of the class by:
19574
19575 1. if instance is of the type, or a class derived from type, it does
19576 nothing.
19577
19578 2. otherwise it instantiates the class, using the value as an
19579 argument. If value is None, it uses an empty arg tuple, and if
19580 the value is a tuple, it uses just that.
19581
19582- Another new C API function: PyErr_NewException() creates a new
19583exception class derived from Exception; when -X is given, it creates a
19584new string exception.
19585
19586- core interpreter: remove the distinction between tuple and list
19587unpacking; allow an arbitrary sequence on the right hand side of any
19588unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
19589thing, which should really be called UNPACK_SEQUENCE.)
19590
19591- classes: Allow assignments to an instance's __dict__ or __class__,
19592so you can change ivars (including shared ivars -- shock horror) and
19593change classes dynamically. Also make the check on read-only
19594attributes of classes less draconic -- only the specials names
19595__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
19596assigned.
19597
19598- Two new built-in functions: issubclass() and isinstance(). Both
19599take classes as their second arguments. The former takes a class as
19600the first argument and returns true iff first is second, or is a
19601subclass of second. The latter takes any object as the first argument
19602and returns true iff first is an instance of the second, or any
19603subclass of second.
19604
19605- configure: Added configuration tests for presence of alarm(),
19606pause(), and getpwent().
19607
19608- Doc/Makefile: changed latex2html targets.
19609
19610- classes: Reverse the search order for the Don Beaudry hook so that
19611the first class with an applicable hook wins. Makes more sense.
19612
19613- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
19614now legal to call these more than once. The first call to
19615Py_Initialize() initializes, the first call to Py_Finalize()
19616finalizes. There's also a new API, Py_IsInitalized() which checks
19617whether we are already initialized (in case you want to leave things
19618as they were).
19619
19620- Completely disable the declarations for malloc(), realloc() and
19621free(). Any 90's C compiler has these in header files, and the tests
19622to decide whether to suppress the declarations kept failing on some
19623platforms.
19624
19625- *Before* (instead of after) signalmodule.o is added, remove both
19626intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
19627ld on various systems.
19628
19629- Added reop to PC/config.c
19630
19631- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
19632Removed outdated HP-UX comments from README. Added Cray T3E comments.
19633
19634- Various renames of statically defined functions that had name
19635conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
19636roundup (sys/types.h).
19637
19638- urllib.py: Interpret three slashes in file: URL as local file (for
19639Netscape on Windows/Mac).
19640
19641- copy.py: Make sure the objects returned by __getinitargs__() are
19642kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
19643easily reproducable because it requires a later call to
19644__getinitargs__() to return a tuple that happens to be allocated at
19645the same address.)
19646
19647- Added definition of AR to toplevel Makefile. Renamed @buildno temp
19648file to buildno1.
19649
19650- Moved Include/assert.h to Parser/assert.h, which seems to be the
19651only place where it's needed.
19652
19653- Tweaked the dictionary lookup code again for some more speed
19654(Vladimir Marangozov).
19655
19656- NT build: Changed the way python15.lib is included in the other
19657projects. Per Mark Hammond's suggestion, add it to the extra libs in
19658Settings instead of to the project's source files.
19659
19660- regrtest.py: Change default verbosity so that there are only three
19661levels left: -q, default and -v. In default mode, the name of each
19662test is now printed. -v is the same as the old -vv. -q is more quiet
19663than the old default mode.
19664
19665- Removed the old FAQ from the distribution. You now have to get it
19666from the web!
19667
19668- Removed the PC/make_nt.in file from the distribution; it is no
19669longer needed.
19670
19671- Changed the build sequence so that shared modules are built last.
19672This fixes things for AIX and doesn't hurt elsewhere.
19673
19674- Improved test for GNU MP v1 in mpzmodule.c
19675
19676- fileobject.c: ftell() on Linux discards all buffered data; changed
19677read() code to use lseek() instead to get the same effect
19678
19679- configure.in, configure, importdl.c: NeXT sharedlib fixes
19680
19681- tupleobject.c: PyTuple_SetItem asserts refcnt==1
19682
19683- resource.c: Different strategy regarding whether to declare
19684getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
19685conflicting decls in its headers. Choice: only declare the return
19686type, not the argument prototype, and not on Linux.
19687
19688- importdl.c, configure*: set sharedlib extensions properly for NeXT
19689
19690- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
19691fixed; moved addition of PURIFY to LINKCC to configure
19692
19693- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
19694added to shup up various compilers.
19695
19696- _tkinter.c: removed buggy mac #ifndef
19697
19698- Doc: various Mac documentation changes, added docs for 'ic' module
19699
19700- PC/make_nt.in: deleted
19701
19702- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
19703"")
19704
19705- test_rotor.py: print b -> print `b`
19706
19707- Tkinter.py: (tagOrId) -> (tagOrId,)
19708
19709- Tkinter.py: the Tk class now also has a configure() method and
19710friends (they have been moved to the Misc class to accomplish this).
19711
19712- dict.get(key[, default]) returns dict[key] if it exists, or default
19713if it doesn't. The default defaults to None. This is quicker for
19714some applications than using either has_key() or try:...except
19715KeyError:....
19716
19717- Tools/webchecker/: some small changes to webchecker.py; added
19718websucker.py (a simple web site mirroring script).
19719
19720- Dictionary objects now have a get() method (also in UserDict.py).
19721dict.get(key, default) returns dict[key] if it exists and default
19722otherwise; default defaults to None.
19723
19724- Tools/scripts/logmerge.py: print the author, too.
19725
19726- Changes to import: support for "import a.b.c" is now built in. See
19727http://grail.cnri.reston.va.us/python/essays/packages.html
19728for more info. Most important deviations from "ni.py": __init__.py is
19729executed in the package's namespace instead of as a submodule; and
19730there's no support for "__" or "__domain__". Note that "ni.py" is not
19731changed to match this -- it is simply declared obsolete (while at the
19732same time, it is documented...:-( ).
19733Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
19734for an example implementation of hierarchical module import written in
19735Python).
19736
19737- More changes to import: the site.py module is now imported by
19738default when Python is initialized; use -S to disable it. The site.py
19739module extends the path with several more directories: site-packages
19740inside the lib/python1.5/ directory, site-python in the lib/
19741directory, and pathnames mentioned in *.pth files found in either of
19742those directories. See
19743http://grail.cnri.reston.va.us/python/essays/packages.html
19744for more info.
19745
19746- Changes to standard library subdirectory names: those subdirectories
19747that are not packages have been renamed with a hypen in their name,
19748e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
19749The test suite is now a package -- to run a test, you must now use
19750"import test.test_foo".
19751
19752- A completely new re.py module is provided (thanks to Andrew
19753Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
19754"pcre" re compiler and engine. For a while, the "old" re.py (which
19755was new in 1.5a3!) will be kept around as re1.py. The "old" regex
19756module and underlying parser and engine are still present -- while
19757regex is now officially obsolete, it will probably take several major
19758release cycles before it can be removed.
19759
19760- The posix module now has a strerror() function which translates an
19761error code to a string.
19762
19763- The emacs.py module (which was long obsolete) has been removed.
19764
19765- The universal makefile Misc/Makefile.pre.in now features an
19766"install" target. By default, installed shared libraries go into
19767$exec_prefix/lib/python$VERSION/site-packages/.
19768
19769- The install-sh script is installed with the other configuration
19770specific files (in the config/ subdirectory).
19771
19772- It turns out whatsound.py and sndhdr.py were identical modules.
19773Since there's also an imghdr.py file, I propose to make sndhdr.py the
19774official one. For compatibility, whatsound.py imports * from
19775sndhdr.py.
19776
19777- Class objects have a new attribute, __module__, giving the name of
19778the module in which they were declared. This is useful for pickle and
19779for printing the full name of a class exception.
19780
19781- Many extension modules no longer issue a fatal error when their
19782initialization fails; the importing code now checks whether an error
19783occurred during module initialization, and correctly propagates the
19784exception to the import statement.
19785
19786- Most extension modules now raise class-based exceptions (except when
19787-X is used).
19788
19789- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
19790thread state -- just don't manipulate the lock if it isn't there.
19791
19792- Fixed a bug in Python/getopt.c that made it do the wrong thing when
19793an option was a single '-'. Thanks to Andrew Kuchling.
19794
19795- New module mimetypes.py will guess a MIME type from a filename's
19796extension.
19797
19798- Windows: the DLL version is now settable via a resource rather than
19799being hardcoded. This can be used for "branding" a binary Python
19800distribution.
19801
19802- urllib.py is now threadsafe -- it now uses re instead of regex, and
19803sys.exc_info() instead of sys.exc_{type,value}.
19804
19805- Many other library modules that used to use
19806sys.exc_{type,value,traceback} are now more thread-safe by virtue of
19807using sys.exc_info().
19808
19809- The functions in popen2 have an optional buffer size parameter.
19810Also, the command argument can now be either a string (passed to the
19811shell) or a list of arguments (passed directly to execv).
19812
19813- Alas, the thread support for _tkinter released with 1.5a3 didn't
19814work. It's been rewritten. The bad news is that it now requires a
19815modified version of a file in the standard Tcl distribution, which you
19816must compile with a -I option pointing to the standard Tcl source
19817tree. For this reason, the thread support is disabled by default.
19818
19819- The errno extension module adds two tables: errorcode maps errno
19820numbers to errno names (e.g. EINTR), and errorstr maps them to
19821message strings. (The latter is redundant because the new call
19822posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
19823
19824- The readline extension module now provides some interfaces to
19825internal readline routines that make it possible to write a completer
19826in Python. An example completer, rlcompleter.py, is provided.
19827
19828 When completing a simple identifier, it completes keywords,
19829 built-ins and globals in __main__; when completing
19830 NAME.NAME..., it evaluates (!) the expression up to the last
19831 dot and completes its attributes.
19832
19833 It's very cool to do "import string" type "string.", hit the
19834 completion key (twice), and see the list of names defined by
19835 the string module!
19836
19837 Tip: to use the tab key as the completion key, call
19838
19839 readline.parse_and_bind("tab: complete")
19840
19841- The traceback.py module has a new function tb_lineno() by Marc-Andre
19842Lemburg which extracts the line number from the linenumber table in
19843the code object. Apparently the traceback object doesn't contains the
19844right linenumber when -O is used. Rather than guessing whether -O is
19845on or off, the module itself uses tb_lineno() unconditionally.
19846
19847- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
19848to tag_bind() so it works again.
19849
19850- The pystone script is now a standard library module. Example use:
19851"import test.pystone; test.pystone.main()".
19852
19853- The import of the readline module in interactive mode is now also
19854attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
19855Lemburg, who asked for this. :-)
19856
19857- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
19858Mullender, to be closer to the standard. This fixes the getaddr()
19859method. Unfortunately, getaddrlist() is as broken as ever, since it
19860splits on commas without regard for RFC 822 quoting conventions.
19861
19862- pprint.py: correctly emit trailing "," in singleton tuples.
19863
19864- _tkinter.c: export names for its type objects, TkappType and
19865TkttType.
19866
19867- pickle.py: use __module__ when defined; fix a particularly hard to
19868reproduce bug that confuses the memo when temporary objects are
19869returned by custom pickling interfaces; and a semantic change: when
19870unpickling the instance variables of an instance, use
19871inst.__dict__.update(value) instead of a for loop with setattr() over
19872the value.keys(). This is more consistent (the pickling doesn't use
19873getattr() either but pickles inst.__dict__) and avoids problems with
19874instances that have a __setattr__ hook. But it *is* a semantic change
19875(because the setattr hook is no longer used). So beware!
19876
19877- config.h is now installed (at last) in
19878$exec_prefix/include/python1.5/. For most sites, this means that it
19879is actually in $prefix/include/python1.5/, with all the other Python
19880include files, since $prefix and $exec_prefix are the same by
19881default.
19882
19883- The imp module now supports parts of the functionality to implement
19884import of hierarchical module names. It now supports find_module()
19885and load_module() for all types of modules. Docstrings have been
19886added for those functions in the built-in imp module that are still
19887relevant (some old interfaces are obsolete). For a sample
19888implementation of hierarchical module import in Python, see the new
19889library module knee.py.
19890
19891- The % operator on string objects now allows arbitrary nested parens
19892in a %(...)X style format. (Brad Howes)
19893
19894- Reverse the order in which Setup and Setup.local are passed to the
19895makesetup script. This allows variable definitions in Setup.local to
19896override definitions in Setup. (But you'll still have to edit Setup
19897if you want to disable modules that are enabled by default, or if such
19898modules need non-standard options.)
19899
19900- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
19901is like PyImport_ImporModule(name) but receives the globals and locals
19902dict and the fromlist arguments as well. (The name is a char*; the
19903others are PyObject*s).
19904
19905- The 'p' format in the struct extension module alloded to above is
19906new in 1.5a4.
19907
19908- The types.py module now uses try-except in a few places to make it
19909more likely that it can be imported in restricted mode. Some type
19910names are undefined in that case, e.g. CodeType (inaccessible),
19911FileType (not always accessible), and TracebackType and FrameType
19912(inaccessible).
19913
19914- In urllib.py: added separate administration of temporary files
19915created y URLopener.retrieve() so cleanup() can properly remove them.
19916The old code removed everything in tempcache which was a bad idea if
19917the user had passed a non-temp file into it. Also, in basejoin(),
19918interpret relative paths starting in "../". This is necessary if the
19919server uses symbolic links.
19920
19921- The Windows build procedure and project files are now based on
19922Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
19923directory. It is much more robust, and properly builds separate Debug
19924and Release versions. (The installer will be added shortly.)
19925
19926- Added casts and changed some return types in regexpr.c to avoid
19927compiler warnings or errors on some platforms.
19928
19929- The AIX build tools for shared libraries now supports VPATH. (Donn
19930Cave)
19931
19932- By default, disable the "portable" multimedia modules audioop,
19933imageop, and rgbimg, since they don't work on 64-bit platforms.
19934
19935- Fixed a nasty bug in cStringIO.c when code was actually using the
19936close() method (the destructors would try to free certain fields a
19937second time).
19938
19939- For those who think they need it, there's a "user.py" module. This
19940is *not* imported by default, but can be imported to run user-specific
19941setup commands, ~/.pythonrc.py.
19942
19943- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
19944Vladimir Marangozov, and others.
19945
19946- Added os.altsep; this is '/' on DOS/Windows, and None on systems
19947with a sane filename syntax.
19948
19949- os.py: Write out the dynamic OS choice, to avoid exec statements.
19950Adding support for a new OS is now a bit more work, but I bet that
19951'dos' or 'nt' will cover most situations...
19952
19953- The obsolete exception AccessError is now really gone.
19954
19955- Tools/faqwiz/: New installation instructions show how to maintain
19956multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
19957Added instructions to bootstrap script, too. Version bumped to 0.8.1.
19958Added <html>...</html> feature suggested by Skip Montanaro. Added
19959leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
19960default SRCDIR.
19961
19962- Documentation for the relatively new modules "keyword" and "symbol"
19963has been added (to the end of the section on the parser extension
19964module).
19965
19966- In module bisect.py, but functions have two optional argument 'lo'
19967and 'hi' which allow you to specify a subsequence of the array to
19968operate on.
19969
19970- In ftplib.py, changed most methods to return their status (even when
19971it is always "200 OK") rather than swallowing it.
19972
19973- main() now calls setlocale(LC_ALL, ""), if setlocale() and
19974<locale.h> are defined.
19975
19976- Changes to configure.in, the configure script, and both
19977Makefile.pre.in files, to support SGI's SGI_ABI platform selection
19978environment variable.
19979
19980
19981======================================================================
19982
19983
19984From 1.4 to 1.5a3
19985=================
19986
19987Security
19988--------
19989
19990- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
19991please use the new version. The old version has a huge security leak.
19992
19993Miscellaneous
19994-------------
19995
19996- Because of various (small) incompatible changes in the Python
19997bytecode interpreter, the magic number for .pyc files has changed
19998again.
19999
20000- The default module search path is now much saner. Both on Unix and
20001Windows, it is essentially derived from the path to the executable
20002(which can be overridden by setting the environment variable
20003$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
20004front of the default path, like in Unix (instead of overriding the
20005default path). On Windows, the directory containing the executable is
20006added to the end of the path.
20007
20008- A new version of python-mode.el for Emacs has been included. Also,
20009a new file ccpy-style.el has been added to configure Emacs cc-mode for
20010the preferred style in Python C sources.
20011
20012- On Unix, when using sys.argv[0] to insert the script directory in
20013front of sys.path, expand a symbolic link. You can now install a
20014program in a private directory and have a symbolic link to it in a
20015public bin directory, and it will put the private directory in the
20016module search path. Note that the symlink is expanded in sys.path[0]
20017but not in sys.argv[0], so you can still tell the name by which you
20018were invoked.
20019
20020- It is now recommended to use ``#!/usr/bin/env python'' instead of
20021``#!/usr/local/bin/python'' at the start of executable scripts, except
20022for CGI scripts. It has been determined that the use of /usr/bin/env
20023is more portable than that of /usr/local/bin/python -- scripts almost
20024never have to be edited when the Python interpreter lives in a
20025non-standard place. Note that this doesn't work for CGI scripts since
20026the python executable often doesn't live in the HTTP server's default
20027search path.
20028
20029- The silly -s command line option and the corresponding
20030PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
20031flag in the Python/C API) are gone.
20032
20033- Most problems on 64-bit platforms should now be fixed. Andrew
20034Kuchling helped. Some uncommon extension modules are still not
20035clean (image and audio ops?).
20036
20037- Fixed a bug where multiple anonymous tuple arguments would be mixed up
20038when using the debugger or profiler (reported by Just van Rossum).
20039The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
20040would print the wrong value when run under the debugger or profiler.
20041
20042- The hacks that the dictionary implementation used to speed up
20043repeated lookups of the same C string were removed; these were a
20044source of subtle problems and don't seem to serve much of a purpose
20045any longer.
20046
20047- All traces of support for the long dead access statement have been
20048removed from the sources.
20049
20050- Plugged the two-byte memory leak in the tokenizer when reading an
20051interactive EOF.
20052
20053- There's a -O option to the interpreter that removes SET_LINENO
20054instructions and assert statements (see below); it uses and produces
20055.pyo files instead of .pyc files. The speedup is only a few percent
20056in most cases. The line numbers are still available in the .pyo file,
20057as a separate table (which is also available in .pyc files). However,
20058the removal of the SET_LINENO instructions means that the debugger
20059(pdb) can't set breakpoints on lines in -O mode. The traceback module
20060contains a function to extract a line number from the code object
20061referenced in a traceback object. In the future it should be possible
20062to write external bytecode optimizers that create better optimized
20063.pyo files, and there should be more control over optimization;
20064consider the -O option a "teaser". Without -O, the assert statement
20065actually generates code that first checks __debug__; if this variable
20066is false, the assertion is not checked. __debug__ is a built-in
20067variable whose value is initialized to track the -O flag (it's true
20068iff -O is not specified). With -O, no code is generated for assert
20069statements, nor for code of the form ``if __debug__: <something>''.
20070Sorry, no further constant folding happens.
20071
20072
20073Performance
20074-----------
20075
20076- It's much faster (almost twice for pystone.py -- see
20077Tools/scripts). See the entry on string interning below.
20078
20079- Some speedup by using separate free lists for method objects (both
20080the C and the Python variety) and for floating point numbers.
20081
20082- Big speedup by allocating frame objects with a single malloc() call.
20083The Python/C API for frames is changed (you shouldn't be using this
20084anyway).
20085
20086- Significant speedup by inlining some common opcodes for common operand
20087types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
20088
20089- Small speedup by reordering the method tables of some common
20090objects (e.g. list.append is now first).
20091
20092- Big optimization to the read() method of file objects. A read()
20093without arguments now attempts to use fstat to allocate a buffer of
20094the right size; for pipes and sockets, it will fall back to doubling
20095the buffer size. While that the improvement is real on all systems,
20096it is most dramatic on Windows.
20097
20098
20099Documentation
20100-------------
20101
20102- Many new pieces of library documentation were contributed, mostly by
20103Andrew Kuchling. Even cmath is now documented! There's also a
20104chapter of the library manual, "libundoc.tex", which provides a
20105listing of all undocumented modules, plus their status (e.g. internal,
20106obsolete, or in need of documentation). Also contributions by Sue
20107Williams, Skip Montanaro, and some module authors who succumbed to
20108pressure to document their own contributed modules :-). Note that
20109printing the documentation now kills fewer trees -- the margins have
20110been reduced.
20111
20112- I have started documenting the Python/C API. Unfortunately this project
20113hasn't been completed yet. It will be complete before the final release of
20114Python 1.5, though. At the moment, it's better to read the LaTeX source
20115than to attempt to run it through LaTeX and print the resulting dvi file.
20116
20117- The posix module (and hence os.py) now has doc strings! Thanks to Neil
20118Schemenauer. I received a few other contributions of doc strings. In most
20119other places, doc strings are still wishful thinking...
20120
20121
20122Language changes
20123----------------
20124
20125- Private variables with leading double underscore are now a permanent
20126feature of the language. (These were experimental in release 1.4. I have
20127favorable experience using them; I can't label them "experimental"
20128forever.)
20129
20130- There's new string literal syntax for "raw strings". Prefixing a string
20131literal with the letter r (or R) disables all escape processing in the
20132string; for example, r'\n' is a two-character string consisting of a
20133backslash followed by the letter n. This combines with all forms of string
20134quotes; it is actually useful for triple quoted doc strings which might
20135contain references to \n or \t. An embedded quote prefixed with a
20136backslash does not terminate the string, but the backslash is still
20137included in the string; for example, r'\'' is a two-character string
20138consisting of a backslash and a quote. (Raw strings are also
20139affectionately known as Robin strings, after their inventor, Robin
20140Friedrich.)
20141
20142- There's a simple assert statement, and a new exception
20143AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
20144not foo > 0: raise AssertionError''. Sorry, the text of the asserted
20145condition is not available; it would be too complicated to generate
20146code for this (since the code is generated from a parse tree).
20147However, the text is displayed as part of the traceback!
20148
20149- The raise statement has a new feature: when using "raise SomeClass,
20150somevalue" where somevalue is not an instance of SomeClass, it
20151instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
20152instance of a *derived* class of SomeClass, the exception class raised
20153is set to somevalue.__class__, and SomeClass is ignored after that.
20154
20155- Duplicate keyword arguments are now detected at compile time;
20156f(a=1,a=2) is now a syntax error.
20157
20158
Georg Brandl93dc9eb2010-03-14 10:56:14 +000020159Changes to built-in features
20160----------------------------
Guido van Rossum439d1fa1998-12-21 21:41:14 +000020161
20162- There's a new exception FloatingPointError (used only by Lee Busby's
20163patches to catch floating point exceptions, at the moment).
20164
20165- The obsolete exception ConflictError (presumably used by the long
20166obsolete access statement) has been deleted.
20167
20168- There's a new function sys.exc_info() which returns the tuple
20169(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
20170
20171- There's a new variable sys.executable, pointing to the executable file
20172for the Python interpreter.
20173
20174- The sort() methods for lists no longer uses the C library qsort(); I
20175wrote my own quicksort implementation, with lots of help (in the form
20176of a kind of competition) from Tim Peters. This solves a bug in
20177dictionary comparisons on some Solaris versions when Python is built
20178with threads, and makes sorting lists even faster.
20179
20180- The semantics of comparing two dictionaries have changed, to make
20181comparison of unequal dictionaries faster. A shorter dictionary is
20182always considered smaller than a larger dictionary. For dictionaries
20183of the same size, the smallest differing element determines the
20184outcome (which yields the same results as before in this case, without
20185explicit sorting). Thanks to Aaron Watters for suggesting something
20186like this.
20187
20188- The semantics of try-except have changed subtly so that calling a
20189function in an exception handler that itself raises and catches an
20190exception no longer overwrites the sys.exc_* variables. This also
20191alleviates the problem that objects referenced in a stack frame that
20192caught an exception are kept alive until another exception is caught
20193-- the sys.exc_* variables are restored to their previous value when
20194returning from a function that caught an exception.
20195
20196- There's a new "buffer" interface. Certain objects (e.g. strings and
20197arrays) now support the "buffer" protocol. Buffer objects are acceptable
20198whenever formerly a string was required for a write operation; mutable
20199buffer objects can be the target of a read operation using the call
20200f.readinto(buffer). A cool feature is that regular expression matching now
20201also work on array objects. Contribution by Jack Jansen. (Needs
20202documentation.)
20203
20204- String interning: dictionary lookups are faster when the lookup
20205string object is the same object as the key in the dictionary, not
20206just a string with the same value. This is done by having a pool of
20207"interned" strings. Most names generated by the interpreter are now
20208automatically interned, and there's a new built-in function intern(s)
20209that returns the interned version of a string. Interned strings are
20210not a different object type, and interning is totally optional, but by
20211interning most keys a speedup of about 15% was obtained for the
20212pystone benchmark.
20213
20214- Dictionary objects have several new methods; clear() and copy() have
20215the obvious semantics, while update(d) merges the contents of another
20216dictionary d into this one, overriding existing keys. The dictionary
20217implementation file is now called dictobject.c rather than the
20218confusing mappingobject.c.
20219
20220- The intrinsic function dir() is much smarter; it looks in __dict__,
20221__members__ and __methods__.
20222
20223- The intrinsic functions int(), long() and float() can now take a
20224string argument and then do the same thing as string.atoi(),
20225string.atol(), and string.atof(). No second 'base' argument is
20226allowed, and complex() does not take a string (nobody cared enough).
20227
20228- When a module is deleted, its globals are now deleted in two phases.
20229In the first phase, all variables whose name begins with exactly one
20230underscore are replaced by None; in the second phase, all variables
20231are deleted. This makes it possible to have global objects whose
20232destructors depend on other globals. The deletion order within each
20233phase is still random.
20234
20235- It is no longer an error for a function to be called without a
20236global variable __builtins__ -- an empty directory will be provided
20237by default.
20238
20239- Guido's corollary to the "Don Beaudry hook": it is now possible to
20240do metaprogramming by using an instance as a base class. Not for the
20241faint of heart; and undocumented as yet, but basically if a base class
20242is an instance, its class will be instantiated to create the new
20243class. Jim Fulton will love it -- it also works with instances of his
20244"extension classes", since it is triggered by the presence of a
20245__class__ attribute on the purported base class. See
20246Demo/metaclasses/index.html for an explanation and see that directory
20247for examples.
20248
20249- Another change is that the Don Beaudry hook is now invoked when
20250*any* base class is special. (Up to 1.5a3, the *last* special base
20251class is used; in 1.5a4, the more rational choice of the *first*
20252special base class is used.)
20253
20254- New optional parameter to the readlines() method of file objects.
20255This indicates the number of bytes to read (the actual number of bytes
20256read will be somewhat larger due to buffering reading until the end of
20257the line). Some optimizations have also been made to speed it up (but
20258not as much as read()).
20259
20260- Complex numbers no longer have the ".conj" pseudo attribute; use
20261z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
20262now *do* support the __members__ and __methods__ special attributes.
20263
20264- The complex() function now looks for a __complex__() method on class
20265instances before giving up.
20266
20267- Long integers now support arbitrary shift counts, so you can now
20268write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
20269shift count for this.)
20270
20271- The hex() and oct() functions have been changed so that for regular
20272integers, they never emit a minus sign. For example, on a 32-bit
20273machine, oct(-1) now returns '037777777777' and hex(-1) returns
20274'0xffffffff'. While this may seem inconsistent, it is much more
20275useful. (For long integers, a minus sign is used as before, to fit
20276the result in memory :-)
20277
20278- The hash() function computes better hashes for several data types,
20279including strings, floating point numbers, and complex numbers.
20280
20281
20282New extension modules
20283---------------------
20284
20285- New extension modules cStringIO.c and cPickle.c, written by Jim
20286Fulton and other folks at Digital Creations. These are much more
20287efficient than their Python counterparts StringIO.py and pickle.py,
20288but don't support subclassing. cPickle.c clocks up to 1000 times
20289faster than pickle.py; cStringIO.c's improvement is less dramatic but
20290still significant.
20291
20292- New extension module zlibmodule.c, interfacing to the free zlib
20293library (gzip compatible compression). There's also a module gzip.py
20294which provides a higher level interface. Written by Andrew Kuchling
20295and Jeremy Hylton.
20296
20297- New module readline; see the "miscellaneous" section above.
20298
20299- New Unix extension module resource.c, by Jeremy Hylton, provides
20300access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
20301related symbolic constants.
20302
20303- New extension puremodule.c, by Barry Warsaw, which interfaces to the
20304Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
20305possible to enable Purify by simply setting the PURIFY Makefile
20306variable in the Modules/Setup file.
20307
20308
20309Changes in extension modules
20310----------------------------
20311
20312- The struct extension module has several new features to control byte
20313order and word size. It supports reading and writing IEEE floats even
20314on platforms where this is not the native format. It uses uppercase
20315format codes for unsigned integers of various sizes (always using
20316Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
20317and 'p' for "Pascal strings" (with a leading length byte, included in
20318the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
20319big-endian data and '<' forces little-endian data; these also select
20320standard data sizes and disable automatic alignment (use pad bytes as
20321needed).
20322
20323- The array module supports uppercase format codes for unsigned data
20324formats (like the struct module).
20325
20326- The fcntl extension module now exports the needed symbolic
20327constants. (Formerly these were in FCNTL.py which was not available
20328or correct for all platforms.)
20329
20330- The extension modules dbm, gdbm and bsddb now check that the
20331database is still open before making any new calls.
20332
20333- The dbhash module is no more. Use bsddb instead. (There's a third
20334party interface for the BSD 2.x code somewhere on the web; support for
20335bsddb will be deprecated.)
20336
20337- The gdbm module now supports a sync() method.
20338
20339- The socket module now has some new functions: getprotobyname(), and
20340the set {ntoh,hton}{s,l}().
20341
20342- Various modules now export their type object: socket.SocketType,
20343array.ArrayType.
20344
20345- The socket module's accept() method now returns unknown addresses as
20346a tuple rather than raising an exception. (This can happen in
20347promiscuous mode.) Theres' also a new function getprotobyname().
20348
20349- The pthread support for the thread module now works on most platforms.
20350
20351- STDWIN is now officially obsolete. Support for it will eventually
20352be removed from the distribution.
20353
20354- The binascii extension module is now hopefully fully debugged.
20355(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
20356received.)
20357
20358- audioop.c: added a ratecv() function; better handling of overflow in
20359add().
20360
20361- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
20362Windows, also O_TEXT and O_BINARY. The 'error' variable (the
20363exception is raises) is renamed -- its string value is now "os.error",
20364so newbies don't believe they have to import posix (or nt) to catch
20365it when they see os.error reported as posix.error. The execve()
20366function now accepts any mapping object for the environment.
20367
20368- A new version of the al (audio library) module for SGI was
20369contributed by Sjoerd Mullender.
20370
20371- The regex module has a new function get_syntax() which retrieves the
20372syntax setting set by set_syntax(). The code was also sanitized,
20373removing worries about unclean error handling. See also below for its
20374successor, re.py.
20375
20376- The "new" module (which creates new objects of various types) once
20377again has a fully functioning new.function() method. Dangerous as
20378ever! Also, new.code() has several new arguments.
20379
20380- A problem has been fixed in the rotor module: on systems with signed
20381characters, rotor-encoded data was not portable when the key contained
203828-bit characters. Also, setkey() now requires its argument rather
20383than having broken code to default it.
20384
20385- The sys.builtin_module_names variable is now a tuple. Another new
20386variables in sys is sys.executable (the full path to the Python
20387binary, if known).
20388
20389- The specs for time.strftime() have undergone some revisions. It
20390appears that not all format characters are supported in the same way
20391on all platforms. Rather than reimplement it, we note these
20392differences in the documentation, and emphasize the shared set of
20393features. There's also a thorough test set (that occasionally finds
20394problems in the C library implementation, e.g. on some Linuxes),
20395thanks to Skip Montanaro.
20396
20397- The nis module seems broken when used with NIS+; unfortunately
20398nobody knows how to fix it. It should still work with old NIS.
20399
20400
20401New library modules
20402-------------------
20403
20404- New (still experimental) Perl-style regular expression module,
20405re.py, which uses a new interface for matching as well as a new
20406syntax; the new interface avoids the thread-unsafety of the regex
20407interface. This comes with a helper extension reopmodule.c and vastly
20408rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
20409Peters, and Andrew Kuchling. See the documentation libre.tex. In
204101.5, the old regex module is still fully supported; in the future, it
20411will become obsolete.
20412
20413- New module gzip.py; see zlib above.
20414
20415- New module keyword.py exports knowledge about Python's built-in
20416keywords. (New version by Ka-Ping Yee.)
20417
20418- New module pprint.py (with documentation) which supports
20419pretty-printing of lists, tuples, & dictionaries recursively. By Fred
20420Drake.
20421
20422- New module code.py. The function code.compile_command() can
20423determine whether an interactively entered command is complete or not,
20424distinguishing incomplete from invalid input. (XXX Unfortunately,
20425this seems broken at this moment, and I don't have the time to fix
20426it. It's probably better to add an explicit interface to the parser
20427for this.)
20428
20429- There is now a library module xdrlib.py which can read and write the
20430XDR data format as used by Sun RPC, for example. It uses the struct
20431module.
20432
20433
20434Changes in library modules
20435--------------------------
20436
20437- Module codehack.py is now completely obsolete.
20438
20439- The pickle.py module has been updated to make it compatible with the
20440new binary format that cPickle.c produces. By default it produces the
20441old all-ASCII format compatible with the old pickle.py, still much
20442faster than pickle.py; it will read both formats automatically. A few
20443other updates have been made.
20444
20445- A new helper module, copy_reg.py, is provided to register extensions
20446to the pickling code.
20447
20448- Revamped module tokenize.py is much more accurate and has an
20449interface that makes it a breeze to write code to colorize Python
20450source code. Contributed by Ka-Ping Yee.
20451
20452- In ihooks.py, ModuleLoader.load_module() now closes the file under
20453all circumstances.
20454
20455- The tempfile.py module has a new class, TemporaryFile, which creates
20456an open temporary file that will be deleted automatically when
20457closed. This works on Windows and MacOS as well as on Unix. (Jim
20458Fulton.)
20459
20460- Changes to the cgi.py module: Most imports are now done at the
20461top of the module, which provides a speedup when using ni (Jim
20462Fulton). The problem with file upload to a Windows platform is solved
20463by using the new tempfile.TemporaryFile class; temporary files are now
20464always opened in binary mode (Jim Fulton). The cgi.escape() function
20465now takes an optional flag argument that quotes '"' to '&quot;'. It
20466is now possible to invoke cgi.py from a command line script, to test
20467cgi scripts more easily outside an http server. There's an optional
20468limit to the size of uploads to POST (Skip Montanaro). Added a
20469'strict_parsing' option to all parsing functions (Jim Fulton). The
20470function parse_qs() now uses urllib.unquote() on the name as well as
20471the value of fields (Clarence Gardner). The FieldStorage class now
20472has a __len__() method.
20473
20474- httplib.py: the socket object is no longer closed; all HTTP/1.*
20475responses are now accepted; and it is now thread-safe (by not using
20476the regex module).
20477
20478- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
20479
20480- The popen2.py module is now rewritten using a class, which makes
20481access to the standard error stream and the process id of the
20482subprocess possible.
20483
20484- Added timezone support to the rfc822.py module, in the form of a
20485getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
20486Also added recognition of some non-standard date formats, by Lars
20487Wirzenius, and RFC 850 dates (Chris Lawrence).
20488
20489- mhlib.py: various enhancements, including almost compatible parsing
20490of message sequence specifiers without invoking a subprocess. Also
20491added a createmessage() method by Lars Wirzenius.
20492
20493- The StringIO.StringIO class now supports readline(nbytes). (Lars
20494Wirzenius.) (Of course, you should be using cStringIO for performance.)
20495
20496- UserDict.py supports the new dictionary methods as well.
20497
20498- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
20499speed it up, and replace 0 seed values by 1 to avoid degeneration.
20500A bug was fixed in the test for invalid arguments.
20501
20502- Module ftplib.py: added support for parsing a .netrc file (Fred
20503Drake). Also added an ntransfercmd() method to the FTP class, which
20504allows access to the expected size of a transfer when available, and a
20505parse150() function to the module which parses the corresponding 150
20506response.
20507
20508- urllib.py: the ftp cache is now limited to 10 entries. Added
20509quote_plus() and unquote_plus() functions which are like quote() and
20510unquote() but also replace spaces with '+' or vice versa, for
20511encoding/decoding CGI form arguments. Catch all errors from the ftp
20512module. HTTP requests now add the Host: header line. The proxy
20513variable names are now mapped to lower case, for Windows. The
20514spliturl() function no longer erroneously throws away all data past
20515the first newline. The basejoin() function now intereprets "../"
20516correctly. I *believe* that the problems with "exception raised in
20517__del__" under certain circumstances have been fixed (mostly by
20518changes elsewher in the interpreter).
20519
20520- In urlparse.py, there is a cache for results in urlparse.urlparse();
20521its size limit is set to 20. Also, new URL schemes shttp, https, and
20522snews are "supported".
20523
20524- shelve.py: use cPickle and cStringIO when available. Also added
20525a sync() method, which calls the database's sync() method if there is
20526one.
20527
20528- The mimetools.py module now uses the available Python modules for
20529decoding quoted-printable, uuencode and base64 formats, rather than
20530creating a subprocess.
20531
20532- The python debugger (pdb.py, and its base class bdb.py) now support
20533conditional breakpoints. See the docs.
20534
20535- The modules base64.py, uu.py and quopri.py can now be used as simple
20536command line utilities.
20537
20538- Various small fixes to the nntplib.py module that I can't bother to
20539document in detail.
20540
20541- Sjoerd Mullender's mimify.py module now supports base64 encoding and
20542includes functions to handle the funny encoding you sometimes see in mail
20543headers. It is now documented.
20544
20545- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
20546gotten from the environment.
20547
20548- Many more modules now correctly open files in binary mode when this
20549is necessary on non-Unix platforms.
20550
20551- The copying functions in the undocumented module shutil.py are
20552smarter.
20553
20554- The Writer classes in the formatter.py module now have a flush()
20555method.
20556
20557- The sgmllib.py module accepts hyphens and periods in the middle of
20558attribute names. While this is against the SGML standard, there is
20559some HTML out there that uses this...
20560
20561- The interface for the Python bytecode disassembler module, dis.py,
20562has been enhanced quite a bit. There's now one main function,
20563dis.dis(), which takes almost any kind of object (function, module,
20564class, instance, method, code object) and disassembles it; without
20565arguments it disassembles the last frame of the last traceback. The
20566other functions have changed slightly, too.
20567
20568- The imghdr.py module recognizes new image types: BMP, PNG.
20569
20570- The string.py module has a new function replace(str, old, new,
20571[maxsplit]) which does substring replacements. It is actually
20572implemented in C in the strop module. The functions [r]find() an
20573[r]index() have an optional 4th argument indicating the end of the
20574substring to search, alsoo implemented by their strop counterparts.
20575(Remember, never import strop -- import string uses strop when
20576available with zero overhead.)
20577
20578- The string.join() function now accepts any sequence argument, not
20579just lists and tuples.
20580
20581- The string.maketrans() requires its first two arguments to be
20582present. The old version didn't require them, but there's not much
20583point without them, and the documentation suggests that they are
20584required, so we fixed the code to match the documentation.
20585
20586- The regsub.py module has a function clear_cache(), which clears its
20587internal cache of compiled regular expressions. Also, the cache now
20588takes the current syntax setting into account. (However, this module
20589is now obsolete -- use the sub() or subn() functions or methods in the
20590re module.)
20591
20592- The undocumented module Complex.py has been removed, now that Python
20593has built-in complex numbers. A similar module remains as
20594Demo/classes/Complex.py, as an example.
20595
20596
20597Changes to the build process
20598----------------------------
20599
20600- The way GNU readline is configured is totally different. The
20601--with-readline configure option is gone. It is now an extension
20602module, which may be loaded dynamically. You must enable it (and
Thomas Wouters89f507f2006-12-13 04:49:30 +000020603specify the correct libraries to link with) in the Modules/Setup file.
Guido van Rossum439d1fa1998-12-21 21:41:14 +000020604Importing the module installs some hooks which enable command line
20605editing. When the interpreter shell is invoked interactively, it
20606attempts to import the readline module; when this fails, the default
20607input mechanism is used. The hook variables are PyOS_InputHook and
20608PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
20609ideas from William Magro.)
20610
20611- New build procedure: a single library, libpython1.5.a, is now built,
20612which contains absolutely everything except for a one-line main()
20613program (which calls Py_Main(argc, argv) to start the interpreter
20614shell). This makes life much simpler for applications that need to
20615embed Python. The serial number of the build is now included in the
20616version string (sys.version).
20617
20618- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
20619emits a single warning any more when compiling Python.
20620
20621- A number of new Makefile variables have been added for special
20622situations, e.g. LDLAST is appended to the link command. These are
20623used by editing the Makefile or passing them on the make command
20624line.
20625
20626- A set of patches from Lee Busby has been integrated that make it
20627possible to catch floating point exceptions. Use the configure option
20628--with-fpectl to enable the patches; the extension modules fpectl and
20629fpetest provide control to enable/disable and test the feature,
20630respectively.
20631
20632- The support for shared libraries under AIX is now simpler and more
20633robust. Thanks to Vladimir Marangozov for revamping his own patches!
20634
20635- The Modules/makesetup script now reads a file Setup.local as well as
20636a file Setup. Most changes to the Setup script can be done by editing
20637Setup.local instead, which makes it easier to carry a particular setup
20638over from one release to the next.
20639
20640- The Modules/makesetup script now copies any "include" lines it
20641encounters verbatim into the output Makefile. It also recognizes .cxx
20642and .cpp as C++ source files.
20643
20644- The configure script is smarter about C compiler options; e.g. with
20645gcc it uses -O2 and -g when possible, and on some other platforms it
20646uses -Olimit 1500 to avoid a warning from the optimizer about the main
20647loop in ceval.c (which has more than 1000 basic blocks).
20648
20649- The configure script now detects whether malloc(0) returns a NULL
20650pointer or a valid block (of length zero). This avoids the nonsense
20651of always adding one byte to all malloc() arguments on most platforms.
20652
20653- The configure script has a new option, --with-dec-threads, to enable
20654DEC threads on DEC Alpha platforms. Also, --with-threads is now an
20655alias for --with-thread (this was the Most Common Typo in configure
20656arguments).
20657
20658- Many changes in Doc/Makefile; amongst others, latex2html is now used
20659to generate HTML from all latex documents.
20660
20661
20662Change to the Python/C API
20663--------------------------
20664
20665- Because some interfaces have changed, the PYTHON_API macro has been
20666bumped. Most extensions built for the old API version will still run,
20667but I can't guarantee this. Python prints a warning message on
20668version mismatches; it dumps core when the version mismatch causes a
20669serious problem :-)
20670
20671- I've completed the Grand Renaming, with the help of Roger Masse and
20672Barry Warsaw. This makes reading or debugging the code much easier.
20673Many other unrelated code reorganizations have also been carried out.
20674The allobjects.h header file is gone; instead, you would have to
20675include Python.h followed by rename2.h. But you're better off running
20676Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
20677the rename2.h; it will disappear in the next release.
20678
20679- Various and sundry small bugs in the "abstract" interfaces have been
20680fixed. Thanks to all the (involuntary) testers of the Python 1.4
20681version! Some new functions have been added, e.g. PySequence_List(o),
20682equivalent to list(o) in Python.
20683
20684- New API functions PyLong_FromUnsignedLong() and
20685PyLong_AsUnsignedLong().
20686
20687- The API functions in the file cgensupport.c are no longer
20688supported. This file has been moved to Modules and is only ever
20689compiled when the SGI specific 'gl' module is built.
20690
20691- PyObject_Compare() can now raise an exception. Check with
20692PyErr_Occurred(). The comparison function in an object type may also
20693raise an exception.
20694
20695- The slice interface uses an upper bound of INT_MAX when no explicit
20696upper bound is given (e.x. for a[1:]). It used to ask the object for
20697its length and do the calculations.
20698
20699- Support for multiple independent interpreters. See Doc/api.tex,
20700functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
20701documentation is incomplete, also see the new Demo/pysvr example
20702(which shows how to use these in a threaded application) and the
20703source code.
20704
20705- There is now a Py_Finalize() function which "de-initializes"
20706Python. It is possible to completely restart the interpreter
20707repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
20708change of functionality in Py_Initialize() means that it is now a
20709fatal error to call it while the interpreter is already initialized.
20710The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
20711is deprecated (it is nothing more than Py_Finalize() followed by
20712exit()).
20713
20714- There are no known memory leaks left. While Py_Finalize() doesn't
20715free *all* allocated memory (some of it is hard to track down),
20716repeated calls to Py_Finalize() and Py_Initialize() do not create
20717unaccessible heap blocks.
20718
20719- There is now explicit per-thread state. (Inspired by, but not the
20720same as, Greg Stein's free threading patches.)
20721
20722- There is now better support for threading C applications. There are
20723now explicit APIs to manipulate the interpreter lock. Read the source
20724or the Demo/pysvr example; the new functions are
20725PyEval_{Acquire,Release}{Lock,Thread}().
20726
20727- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
20728with other libraries' DEBUG macros. Likewise for any other test
20729macros that didn't yet start with Py_.
20730
20731- New wrappers around malloc() and friends: Py_Malloc() etc. call
20732malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
20733just malloc(). Use of these wrappers could be essential if multiple
20734memory allocators exist (e.g. when using certain DLL setups under
20735Windows). (Idea by Jim Fulton.)
20736
20737- New C API PyImport_Import() which uses whatever __import__() hook
20738that is installed for the current execution environment. By Jim
20739Fulton.
20740
20741- It is now possible for an extension module's init function to fail
20742non-fatally, by calling one of the PyErr_* functions and returning.
20743
20744- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
20745argument to the proper type, like the similar PyString macros already
20746did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
20747and PyList_GET_ITEM.
20748
20749- Some of the Py_Get* function, like Py_GetVersion() (but not yet
20750Py_GetPath()) are now declared as returning a const char *. (More
20751should follow.)
20752
20753- Changed the run-time library to check for exceptions after object
20754comparisons. PyObject_Compare() can now return an exception; use
20755PyErr_Occurred() to check (there is *no* special return value).
20756
20757- PyFile_WriteString() and Py_Flushline() now return error indicators
20758instead of clearing exceptions. This fixes an obscure bug where using
20759these would clear a pending exception, discovered by Just van Rossum.
20760
20761- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
20762an argument list including keyword arguments. Contributed by Geoff
20763Philbrick.
20764
20765- PyArg_GetInt() is gone.
20766
20767- It's no longer necessary to include graminit.h when calling one of
20768the extended parser API functions. The three public grammar start
20769symbols are now in Python.h as Py_single_input, Py_file_input, and
20770Py_eval_input.
20771
20772- The CObject interface has a new function,
20773PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
20774on the object referenced by "module.name".
20775
20776
20777Tkinter
20778-------
20779
20780- On popular demand, _tkinter once again installs a hook for readline
20781that processes certain Tk events while waiting for the user to type
20782(using PyOS_InputHook).
20783
20784- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
20785caused by command definitions referencing widget objects beyond their
20786lifetime.
20787
20788- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
20789tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
20790with the new Tk dialog scripts, and provide more "native platform"
20791style file selection dialog boxes on some platforms. Contributed by
20792Fredrik Lundh.
20793
20794- Tkinter.py: when the first Tk object is destroyed, it sets the
20795hiddel global _default_root to None, so that when another Tk object is
20796created it becomes the new default root. Other miscellaneous
20797changes and fixes.
20798
20799- The Image class now has a configure method.
20800
20801- Added a bunch of new winfo options to Tkinter.py; we should now be
20802up to date with Tk 4.2. The new winfo options supported are:
20803mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
20804visualsavailable.
20805
20806- The broken bind() method on Canvas objects defined in the Canvas.py
20807module has been fixed. The CanvasItem and Group classes now also have
20808an unbind() method.
20809
20810- The problem with Tkinter.py falling back to trying to import
20811"tkinter" when "_tkinter" is not found has been fixed -- it no longer
20812tries "tkinter", ever. This makes diagnosing the problem "_tkinter
20813not configured" much easier and will hopefully reduce the newsgroup
20814traffic on this topic.
20815
20816- The ScrolledText module once again supports the 'cnf' parameter, to
20817be compatible with the examples in Mark Lutz' book (I know, I know,
20818too late...)
20819
20820- The _tkinter.c extension module has been revamped. It now support
20821Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
20822works well under Windows and Mac (with the latest Tk ports to those
20823platforms). It also supports threading -- it is safe for one
20824(Python-created) thread to be blocked in _tkinter.mainloop() while
20825other threads modify widgets. To make the changes visible, those
20826threads must use update_idletasks()method. (The patch for threading
20827in 1.5a3 was broken; in 1.5a4, it is back in a different version,
20828which requires access to the Tcl sources to get it to work -- hence it
20829is disabled by default.)
20830
20831- A bug in _tkinter.c has been fixed, where Split() with a string
20832containing an unmatched '"' could cause an exception or core dump.
20833
20834- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
20835CreateFileHandler, so _tkinter.createfilehandler is not available on
20836those platforms when using Tk 8.0 or later. I will have to rethink
20837how to interface with Tcl's lower-level event mechanism, or with its
20838channels (which are like Python's file-like objects). Jack Jansen has
20839provided a fix for the Mac, so createfilehandler *is* actually
20840supported there; maybe I can adapt his fix for Windows.
20841
20842
20843Tools and Demos
20844---------------
20845
20846- A new regression test suite is provided, which tests most of the
20847standard and built-in modules. The regression test is run by invoking
20848the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
20849he and Roger Masse contributed most of the new tests.
20850
20851- New tool: faqwiz -- the CGI script that is used to maintain the
20852Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
20853Tools/faqwiz.
20854
20855- New tool: webchecker -- a simple extensible web robot that, when
20856aimed at a web server, checks that server for dead links. Available
20857are a command line utility as well as a Tkinter based GUI version. In
20858Tools/webchecker. A simplified version of this program is dissected
20859in my article in O'Reilly's WWW Journal, the issue on Scripting
20860Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
20861Includes a parser for robots.txt files by Skip Montanaro.
20862
20863- New small tools: cvsfiles.py (prints a list of all files under CVS
20864n a particular directory tree), treesync.py (a rather Guido-specific
20865script to synchronize two source trees, one on Windows NT, the other
20866one on Unix under CVS but accessible from the NT box), and logmerge.py
20867(sort a collection of RCS or CVS logs by date). In Tools/scripts.
20868
20869- The freeze script now also works under Windows (NT). Another
20870feature allows the -p option to be pointed at the Python source tree
20871instead of the installation prefix. This was loosely based on part of
20872xfreeze by Sam Rushing and Bill Tutt.
20873
20874- New examples (Demo/extend) that show how to use the generic
20875extension makefile (Misc/Makefile.pre.in).
20876
20877- Tools/scripts/h2py.py now supports C++ comments.
20878
20879- Tools/scripts/pystone.py script is upgraded to version 1.1; there
20880was a bug in version 1.0 (distributed with Python 1.4) that leaked
20881memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
20882
20883- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
20884
20885
20886Windows (NT and 95)
20887-------------------
20888
20889- New project files for Developer Studio (Visual C++) 5.0 for Windows
20890NT (the old VC++ 4.2 Makefile is also still supported, but will
20891eventually be withdrawn due to its bulkiness).
20892
20893- See the note on the new module search path in the "Miscellaneous" section
20894above.
20895
20896- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
20897basically withdrawn. If it still works for you, you're lucky.
20898
20899- There's a new extension module, msvcrt.c, which provides various
20900low-level operations defined in the Microsoft Visual C++ Runtime Library.
20901These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
20902console I/O functions like kbhit(), getch() and putch().
20903
20904- The -u option not only sets the standard I/O streams to unbuffered
20905status, but also sets them in binary mode. (This can also be done
20906using msvcrt.setmode(), by the way.)
20907
20908- The, sys.prefix and sys.exec_prefix variables point to the directory
20909where Python is installed, or to the top of the source tree, if it was run
20910from there.
20911
20912- The various os.path modules (posixpath, ntpath, macpath) now support
20913passing more than two arguments to the join() function, so
20914os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
20915c)).
20916
20917- The ntpath module (normally used as os.path) supports ~ to $HOME
20918expansion in expanduser().
20919
20920- The freeze tool now works on Windows.
20921
20922- See also the Tkinter category for a sad note on
20923_tkinter.createfilehandler().
20924
20925- The truncate() method for file objects now works on Windows.
20926
20927- Py_Initialize() is no longer called when the DLL is loaded. You
20928must call it yourself.
20929
20930- The time module's clock() function now has good precision through
20931the use of the Win32 API QueryPerformanceCounter().
20932
20933- Mark Hammond will release Python 1.5 versions of PythonWin and his
20934other Windows specific code: the win32api extensions, COM/ActiveX
20935support, and the MFC interface.
20936
20937
20938Mac
20939---
20940
20941- As always, the Macintosh port will be done by Jack Jansen. He will
20942make a separate announcement for the Mac specific source code and the
20943binary distribution(s) when these are ready.
20944
20945
20946======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +000020947
Guido van Rossumaa253861994-10-06 17:18:57 +000020948
Guido van Rossumc30e95f1996-07-30 18:53:51 +000020949=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +000020950==> Release 1.4 (October 25 1996) <==
20951=====================================
20952
20953(Starting in reverse chronological order:)
20954
20955- Changed disclaimer notice.
20956
20957- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
20958default to the user's login shell.
20959
20960- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
20961widget, and bogus bspace() function.
20962
20963- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
20964paragraph.
20965
20966- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
20967subprojects, and to remove the (broken) experimental NumPy
20968subprojects.
20969
20970- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
20971(where os.stat() returns mtimes as floats.)
20972- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
20973fix POST in CGIHTTPServer.py.
20974
20975- Version 2.83 of Misc/python-mode.el for Emacs is included.
20976
20977- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
20978group starting immediately after a group tag.
20979
20980- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
20981
20982- In Objects/stringobject.c, fixed the compare function to do the
20983first char comparison in unsigned mode, for consistency with the way
20984other characters are compared by memcmp().
20985
20986- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
20987
20988- In Lib/urllib.py, fix another case where openedurl wasn't set.
20989
20990(XXX Sorry, the rest is in totally random order. No time to fix it.)
20991
20992- SyntaxError exceptions detected during code generation
20993(e.g. assignment to an expression) now include a line number.
20994
20995- Don't leave trailing / or \ in script directory inserted in front of
20996sys.path.
20997
20998- Added a note to Tools/scripts/classfix.py abouts its historical
20999importance.
21000
21001- Added Misc/Makefile.pre.in, a universal Makefile for extensions
21002built outside the distribution.
21003
21004- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
21005
21006- Install shared modules with mode 555 (needed for performance on some
21007platforms).
21008
21009- Some changes to standard library modules to avoid calling append()
21010with more than one argument -- while supported, this should be
21011outlawed, and I don't want to set a bad example.
21012
21013- bdb.py (and hence pdb.py) supports calling run() with a code object
21014instead of a code string.
21015
21016- Fixed an embarrassing bug cgi.py which prevented correct uploading
21017of binary files from Netscape (which doesn't distinguish between
21018binary and text files). Also added dormant logging support, which
21019makes it easier to debug the cgi module itself.
21020
21021- Added default writer to constructor of NullFormatter class.
21022
21023- Use binary mode for socket.makefile() calls in ftplib.py.
21024
21025- The ihooks module no longer "installs" itself upon import -- this
21026was an experimental feature that helped ironing out some bugs but that
21027slowed down code that imported it without the need to install it
21028(e.g. the rexec module). Also close the file in some cases and add
21029the __file__ attribute to loaded modules.
21030
21031- The test program for mailbox.py is now more useful.
21032
21033- Added getparamnames() to Message class in mimetools.py -- it returns
21034the names of parameters to the content-type header.
21035
21036- Fixed a typo in ni that broke the loop stripping "__." from names.
21037
21038- Fix sys.path[0] for scripts run via pdb.py's new main program.
21039
21040- profile.py can now also run a script, like pdb.
21041
21042- Fix a small bug in pyclbr -- don't add names starting with _ when
21043emulating from ... import *.
21044
21045- Fixed a series of embarrassing typos in rexec's handling of standard
21046I/O redirection. Added some more "safe" built-in modules: cmath,
21047errno, operator.
21048
21049- Fixed embarrassing typo in shelve.py.
21050
21051- Added SliceType and EllipsisType to types.py.
21052
21053- In urllib.py, added handling for error 301 (same as 302); added
21054geturl() method to get the URL after redirection.
21055
21056- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
21057for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
21058
21059- Fixed bsddbmodule.c to add binary mode indicator on platforms that
21060have it. This should make it working on Windows NT.
21061
21062- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
21063whatever applies. Also rationalized some other tests for various MS
21064platforms.
21065
21066- Added the sources for the NT installer script used for Python
210671.4beta3. Not tested with this release, but better than nothing.
21068
21069- A compromise in pickle's defenses against Trojan horses: a
21070user-defined function is now okay where a class is expected. A
21071built-in function is not okay, to prevent pickling something that
21072will execute os.system("rm -f *") when unpickling.
21073
21074- dis.py will print the name of local variables referenced by local
21075load/store/delete instructions.
21076
21077- Improved portability of SimpleHTTPServer module to non-Unix
21078platform.
21079
21080- The thread.h interface adds an extra argument to down_sema(). This
21081only affects other C code that uses thread.c; the Python thread module
21082doesn't use semaphores (which aren't provided on all platforms where
21083Python threads are supported). Note: on NT, this change is not
21084implemented.
21085
21086- Fixed some typos in abstract.h; corrected signature of
21087PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
21088abstract.c's PyObject_CallMethod().
21089
21090- apply(classname, (), {}) now works even if the class has no
21091__init__() method.
21092
21093- Implemented complex remainder and divmod() (these would dump core!).
21094Conversion of complex numbers to int, long int or float now raises an
21095exception, since there is no meaningful way to do it without losing
21096information.
21097
21098- Fixed bug in built-in complex() function which gave the wrong result
21099for two real arguments.
21100
21101- Change the hash algorithm for strings -- the multiplier is now
211021000003 instead of 3, which gives better spread for short strings.
21103
21104- New default path for Windows NT, the registry structure now supports
21105default paths for different install packages. (Mark Hammond -- the
21106next PythonWin release will use this.)
21107
21108- Added more symbols to the python_nt.def file.
21109
21110- When using GNU readline, set rl_readline_name to "python".
21111
21112- The Ellipses built-in name has been renamed to Ellipsis -- this is
21113the correct singular form. Thanks to Ka-Ping Yee, who saved us from
21114eternal embarrassment.
21115
21116- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
21117Ellipsis name change.
21118
21119- Updated the library reference manual. Added documentation of
21120restricted mode (rexec, Bastion) and the formatter module (for use
21121with the htmllib module). Fixed the documentation of htmllib
21122(finally).
21123
21124- The reference manual is now maintained in FrameMaker.
21125
21126- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
21127
21128- Slight improvements to Doc/Makefile.
21129
21130- Added fcntl.lockf(). This should be used for Unix file locking
21131instead of the posixfile module; lockf() is more portable.
21132
21133- The getopt module now supports long option names, thanks to Lars
21134Wizenius.
21135
21136- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
21137and Nils Fischbeck.
21138
21139- Use more bits of time.time() in whrandom's default seed().
21140
21141- Performance hack for regex module's regs attribute.
21142
21143- Don't close already closed socket in socket module.
21144
21145- Correctly handle separators containing embedded nulls in
21146strop.split, strop.find and strop.rfind. Also added more detail to
21147error message for strop.atoi and friends.
21148
21149- Moved fallback definition for hypot() to Python/hypot.c.
21150
21151- Added fallback definition for strdup, in Python/strdup.c.
21152
21153- Fixed some bugs where a function would return 0 to indicate an error
21154where it should return -1.
21155
21156- Test for error returned by time.localtime(), and rationalized its MS
21157tests.
21158
21159- Added Modules/Setup.local file, which is processed after Setup.
21160
21161- Corrected bug in toplevel Makefile.in -- execution of regen script
21162would not use the right PATH and PYTHONPATH.
21163
21164- Various and sundry NeXT configuration changes (sigh).
21165
21166- Support systems where libreadline needs neither termcap nor curses.
21167
21168- Improved ld_so_aix script and python.exp file (for AIX).
21169
21170- More stringent test for working <stdarg.h> in configure script.
21171
21172- Removed Demo/www subdirectory -- it was totally out of date.
21173
21174- Improved demos and docs for Fred Drake's parser module; fixed one
21175typo in the module itself.
21176
21177
21178=========================================
21179==> Release 1.4beta3 (August 26 1996) <==
21180=========================================
21181
21182
21183(XXX This is less readable that it should. I promise to restructure
21184it for the final 1.4 release.)
21185
21186
21187What's new in 1.4beta3 (since beta2)?
21188-------------------------------------
21189
21190- Name mangling to implement a simple form of class-private variables.
21191A name of the form "__spam" can't easily be used outside the class.
21192(This was added in 1.4beta3, but left out of the 1.4beta3 release
21193message.)
21194
21195- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
21196handled correctly when using a proxy server.
21197
21198- In ntpath.normpath(): don't truncate to 8+3 format.
21199
21200- In mimetools.choose_boundary(): don't die when getuid() or getpid()
21201aren't defined.
21202
21203- Module urllib: some optimizations to (un)quoting.
21204
21205- New module MimeWriter for writing MIME documents.
21206
21207- More changes to formatter module.
21208
21209- The freeze script works once again and is much more robust (using
21210sys.prefix etc.). It also supports a -o option to specify an
21211output directory.
21212
21213- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
21214
21215- The Doc/Makefile targets have been reorganized somewhat to remove the
21216insistence on always generating PostScript.
21217
21218- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
21219
21220- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
21221name conflict on the Mac.
21222
21223- Linking a module compiled with a different setting for Py_TRACE_REFS now
21224generates a linker error rather than a core dump.
21225
21226- The cgi module has a new convenience function print_exception(), which
21227formats a python exception using HTML. It also fixes a bug in the
21228compatibility code and adds a dubious feature which makes it possible to
21229have two query strings, one in the URL and one in the POST data.
21230
21231- A subtle change in the unpickling of class instances makes it possible
21232to unpickle in restricted execution mode, where the __dict__ attribute is
21233not available (but setattr() is).
21234
21235- Documentation for os.path.splitext() (== posixpath.splitext()) has been
21236cleared up. It splits at the *last* dot.
21237
21238- posixfile locking is now also correctly supported on AIX.
21239
21240- The tempfile module once again honors an initial setting of tmpdir. It
21241now works on Windows, too.
21242
21243- The traceback module has some new functions to extract, format and print
21244the active stack.
21245
21246- Some translation functions in the urllib module have been made a little
21247less sluggish.
21248
21249- The addtag_* methods for Canvas widgets in Tkinter as well as in the
21250separate Canvas class have been fixed so they actually do something
21251meaningful.
21252
21253- A tiny _test() function has been added to Tkinter.py.
21254
21255- A generic Makefile for dynamically loaded modules is provided in the Misc
21256subdirectory (Misc/gMakefile).
21257
21258- A new version of python-mode.el for Emacs is provided. See
21259http://www.python.org/ftp/emacs/pmdetails.html for details. The
21260separate file pyimenu.el is no longer needed, imenu support is folded
21261into python-mode.el.
21262
21263- The configure script can finally correctly find the readline library in a
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000021264non-standard location. The LDFLAGS variable is passed on the Makefiles
Guido van Rossum821a5581997-05-23 04:05:31 +000021265from the configure script.
21266
21267- Shared libraries are now installed as programs (i.e. with executable
21268permission). This is required on HP-UX and won't hurt on other systems.
21269
21270- The objc.c module is no longer part of the distribution. Objective-C
21271support may become available as contributed software on the ftp site.
21272
21273- The sybase module is no longer part of the distribution. A much
21274improved sybase module is available as contributed software from the
21275ftp site.
21276
21277- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
21278Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
21279now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
21280
21281- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
21282can use *.so and *.sl as shared libraries.
21283
21284- Some more fidgeting for AIX shared libraries.
21285
21286- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
21287(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
21288available from the contrib directory on the ftp site.)
21289
21290- A warning is written to sys.stderr when a __del__ method raises an
21291exception (formerly, such exceptions were completely ignored).
21292
21293- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
21294incapable of ANSI style token concatenation and stringification.
21295
21296- All source files (except a few platform specific modules) are once again
21297compatible with K&R C compilers as well as ANSI compilers. In particular,
21298ANSI-isms have been removed or made conditional in complexobject.c,
21299getargs.c and operator.c.
21300
21301- The abstract object API has three new functions, PyObject_DelItem,
21302PySequence_DelItem, and PySequence_DelSlice.
21303
21304- The operator module has new functions delitem and delslice, and the
21305functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
21306"and" are reserved words). ("__or__" and "__and__" are unchanged.)
21307
21308- The environment module is no longer supported; putenv() is now a function
21309in posixmodule (also under NT).
21310
21311- Error in filter(<function>, "") has been fixed.
21312
21313- Unrecognized keyword arguments raise TypeError, not KeyError.
21314
21315- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
21316some more documentation.
21317
21318- Bug in float power boundary case (0.0 to the negative integer power)
21319fixed.
21320
21321- The test of negative number to the float power has been moved from the
21322built-in pow() functin to floatobject.c (so complex numbers can yield the
21323correct result).
21324
21325- The bug introduced in beta2 where shared libraries loaded (using
21326dlopen()) from the current directory would fail, has been fixed.
21327
21328- Modules imported as shared libraries now also have a __file__ attribute,
21329giving the filename from which they were loaded. The only modules without
21330a __file__ attribute now are built-in modules.
21331
21332- On the Mac, dynamically loaded modules can end in either ".slb" or
21333".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
21334extension should only be used for "fat" binaries.
21335
21336- C API addition: marshal.c now supports
21337PyMarshal_WriteObjectToString(object).
21338
21339- C API addition: getargs.c now supports
21340PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
21341to parse keyword arguments.
21342
21343- The PC versioning scheme (sys.winver) has changed once again. the
21344version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
21345first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
21346"1.4.1" for Python 1.4.1 -- the beta level is not included) and
21347<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
21348
21349- h2py.py accepts whitespace before the # in CPP directives
21350
21351- On Solaris 2.5, it should now be possible to use either Posix threads or
21352Solaris threads (XXX: how do you select which is used???). (Note: the
21353Python pthreads interface doesn't fully support semaphores yet -- anyone
21354care to fix this?)
21355
21356- Thread support should now work on AIX, using either DCE threads or
21357pthreads.
21358
21359- New file Demo/sockets/unicast.py
21360
21361- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
21362both) (XXX)
21363
21364- New project setup for PC port, now compatible with PythonWin, with
21365_tkinter and NumPy support (XXX)
21366
21367- New module site.py (XXX)
21368
21369- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
21370
21371- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
21372
21373- regen script fixed (XXX)
21374
21375- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
21376
21377- testall now also tests math module (XXX)
21378
21379- string.atoi c.s. now raise an exception for an empty input string.
21380
21381- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
21382have config.h included at various places.
21383
21384- Unrecognized keyword arguments now raise TypeError rather than KeyError.
21385
21386- The makesetup script recognizes files with extension .so or .sl as
21387(shared) libraries.
21388
21389- 'access' is no longer a reserved word, and all code related to its
21390implementation is gone (or at least #ifdef'ed out). This should make
21391Python a little speedier too!
21392
21393- Performance enhancements suggested by Sjoerd Mullender. This includes
21394the introduction of two new optional function pointers in type object,
21395getattro and setattro, which are like getattr and setattr but take a
21396string object instead of a C string pointer.
21397
21398- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
21399only on the left or only on the right, A new optional third argument to
21400split() specifies the maximum number of separators honored (so
21401splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
214021.3, splitfields(s, None) is totally equivalent to split(s).)
21403string.capwords() has an optional second argument specifying the
21404separator (which is passed to split()).
21405
21406- regsub.split() has the same addition as string.split(). regsub.splitx(s,
21407sep, maxsep) implements the functionality that was regsub.split(s, 1) in
214081.4beta2 (return a list containing the delimiters as well as the words).
21409
21410- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
21411
21412- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
21413argument to _tkinter.create() to set Tcl's argv0 variable, so X
21414resources use the right resource class again.
21415
21416- Add #undef fabs to Modules/mathmodule.c for macintosh.
21417
21418- Added some macro renames for AIX in Modules/operator.c.
21419
21420- Removed spurious 'E' from Doc/liberrno.tex.
21421
21422- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
21423Misc/gMakefile and new version of Misc/python-mode.el.
21424
21425- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
21426NameError).
21427
21428- Added missing "from types import *" to Lib/tkinter/Canvas.py.
21429
21430- Added hint about using default args for __init__ to pickle docs.
21431
21432- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
21433PySequence_Length.
21434
21435- Some improvements to Doc/texi2html.py.
21436
21437- In Python/import.c, Cast unsigned char * in struct _frozen to char *
21438in calls to rds_object().
21439
21440- In doc/ref4.tex, added note about scope of lambda bodies.
21441
21442What's new in 1.4beta2 (since beta1)?
21443-------------------------------------
21444
21445- Portability bug in the md5.h header solved.
21446
21447- The PC build procedure now really works, and sets sys.platform to a
21448meaningful value (a few things were botched in beta 1). Lib/dos_8x3
21449is now a standard part of the distribution (alas).
21450
21451- More improvements to the installation procedure. Typing "make install"
21452now inserts the version number in the pathnames of almost everything
21453installed, and creates the machine dependent modules (FCNTL.py etc.) if not
21454supplied by the distribution. (XXX There's still a problem with the latter
21455because the "regen" script requires that Python is installed. Some manual
21456intervention may still be required.) (This has been fixed in 1.4beta3.)
21457
21458- New modules: errno, operator (XXX).
21459
Georg Brandl93dc9eb2010-03-14 10:56:14 +000021460- Changes for use with Numerical Python: built-in function slice() and
Guido van Rossum821a5581997-05-23 04:05:31 +000021461Ellipses object, and corresponding syntax:
21462
21463 x[lo:hi:stride] == x[slice(lo, hi, stride)]
21464 x[a, ..., z] == x[(a, Ellipses, z)]
21465
Raymond Hettinger565ea5a2004-10-02 11:02:59 +000021466- New documentation for errno and cgi modules.
Guido van Rossum821a5581997-05-23 04:05:31 +000021467
21468- The directory containing the script passed to the interpreter is
21469inserted in from of sys.path; "." is no longer a default path
21470component.
21471
21472- Optional third string argument to string.translate() specifies
21473characters to delete. New function string.maketrans() creates a
21474translation table for translate() or for regex.compile().
21475
21476- Module posix (and hence module os under Unix) now supports putenv().
21477Moreover, module os is enhanced so that if putenv() is supported,
21478assignments to os.environ entries make the appropriate putenv() call.
21479(XXX the putenv() implementation can leak a small amount of memory per
21480call.)
21481
21482- pdb.py can now be invoked from the command line to debug a script:
21483python pdb.py <script> <arg> ...
21484
21485- Much improved parseaddr() in rfc822.
21486
21487- In cgi.py, you can now pass an alternative value for environ to
21488nearly all functions.
21489
21490- You can now assign to instance variables whose name begins and ends
21491with '__'.
21492
21493- New version of Fred Drake's parser module and associates (token,
21494symbol, AST).
21495
21496- New PYTHON_API_VERSION value and .pyc file magic number (again!).
21497
21498- The "complex" internal structure type is now called "Py_complex" to
21499avoid name conflicts.
21500
21501- Numerous small bugs fixed.
21502
21503- Slight pickle speedups.
21504
21505- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
21506
21507- NeXT portability mods by Bill Bumgarner integrated.
21508
21509- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
21510converted to new naming style.
21511
21512
21513What's new in 1.4beta1 (since 1.3)?
21514-----------------------------------
21515
21516- Added sys.platform and sys.exec_platform for Bill Janssen.
21517
21518- Installation has been completely overhauled. "make install" now installs
21519everything, not just the python binary. Installation uses the install-sh
21520script (borrowed from X11) to install each file.
21521
21522- New functions in the posix module: mkfifo, plock, remove (== unlink),
21523and ftruncate. More functions are also available under NT.
21524
21525- New function in the fcntl module: flock.
21526
21527- Shared library support for FreeBSD.
21528
21529- The --with-readline option can now be used without a DIRECTORY argument,
21530for systems where libreadline.* is in one of the standard places. It is
21531also possible for it to be a shared library.
21532
21533- The extension tkinter has been renamed to _tkinter, to avoid confusion
21534with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
21535well as 4.0.
21536
21537- Author's change of address from CWI in Amsterdam, The Netherlands, to
21538CNRI in Reston, VA, USA.
21539
21540- The math.hypot() function is now always available (if it isn't found in
21541the C math library, Python provides its own implementation).
21542
21543- The latex documentation is now compatible with latex2e, thanks to David
21544Ascher.
21545
21546- The expression x**y is now equivalent to pow(x, y).
21547
21548- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
21549
21550- Complex numbers are now supported. Imaginary constants are written with
21551a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
21552part to an imaginary part, like 3+4j. Complex numbers are always stored in
21553floating point form, so this is equivalent to 3.0+4.0j. It is also
21554possible to create complex numbers with the new built-in function
21555complex(re, [im]). For the footprint-conscious, complex number support can
21556be disabled by defining the symbol WITHOUT_COMPLEX.
21557
21558- New built-in function list() is the long-awaited counterpart of tuple().
21559
21560- There's a new "cmath" module which provides the same functions as the
21561"math" library but with complex arguments and results. (There are very
21562good reasons why math.sqrt(-1) still raises an exception -- you have to use
21563cmath.sqrt(-1) to get 1j for an answer.)
21564
21565- The Python.h header file (which is really the same as allobjects.h except
21566it disables support for old style names) now includes several more files,
21567so you have to have fewer #include statements in the average extension.
21568
21569- The NDEBUG symbol is no longer used. Code that used to be dependent on
21570the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
21571and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
21572respectively. At long last, the source actually compiles and links without
21573errors when this symbol is defined.
21574
21575- Several symbols that didn't follow the new naming scheme have been
21576renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
21577are no external symbols left without a Py or _Py prefix, not even those
21578defined by sources that were incorporated from elsewhere (regexpr.c,
21579md5c.c). (Macros are a different story...)
21580
21581- There are now typedefs for the structures defined in config.c and
21582frozen.c.
21583
21584- New PYTHON_API_VERSION value and .pyc file magic number.
21585
21586- New module Bastion. (XXX)
21587
21588- Improved performance of StringIO module.
21589
21590- UserList module now supports + and * operators.
21591
21592- The binhex and binascii modules now actually work.
21593
21594- The cgi module has been almost totally rewritten and documented.
21595It now supports file upload and a new data type to handle forms more
21596flexibly.
21597
21598- The formatter module (for use with htmllib) has been overhauled (again).
21599
21600- The ftplib module now supports passive mode and has doc strings.
21601
21602- In (ideally) all places where binary files are read or written, the file
21603is now correctly opened in binary mode ('rb' or 'wb') so the code will work
21604on Mac or PC.
21605
21606- Dummy versions of os.path.expandvars() and expanduser() are now provided
21607on non-Unix platforms.
21608
21609- Module urllib now has two new functions url2pathname and pathname2url
21610which turn local filenames into "file:..." URLs using the same rules as
21611Netscape (why be different). it also supports urlretrieve() with a
21612pathname parameter, and honors the proxy environment variables (http_proxy
21613etc.). The URL parsing has been improved somewhat, too.
21614
21615- Micro improvements to urlparse. Added urlparse.urldefrag() which
21616removes a trailing ``#fragment'' if any.
21617
21618- The mailbox module now supports MH style message delimiters as well.
21619
21620- The mhlib module contains some new functionality: setcontext() to set the
21621current folder and parsesequence() to parse a sequence as commonly passed
21622to MH commands (e.g. 1-10 or last:5).
21623
21624- New module mimify for conversion to and from MIME format of email
21625messages.
21626
21627- Module ni now automatically installs itself when first imported -- this
21628is against the normal rule that modules should define classes and functions
21629but not invoke them, but appears more useful in the case that two
21630different, independent modules want to use ni's features.
21631
21632- Some small performance enhancements in module pickle.
21633
21634- Small interface change to the profile.run*() family of functions -- more
21635sensible handling of return values.
21636
21637- The officially registered Mac creator for Python files is 'Pyth'. This
21638replaces 'PYTH' which was used before but never registered.
21639
21640- Added regsub.capwords(). (XXX)
21641
21642- Added string.capwords(), string.capitalize() and string.translate().
21643(XXX)
21644
21645- Fixed an interface bug in the rexec module: it was impossible to pass a
21646hooks instance to the RExec class. rexec now also supports the dynamic
21647loading of modules from shared libraries. Some other interfaces have been
21648added too.
21649
21650- Module rfc822 now caches the headers in a dictionary for more efficient
21651lookup.
21652
21653- The sgmllib module now understands a limited number of SGML "shorthands"
21654like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
21655
21656- The tempfile module actually tries a number of different places to find a
21657usable temporary directory. (This was prompted by certain Linux
21658installations that appear to be missing a /usr/tmp directory.) [A bug in
21659the implementation that would ignore a pre-existing tmpdir global has been
21660fixed in beta3.]
21661
21662- Much improved and enhanved FileDialog module for Tkinter.
21663
21664- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
21665well as Tk 4.1).
21666
21667- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
21668s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
21669extension is called _socket and a wrapper module win/socket.py provides
21670"makefile()" and "dup()" functionality. On Windows, the select module
21671works only with socket objects.
21672
21673- Bugs in bsddb module fixed (e.g. missing default argument values).
21674
21675- The curses extension now includes <ncurses.h> when available.
21676
21677- The gdbm module now supports opening databases in "fast" mode by
21678specifying 'f' as the second character or the mode string.
21679
21680- new variables sys.prefix and sys.exec_prefix pass corresponding
21681configuration options / Makefile variables to the Python programmer.
21682
21683- The ``new'' module now supports creating new user-defined classes as well
21684as instances thereof.
21685
21686- The soundex module now sports get_soundex() to get the soundex value for an
21687arbitrary string (formerly it would only do soundex-based string
21688comparison) as well as doc strings.
21689
21690- New object type "cobject" to safely wrap void pointers for passing them
21691between various extension modules.
21692
21693- More efficient computation of float**smallint.
21694
21695- The mysterious bug whereby "x.x" (two occurrences of the same
21696one-character name) typed from the commandline would sometimes fail
21697mysteriously.
21698
21699- The initialization of the readline function can now be invoked by a C
21700extension through PyOS_ReadlineInit().
21701
21702- There's now an externally visible pointer PyImport_FrozenModules which
21703can be changed by an embedding application.
21704
21705- The argument parsing functions now support a new format character 'D' to
21706specify complex numbers.
21707
21708- Various memory leaks plugged and bugs fixed.
21709
21710- Improved support for posix threads (now that real implementations are
21711beginning to apepar). Still no fully functioning semaphores.
21712
21713- Some various and sundry improvements and new entries in the Tools
21714directory.
21715
21716
21717=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +000021718==> Release 1.3 (13 October 1995) <==
21719=====================================
21720
21721Major change
21722============
21723
21724Two words: Keyword Arguments. See the first section of Chapter 12 of
21725the Tutorial.
21726
21727(The rest of this file is textually the same as the remaining sections
21728of that chapter.)
21729
21730
21731Changes to the WWW and Internet tools
21732=====================================
21733
21734The "htmllib" module has been rewritten in an incompatible fashion.
21735The new version is considerably more complete (HTML 2.0 except forms,
21736but including all ISO-8859-1 entity definitions), and easy to use.
21737Small changes to "sgmllib" have also been made, to better match the
21738tokenization of HTML as recognized by other web tools.
21739
21740A new module "formatter" has been added, for use with the new
21741"htmllib" module.
21742
21743The "urllib"and "httplib" modules have been changed somewhat to allow
21744overriding unknown URL types and to support authentication. They now
21745use "mimetools.Message" instead of "rfc822.Message" to parse headers.
21746The "endrequest()" method has been removed from the HTTP class since
21747it breaks the interaction with some servers.
21748
21749The "rfc822.Message" class has been changed to allow a flag to be
21750passed in that says that the file is unseekable.
21751
21752The "ftplib" module has been fixed to be (hopefully) more robust on
21753Linux.
21754
21755Several new operations that are optionally supported by servers have
21756been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
21757
21758Other Language Changes
21759======================
21760
21761The "raise" statement now takes an optional argument which specifies
21762the traceback to be used when printing the exception's stack trace.
21763This must be a traceback object, such as found in "sys.exc_traceback".
21764When omitted or given as "None", the old behavior (to generate a stack
21765trace entry for the current stack frame) is used.
21766
21767The tokenizer is now more tolerant of alien whitespace. Control-L in
21768the leading whitespace of a line resets the column number to zero,
21769while Control-R just before the end of the line is ignored.
21770
21771Changes to Built-in Operations
21772==============================
21773
21774For file objects, "f.read(0)" and "f.readline(0)" now return an empty
21775string rather than reading an unlimited number of bytes. For the
21776latter, omit the argument altogether or pass a negative value.
21777
21778A new system variable, "sys.platform", has been added. It specifies
21779the current platform, e.g. "sunos5" or "linux1".
21780
21781The built-in functions "input()" and "raw_input()" now use the GNU
21782readline library when it has been configured (formerly, only
21783interactive input to the interpreter itself was read using GNU
21784readline). The GNU readline library provides elaborate line editing
21785and history. The Python debugger ("pdb") is the first beneficiary of
21786this change.
21787
21788Two new built-in functions, "globals()" and "locals()", provide access
21789to dictionaries containming current global and local variables,
21790respectively. (These augment rather than replace "vars()", which
21791returns the current local variables when called without an argument,
21792and a module's global variables when called with an argument of type
21793module.)
21794
21795The built-in function "compile()" now takes a third possible value for
21796the kind of code to be compiled: specifying "'single'" generates code
21797for a single interactive statement, which prints the output of
21798expression statements that evaluate to something else than "None".
21799
21800Library Changes
21801===============
21802
21803There are new module "ni" and "ihooks" that support importing modules
21804with hierarchical names such as "A.B.C". This is enabled by writing
21805"import ni; ni.ni()" at the very top of the main program. These
21806modules are amply documented in the Python source.
21807
21808The module "rexec" has been rewritten (incompatibly) to define a class
21809and to use "ihooks".
21810
21811The "string.split()" and "string.splitfields()" functions are now the
21812same function (the presence or absence of the second argument
21813determines which operation is invoked); similar for "string.join()"
21814and "string.joinfields()".
21815
21816The "Tkinter" module and its helper "Dialog" have been revamped to use
21817keyword arguments. Tk 4.0 is now the standard. A new module
21818"FileDialog" has been added which implements standard file selection
21819dialogs.
21820
21821The optional built-in modules "dbm" and "gdbm" are more coordinated
21822--- their "open()" functions now take the same values for their "flag"
21823argument, and the "flag" and "mode" argument have default values (to
21824open the database for reading only, and to create the database with
21825mode "0666" minuse the umask, respectively). The memory leaks have
21826finally been fixed.
21827
21828A new dbm-like module, "bsddb", has been added, which uses the BSD DB
21829package's hash method.
21830
21831A portable (though slow) dbm-clone, implemented in Python, has been
21832added for systems where none of the above is provided. It is aptly
21833dubbed "dumbdbm".
21834
21835The module "anydbm" provides a unified interface to "bsddb", "gdbm",
21836"dbm", and "dumbdbm", choosing the first one available.
21837
21838A new extension module, "binascii", provides a variety of operations
21839for conversion of text-encoded binary data.
21840
21841There are three new or rewritten companion modules implemented in
21842Python that can encode and decode the most common such formats: "uu"
21843(uuencode), "base64" and "binhex".
21844
21845A module to handle the MIME encoding quoted-printable has also been
21846added: "quopri".
21847
21848The parser module (which provides an interface to the Python parser's
21849abstract syntax trees) has been rewritten (incompatibly) by Fred
21850Drake. It now lets you change the parse tree and compile the result!
21851
21852The \code{syslog} module has been upgraded and documented.
21853
21854Other Changes
21855=============
21856
21857The dynamic module loader recognizes the fact that different filenames
21858point to the same shared library and loads the library only once, so
21859you can have a single shared library that defines multiple modules.
21860(SunOS / SVR4 style shared libraries only.)
21861
21862Jim Fulton's ``abstract object interface'' has been incorporated into
21863the run-time API. For more detailes, read the files
21864"Include/abstract.h" and "Objects/abstract.c".
21865
21866The Macintosh version is much more robust now.
21867
21868Numerous things I have forgotten or that are so obscure no-one will
21869notice them anyway :-)
21870
21871
Guido van Rossumf456b6d1995-01-04 19:20:37 +000021872===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +000021873==> Release 1.2 (13 April 1995) <==
21874===================================
21875
21876- Changes to Misc/python-mode.el:
21877 - Wrapping and indentation within triple quote strings should work
21878 properly now.
21879 - `Standard' bug reporting mechanism (use C-c C-b)
21880 - py-mark-block was moved to C-c C-m
21881 - C-c C-v shows you the python-mode version
21882 - a basic python-font-lock-keywords has been added for Emacs 19
21883 font-lock colorizations.
21884 - proper interaction with pending-del and del-sel modes.
21885 - New py-electric-colon (:) command for improved outdenting. Also
21886 py-indent-line (TAB) should handle outdented lines better.
21887 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
21888
21889- The Library Reference has been restructured, and many new and
21890existing modules are now documented, in particular the debugger and
21891the profiler, as well as the persistency and the WWW/Internet support
21892modules.
21893
21894- All known bugs have been fixed. For example the pow(2,2,3L) bug on
21895Linux has been fixed. Also the re-entrancy problems with __del__ have
21896been fixed.
21897
21898- All known memory leaks have been fixed.
21899
21900- Phase 2 of the Great Renaming has been executed. The header files
21901now use the new names (PyObject instead of object, etc.). The linker
21902also sees the new names. Most source files still use the old names,
21903by virtue of the rename2.h header file. If you include Python.h, you
21904only see the new names. Dynamically linked modules have to be
21905recompiled. (Phase 3, fixing the rest of the sources, will be
21906executed gradually with the release later versions.)
21907
21908- The hooks for implementing "safe-python" (better called "restricted
21909execution") are in place. Specifically, the import statement is
21910implemented by calling the built-in function __import__, and the
21911built-in names used in a particular scope are taken from the
21912dictionary __builtins__ in that scope's global dictionary. See also
21913the new (unsupported, undocumented) module rexec.py.
21914
21915- The import statement now supports the syntax "import a.b.c" and
21916"from a.b.c import name". No officially supported implementation
21917exists, but one can be prototyped by replacing the built-in __import__
21918function. A proposal by Ken Manheimer is provided as newimp.py.
21919
21920- All machinery used by the import statement (or the built-in
21921__import__ function) is now exposed through the new built-in module
21922"imp" (see the library reference manual). All dynamic loading
21923machinery is moved to the new file importdl.c.
21924
21925- Persistent storage is supported through the use of the modules
21926"pickle" and "shelve" (implemented in Python). There's also a "copy"
21927module implementing deepcopy and normal (shallow) copy operations.
21928See the library reference manual.
21929
21930- Documentation strings for many objects types are accessible through
21931the __doc__ attribute. Modules, classes and functions support special
21932syntax to initialize the __doc__ attribute: if the first statement
21933consists of just a string literal, that string literal becomes the
21934value of the __doc__ attribute. The default __doc__ attribute is
21935None. Documentation strings are also supported for built-in
21936functions, types and modules; however this feature hasn't been widely
21937used yet. See the 'new' module for an example. (Basically, the type
21938object's tp_doc field contains the doc string for the type, and the
219394th member of the methodlist structure contains the doc string for the
21940method.)
21941
21942- The __coerce__ and __cmp__ methods for user-defined classes once
21943again work as expected. As an example, there's a new standard class
21944Complex in the library.
21945
21946- The functions posix.popen() and posix.fdopen() now have an optional
21947third argument to specify the buffer size, and default their second
Georg Brandl93dc9eb2010-03-14 10:56:14 +000021948(mode) argument to 'r' -- in analogy to the built-in open() function.
Guido van Rossumd462f3d1995-10-09 21:30:37 +000021949The same applies to posixfile.open() and the socket method makefile().
21950
21951- The thread.exit_thread() function now raises SystemExit so that
21952'finally' clauses are honored and a memory leak is plugged.
21953
21954- Improved X11 and Motif support, by Sjoerd Mullender. This extension
21955is being maintained and distributed separately.
21956
21957- Improved support for the Apple Macintosh, in part by Jack Jansen,
21958e.g. interfaces to (a few) resource mananger functions, get/set file
21959type and creator, gestalt, sound manager, speech manager, MacTCP, comm
21960toolbox, and the think C console library. This is being maintained
21961and distributed separately.
21962
21963- Improved version for Windows NT, by Mark Hammond. This is being
21964maintained and distributed separately.
21965
21966- Used autoconf 2.0 to generate the configure script. Adapted
21967configure.in to use the new features in autoconf 2.0.
21968
21969- It now builds on the NeXT without intervention, even on the 3.3
21970Sparc pre-release.
21971
21972- Characters passed to isspace() and friends are masked to nonnegative
21973values.
21974
21975- Correctly compute pow(-3.0, 3).
21976
21977- Fix portability problems with getopt (configure now checks for a
21978non-GNU getopt).
21979
21980- Don't add frozenmain.o to libPython.a.
21981
21982- Exceptions can now be classes. ALl built-in exceptions are still
21983string objects, but this will change in the future.
21984
21985- The socket module exports a long list of socket related symbols.
21986(More built-in modules will export their symbolic constants instead of
21987relying on a separately generated Python module.)
21988
21989- When a module object is deleted, it clears out its own dictionary.
21990This fixes a circularity in the references between functions and
21991their global dictionary.
21992
21993- Changed the error handling by [new]getargs() e.g. for "O&".
21994
21995- Dynamic loading of modules using shared libraries is supported for
21996several new platforms.
21997
21998- Support "O&", "[...]" and "{...}" in mkvalue().
21999
22000- Extension to findmethod(): findmethodinchain() (where a chain is a
22001linked list of methodlist arrays). The calling interface for
22002findmethod() has changed: it now gets a pointer to the (static!)
22003methodlist structure rather than just to the function name -- this
22004saves copying flags etc. into the (short-lived) method object.
22005
22006- The callable() function is now public.
22007
22008- Object types can define a few new operations by setting function
22009pointers in the type object structure: tp_call defines how an object
22010is called, and tp_str defines how an object's str() is computed.
22011
22012
22013===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +000022014==> Release 1.1.1 (10 Nov 1994) <==
22015===================================
22016
22017This is a pure bugfix release again. See the ChangeLog file for details.
22018
22019One exception: a few new features were added to tkinter.
22020
22021
22022=================================
22023==> Release 1.1 (11 Oct 1994) <==
22024=================================
22025
22026This release adds several new features, improved configuration and
22027portability, and fixes more bugs than I can list here (including some
22028memory leaks).
22029
22030The source compiles and runs out of the box on more platforms than
22031ever -- including Windows NT. Makefiles or projects for a variety of
22032non-UNIX platforms are provided.
22033
22034APOLOGY: some new features are badly documented or not at all. I had
22035the choice -- postpone the new release indefinitely, or release it
22036now, with working code but some undocumented areas. The problem with
22037postponing the release is that people continue to suffer from existing
22038bugs, and send me patches based on the previous release -- which I
22039can't apply directly because my own source has changed. Also, some
22040new modules (like signal) have been ready for release for quite some
22041time, and people are anxiously waiting for them. In the case of
22042signal, the interface is simple enough to figure out without
22043documentation (if you're anxious enough :-). In this case it was not
22044simple to release the module on its own, since it relies on many small
22045patches elsewhere in the source.
22046
22047For most new Python modules, the source code contains comments that
22048explain how to use them. Documentation for the Tk interface, written
22049by Matt Conway, is available as tkinter-doc.tar.gz from the Python
22050home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
22051new operator overloading facilities, have a look at Demo/classes:
22052Complex.py and Rat.py show how to implement a numeric type without and
22053with __coerce__ method. Also have a look at the end of the Tutorial
22054document (Doc/tut.tex). If you're still confused: use the newsgroup
22055or mailing list.
22056
22057
22058New language features:
22059
22060 - More flexible operator overloading for user-defined classes
22061 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
22062
22063 - Classes can define methods named __getattr__, __setattr__ and
22064 __delattr__ to trap attribute accesses. See end of tutorial.
22065
22066 - Classes can define method __call__ so instances can be called
22067 directly. See end of tutorial.
22068
22069
22070New support facilities:
22071
22072 - The Makefiles (for the base interpreter as well as for extensions)
22073 now support creating dynamically loadable modules if the platform
22074 supports shared libraries.
22075
22076 - Passing the interpreter a .pyc file as script argument will execute
22077 the code in that file. (On the Mac such files can be double-clicked!)
22078
22079 - New Freeze script, to create independently distributable "binaries"
22080 of Python programs -- look in Demo/freeze
22081
22082 - Improved h2py script (in Demo/scripts) follows #includes and
22083 supports macros with one argument
22084
22085 - New module compileall generates .pyc files for all modules in a
22086 directory (tree) without also executing them
22087
22088 - Threads should work on more platforms
22089
22090
22091New built-in modules:
22092
22093 - tkinter (support for Tcl's Tk widget set) is now part of the base
22094 distribution
22095
22096 - signal allows catching or ignoring UNIX signals (unfortunately still
22097 undocumented -- any taker?)
22098
22099 - termios provides portable access to POSIX tty settings
22100
22101 - curses provides an interface to the System V curses library
22102
22103 - syslog provides an interface to the (BSD?) syslog daemon
22104
22105 - 'new' provides interfaces to create new built-in object types
22106 (e.g. modules and functions)
22107
22108 - sybase provides an interface to SYBASE database
22109
22110
22111New/obsolete built-in methods:
22112
22113 - callable(x) tests whether x can be called
22114
22115 - sockets now have a setblocking() method
22116
22117 - sockets no longer have an allowbroadcast() method
22118
22119 - socket methods send() and sendto() return byte count
22120
22121
22122New standard library modules:
22123
22124 - types.py defines standard names for built-in types, e.g. StringType
22125
22126 - urlparse.py parses URLs according to the latest Internet draft
22127
22128 - uu.py does uuencode/uudecode (not the fastest in the world, but
22129 quicker than installing uuencode on a non-UNIX machine :-)
22130
22131 - New, faster and more powerful profile module.py
22132
22133 - mhlib.py provides interface to MH folders and messages
22134
22135
22136New facilities for extension writers (unfortunately still
22137undocumented):
22138
22139 - newgetargs() supports optional arguments and improved error messages
22140
22141 - O!, O& O? formats for getargs allow more versatile type checking of
22142 non-standard types
22143
22144 - can register pending asynchronous callback, to be called the next
22145 time the Python VM begins a new instruction (Py_AddPendingCall)
22146
22147 - can register cleanup routines to be called when Python exits
22148 (Py_AtExit)
22149
22150 - makesetup script understands C++ files in Setup file (use file.C
22151 or file.cc)
22152
22153 - Make variable OPT is passed on to sub-Makefiles
22154
22155 - An init<module>() routine may signal an error by not entering
22156 the module in the module table and raising an exception instead
22157
22158 - For long module names, instead of foobarbletchmodule.c you can
22159 use foobarbletch.c
22160
22161 - getintvalue() and getfloatvalue() try to convert any object
22162 instead of requiring an "intobject" or "floatobject"
22163
22164 - All the [new]getargs() formats that retrieve an integer value
22165 will now also work if a float is passed
22166
22167 - C function listtuple() converts list to tuple, fast
22168
22169 - You should now call sigcheck() instead of intrcheck();
22170 sigcheck() also sets an exception when it returns nonzero
22171
22172
Guido van Rossumaa253861994-10-06 17:18:57 +000022173====================================
22174==> Release 1.0.3 (14 July 1994) <==
22175====================================
22176
22177This release consists entirely of bug fixes to the C sources; see the
22178head of ../ChangeLog for a complete list. Most important bugs fixed:
22179
22180- Sometimes the format operator (string%expr) would drop the last
22181character of the format string
22182
22183- Tokenizer looped when last line did not end in \n
22184
22185- Bug when triple-quoted string ended in quote plus newline
22186
22187- Typo in socketmodule (listen) (== instead of =)
22188
22189- typing vars() at the >>> prompt would cause recursive output
22190
22191
22192==================================
22193==> Release 1.0.2 (4 May 1994) <==
22194==================================
22195
22196Overview of the most visible changes. Bug fixes are not listed. See
22197also ChangeLog.
22198
22199Tokens
22200------
22201
22202* String literals follow Standard C rules: they may be continued on
22203the next line using a backslash; adjacent literals are concatenated
22204at compile time.
22205
22206* A new kind of string literals, surrounded by triple quotes (""" or
22207'''), can be continued on the next line without a backslash.
22208
22209Syntax
22210------
22211
22212* Function arguments may have a default value, e.g. def f(a, b=1);
22213defaults are evaluated at function definition time. This also applies
22214to lambda.
22215
22216* The try-except statement has an optional else clause, which is
22217executed when no exception occurs in the try clause.
22218
22219Interpreter
22220-----------
22221
22222* The result of a statement-level expression is no longer printed,
22223except_ for expressions entered interactively. Consequently, the -k
22224command line option is gone.
22225
22226* The result of the last printed interactive expression is assigned to
22227the variable '_'.
22228
22229* Access to implicit global variables has been speeded up by removing
22230an always-failing dictionary lookup in the dictionary of local
22231variables (mod suggested by Steve Makewski and Tim Peters).
22232
22233* There is a new command line option, -u, to force stdout and stderr
22234to be unbuffered.
22235
22236* Incorporated Steve Majewski's mods to import.c for dynamic loading
22237under AIX.
22238
22239* Fewer chances of dumping core when trying to reload or re-import
22240static built-in, dynamically loaded built-in, or frozen modules.
22241
22242* Loops over sequences now don't ask for the sequence's length when
22243they start, but try to access items 0, 1, 2, and so on until they hit
22244an IndexError. This makes it possible to create classes that generate
22245infinite or indefinite sequences a la Steve Majewski. This affects
22246for loops, the (not) in operator, and the built-in functions filter(),
22247map(), max(), min(), reduce().
22248
22249Changed Built-in operations
22250---------------------------
22251
22252* The '%' operator on strings (printf-style formatting) supports a new
22253feature (adapted from a patch by Donald Beaudry) to allow
22254'%(<key>)<format>' % {...} to take values from a dictionary by name
22255instead of from a tuple by position (see also the new function
22256vars()).
22257
22258* The '%s' formatting operator is changed to accept any type and
22259convert it to a string using str().
22260
22261* Dictionaries with more than 20,000 entries can now be created
22262(thanks to Steve Kirsch).
22263
22264New Built-in Functions
22265----------------------
22266
22267* vars() returns a dictionary containing the local variables; vars(m)
22268returns a dictionary containing the variables of module m. Note:
22269dir(x) is now equivalent to vars(x).keys().
22270
22271Changed Built-in Functions
22272--------------------------
22273
22274* open() has an optional third argument to specify the buffer size: 0
22275for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
22276for default.
22277
22278* open()'s second argument is now optional; it defaults to "r".
22279
22280* apply() now checks that its second argument is indeed a tuple.
22281
22282New Built-in Modules
22283--------------------
22284
22285Changed Built-in Modules
22286------------------------
22287
22288The thread module no longer supports exit_prog().
22289
22290New Python Modules
22291------------------
22292
22293* Module addpack contains a standard interface to modify sys.path to
22294find optional packages (groups of related modules).
22295
22296* Module urllib contains a number of functions to access
22297World-Wide-Web files specified by their URL.
22298
22299* Module httplib implements the client side of the HTTP protocol used
22300by World-Wide-Web servers.
22301
22302* Module gopherlib implements the client side of the Gopher protocol.
22303
22304* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
22305style mailbox files.
22306
22307* Module random contains various random distributions, e.g. gauss().
22308
22309* Module lockfile locks and unlocks open files using fcntl (inspired
22310by a similar module by Andy Bensky).
22311
22312* Module ntpath (by Jaap Vermeulen) implements path operations for
22313Windows/NT.
22314
22315* Module test_thread (in Lib/test) contains a small test set for the
22316thread module.
22317
22318Changed Python Modules
22319----------------------
22320
22321* The string module's expandvars() function is now documented and is
22322implemented in Python (using regular expressions) instead of forking
22323off a shell process.
22324
22325* Module rfc822 now supports accessing the header fields using the
22326mapping/dictionary interface, e.g. h['subject'].
22327
22328* Module pdb now makes it possible to set a break on a function
22329(syntax: break <expression>, where <expression> yields a function
22330object).
22331
22332Changed Demos
22333-------------
22334
22335* The Demo/scripts/freeze.py script is working again (thanks to Jaap
22336Vermeulen).
22337
22338New Demos
22339---------
22340
22341* Demo/threads/Generator.py is a proposed interface for restartable
22342functions a la Tim Peters.
22343
22344* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
22345directory full of HTML pages which between them contain links to all
22346the newsgroups available on your server.
22347
22348* Demo/dns contains a DNS (Domain Name Server) client.
22349
22350* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
22351nice enhanced Python shell!!!).
22352
22353* Demo/turing contains a Turing machine by Amrit Prem.
22354
22355Documentation
22356-------------
22357
22358* Documented new language features mentioned above (but not all new
22359modules).
22360
22361* Added a chapter to the Tutorial describing recent additions to
22362Python.
22363
22364* Clarified some sentences in the reference manual,
22365e.g. break/continue, local/global scope, slice assignment.
22366
22367Source Structure
22368----------------
22369
22370* Moved Include/tokenizer.h to Parser/tokenizer.h.
22371
22372* Added Python/getopt.c for systems that don't have it.
22373
22374Emacs mode
22375----------
22376
22377* Indentation of continuated lines is done more intelligently;
22378consequently the variable py-continuation-offset is gone.
22379
Guido van Rossumf2eac992000-09-04 17:24:24 +000022380
Guido van Rossumaa253861994-10-06 17:18:57 +000022381========================================
22382==> Release 1.0.1 (15 February 1994) <==
22383========================================
22384
22385* Many portability fixes should make it painless to build Python on
22386several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
22387
22388* Fixed test for <stdarg.h> -- this broke on some platforms.
22389
22390* Fixed test for shared library dynalic loading -- this broke on SunOS
223914.x using the GNU loader.
22392
22393* Changed order and number of SVR4 networking libraries (it is now
22394-lsocket -linet -lnsl, if these libraries exist).
22395
22396* Installing the build intermediate stages with "make libainstall" now
22397also installs config.c.in, Setup and makesetup, which are used by the
22398new Extensions mechanism.
22399
22400* Improved README file contains more hints and new troubleshooting
22401section.
22402
22403* The built-in module strop now defines fast versions of three more
22404functions of the standard string module: atoi(), atol() and atof().
22405The strop versions of atoi() and atol() support an optional second
22406argument to specify the base (default 10). NOTE: you don't have to
22407explicitly import strop to use the faster versions -- the string
22408module contains code to let versions from stop override the default
22409versions.
22410
22411* There is now a working Lib/dospath.py for those who use Python under
22412DOS (or Windows). Thanks, Jaap!
22413
22414* There is now a working Modules/dosmodule.c for DOS (or Windows)
22415system calls.
22416
22417* Lib.os.py has been reorganized (making it ready for more operating
22418systems).
22419
22420* Lib/ospath.py is now obsolete (use os.path instead).
22421
22422* Many fixes to the tutorial to make it match Python 1.0. Thanks,
22423Tim!
22424
22425* Fixed Doc/Makefile, Doc/README and various scripts there.
22426
22427* Added missing description of fdopen to Doc/libposix.tex.
22428
22429* Made cleanup() global, for the benefit of embedded applications.
22430
22431* Added parsing of addresses and dates to Lib/rfc822.py.
22432
22433* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
22434them usable at all.
22435
22436* New module Lib/wave.py reads RIFF (*.wav) audio files.
22437
22438* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
22439belongs.
22440
22441* New options and comments for Modules/makesetup (used by new
22442Extension mechanism).
22443
22444* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
22445and elsewhere.
22446
22447* Fixed coredump in filter(None, 'abcdefg').
22448
22449
22450=======================================
22451==> Release 1.0.0 (26 January 1994) <==
22452=======================================
22453
22454As is traditional, so many things have changed that I can't pretend to
22455be complete in these release notes, but I'll try anyway :-)
22456
22457Note that the very last section is labeled "remaining bugs".
22458
22459
22460Source organization and build process
22461-------------------------------------
22462
22463* The sources have finally been split: instead of a single src
22464subdirectory there are now separate directories Include, Parser,
22465Grammar, Objects, Python and Modules. Other directories also start
22466with a capital letter: Misc, Doc, Lib, Demo.
22467
22468* A few extensions (notably Amoeba and X support) have been moved to a
22469separate subtree Extensions, which is no longer in the core
22470distribution, but separately ftp'able as extensions.tar.Z. (The
22471distribution contains a placeholder Ext-dummy with a description of
22472the Extensions subtree as well as the most recent versions of the
22473scripts used there.)
22474
22475* A few large specialized demos (SGI video and www) have been
22476moved to a separate subdirectory Demo2, which is no longer in the core
22477distribution, but separately ftp'able as demo2.tar.Z.
22478
22479* Parts of the standard library have been moved to subdirectories:
22480there are now standard subdirectories stdwin, test, sgi and sun4.
22481
22482* The configuration process has radically changed: I now use GNU
22483autoconf. This makes it much easier to build on new Unix flavors, as
22484well as fully supporting VPATH (if your Make has it). The scripts
22485Configure.py and Addmodule.sh are no longer needed. Many source files
22486have been adapted in order to work with the symbols that the configure
22487script generated by autoconf defines (or not); the resulting source is
22488much more portable to different C compilers and operating systems,
22489even non Unix systems (a Mac port was done in an afternoon). See the
22490toplevel README file for a description of the new build process.
22491
22492* GNU readline (a slightly newer version) is now a subdirectory of the
22493Python toplevel. It is still not automatically configured (being
22494totally autoconf-unaware :-). One problem has been solved: typing
22495Control-C to a readline prompt will now work. The distribution no
22496longer contains a "super-level" directory (above the python toplevel
22497directory), and dl, dl-dld and GNU dld are no longer part of the
22498Python distribution (you can still ftp them from
22499ftp.cwi.nl:/pub/dynload).
22500
22501* The DOS functions have been taken out of posixmodule.c and moved
22502into a separate file dosmodule.c.
22503
22504* There's now a separate file version.c which contains nothing but
22505the version number.
22506
22507* The actual main program is now contained in config.c (unless NO_MAIN
22508is defined); pythonmain.c now contains a function realmain() which is
22509called from config.c's main().
22510
22511* All files needed to use the built-in module md5 are now contained in
22512the distribution. The module has been cleaned up considerably.
22513
22514
22515Documentation
22516-------------
22517
22518* The library manual has been split into many more small latex files,
22519so it is easier to edit Doc/lib.tex file to create a custom library
22520manual, describing only those modules supported on your system. (This
22521is not automated though.)
22522
22523* A fourth manual has been added, titled "Extending and Embedding the
22524Python Interpreter" (Doc/ext.tex), which collects information about
22525the interpreter which was previously spread over several files in the
22526misc subdirectory.
22527
22528* The entire documentation is now also available on-line for those who
22529have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
22530"http://www.cwi.nl/~guido/Python.html".
22531
22532
22533Syntax
22534------
22535
22536* Strings may now be enclosed in double quotes as well as in single
22537quotes. There is no difference in interpretation. The repr() of
22538string objects will use double quotes if the string contains a single
22539quote and no double quotes. Thanks to Amrit Prem for these changes!
22540
22541* There is a new keyword 'exec'. This replaces the exec() built-in
22542function. If a function contains an exec statement, local variable
22543optimization is not performed for that particular function, thus
22544making assignment to local variables in exec statements less
22545confusing. (As a consequence, os.exec and python.exec have been
22546renamed to execv.)
22547
22548* There is a new keyword 'lambda'. An expression of the form
22549
22550 lambda <parameters> : <expression>
22551
22552yields an anonymous function. This is really only syntactic sugar;
22553you can just as well define a local function using
22554
22555 def some_temporary_name(<parameters>): return <expression>
22556
22557Lambda expressions are particularly useful in combination with map(),
22558filter() and reduce(), described below. Thanks to Amrit Prem for
22559submitting this code (as well as map(), filter(), reduce() and
22560xrange())!
22561
22562
22563Built-in functions
22564------------------
22565
22566* The built-in module containing the built-in functions is called
22567__builtin__ instead of builtin.
22568
22569* New built-in functions map(), filter() and reduce() perform standard
22570functional programming operations (though not lazily):
22571
22572- map(f, seq) returns a new sequence whose items are the items from
22573seq with f() applied to them.
22574
22575- filter(f, seq) returns a subsequence of seq consisting of those
22576items for which f() is true.
22577
22578- reduce(f, seq, initial) returns a value computed as follows:
22579 acc = initial
22580 for item in seq: acc = f(acc, item)
22581 return acc
22582
22583* New function xrange() creates a "range object". Its arguments are
22584the same as those of range(), and when used in a for loop a range
22585objects also behaves identical. The advantage of xrange() over
22586range() is that its representation (if the range contains many
22587elements) is much more compact than that of range(). The disadvantage
22588is that the result cannot be used to initialize a list object or for
22589the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
22590architectures, benchmarks have shown that "for i in range(...): ..."
22591actually executes *faster* than "for i in xrange(...): ...", but on
22592memory starved machines like PCs running DOS range(100000) may be just
22593too big to be represented at all...
22594
22595* Built-in function exec() has been replaced by the exec statement --
22596see above.
22597
22598
22599The interpreter
22600---------------
22601
22602* Syntax errors are now not printed to stderr by the parser, but
22603rather the offending line and other relevant information are packed up
22604in the SyntaxError exception argument. When the main loop catches a
22605SyntaxError exception it will print the error in the same format as
22606previously, but at the proper position in the stack traceback.
22607
22608* You can now set a maximum to the number of traceback entries
22609printed by assigning to sys.tracebacklimit. The default is 1000.
22610
22611* The version number in .pyc files has changed yet again.
22612
22613* It is now possible to have a .pyc file without a corresponding .py
22614file. (Warning: this may break existing installations if you have an
22615old .pyc file lingering around somewhere on your module search path
22616without a corresponding .py file, when there is a .py file for a
22617module of the same name further down the path -- the new interpreter
22618will find the first .pyc file and complain about it, while the old
22619interpreter would ignore it and use the .py file further down.)
22620
22621* The list sys.builtin_module_names is now sorted and also contains
22622the names of a few hardwired built-in modules (sys, __main__ and
22623__builtin__).
22624
22625* A module can now find its own name by accessing the global variable
22626__name__. Assigning to this variable essentially renames the module
22627(it should also be stored under a different key in sys.modules).
22628A neat hack follows from this: a module that wants to execute a main
22629program when called as a script no longer needs to compare
22630sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
22631
22632* When an object is printed by the print statement, its implementation
22633of str() is used. This means that classes can define __str__(self) to
22634direct how their instances are printed. This is different from
22635__repr__(self), which should define an unambigous string
22636representation of the instance. (If __str__() is not defined, it
22637defaults to __repr__().)
22638
22639* Functions and code objects can now be compared meaningfully.
22640
22641* On systems supporting SunOS or SVR4 style shared libraries, dynamic
22642loading of modules using shared libraries is automatically configured.
22643Thanks to Bill Jansen and Denis Severson for contributing this change!
22644
22645
22646Built-in objects
22647----------------
22648
22649* File objects have acquired a new method writelines() which is the
22650reverse of readlines(). (It does not actually write lines, just a
22651list of strings, but the symmetry makes the choice of name OK.)
22652
22653
22654Built-in modules
22655----------------
22656
22657* Socket objects no longer support the avail() method. Use the select
22658module instead, or use this function to replace it:
22659
22660 def avail(f):
22661 import select
22662 return f in select.select([f], [], [], 0)[0]
22663
22664* Initialization of stdwin is done differently. It actually modifies
22665sys.argv (taking out the options the X version of stdwin recognizes)
22666the first time it is imported.
22667
22668* A new built-in module parser provides a rudimentary interface to the
22669python parser. Corresponding standard library modules token and symbol
22670defines the numeric values of tokens and non-terminal symbols.
22671
22672* The posix module has aquired new functions setuid(), setgid(),
22673execve(), and exec() has been renamed to execv().
22674
22675* The array module is extended with 8-byte object swaps, the 'i'
22676format character, and a reverse() method. The read() and write()
22677methods are renamed to fromfile() and tofile().
22678
22679* The rotor module has freed of portability bugs. This introduces a
22680backward compatibility problem: strings encoded with the old rotor
22681module can't be decoded by the new version.
22682
22683* For select.select(), a timeout (4th) argument of None means the same
22684as leaving the timeout argument out.
22685
22686* Module strop (and hence standard library module string) has aquired
22687a new function: rindex(). Thanks to Amrit Prem!
22688
22689* Module regex defines a new function symcomp() which uses an extended
22690regular expression syntax: parenthesized subexpressions may be labeled
22691using the form "\(<labelname>...\)", and the group() method can return
22692sub-expressions by name. Thanks to Tracy Tims for these changes!
22693
22694* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
22695Mullender!
22696
22697
22698Standard library modules
22699------------------------
22700
22701* The library is now split in several subdirectories: all stuff using
22702stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
22703is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
22704test modules are in Lib/test. The default module search path will
22705include all relevant subdirectories by default.
22706
22707* Module os now knows about trying to import dos. It defines
22708functions execl(), execle(), execlp() and execvp().
22709
22710* New module dospath (should be attacked by a DOS hacker though).
22711
22712* All modules defining classes now define __init__() constructors
22713instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
22714
22715* Some minor changes and bugfixes module ftplib (mostly Steve
22716Majewski's suggestions); the debug() method is renamed to
22717set_debuglevel().
22718
22719* Some new test modules (not run automatically by testall though):
22720test_audioop, test_md5, test_rgbimg, test_select.
22721
22722* Module string now defines rindex() and rfind() in analogy of index()
22723and find(). It also defines atof() and atol() (and corresponding
22724exceptions) in analogy to atoi().
22725
22726* Added help() functions to modules profile and pdb.
22727
22728* The wdb debugger (now in Lib/stdwin) now shows class or instance
22729variables on a double click. Thanks to Sjoerd Mullender!
22730
22731* The (undocumented) module lambda has gone -- you couldn't import it
22732any more, and it was basically more a demo than a library module...
22733
22734
22735Multimedia extensions
22736---------------------
22737
22738* The optional built-in modules audioop and imageop are now standard
22739parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
22740for contributing this code!
22741
22742* There's a new operation in audioop: minmax().
22743
22744* There's a new built-in module called rgbimg which supports portable
22745efficient reading of SGI RCG image files. Thanks also to Paul
22746Haeberli for the original code! (Who will contribute a GIF reader?)
22747
22748* The module aifc is gone -- you should now always use aifc, which has
22749received a facelift.
22750
22751* There's a new module sunau., for reading Sun (and NeXT) audio files.
22752
22753* There's a new module audiodev which provides a uniform interface to
22754(SGI Indigo and Sun Sparc) audio hardware.
22755
22756* There's a new module sndhdr which recognizes various sound files by
22757looking in their header and checking for various magic words.
22758
22759
22760Optimizations
22761-------------
22762
22763* Most optimizations below can be configured by compile-time flags.
22764Thanks to Sjoerd Mullender for submitting these optimizations!
22765
22766* Small integers (default -1..99) are shared -- i.e. if two different
22767functions compute the same value it is possible (but not
22768guaranteed!!!) that they return the same *object*. Python programs
22769can detect this but should *never* rely on it.
22770
22771* Empty tuples (which all compare equal) are shared in the same
22772manner.
22773
22774* Tuples of size up to 20 (default) are put in separate free lists
22775when deallocated.
22776
22777* There is a compile-time option to cache a string's hash function,
22778but this appeared to have a negligeable effect, and as it costs 4
22779bytes per string it is disabled by default.
22780
22781
22782Embedding Python
22783----------------
22784
22785* The initialization interface has been simplified somewhat. You now
22786only call "initall()" to initialize the interpreter.
22787
22788* The previously announced renaming of externally visible identifiers
22789has not been carried out. It will happen in a later release. Sorry.
22790
22791
22792Miscellaneous bugs that have been fixed
22793---------------------------------------
22794
22795* All known portability bugs.
22796
22797* Version 0.9.9 dumped core in <listobject>.sort() which has been
22798fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
22799on the mailing list while I was away!
22800
22801* Core dump on a format string ending in '%', e.g. in the expression
22802'%' % None.
22803
22804* The array module yielded a bogus result for concatenation (a+b would
22805yield a+a).
22806
22807* Some serious memory leaks in strop.split() and strop.splitfields().
22808
22809* Several problems with the nis module.
22810
22811* Subtle problem when copying a class method from another class
22812through assignment (the method could not be called).
22813
22814
22815Remaining bugs
22816--------------
22817
22818* One problem with 64-bit machines remains -- since .pyc files are
22819portable and use only 4 bytes to represent an integer object, 64-bit
22820integer literals are silently truncated when written into a .pyc file.
22821Work-around: use eval('123456789101112').
22822
22823* The freeze script doesn't work any more. A new and more portable
22824one can probably be cooked up using tricks from Extensions/mkext.py.
22825
22826* The dos support hasn't been tested yet. (Really Soon Now we should
22827have a PC with a working C compiler!)
22828
22829
Guido van Rossuma7925f11994-01-26 10:20:16 +000022830===================================
22831==> Release 0.9.9 (29 Jul 1993) <==
22832===================================
22833
22834I *believe* these are the main user-visible changes in this release,
22835but there may be others. SGI users may scan the {src,lib}/ChangeLog
22836files for improvements of some SGI specific modules, e.g. aifc and
22837cl. Developers of extension modules should also read src/ChangeLog.
22838
22839
22840Naming of C symbols used by the Python interpreter
22841--------------------------------------------------
22842
22843* This is the last release using the current naming conventions. New
22844naming conventions are explained in the file misc/NAMING.
22845Summarizing, all externally visible symbols get (at least) a "Py"
22846prefix, and most functions are renamed to the standard form
22847PyModule_FunctionName.
22848
22849* Writers of extensions are urged to start using the new naming
22850conventions. The next release will use the new naming conventions
22851throughout (it will also have a different source directory
22852structure).
22853
22854* As a result of the preliminary work for the great renaming, many
22855functions that were accidentally global have been made static.
22856
22857
22858BETA X11 support
22859----------------
22860
22861* There are now modules interfacing to the X11 Toolkit Intrinsics, the
22862Athena widgets, and the Motif 1.1 widget set. These are not yet
22863documented except through the examples and README file in the demo/x11
22864directory. It is expected that this interface will be replaced by a
22865more powerful and correct one in the future, which may or may not be
22866backward compatible. In other words, this part of the code is at most
22867BETA level software! (Note: the rest of Python is rock solid as ever!)
22868
22869* I understand that the above may be a bit of a disappointment,
22870however my current schedule does not allow me to change this situation
22871before putting the release out of the door. By releasing it
22872undocumented and buggy, at least some of the (working!) demo programs,
22873like itr (my Internet Talk Radio browser) become available to a larger
22874audience.
22875
22876* There are also modules interfacing to SGI's "Glx" widget (a GL
22877window wrapped in a widget) and to NCSA's "HTML" widget (which can
22878format HyperText Markup Language, the document format used by the
22879World Wide Web).
22880
22881* I've experienced some problems when building the X11 support. In
22882particular, the Xm and Xaw widget sets don't go together, and it
22883appears that using X11R5 is better than using X11R4. Also the threads
22884module and its link time options may spoil things. My own strategy is
22885to build two Python binaries: one for use with X11 and one without
22886it, which can contain a richer set of built-in modules. Don't even
22887*think* of loading the X11 modules dynamically...
22888
22889
22890Environmental changes
22891---------------------
22892
22893* Compiled files (*.pyc files) created by this Python version are
22894incompatible with those created by the previous version. Both
22895versions detect this and silently create a correct version, but it
22896means that it is not a good idea to use the same library directory for
22897an old and a new interpreter, since they will start to "fight" over
22898the *.pyc files...
22899
22900* When a stack trace is printed, the exception is printed last instead
22901of first. This means that if the beginning of the stack trace
22902scrolled out of your window you can still see what exception caused
22903it.
22904
22905* Sometimes interrupting a Python operation does not work because it
22906hangs in a blocking system call. You can now kill the interpreter by
22907interrupting it three times. The second time you interrupt it, a
22908message will be printed telling you that the third interrupt will kill
22909the interpreter. The "sys.exitfunc" feature still makes limited
22910clean-up possible in this case.
22911
22912
22913Changes to the command line interface
22914-------------------------------------
22915
22916* The python usage message is now much more informative.
22917
22918* New option -i enters interactive mode after executing a script --
22919useful for debugging.
22920
22921* New option -k raises an exception when an expression statement
22922yields a value other than None.
22923
22924* For each option there is now also a corresponding environment
22925variable.
22926
22927
22928Using Python as an embedded language
22929------------------------------------
22930
22931* The distribution now contains (some) documentation on the use of
22932Python as an "embedded language" in other applications, as well as a
22933simple example. See the file misc/EMBEDDING and the directory embed/.
22934
22935
22936Speed improvements
22937------------------
22938
22939* Function local variables are now generally stored in an array and
22940accessed using an integer indexing operation, instead of through a
22941dictionary lookup. (This compensates the somewhat slower dictionary
22942lookup caused by the generalization of the dictionary module.)
22943
22944
22945Changes to the syntax
22946---------------------
22947
22948* Continuation lines can now *sometimes* be written without a
22949backslash: if the continuation is contained within nesting (), [] or
22950{} brackets the \ may be omitted. There's a much improved
22951python-mode.el in the misc directory which knows about this as well.
22952
22953* You can no longer use an empty set of parentheses to define a class
22954without base classes. That is, you no longer write this:
22955
22956 class Foo(): # syntax error
22957 ...
22958
22959You must write this instead:
22960
22961 class Foo:
22962 ...
22963
22964This was already the preferred syntax in release 0.9.8 but many
22965people seemed not to have picked it up. There's a Python script that
22966fixes old code: demo/scripts/classfix.py.
22967
22968* There's a new reserved word: "access". The syntax and semantics are
Georg Brandleeb575f2009-06-24 06:42:05 +000022969still subject of research and debate (as well as undocumented), but
Guido van Rossuma7925f11994-01-26 10:20:16 +000022970the parser knows about the keyword so you must not use it as a
22971variable, function, or attribute name.
22972
22973
22974Changes to the semantics of the language proper
22975-----------------------------------------------
22976
22977* The following compatibility hack is removed: if a function was
22978defined with two or more arguments, and called with a single argument
22979that was a tuple with just as many arguments, the items of this tuple
22980would be used as the arguments. This is no longer supported.
22981
22982
22983Changes to the semantics of classes and instances
22984-------------------------------------------------
22985
22986* Class variables are now also accessible as instance variables for
22987reading (assignment creates an instance variable which overrides the
22988class variable of the same name though).
22989
22990* If a class attribute is a user-defined function, a new kind of
22991object is returned: an "unbound method". This contains a pointer to
22992the class and can only be called with a first argument which is a
22993member of that class (or a derived class).
22994
22995* If a class defines a method __init__(self, arg1, ...) then this
22996method is called when a class instance is created by the classname()
22997construct. Arguments passed to classname() are passed to the
22998__init__() method. The __init__() methods of base classes are not
22999automatically called; the derived __init__() method must call these if
23000necessary (this was done so the derived __init__() method can choose
23001the call order and arguments for the base __init__() methods).
23002
23003* If a class defines a method __del__(self) then this method is called
23004when an instance of the class is about to be destroyed. This makes it
23005possible to implement clean-up of external resources attached to the
23006instance. As with __init__(), the __del__() methods of base classes
23007are not automatically called. If __del__ manages to store a reference
23008to the object somewhere, its destruction is postponed; when the object
23009is again about to be destroyed its __del__() method will be called
23010again.
23011
23012* Classes may define a method __hash__(self) to allow their instances
23013to be used as dictionary keys. This must return a 32-bit integer.
23014
23015
23016Minor improvements
23017------------------
23018
23019* Function and class objects now know their name (the name given in
23020the 'def' or 'class' statement that created them).
23021
23022* Class instances now know their class name.
23023
23024
23025Additions to built-in operations
23026--------------------------------
23027
23028* The % operator with a string left argument implements formatting
23029similar to sprintf() in C. The right argument is either a single
23030value or a tuple of values. All features of Standard C sprintf() are
23031supported except %p.
23032
23033* Dictionaries now support almost any key type, instead of just
23034strings. (The key type must be an immutable type or must be a class
23035instance where the class defines a method __hash__(), in order to
23036avoid losing track of keys whose value may change.)
23037
23038* Built-in methods are now compared properly: when comparing x.meth1
23039and y.meth2, if x is equal to y and the methods are defined by the
23040same function, x.meth1 compares equal to y.meth2.
23041
23042
23043Additions to built-in functions
23044-------------------------------
23045
23046* str(x) returns a string version of its argument. If the argument is
23047a string it is returned unchanged, otherwise it returns `x`.
23048
23049* repr(x) returns the same as `x`. (Some users found it easier to
23050have this as a function.)
23051
23052* round(x) returns the floating point number x rounded to an whole
23053number, represented as a floating point number. round(x, n) returns x
23054rounded to n digits.
23055
23056* hasattr(x, name) returns true when x has an attribute with the given
23057name.
23058
23059* hash(x) returns a hash code (32-bit integer) of an arbitrary
23060immutable object's value.
23061
23062* id(x) returns a unique identifier (32-bit integer) of an arbitrary
23063object.
23064
23065* compile() compiles a string to a Python code object.
23066
23067* exec() and eval() now support execution of code objects.
23068
23069
23070Changes to the documented part of the library (standard modules)
23071----------------------------------------------------------------
23072
23073* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
23074the border case '/foo/..' returns '/' instead of ''.
23075
23076* A new function string.find() is added with similar semantics to
23077string.index(); however when it does not find the given substring it
23078returns -1 instead of raising string.index_error.
23079
23080
23081Changes to built-in modules
23082---------------------------
23083
23084* New optional module 'array' implements operations on sequences of
23085integers or floating point numbers of a particular size. This is
23086useful to manipulate large numerical arrays or to read and write
23087binary files consisting of numerical data.
23088
23089* Regular expression objects created by module regex now support a new
23090method named group(), which returns one or more \(...\) groups by number.
23091The number of groups is increased from 10 to 100.
23092
23093* Function compile() in module regex now supports an optional mapping
23094argument; a variable casefold is added to the module which can be used
23095as a standard uppercase to lowercase mapping.
23096
23097* Module time now supports many routines that are defined in the
23098Standard C time interface (<time.h>): gmtime(), localtime(),
23099asctime(), ctime(), mktime(), as well as these variables (taken from
23100System V): timezone, altzone, daylight and tzname. (The corresponding
23101functions in the undocumented module calendar have been removed; the
23102undocumented and unfinished module tzparse is now obsolete and will
23103disappear in a future release.)
23104
23105* Module strop (the fast built-in version of standard module string)
23106now uses C's definition of whitespace instead of fixing it to space,
23107tab and newline; in practice this usually means that vertical tab,
23108form feed and return are now also considered whitespace. It exports
23109the string of characters that are considered whitespace as well as the
23110characters that are considered lowercase or uppercase.
23111
23112* Module sys now defines the variable builtin_module_names, a list of
23113names of modules built into the current interpreter (including not
23114yet imported, but excluding two special modules that always have to be
23115defined -- sys and builtin).
23116
23117* Objects created by module sunaudiodev now also support flush() and
23118close() methods.
23119
23120* Socket objects created by module socket now support an optional
23121flags argument for their methods sendto() and recvfrom().
23122
23123* Module marshal now supports dumping to and loading from strings,
23124through the functions dumps() and loads().
23125
23126* Module stdwin now supports some new functionality. You may have to
23127ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
23128
23129
23130Bugs fixed
23131----------
23132
23133* Fixed comparison of negative long integers.
23134
23135* The tokenizer no longer botches input lines longer than BUFSIZ.
23136
23137* Fixed several severe memory leaks in module select.
23138
23139* Fixed memory leaks in modules socket and sv.
23140
23141* Fixed memory leak in divmod() for long integers.
23142
23143* Problems with definition of floatsleep() on Suns fixed.
23144
23145* Many portability bugs fixed (and undoubtedly new ones added :-).
23146
23147
23148Changes to the build procedure
23149------------------------------
23150
23151* The Makefile supports some new targets: "make default" and "make
23152all". Both are by normally equivalent to "make python".
23153
23154* The Makefile no longer uses $> since it's not supported by all
23155versions of Make.
23156
23157* The header files now all contain #ifdef constructs designed to make
23158it safe to include the same header file twice, as well as support for
23159inclusion from C++ programs (automatic extern "C" { ... } added).
23160
23161
23162Freezing Python scripts
23163-----------------------
23164
23165* There is now some support for "freezing" a Python script as a
23166stand-alone executable binary file. See the script
23167demo/scripts/freeze.py. It will require some site-specific tailoring
23168of the script to get this working, but is quite worthwhile if you write
23169Python code for other who may not have built and installed Python.
23170
23171
23172MS-DOS
23173------
23174
23175* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
23176Marcel van der Peijl! This requires fewer compatibility hacks in
23177posixmodule.c. The executable is not yet available but will be soon
23178(check the mailing list).
23179
23180* The default PYTHONPATH has changed.
23181
23182
23183Changes for developers of extension modules
23184-------------------------------------------
23185
23186* Read src/ChangeLog for full details.
23187
23188
23189SGI specific changes
23190--------------------
23191
23192* Read src/ChangeLog for full details.
23193
Guido van Rossumaa253861994-10-06 17:18:57 +000023194
Guido van Rossuma7925f11994-01-26 10:20:16 +000023195==================================
23196==> Release 0.9.8 (9 Jan 1993) <==
23197==================================
23198
23199I claim no completeness here, but I've tried my best to scan the log
23200files throughout my source tree for interesting bits of news. A more
23201complete account of the changes is to be found in the various
23202ChangeLog files. See also "News for release 0.9.7beta" below if you're
23203still using release 0.9.6, and the file HISTORY if you have an even
23204older release.
23205
23206 --Guido
23207
23208
23209Changes to the language proper
23210------------------------------
23211
23212There's only one big change: the conformance checking for function
23213argument lists (of user-defined functions only) is stricter. Earlier,
23214you could get away with the following:
23215
23216 (a) define a function of one argument and call it with any
23217 number of arguments; if the actual argument count wasn't
23218 one, the function would receive a tuple containing the
Georg Brandleeb575f2009-06-24 06:42:05 +000023219 arguments (an empty tuple if there were none).
Guido van Rossuma7925f11994-01-26 10:20:16 +000023220
23221 (b) define a function of two arguments, and call it with more
23222 than two arguments; if there were more than two arguments,
23223 the second argument would be passed as a tuple containing
23224 the second and further actual arguments.
23225
23226(Note that an argument (formal or actual) that is a tuple is counted as
23227one; these rules don't apply inside such tuples, only at the top level
23228of the argument list.)
23229
23230Case (a) was needed to accommodate variable-length argument lists;
23231there is now an explicit "varargs" feature (precede the last argument
23232with a '*'). Case (b) was needed for compatibility with old class
23233definitions: up to release 0.9.4 a method with more than one argument
23234had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
23235Version 0.9.6 provide better ways to handle both casees, bot provided
23236backward compatibility; version 0.9.8 retracts the compatibility hacks
23237since they also cause confusing behavior if a function is called with
23238the wrong number of arguments.
23239
23240There's a script that helps converting classes that still rely on (b),
23241provided their methods' first argument is called "self":
23242demo/scripts/methfix.py.
23243
23244If this change breaks lots of code you have developed locally, try
23245#defining COMPAT_HACKS in ceval.c.
23246
23247(There's a third compatibility hack, which is the reverse of (a): if a
23248function is defined with two or more arguments, and called with a
23249single argument that is a tuple with just as many arguments, the items
23250of this tuple will be used as the arguments. Although this can (and
23251should!) be done using the built-in function apply() instead, it isn't
23252withdrawn yet.)
23253
23254
23255One minor change: comparing instance methods works like expected, so
23256that if x is an instance of a user-defined class and has a method m,
23257then (x.m==x.m) yields 1.
23258
23259
23260The following was already present in 0.9.7beta, but not explicitly
23261mentioned in the NEWS file: user-defined classes can now define types
23262that behave in almost allrespects like numbers. See
23263demo/classes/Rat.py for a simple example.
23264
23265
23266Changes to the build process
23267----------------------------
23268
23269The Configure.py script and the Makefile has been made somewhat more
23270bullet-proof, after reports of (minor) trouble on certain platforms.
23271
23272There is now a script to patch Makefile and config.c to add a new
23273optional built-in module: Addmodule.sh. Read the script before using!
23274
23275Useing Addmodule.sh, all optional modules can now be configured at
23276compile time using Configure.py, so there are no modules left that
23277require dynamic loading.
23278
23279The Makefile has been fixed to make it easier to use with the VPATH
23280feature of some Make versions (e.g. SunOS).
23281
23282
23283Changes affecting portability
23284-----------------------------
23285
23286Several minor portability problems have been solved, e.g. "malloc.h"
23287has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
23288the system now tolerates malloc(0) returning 0.
23289
23290For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
23291distributed with Python. This solves several minor problems, in
23292particular scripts invoked using #! can now use dynamic loading.
23293
23294
23295Changes to the interpreter interface
23296------------------------------------
23297
23298On popular demand, there's finally a "profile" feature for interactive
23299use of the interpreter. If the environment variable $PYTHONSTARTUP is
23300set to the name of an existing file, Python statements in this file
23301are executed when the interpreter is started in interactive mode.
23302
23303There is a new clean-up mechanism, complementing try...finally: if you
23304assign a function object to sys.exitfunc, it will be called when
23305Python exits or receives a SIGTERM or SIGHUP signal.
23306
23307The interpreter is now generally assumed to live in
23308/usr/local/bin/python (as opposed to /usr/local/python). The script
23309demo/scripts/fixps.py will update old scripts in place (you can easily
23310modify it to do other similar changes).
23311
23312Most I/O that uses sys.stdin/stdout/stderr will now use any object
23313assigned to those names as long as the object supports readline() or
23314write() methods.
23315
23316The parser stack has been increased to 500 to accommodate more
23317complicated expressions (7 levels used to be the practical maximum,
23318it's now about 38).
23319
23320The limit on the size of the *run-time* stack has completely been
23321removed -- this means that tuple or list displays can contain any
23322number of elements (formerly more than 50 would crash the
23323interpreter).
23324
23325
23326Changes to existing built-in functions and methods
23327--------------------------------------------------
23328
23329The built-in functions int(), long(), float(), oct() and hex() now
23330also apply to class instalces that define corresponding methods
23331(__int__ etc.).
23332
23333
23334New built-in functions
23335----------------------
23336
23337The new functions str() and repr() convert any object to a string.
23338The function repr(x) is in all respects equivalent to `x` -- some
23339people prefer a function for this. The function str(x) does the same
23340except if x is already a string -- then it returns x unchanged
23341(repr(x) adds quotes and escapes "funny" characters as octal escapes).
23342
23343The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
23344
23345
23346Changes to general built-in modules
23347-----------------------------------
23348
23349The time module's functions are more general: time() returns a
23350floating point number and sleep() accepts one. Their accuracies
23351depends on the precision of the system clock. Millisleep is no longer
23352needed (although it still exists for now), but millitimer is still
23353needed since on some systems wall clock time is only available with
23354seconds precision, while a source of more precise time exists that
23355isn't synchronized with the wall clock. (On UNIX systems that support
23356the BSD gettimeofday() function, time.time() is as time.millitimer().)
23357
23358The string representation of a file object now includes an address:
23359'<file 'filename', mode 'r' at #######>' where ###### is a hex number
23360(the object's address) to make it unique.
23361
23362New functions added to posix: nice(), setpgrp(), and if your system
23363supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
23364
23365Improvements to the socket module: socket objects have new methods
23366getpeername() and getsockname(), and the {get,set}sockopt methods can
23367now get/set any kind of option using strings built with the new struct
23368module. And there's a new function fromfd() which creates a socket
23369object given a file descriptor (useful for servers started by inetd,
23370which have a socket connected to stdin and stdout).
23371
23372
23373Changes to SGI-specific built-in modules
23374----------------------------------------
23375
23376The FORMS library interface (fl) now requires FORMS 2.1a. Some new
23377functions have been added and some bugs have been fixed.
23378
23379Additions to al (audio library interface): added getname(),
23380getdefault() and getminmax().
23381
23382The gl modules doesn't call "foreground()" when initialized (this
23383caused some problems) like it dit in 0.9.7beta (but not before).
23384There's a new gl function 'gversion() which returns a version string.
23385
23386The interface to sv (Indigo video interface) has totally changed.
23387(Sorry, still no documentation, but see the examples in
23388demo/sgi/{sv,video}.)
23389
23390
23391Changes to standard library modules
23392-----------------------------------
23393
23394Most functions in module string are now much faster: they're actually
23395implemented in C. The module containing the C versions is called
23396"strop" but you should still import "string" since strop doesn't
23397provide all the interfaces defined in string (and strop may be renamed
23398to string when it is complete in a future release).
23399
23400string.index() now accepts an optional third argument giving an index
23401where to start searching in the first argument, so you can find second
23402and further occurrences (this is similar to the regular expression
23403functions in regex).
23404
23405The definition of what string.splitfields(anything, '') should return
23406is changed for the last time: it returns a singleton list containing
23407its whole first argument unchanged. This is compatible with
23408regsub.split() which also ignores empty delimiter matches.
23409
23410posixpath, macpath: added dirname() and normpath() (and basename() to
23411macpath).
23412
23413The mainloop module (for use with stdwin) can now demultiplex input
23414from other sources, as long as they can be polled with select().
23415
23416
23417New built-in modules
23418--------------------
23419
23420Module struct defines functions to pack/unpack values to/from strings
23421representing binary values in native byte order.
23422
23423Module strop implements C versions of many functions from string (see
23424above).
23425
23426Optional module fcntl defines interfaces to fcntl() and ioctl() --
23427UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
23428
23429Optional module mpz defines an interface to an altaernative long
23430integer implementation, the GNU MPZ library.
23431
23432Optional module md5 uses the GNU MPZ library to calculate MD5
23433signatures of strings.
23434
23435There are also optional new modules specific to SGI machines: imageop
23436defines some simple operations to images represented as strings; sv
23437interfaces to the Indigo video board; cl interfaces to the (yet
23438unreleased) compression library.
23439
23440
23441New standard library modules
23442----------------------------
23443
23444(Unfortunately the following modules are not all documented; read the
23445sources to find out more about them!)
23446
23447autotest: run testall without showing any output unless it differs
23448from the expected output
23449
23450bisect: use bisection to insert or find an item in a sorted list
23451
23452colorsys: defines conversions between various color systems (e.g. RGB
23453<-> YUV)
23454
23455nntplib: a client interface to NNTP servers
23456
23457pipes: utility to construct pipeline from templates, e.g. for
23458conversion from one file format to another using several utilities.
23459
23460regsub: contains three functions that are more or less compatible with
23461awk functions of the same name: sub() and gsub() do string
23462substitution, split() splits a string using a regular expression to
23463define how separators are define.
23464
23465test_types: test operations on the built-in types of Python
23466
23467toaiff: convert various audio file formats to AIFF format
23468
23469tzparse: parse the TZ environment parameter (this may be less general
23470than it could be, let me know if you fix it).
23471
23472(Note that the obsolete module "path" no longer exists.)
23473
23474
23475New SGI-specific library modules
23476--------------------------------
23477
23478CL: constants for use with the built-in compression library interface (cl)
23479
23480Queue: a multi-producer, multi-consumer queue class implemented for
23481use with the built-in thread module
23482
23483SOCKET: constants for use with built-in module socket, e.g. to set/get
23484socket options. This is SGI-specific because the constants to be
23485passed are system-dependent. You can generate a version for your own
23486system by running the script demo/scripts/h2py.py with
23487/usr/include/sys/socket.h as input.
23488
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000023489cddb: interface to the database used by the CD player
Guido van Rossuma7925f11994-01-26 10:20:16 +000023490
23491torgb: convert various image file types to rgb format (requires pbmplus)
23492
23493
23494New demos
23495---------
23496
23497There's an experimental interface to define Sun RPC clients and
23498servers in demo/rpc.
23499
23500There's a collection of interfaces to WWW, WAIS and Gopher (both
23501Python classes and program providing a user interface) in demo/www.
23502This includes a program texi2html.py which converts texinfo files to
23503HTML files (the format used hy WWW).
23504
23505The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
23506
23507For SGI systems, there's a whole collection of programs and classes
23508that make use of the Indigo video board in demo/sgi/{sv,video}. This
23509represents a significant amount of work that we're giving away!
23510
23511There are demos "rsa" and "md5test" that exercise the mpz and md5
23512modules, respectively. The rsa demo is a complete implementation of
23513the RSA public-key cryptosystem!
23514
23515A bunch of games and examples submitted by Stoffel Erasmus have been
23516included in demo/stoffel.
23517
23518There are miscellaneous new files in some existing demo
23519subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
23520sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
23521
23522There are also many minor changes to existing files, but I'm too lazy
23523to run a diff and note the differences -- you can do this yourself if
23524you save the old distribution's demos. One highlight: the
23525stdwin/python.py demo is much improved!
23526
23527
23528Changes to the documentation
23529----------------------------
23530
23531The LaTeX source for the library uses different macros to enable it to
23532be converted to texinfo, and from there to INFO or HTML format so it
23533can be browsed as a hypertext. The net result is that you can now
23534read the Python library documentation in Emacs info mode!
23535
23536
23537Changes to the source code that affect C extension writers
23538----------------------------------------------------------
23539
23540The function strdup() no longer exists (it was used only in one places
Georg Brandleeb575f2009-06-24 06:42:05 +000023541and is somewhat of a portability problem since some systems have the
Guido van Rossuma7925f11994-01-26 10:20:16 +000023542same function in their C library.
23543
23544The functions NEW() and RENEW() allocate one spare byte to guard
23545against a NULL return from malloc(0) being taken for an error, but
23546this should not be relied upon.
23547
23548
23549=========================
23550==> Release 0.9.7beta <==
23551=========================
23552
23553
23554Changes to the language proper
23555------------------------------
23556
23557User-defined classes can now implement operations invoked through
23558special syntax, such as x[i] or `x` by defining methods named
23559__getitem__(self, i) or __repr__(self), etc.
23560
23561
23562Changes to the build process
23563----------------------------
23564
23565Instead of extensive manual editing of the Makefile to select
23566compile-time options, you can now run a Configure.py script.
23567The Makefile as distributed builds a minimal interpreter sufficient to
23568run Configure.py. See also misc/BUILD
23569
23570The Makefile now includes more "utility" targets, e.g. install and
23571tags/TAGS
23572
23573Using the provided strtod.c and strtol.c are now separate options, as
23574on the Sun the provided strtod.c dumps core :-(
23575
23576The regex module is now an option chosen by the Makefile, since some
23577(old) C compilers choke on regexpr.c
23578
23579
23580Changes affecting portability
23581-----------------------------
23582
23583You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
23584interface
23585
23586Dynamic loading is now supported for Sun (and other non-COFF systems)
23587throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
23588DL is out, 1.4)
23589
23590The system-dependent code for the use of the select() system call is
23591moved to one file: myselect.h
23592
23593Thanks to Jaap Vermeulen, the code should now port cleanly to the
23594SEQUENT
23595
23596
23597Changes to the interpreter interface
23598------------------------------------
23599
23600The interpretation of $PYTHONPATH in the environment is different: it
23601is inserted in front of the default path instead of overriding it
23602
23603
23604Changes to existing built-in functions and methods
23605--------------------------------------------------
23606
23607List objects now support an optional argument to their sort() method,
23608which is a comparison function similar to qsort(3) in C
23609
23610File objects now have a method fileno(), used by the new select module
23611(see below)
23612
23613
23614New built-in function
23615---------------------
23616
23617coerce(x, y): take two numbers and return a tuple containing them
23618both converted to a common type
23619
23620
23621Changes to built-in modules
23622---------------------------
23623
23624sys: fixed core dumps in settrace() and setprofile()
23625
23626socket: added socket methods setsockopt() and getsockopt(); and
23627fileno(), used by the new select module (see below)
23628
23629stdwin: added fileno() == connectionnumber(), in support of new module
23630select (see below)
23631
23632posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
23633
23634gl: added qgetfd()
23635
23636fl: added several new functions, fixed several obscure bugs, adapted
23637to FORMS 2.1
23638
23639
23640Changes to standard modules
23641---------------------------
23642
23643posixpath: changed implementation of ismount()
23644
23645string: atoi() no longer mistakes leading zero for octal number
23646
23647...
23648
23649
23650New built-in modules
23651--------------------
23652
23653Modules marked "dynamic only" are not configured at compile time but
23654can be loaded dynamically. You need to turn on the DL or DLD option in
23655the Makefile for support dynamic loading of modules (this requires
23656external code).
23657
23658select: interfaces to the BSD select() system call
23659
23660dbm: interfaces to the (new) dbm library (dynamic only)
23661
23662nis: interfaces to some NIS functions (aka yellow pages)
23663
23664thread: limited form of multiple threads (sgi only)
23665
23666audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
23667coding (dynamic only)
23668
23669cd: interface to Indigo SCSI CDROM player audio library (sgi only)
23670
23671jpeg: read files in JPEG format (dynamic only, sgi only; needs
23672external code)
23673
23674imgfile: read SGI image files (dynamic only, sgi only)
23675
23676sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
23677
23678sv: interface to Indigo video library (sgi only)
23679
23680pc: a minimal set of MS-DOS interfaces (MS-DOS only)
23681
23682rotor: encryption, by Lance Ellinghouse (dynamic only)
23683
23684
23685New standard modules
23686--------------------
23687
23688Not all these modules are documented. Read the source:
23689lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
23690additional documentation.
23691
23692imghdr: recognizes image file headers
23693
23694sndhdr: recognizes sound file headers
23695
23696profile: print run-time statistics of Python code
23697
23698readcd, cdplayer: companion modules for built-in module cd (sgi only)
23699
23700emacs: interface to Emacs using py-connect.el (see below).
23701
23702SOCKET: symbolic constant definitions for socket options
23703
23704SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
23705
23706SV: symbolic constat definitions for sv (sgi only)
23707
23708CD: symbolic constat definitions for cd (sgi only)
23709
23710
23711New demos
23712---------
23713
23714scripts/pp.py: execute Python as a filter with a Perl-like command
23715line interface
23716
23717classes/: examples using the new class features
23718
23719threads/: examples using the new thread module
23720
23721sgi/cd/: examples using the new cd module
23722
23723
23724Changes to the documentation
23725----------------------------
23726
23727The last-minute syntax changes of release 0.9.6 are now reflected
23728everywhere in the manuals
23729
23730The reference manual has a new section (3.2) on implementing new kinds
23731of numbers, sequences or mappings with user classes
23732
23733Classes are now treated extensively in the tutorial (chapter 9)
23734
23735Slightly restructured the system-dependent chapters of the library
23736manual
23737
23738The file misc/EXTENDING incorporates documentation for mkvalue() and
23739a new section on error handling
23740
23741The files misc/CLASSES and misc/ERRORS are no longer necessary
23742
23743The doc/Makefile now creates PostScript files automatically
23744
23745
23746Miscellaneous changes
23747---------------------
23748
23749Incorporated Tim Peters' changes to python-mode.el, it's now version
237501.06
23751
23752A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
23753program running in an Emacs buffer execute Emacs lisp code. The
23754necessary Python code is in lib/emacs.py. The Emacs code is
23755misc/py-connect.el (it needs some external Emacs lisp code)
23756
23757
23758Changes to the source code that affect C extension writers
23759----------------------------------------------------------
23760
23761New service function mkvalue() to construct a Python object from C
23762values according to a "format" string a la getargs()
23763
23764Most functions from pythonmain.c moved to new pythonrun.c which is
23765in libpython.a. This should make embedded versions of Python easier
23766
23767ceval.h is split in eval.h (which needs compile.h and only declares
23768eval_code) and ceval.h (which doesn't need compile.hand declares the
23769rest)
23770
23771ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
23772improve the parallellism of multi-threaded programs by letting other
23773Python code run when a blocking system call or something similar is
23774made)
23775
23776In structmember.[ch], new member types BYTE, CHAR and unsigned
23777variants have been added
23778
23779New file xxmodule.c is a template for new extension modules.
23780
Guido van Rossumaa253861994-10-06 17:18:57 +000023781
Guido van Rossuma7925f11994-01-26 10:20:16 +000023782==================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000023783==> Release 0.9.6 (6 Apr 1992) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000023784==================================
23785
23786Misc news in 0.9.6:
23787- Restructured the misc subdirectory
23788- Reference manual completed, library manual much extended (with indexes!)
23789- the GNU Readline library is now distributed standard with Python
23790- the script "../demo/scripts/classfix.py" fixes Python modules using old
23791 class syntax
23792- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
23793- Because of the GNU copyleft business I am not using the GNU regular
23794 expression implementation but a free re-implementation by Tatu Ylonen
23795 that recently appeared in comp.sources.misc (Bravo, Tatu!)
23796
23797New features in 0.9.6:
23798- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
23799- New module 'os' supplants modules 'mac' and 'posix' for most cases;
23800 module 'path' is replaced by 'os.path'
23801- os.path.split() return value differs from that of old path.split()
23802- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
23803 currently being handled
23804- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
23805 exception
23806- New function string.expandtabs() expands tabs in a string
23807- Added times() interface to posix (user & sys time of process & children)
23808- Added uname() interface to posix (returns OS type, hostname, etc.)
23809- New built-in function execfile() is like exec() but from a file
23810- Functions exec() and eval() are less picky about whitespace/newlines
23811- New built-in functions getattr() and setattr() access arbitrary attributes
23812- More generic argument handling in built-in functions (see "./EXTENDING")
23813- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
23814- Division and modulo for long and plain integers with negative operands
23815 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
23816 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
23817 (a/b, a%b) for integers. For floats, % is also changed, but of course
23818 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
23819- A function with explicit variable-length argument list can be declared
23820 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
23821- Code tracing and profiling features have been added, and two source
23822 code debuggers are provided in the library (pdb.py, tty-oriented,
23823 and wdb, window-oriented); you can now step through Python programs!
23824 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
23825- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
23826 a script that fixes old Python modules
23827- Plain integer right shift now uses sign extension
23828- Long integer shift/mask operations now simulate 2's complement
23829 to give more useful results for negative operands
23830- Changed/added range checks for long/plain integer shifts
23831- Options found after "-c command" are now passed to the command in sys.argv
23832 (note subtle incompatiblity with "python -c command -- -options"!)
23833- Module stdwin is better protected against touching objects after they've
23834 been closed; menus can now also be closed explicitly
23835- Stdwin now uses its own exception (stdwin.error)
23836
23837New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
23838- dictionary objects can now be compared properly; e.g., {}=={} is true
23839- new exception SystemExit causes termination if not caught;
23840 it is raised by sys.exit() so that 'finally' clauses can clean up,
23841 and it may even be caught. It does work interactively!
23842- new module "regex" implements GNU Emacs style regular expressions;
23843 module "regexp" is rewritten in Python for backward compatibility
23844- formal parameter lists may contain trailing commas
23845
23846Bugs fixed in 0.9.6:
23847- assigning to or deleting a list item with a negative index dumped core
23848- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
23849
23850Bugs fixed in 0.9.5:
23851- masking operations involving negative long integers gave wrong results
23852
23853
23854===================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000023855==> Release 0.9.4 (24 Dec 1991) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000023856===================================
23857
23858- new function argument handling (see below)
23859- built-in apply(func, args) means func(args[0], args[1], ...)
23860- new, more refined exceptions
23861- new exception string values (NameError = 'NameError' etc.)
23862- better checking for math exceptions
23863- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
23864- fixed list assignment bug: "a[1:1] = a" now works correctly
23865- new class syntax, without extraneous parentheses
23866- new 'global' statement to assign global variables from within a function
23867
23868
23869New class syntax
23870----------------
23871
23872You can now declare a base class as follows:
23873
23874 class B: # Was: class B():
23875 def some_method(self): ...
23876 ...
23877
23878and a derived class thusly:
23879
23880 class D(B): # Was: class D() = B():
23881 def another_method(self, arg): ...
23882
23883Multiple inheritance looks like this:
23884
23885 class M(B, D): # Was: class M() = B(), D():
23886 def this_or_that_method(self, arg): ...
23887
23888The old syntax is still accepted by Python 0.9.4, but will disappear
23889in Python 1.0 (to be posted to comp.sources).
23890
23891
23892New 'global' statement
23893----------------------
23894
23895Every now and then you have a global variable in a module that you
23896want to change from within a function in that module -- say, a count
23897of calls to a function, or an option flag, etc. Until now this was
23898not directly possible. While several kludges are known that
23899circumvent the problem, and often the need for a global variable can
23900be avoided by rewriting the module as a class, this does not always
23901lead to clearer code.
23902
23903The 'global' statement solves this dilemma. Its occurrence in a
23904function body means that, for the duration of that function, the
23905names listed there refer to global variables. For instance:
23906
23907 total = 0.0
23908 count = 0
23909
23910 def add_to_total(amount):
23911 global total, count
23912 total = total + amount
23913 count = count + 1
23914
23915'global' must be repeated in each function where it is needed. The
23916names listed in a 'global' statement must not be used in the function
23917before the statement is reached.
23918
23919Remember that you don't need to use 'global' if you only want to *use*
23920a global variable in a function; nor do you need ot for assignments to
23921parts of global variables (e.g., list or dictionary items or
23922attributes of class instances). This has not changed; in fact
23923assignment to part of a global variable was the standard workaround.
23924
23925
23926New exceptions
23927--------------
23928
23929Several new exceptions have been defined, to distinguish more clearly
23930between different types of errors.
23931
23932name meaning was
23933
23934AttributeError reference to non-existing attribute NameError
23935IOError unexpected I/O error RuntimeError
23936ImportError import of non-existing module or name NameError
23937IndexError invalid string, tuple or list index RuntimeError
23938KeyError key not in dictionary RuntimeError
23939OverflowError numeric overflow RuntimeError
23940SyntaxError invalid syntax RuntimeError
23941ValueError invalid argument value RuntimeError
23942ZeroDivisionError division by zero RuntimeError
23943
23944The string value of each exception is now its name -- this makes it
23945easier to experimentally find out which operations raise which
23946exceptions; e.g.:
23947
23948 >>> KeyboardInterrupt
23949 'KeyboardInterrupt'
23950 >>>
23951
23952
23953New argument passing semantics
23954------------------------------
23955
23956Off-line discussions with Steve Majewski and Daniel LaLiberte have
23957convinced me that Python's parameter mechanism could be changed in a
23958way that made both of them happy (I hope), kept me happy, fixed a
23959number of outstanding problems, and, given some backward compatibility
23960provisions, would only break a very small amount of existing code --
23961probably all mine anyway. In fact I suspect that most Python users
23962will hardly notice the difference. And yet it has cost me at least
23963one sleepless night to decide to make the change...
23964
23965Philosophically, the change is quite radical (to me, anyway): a
23966function is no longer called with either zero or one argument, which
23967is a tuple if there appear to be more arguments. Every function now
23968has an argument list containing 0, 1 or more arguments. This list is
23969always implemented as a tuple, and it is a (run-time) error if a
23970function is called with a different number of arguments than expected.
23971
23972What's the difference? you may ask. The answer is, very little unless
23973you want to write variadic functions -- functions that may be called
23974with a variable number of arguments. Formerly, you could write a
23975function that accepted one or more arguments with little trouble, but
23976writing a function that could be called with either 0 or 1 argument
23977(or more) was next to impossible. This is now a piece of cake: you
23978can simply declare an argument that receives the entire argument
23979tuple, and check its length -- it will be of size 0 if there are no
23980arguments.
23981
23982Another anomaly of the old system was the way multi-argument methods
23983(in classes) had to be declared, e.g.:
23984
23985 class Point():
23986 def init(self, (x, y, color)): ...
23987 def setcolor(self, color): ...
23988 dev moveto(self, (x, y)): ...
23989 def draw(self): ...
23990
23991Using the new scheme there is no need to enclose the method arguments
23992in an extra set of parentheses, so the above class could become:
23993
23994 class Point:
23995 def init(self, x, y, color): ...
23996 def setcolor(self, color): ...
23997 dev moveto(self, x, y): ...
23998 def draw(self): ...
23999
24000That is, the equivalence rule between methods and functions has
24001changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
24002while formerly it was equivalent to Point.moveto(p,(x,y)).
24003
24004A special backward compatibility rule makes that the old version also
24005still works: whenever a function with exactly two arguments (at the top
24006level) is called with more than two arguments, the second and further
24007arguments are packed into a tuple and passed as the second argument.
24008This rule is invoked independently of whether the function is actually a
24009method, so there is a slight chance that some erroneous calls of
24010functions expecting two arguments with more than that number of
24011arguments go undetected at first -- when the function tries to use the
24012second argument it may find it is a tuple instead of what was expected.
24013Note that this rule will be removed from future versions of the
24014language; it is a backward compatibility provision *only*.
24015
24016Two other rules and a new built-in function handle conversion between
24017tuples and argument lists:
24018
24019Rule (a): when a function with more than one argument is called with a
24020single argument that is a tuple of the right size, the tuple's items
24021are used as arguments.
24022
24023Rule (b): when a function with exactly one argument receives no
24024arguments or more than one, that one argument will receive a tuple
24025containing the arguments (the tuple will be empty if there were no
24026arguments).
24027
24028
24029A new built-in function, apply(), was added to support functions that
24030need to call other functions with a constructed argument list. The call
24031
24032 apply(function, tuple)
24033
24034is equivalent to
24035
24036 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
24037
24038
24039While no new argument syntax was added in this phase, it would now be
24040quite sensible to add explicit syntax to Python for default argument
24041values (as in C++ or Modula-3), or a "rest" argument to receive the
24042remaining arguments of a variable-length argument list.
24043
24044
24045========================================================
24046==> Release 0.9.3 (never made available outside CWI) <==
24047========================================================
24048
24049- string sys.version shows current version (also printed on interactive entry)
24050- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
24051- 'global' statement to declare module-global variables assigned in functions.
24052- new class declaration syntax: class C(Base1, Base2, ...): suite
24053 (the old syntax is still accepted -- be sure to convert your classes now!)
24054- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
24055- C comparison operators: == != (the old = and <> remain valid).
24056- floating point numbers may now start with a period (e.g., .14).
24057- definition of integer division tightened (always truncates towards zero).
24058- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
24059- new list method l.count(x) returns the number of occurrences of x in l.
24060- new SGI module: al (Indigo and 4D/35 audio library).
24061- the FORMS interface (modules fl and FL) now uses FORMS 2.0
24062- module gl: added lrect{read,write}, rectzoom and pixmode;
24063 added (non-GL) functions (un)packrect.
24064- new socket method: s.allowbroadcast(flag).
24065- many objects support __dict__, __methods__ or __members__.
24066- dir() lists anything that has __dict__.
24067- class attributes are no longer read-only.
24068- classes support __bases__, instances support __class__ (and __dict__).
24069- divmod() now also works for floats.
24070- fixed obscure bug in eval('1 ').
24071
24072
24073===================================
24074==> Release 0.9.2 (Autumn 1991) <==
24075===================================
24076
24077Highlights
24078----------
24079
24080- tutorial now (almost) complete; library reference reorganized
24081- new syntax: continue statement; semicolons; dictionary constructors;
24082 restrictions on blank lines in source files removed
24083- dramatically improved module load time through precompiled modules
24084- arbitrary precision integers: compute 2 to the power 1000 and more...
24085- arithmetic operators now accept mixed type operands, e.g., 3.14/4
24086- more operations on list: remove, index, reverse; repetition
24087- improved/new file operations: readlines, seek, tell, flush, ...
24088- process management added to the posix module: fork/exec/wait/kill etc.
24089- BSD socket operations (with example servers and clients!)
24090- many new STDWIN features (color, fonts, polygons, ...)
24091- new SGI modules: font manager and FORMS library interface
24092
24093
24094Extended list of changes in 0.9.2
24095---------------------------------
24096
24097Here is a summary of the most important user-visible changes in 0.9.2,
24098in somewhat arbitrary order. Changes in later versions are listed in
24099the "highlights" section above.
24100
24101
241021. Changes to the interpreter proper
24103
24104- Simple statements can now be separated by semicolons.
24105 If you write "if t: s1; s2", both s1 and s2 are executed
24106 conditionally.
24107- The 'continue' statement was added, with semantics as in C.
24108- Dictionary displays are now allowed on input: {key: value, ...}.
24109- Blank lines and lines bearing only a comment no longer need to
24110 be indented properly. (A completely empty line still ends a multi-
24111 line statement interactively.)
24112- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
24113- Option "-c command" to execute statements from the command line
24114- Compiled versions of modules are cached in ".pyc" files, giving a
24115 dramatic improvement of start-up time
24116- Other, smaller speed improvements, e.g., extracting characters from
24117 strings, looking up single-character keys, and looking up global
24118 variables
24119- Interrupting a print operation raises KeyboardInterrupt instead of
24120 only cancelling the print operation
24121- Fixed various portability problems (it now passes gcc with only
24122 warnings -- more Standard C compatibility will be provided in later
24123 versions)
24124- Source is prepared for porting to MS-DOS
24125- Numeric constants are now checked for overflow (this requires
24126 standard-conforming strtol() and strtod() functions; a correct
24127 strtol() implementation is provided, but the strtod() provided
24128 relies on atof() for everything, including error checking
24129
24130
241312. Changes to the built-in types, functions and modules
24132
24133- New module socket: interface to BSD socket primitives
24134- New modules pwd and grp: access the UNIX password and group databases
24135- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
24136- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
24137- New numeric type: long integer, for unlimited precision
24138 - integer constants suffixed with 'L' or 'l' are long integers
24139 - new built-in function long(x) converts int or float to long
24140 - int() and float() now also convert from long integers
24141- New built-in function:
24142 - pow(x, y) returns x to the power y
24143- New operation and methods for lists:
24144 - l*n returns a new list consisting of n concatenated copies of l
24145 - l.remove(x) removes the first occurrence of the value x from l
24146 - l.index(x) returns the index of the first occurrence of x in l
24147 - l.reverse() reverses l in place
24148- New operation for tuples:
24149 - t*n returns a tuple consisting of n concatenated copies of t
24150- Improved file handling:
24151 - f.readline() no longer restricts the line length, is faster,
24152 and isn't confused by null bytes; same for raw_input()
24153 - f.read() without arguments reads the entire (rest of the) file
24154 - mixing of print and sys.stdout.write() has different effect
24155- New methods for files:
24156 - f.readlines() returns a list containing the lines of the file,
24157 as read with f.readline()
24158 - f.flush(), f.tell(), f.seek() call their stdio counterparts
24159 - f.isatty() tests for "tty-ness"
24160- New posix functions:
24161 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
24162 - popen() returns a file object connected to a pipe
24163 - utime() replaces utimes() (the latter is not a POSIX name)
24164- New stdwin features, including:
24165 - font handling
24166 - color drawing
24167 - scroll bars made optional
24168 - polygons
24169 - filled and xor shapes
24170 - text editing objects now have a 'settext' method
24171
24172
241733. Changes to the standard library
24174
24175- Name change: the functions path.cat and macpath.cat are now called
24176 path.join and macpath.join
24177- Added new modules: formatter, mutex, persist, sched, mainloop
24178- Added some modules and functionality to the "widget set" (which is
24179 still under development, so please bear with me):
24180 DirList, FormSplit, TextEdit, WindowSched
24181- Fixed module testall to work non-interactively
24182- Module string:
24183 - added functions join() and joinfields()
24184 - fixed center() to work correct and make it "transitive"
24185- Obsolete modules were removed: util, minmax
24186- Some modules were moved to the demo directory
24187
24188
241894. Changes to the demonstration programs
24190
24191- Added new useful scipts: byteyears, eptags, fact, from, lfact,
24192 objgraph, pdeps, pi, primes, ptags, which
24193- Added a bunch of socket demos
24194- Doubled the speed of ptags
24195- Added new stdwin demos: microedit, miniedit
24196- Added a windowing interface to the Python interpreter: python (most
24197 useful on the Mac)
24198- Added a browser for Emacs info files: demo/stdwin/ibrowse
24199 (yes, I plan to put all STDWIN and Python documentation in texinfo
24200 form in the future)
24201
24202
242035. Other changes to the distribution
24204
24205- An Emacs Lisp file "python.el" is provided to facilitate editing
24206 Python programs in GNU Emacs (slightly improved since posted to
24207 gnu.emacs.sources)
24208- Some info on writing an extension in C is provided
24209- Some info on building Python on non-UNIX platforms is provided
24210
24211
24212=====================================
24213==> Release 0.9.1 (February 1991) <==
24214=====================================
24215
24216- Micro changes only
24217- Added file "patchlevel.h"
24218
24219
24220=====================================
24221==> Release 0.9.0 (February 1991) <==
24222=====================================
24223
24224Original posting to alt.sources.