blob: 954a87f9a808c253ee5da0d4d942b69bb93261f2 [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.
6
7
8======================================================================
9
10
Georg Brandl86dc7322012-10-01 18:58:45 +020011What's New in Python 3.3.0?
12===========================
13
14*Release date: 29-Sep-2012*
15
16Core and Builtins
17-----------------
18
19- Issue #16046: Fix loading sourceless legacy .pyo files.
20
21- Issue #16060: Fix refcounting bug when __trunc__ returns an object
22 whose __int__ gives a non-integer. Patch by Serhiy Storchaka.
23
24Extension Modules
25-----------------
26
27- Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
28 method doesn't require an argument again.
29
30
31What's New in Python 3.3.0 Release Candidate 3?
32===============================================
33
34*Release date: 23-Sep-2012*
35
36Core and Builtins
37-----------------
38
39- Issue #15900: Fix reference leak in PyUnicode_TranslateCharmap().
40
41- Issue #15926: Fix crash after multiple reinitializations of the interpreter.
42
43- Issue #15895: Fix FILE pointer leak in one error branch of
44 PyRun_SimpleFileExFlags() when filename points to a pyc/pyo file, closeit
45 is false an and set_main_loader() fails.
46
47- Fixes for a few crash and memory leak regressions found by Coverity.
48
49Library
50-------
51
52- Issue #15882: Change _decimal to accept any coefficient tuple when
53 constructing infinities. This is done for backwards compatibility
54 with decimal.py: Infinity coefficients are undefined in _decimal
55 (in accordance with the specification).
56
57- Issue #15925: Fix a regression in email.util where the parsedate() and
58 parsedate_tz() functions did not return None anymore when the argument could
59 not be parsed.
60
61Extension Modules
62-----------------
63
64- Issue #15973: Fix a segmentation fault when comparing datetime timezone
65 objects.
66
67- Issue #15977: Fix memory leak in Modules/_ssl.c when the function
68 _set_npn_protocols() is called multiple times, thanks to Daniel Sommermann.
69
70- Issue #15969: faulthandler module: rename dump_tracebacks_later() to
71 dump_traceback_later() and cancel_dump_tracebacks_later() to
72 cancel_dump_traceback_later().
73
74- _decimal module: use only C 89 style comments.
75
76
77What's New in Python 3.3.0 Release Candidate 2?
78===============================================
79
80*Release date: 09-Sep-2012*
81
82Core and Builtins
83-----------------
84
85- Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
86 sporadic crashes in multi-thread programs when several long deallocator
87 chains ran concurrently and involved subclasses of built-in container
88 types.
89
90- Issue #15784: Modify OSError.__str__() to better distinguish between
91 errno error numbers and Windows error numbers.
92
93- Issue #15781: Fix two small race conditions in import's module locking.
94
95Library
96-------
97
98- Issue #15847: Fix a regression in argparse, which did not accept tuples
99 as argument lists anymore.
100
101- Issue #15828: Restore support for C extensions in imp.load_module().
102
103- Issue #15340: Fix importing the random module when /dev/urandom cannot
104 be opened. This was a regression caused by the hash randomization patch.
105
106- Issue #10650: Deprecate the watchexp parameter of the Decimal.quantize()
107 method.
108
109- Issue #15785: Modify window.get_wch() API of the curses module: return
110 a character for most keys, and an integer for special keys, instead of
111 always returning an integer. So it is now possible to distinguish special
112 keys like keypad keys.
113
114- Issue #14223: Fix window.addch() of the curses module for special characters
115 like curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now
116 calling the C function waddch()/mvwaddch() (as it was done in Python 3.2),
117 instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still
118 calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked
119 to libncursesw.
120
121Build
122-----
123
124- Issue #15822: Really ensure 2to3 grammar pickles are properly installed
125 (replaces fixes for Issue #15645).
126
127Documentation
128-------------
129
130- Issue #15814: The memoryview enhancements in 3.3.0 accidentally permitted
131 the hashing of multi-dimensional memorviews and memoryviews with multi-byte
132 item formats. The intended restrictions have now been documented - they
133 will be correctly enforced in 3.3.1
134
135
136What's New in Python 3.3.0 Release Candidate 1?
137===============================================
138
139*Release date: 25-Aug-2012*
140
141Core and Builtins
142-----------------
143
144- Issue #15573: memoryview comparisons are now performed by value with full
145 support for any valid struct module format definition.
146
147- Issue #15316: When an item in the fromlist for __import__ doesn't exist,
148 don't raise an error, but if an exception is raised as part of an import do
149 let that propagate.
150
151- Issue #15778: ensure that str(ImportError(msg)) returns a str
152 even when msg isn't a str.
153
154- Issue #2051: Source file permission bits are once again correctly
155 copied to the cached bytecode file. (The migration to importlib
156 reintroduced this problem because these was no regression test. A test
157 has been added as part of this patch)
158
159- Issue #15761: Fix crash when PYTHONEXECUTABLE is set on Mac OS X.
160
161- Issue #15726: Fix incorrect bounds checking in PyState_FindModule.
162 Patch by Robin Schreiber.
163
164- Issue #15604: Update uses of PyObject_IsTrue() to check for and handle
165 errors correctly. Patch by Serhiy Storchaka.
166
167- Issue #14846: importlib.FileFinder now handles the case where the
168 directory being searched is removed after a previous import attempt
169
170Library
171-------
172
173- Issue #13370: Ensure that ctypes works on Mac OS X when Python is
174 compiled using the clang compiler
175
176- Issue #13072: The array module's 'u' format code is now deprecated and
177 will be removed in Python 4.0.
178
179- Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
180
181- Issue #15249: BytesGenerator now correctly mangles From lines (when
182 requested) even if the body contains undecodable bytes.
183
184- Issue #15777: Fix a refleak in _posixsubprocess.
185
186- Issue ##665194: Update email.utils.localtime to use datetime.astimezone and
187 correctly handle historic changes in UTC offsets.
188
189- Issue #15199: Fix JavaScript's default MIME type to application/javascript.
190 Patch by Bohuslav Kabrda.
191
192- Issue #12643: code.InteractiveConsole now respects sys.excepthook when
193 displaying exceptions (Patch by Aaron Iles)
194
195- Issue #13579: string.Formatter now understands the 'a' conversion specifier.
196
197- Issue #15793: Stack corruption in ssl.RAND_egd().
198 Patch by Serhiy Storchaka.
199
200- Issue #15595: Fix subprocess.Popen(universal_newlines=True)
201 for certain locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
202
203- Issue #15477: In cmath and math modules, add workaround for platforms whose
204 system-supplied log1p function doesn't respect signs of zeros.
205
206- Issue #15715: importlib.__import__() will silence an ImportError when the use
207 of fromlist leads to a failed import.
208
209- Issue #14669: Fix pickling of connections and sockets on MacOSX
210 by sending/receiving an acknowledgment after file descriptor transfer.
211 TestPicklingConnection has been reenabled for MacOSX.
212
213- Issue #11062: Fix adding a message from file to Babyl mailbox.
214
215- Issue #15646: Prevent equivalent of a fork bomb when using
216 multiprocessing on Windows without the "if __name__ == '__main__'"
217 idiom.
218
219- Issue #15678: Fix IDLE menus when started from OS X command line
220 (3.3.0b2 regression).
221
222C API
223-----
224
225Extension Modules
226-----------------
227
228Tools/Demos
229-----------
230
231Documentation
232-------------
233
234- Issue #14674: Add a discussion of the json module's standard compliance.
235 Patch by Chris Rebert.
236
237- Create a 'Concurrent Execution' section in the docs, and split up the
238 'Optional Operating System Services' section to use a more user-centric
239 classification scheme (splitting them across the new CE section, IPC and
240 text processing). Operating system limitatons can be reflected with
241 the Sphinx ``:platform:`` tag, it doesn't make sense as part of the Table of
242 Contents.
243
244- Issue #4966: Bring the sequence docs up to date for the Py3k transition
245 and the many language enhancements since they were original written
246
247- The "path importer" misnomer has been replaced with Eric Snow's
248 more-awkward-but-at-least-not-wrong suggestion of "path based finder" in
249 the import system reference docs
250
251- Issue #15640: Document importlib.abc.Finder as deprecated.
252
253- Issue #15630: Add an example for "continue" stmt in the tutorial. Patch by
254 Daniel Ellis.
255
256Tests
257-----
258
259- Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the
260 UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected
261 tests in test_posix.py to account for this.
262
263- Issue #15285: Refactor the approach for testing connect timeouts using
264 two external hosts that have been configured specifically for this type
265 of test.
266
267- Issue #15743: Remove the deprecated method usage in urllib tests. Patch by
268 Jeff Knupp.
269
270- Issue #15615: Add some tests for the json module's handling of invalid
271 input data. Patch by Kushal Das.
272
273Build
274-----
275
276- Output lib files for PGO build into PGO directory.
277
278- Pick up 32-bit launcher from PGO directory on 64-bit PGO build.
279
280- Drop PC\python_nt.h as it's not used. Add input dependency on custom
281 build step.
282
283- Issue #15511: Drop explicit dependency on pythonxy.lib from _decimal
284 amd64 configuration.
285
286- Add missing PGI/PGO configurations for pywlauncher.
287
288- Issue #15645: Ensure 2to3 grammar pickles are properly installed.
289
290
291What's New in Python 3.3.0 Beta 2?
292==================================
293
294*Release date: 12-Aug-2012*
295
296Core and Builtins
297-----------------
298
299- Issue #15568: Fix the return value of "yield from" when StopIteration is
300 raised by a custom iterator.
301
302- Issue #13119: sys.stdout and sys.stderr are now using "\r\n" newline on
303 Windows, as Python 2.
304
305- Issue #15534: Fix the fast-search function for non-ASCII Unicode strings.
306
307- Issue #15508: Fix the docstring for __import__ to have the proper default
308 value of 0 for 'level' and to not mention negative levels since they are not
309 supported.
310
311- Issue #15425: Eliminated traceback noise from more situations involving
312 importlib.
313
314- Issue #14578: Support modules registered in the Windows registry again.
315
316- Issue #15466: Stop using TYPE_INT64 in marshal, to make importlib.h (and other
317 byte code files) equal between 32-bit and 64-bit systems.
318
319- Issue #1692335: Move initial exception args assignment to
320 "BaseException.__new__" to help pickling of naive subclasses.
321
322- Issue #12834: Fix PyBuffer_ToContiguous() for non-contiguous arrays.
323
324- Issue #15456: Fix code __sizeof__ after #12399 change. Patch by Serhiy
325 Storchaka.
326
327- Issue #15404: Refleak in PyMethodObject repr.
328
329- Issue #15394: An issue in PyModule_Create that caused references to be leaked
330 on some error paths has been fixed. Patch by Julia Lawall.
331
332- Issue #15368: An issue that caused bytecode generation to be non-deterministic
333 has been fixed.
334
335- Issue #15202: Consistently use the name "follow_symlinks" for new parameters
336 in os and shutil functions.
337
338- Issue #15314: __main__.__loader__ is now set correctly during interpreter
339 startup.
340
341- Issue #15111: When a module imported using 'from import' has an ImportError
342 inside itself, don't mask that fact behind a generic ImportError for the
343 module itself.
344
345- Issue #15293: Add GC support to the AST base node type.
346
347- Issue #15291: Fix a memory leak where AST nodes where not properly
348 deallocated.
349
350- Issue #15110: Fix the tracebacks generated by "import xxx" to not show the
351 importlib stack frames.
352
353- Issue #15020: The program name used to search for Python's path is now
354 "python3" under Unix, not "python".
355
356- Issue #15033: Fix the exit status bug when modules invoked using -m swith,
357 return the proper failure return value (1). Patch contributed by Jeff Knupp.
358
359- Issue #15229: An OSError subclass whose __init__ doesn't call back
360 OSError.__init__ could produce incomplete instances, leading to crashes when
361 calling str() on them.
362
363- Issue 15307: Virtual environments now use symlinks with framework builds on
364 Mac OS X, like other POSIX builds.
365
366Library
367-------
368
369- Issue #15424: Add a __sizeof__ implementation for array objects. Patch by
370 Ludwig Hähne.
371
372- Issue #15576: Allow extension modules to act as a package's __init__ module.
373
374- Issue #15502: Have importlib.invalidate_caches() work on sys.meta_path instead
375 of sys.path_importer_cache.
376
377- Issue #15163: Pydoc shouldn't list __loader__ as module data.
378
379- Issue #15471: Do not use mutable objects as defaults for
380 importlib.__import__().
381
382- Issue #15559: To avoid a problematic failure mode when passed to the bytes
383 constructor, objects in the ipaddress module no longer implement __index__
384 (they still implement __int__ as appropriate)
385
386- Issue #15546: Fix handling of pathological input data in the peek() and
387 read1() methods of the BZ2File, GzipFile and LZMAFile classes.
388
389- Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog
390 ended with '\'. Patch by Roger Serwy.
391
392- Issue #12655: Instead of requiring a custom type, os.sched_getaffinity and
393 os.sched_setaffinity now use regular sets of integers to represent the CPUs a
394 process is restricted to.
395
396- Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() emulation
397 code. Patch by Philipp Hagemeister.
398
399- Issue #15519: Properly expose WindowsRegistryFinder in importlib (and use the
400 correct term for it). Original patch by Eric Snow.
401
402- Issue #15502: Bring the importlib ABCs into line with the current state of the
403 import protocols given PEP 420. Original patch by Eric Snow.
404
405- Issue #15499: Launching a webbrowser in Unix used to sleep for a few seconds.
406 Original patch by Anton Barkovsky.
407
408- Issue #15463: The faulthandler module truncates strings to 500 characters,
409 instead of 100, to be able to display long file paths.
410
411- Issue #6056: Make multiprocessing use setblocking(True) on the sockets it
412 uses. Original patch by J Derek Wilson.
413
414- Issue #15364: Fix sysconfig.get_config_var('srcdir') to be an absolute path.
415
416- Issue #15041: Update "see also" list in tkinter documentation.
417
418- Issue #15413: os.times() had disappeared under Windows.
419
420- Issue #15402: An issue in the struct module that caused sys.getsizeof to
421 return incorrect results for struct.Struct instances has been fixed. Initial
422 patch by Serhiy Storchaka.
423
424- Issue #15232: When mangle_from is True, email.Generator now correctly mangles
425 lines that start with 'From ' that occur in a MIME preamble or epilogue.
426
427- Issue #15094: Incorrectly placed #endif in _tkinter.c. Patch by Serhiy
428 Storchaka.
429
430- Issue #13922: argparse no longer incorrectly strips '--'s that appear after
431 the first one.
432
433- Issue #12353: argparse now correctly handles null argument values.
434
435- Issue #10017, issue #14998: Fix TypeError using pprint on dictionaries with
436 user-defined types as keys or other unorderable keys.
437
438- Issue #15397: inspect.getmodulename() is now based directly on importlib via a
439 new importlib.machinery.all_suffixes() API.
440
441- Issue #14635: telnetlib will use poll() rather than select() when possible to
442 avoid failing due to the select() file descriptor limit.
443
444- Issue #15180: Clarify posixpath.join() error message when mixing str & bytes.
445
446- Issue #15343: pkgutil now includes an iter_importer_modules implementation for
447 importlib.machinery.FileFinder (similar to the way it already handled
448 zipimport.zipimporter).
449
450- Issue #15314: runpy now sets __main__.__loader__ correctly.
451
452- Issue #15357: The import emulation in pkgutil is now deprecated. pkgutil uses
453 importlib internally rather than the emulation.
454
455- Issue #15233: Python now guarantees that callables registered with the atexit
456 module will be called in a deterministic order.
457
458- Issue #15238: shutil.copystat now copies Linux "extended attributes".
459
460- Issue #15230: runpy.run_path now correctly sets __package__ as described in
461 the documentation.
462
463- Issue #15315: Support VS 2010 in distutils cygwincompiler.
464
465- Issue #15294: Fix a regression in pkgutil.extend_path()'s handling of nested
466 namespace packages.
467
468- Issue #15056: imp.cache_from_source() and source_from_cache() raise
469 NotImplementedError when sys.implementation.cache_tag is set to None.
470
471- Issue #15256: Grammatical mistake in exception raised by imp.find_module().
472
473- Issue #5931: wsgiref environ variable SERVER_SOFTWARE will specify an
474 implementation specific term like CPython, Jython instead of generic "Python".
475
476- Issue #13248: Remove obsolete argument "max_buffer_size" of BufferedWriter and
477 BufferedRWPair, from the io module.
478
479- Issue #13248: Remove obsolete argument "version" of argparse.ArgumentParser.
480
481- Issue #14814: Implement more consistent ordering and sorting behaviour for
482 ipaddress objects.
483
484- Issue #14814: ipaddress network objects correctly return NotImplemented when
485 compared to arbitrary objects instead of raising TypeError.
486
487- Issue #14990: Correctly fail with SyntaxError on invalid encoding declaration.
488
489- Issue #14814: ipaddress now provides more informative error messages when
490 constructing instances directly (changes permitted during beta due to
491 provisional API status).
492
493- Issue #15247: FileIO now raises an error when given a file descriptor pointing
494 to a directory.
495
496- Issue #15261: Stop os.stat(fd) crashing on Windows when fd not open.
497
498- Issue #15166: Implement imp.get_tag() using sys.implementation.cache_tag.
499
500- Issue #15210: Catch KeyError when importlib.__init__ can't find
501 _frozen_importlib in sys.modules, not ImportError.
502
503- Issue #15030: importlib.abc.PyPycLoader now supports the new source size
504 header field in .pyc files.
505
506- Issue #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on
507 flush().
508
509- Issue #10571: Fix the "--sign" option of distutils' upload command. Patch by
510 Jakub Wilk.
511
512- Issue #9559: If messages were only added, a new file is no longer created and
513 renamed over the old file when flush() is called on an mbox, MMDF or Babyl
514 mailbox.
515
516- Issue 10924: Fixed crypt.mksalt() to use a RNG that is suitable for
517 cryptographic purpose.
518
519- Issue #15184: Ensure consistent results of OS X configuration tailoring for
520 universal builds by factoring out common OS X-specific customizations from
521 sysconfig, distutils.sysconfig, distutils.util, and distutils.unixccompiler
522 into a new module _osx_support.
523
524C API
525-----
526
527- Issue #15610: PyImport_ImportModuleEx() now uses a 'level' of 0 instead of -1.
528
529- Issues #15169, #14599: Strip out the C implementation of
530 imp.source_from_cache() used by PyImport_ExecCodeModuleWithPathnames() and
531 used the Python code instead. Leads to PyImport_ExecCodeModuleObject() to not
532 try to infer the source path from the bytecode path as
533 PyImport_ExecCodeModuleWithPathnames() does.
534
535Extension Modules
536-----------------
537
538- Issue #15676: Now "mmap" check for empty files before doing the
539 offset check. Patch by Steven Willis.
540
541- Issue #6493: An issue in ctypes on Windows that caused structure bitfields
542 of type ctypes.c_uint32 and width 32 to incorrectly be set has been fixed.
543
544- Issue #15194: Update libffi to the 3.0.11 release.
545
546Tools/Demos
547-----------
548
549- Issue #15458: python-config gets a new option --configdir to print the $LIBPL
550 value.
551
552- Move importlib.test.benchmark to Tools/importbench.
553
554- Issue #12605: The gdb hooks for debugging CPython (within Tools/gdb) have been
555 enhanced to show information on more C frames relevant to CPython within the
556 "py-bt" and "py-bt-full" commands:
557
558 * C frames that are waiting on the GIL
559 * C frames that are garbage-collecting
560 * C frames that are due to the invocation of a PyCFunction
561
562Documentation
563-------------
564
565- Issue #15444: Use proper spelling for non-ASCII contributor names. Patch
566 by Serhiy Storchaka.
567
568- Issue #15295: Reorganize and rewrite the documentation on the import system.
569
570- Issue #15230: Clearly document some of the limitations of the runpy module and
571 nudge readers towards importlib when appropriate.
572
573- Issue #15053: Copy Python 3.3 import lock change notice to all relevant
574 functions in imp instead of just at the top of the relevant section.
575
576- Issue #15288: Link to the term "loader" in notes in pkgutil about how things
577 won't work as expected in Python 3.3 and mark the requisite functions as
578 "changed" since they will no longer work with modules directly imported by
579 import itself.
580
581- Issue #13557: Clarify effect of giving two different namespaces to exec or
582 execfile().
583
584- Issue #15250: Document that filecmp.dircmp compares files shallowly. Patch
585 contributed by Chris Jerdonek.
586
587Tests
588-----
589
590- Issue #15467: Move helpers for __sizeof__ tests into test_support. Patch by
591 Serhiy Storchaka.
592
593- Issue #15320: Make iterating the list of tests thread-safe when running tests
594 in multiprocess mode. Patch by Chris Jerdonek.
595
596- Issue #15168: Move importlib.test to test.test_importlib.
597
598- Issue #15091: Reactivate a test on UNIX which was failing thanks to a
599 forgotten importlib.invalidate_caches() call.
600
601- Issue #15230: Adopted a more systematic approach in the runpy tests.
602
603- Issue #15300: Ensure the temporary test working directories are in the same
604 parent folder when running tests in multiprocess mode from a Python build.
605 Patch by Chris Jerdonek.
606
607- Issue #15284: Skip {send,recv}msg tests in test_socket when IPv6 is not
608 enabled. Patch by Brian Brazil.
609
610- Issue #15277: Fix a resource leak in support.py when IPv6 is disabled. Patch
611 by Brian Brazil.
612
613Build
614-----
615
616- Issue #11715: Fix multiarch detection without having Debian development tools
617 (dpkg-dev) installed.
618
619- Issue #15037: Build OS X installers with local copy of ncurses 5.9 libraries
620 to avoid curses.unget_wch bug present in older versions of ncurses such as
621 those shipped with OS X.
622
623- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK. Also, for
624 OS X installers, ensure consistent sqlite3 behavior and feature availability
625 by building a local copy of libsqlite3 rather than depending on the wide range
626 of versions supplied with various OS X releases.
627
628- Issue #8847: Disable COMDAT folding in Windows PGO builds.
629
630- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
631
632- Issue #15431: Add _freeze_importlib project to regenerate importlib.h on
633 Windows. Patch by Kristján Valur Jónsson.
634
635- Issue #14197: For OS X framework builds, ensure links to the shared library
636 are created with the proper ABI suffix.
637
638- Issue #14330: For cross builds, don't use host python, use host search paths
639 for host compiler.
640
641- Issue #15235: Allow Berkley DB versions up to 5.3 to build the dbm module.
642
643- Issue #15268: Search curses.h in /usr/include/ncursesw.
644
645
646What's New in Python 3.3.0 Beta 1?
647==================================
648
649*Release date: 27-Jun-2012*
650
651Core and Builtins
652-----------------
653
654- Fix a (most likely) very rare memory leak when calling main() and not being
655 able to decode a command-line argument.
656
657- Issue #14815: Use Py_ssize_t instead of long for the object hash, to
658 preserve all 64 bits of hash on Win64.
659
660- Issue #12268: File readline, readlines and read() or readall() methods
661 no longer lose data when an underlying read system call is interrupted.
662 IOError is no longer raised due to a read system call returning EINTR
663 from within these methods.
664
665- Issue #11626: Add _SizeT functions to stable ABI.
666
667- Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
668
669- Issue #15142: Fix reference leak when deallocating instances of types
670 created using PyType_FromSpec().
671
672- Issue #15042: Add PyState_AddModule and PyState_RemoveModule. Add version
673 guard for Py_LIMITED_API additions. Patch by Robin Schreiber.
674
675- Issue #10053: Don't close FDs when FileIO.__init__ fails. Loosely based on
676 the work by Hirokazu Yamamoto.
677
678- Issue #15096: Removed support for ur'' as the raw notation isn't
679 compatible with Python 2.x's raw unicode strings.
680
681- Issue #13783: Generator objects now use the identifier APIs internally
682
683- Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.
684 Patch by Serhiy Storchaka.
685
686- Issue #15026: utf-16 encoding is now significantly faster (up to 10x).
687 Patch by Serhiy Storchaka.
688
689- Issue #11022: open() and io.TextIOWrapper are now calling
690 locale.getpreferredencoding(False) instead of locale.getpreferredencoding()
691 in text mode if the encoding is not specified. Don't change temporary the
692 locale encoding using locale.setlocale(), use the current locale encoding
693 instead of the user preferred encoding.
694
695- Issue #14673: Add Eric Snow's sys.implementation implementation.
696
697- Issue #15038: Optimize python Locks on Windows.
698
699Library
700-------
701
702- Issue #9803: Don't close IDLE on saving if breakpoint is open.
703 Patch by Roger Serwy.
704
705- Issue #12288: Consider '0' and '0.0' as valid initialvalue
706 for tkinter SimpleDialog.
707
708- Issue #15512: Add a __sizeof__ implementation for parser.
709 Patch by Serhiy Storchaka.
710
711- Issue #15469: Add a __sizeof__ implementation for deque objects.
712 Patch by Serhiy Storchaka.
713
714- Issue #15489: Add a __sizeof__ implementation for BytesIO objects.
715 Patch by Serhiy Storchaka.
716
717- Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
718 Patch by Serhiy Storchaka.
719
720- Issue #15514: Correct __sizeof__ support for cpu_set.
721 Patch by Serhiy Storchaka.
722
723- Issue #15187: Bugfix: remove temporary directories test_shutil was leaving
724 behind.
725
726- Issue #15177: Added dir_fd parameter to os.fwalk().
727
728- Issue #15176: Clarified behavior, documentation, and implementation
729 of os.listdir().
730
731- Issue #15061: Re-implemented hmac.compare_digest() in C to prevent further
732 timing analysis and to support all buffer protocol aware objects as well as
733 ASCII only str instances safely.
734
735- Issue #15164: Change return value of platform.uname() from a
736 plain tuple to a collections.namedtuple.
737
738- Support Mageia Linux in the platform module.
739
740- Issue #11678: Support Arch linux in the platform module.
741
742- Issue #15118: Change return value of os.uname() and os.times() from
743 plain tuples to immutable iterable objects with named attributes
744 (structseq objects).
745
746- Speed up _decimal by another 10-15% by caching the thread local context
747 that was last accessed. In the pi benchmark (64-bit platform, prec=9),
748 _decimal is now only 1.5x slower than float.
749
750- Remove the packaging module, which is not ready for prime time.
751
752- Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
753 parameter from os.remove / os.unlink.
754
755- Issue #4489: Add a shutil.rmtree that isn't susceptible to symlink attacks.
756 It is used automatically on platforms supporting the necessary os.openat()
757 and os.unlinkat() functions. Main code by Martin von Löwis.
758
759- Issue #15156: HTMLParser now uses the new "html.entities.html5" dictionary.
760
761- Issue #11113: add a new "html5" dictionary containing the named character
762 references defined by the HTML5 standard and the equivalent Unicode
763 character(s) to the html.entities module.
764
765- Issue #15114: the strict mode of HTMLParser and the HTMLParseError exception
766 are deprecated now that the parser is able to parse invalid markup.
767
768- Issue #3665: \u and \U escapes are now supported in unicode regular
769 expressions. Patch by Serhiy Storchaka.
770
771- Issue #15153: Added inspect.getgeneratorlocals to simplify white box
772 testing of generator state updates
773
774- Issue #13062: Added inspect.getclosurevars to simplify testing stateful
775 closures
776
777- Issue #11024: Fixes and additional tests for Time2Internaldate.
778
779- Issue #14626: Large refactoring of functions / parameters in the os module.
780 Many functions now support "dir_fd" and "follow_symlinks" parameters;
781 some also support accepting an open file descriptor in place of of a path
782 string. Added os.support_* collections as LBYL helpers. Removed many
783 functions only previously seen in 3.3 alpha releases (often starting with
784 "f" or "l", or ending with "at"). Originally suggested by Serhiy Storchaka;
785 implemented by Larry Hastings.
786
787- Issue #15008: Implement PEP 362 "Signature Objects".
788 Patch by Yury Selivanov.
789
790- Issue: #15138: base64.urlsafe_{en,de}code() are now 3-4x faster.
791
792- Issue #444582: Add shutil.which, for finding programs on the system path.
793 Original patch by Erik Demaine, with later iterations by Jan Killian
794 and Brian Curtin.
795
796- Issue #14837: SSL errors now have ``library`` and ``reason`` attributes
797 describing precisely what happened and in which OpenSSL submodule. The
798 str() of a SSLError is also enhanced accordingly.
799
800- Issue #9527: datetime.astimezone() method will now supply a class
801 timezone instance corresponding to the system local timezone when
802 called with no arguments.
803
804- Issue #14653: email.utils.mktime_tz() no longer relies on system
805 mktime() when timezone offest is supplied.
806
807- Issue #14684: zlib.compressobj() and zlib.decompressobj() now support the use
808 of predefined compression dictionaries. Original patch by Sam Rushing.
809
810- Fix GzipFile's handling of filenames given as bytes objects.
811
812- Issue #14772: Return destination values from some shutil functions.
813
814- Issue #15064: Implement context manager protocol for multiprocessing types
815
816- Issue #15101: Make pool finalizer avoid joining current thread.
817
818- Issue #14657: The frozen instance of importlib used for bootstrap is now
819 also the module imported as importlib._bootstrap.
820
821- Issue #14055: Add __sizeof__ support to _elementtree.
822
823- Issue #15054: A bug in tokenize.tokenize that caused string literals
824 with 'b' prefixes to be incorrectly tokenized has been fixed.
825 Patch by Serhiy Storchaka.
826
827- Issue #15006: Allow equality comparison between naive and aware
828 time or datetime objects.
829
830- Issue #14982: Document that pkgutil's iteration functions require the
831 non-standard iter_modules() method to be defined by an importer (something
832 the importlib importers do not define).
833
834- Issue #15036: Mailbox no longer throws an error if a flush is done
835 between operations when removing or changing multiple items in mbox,
836 MMDF, or Babyl mailboxes.
837
838- Issue #14059: Implement multiprocessing.Barrier.
839
840- Issue #15061: The inappropriately named hmac.secure_compare has been
841 renamed to hmac.compare_digest, restricted to operating on bytes inputs
842 only and had its documentation updated to more accurately reflect both its
843 intent and its limitations
844
845- Issue #13841: Make child processes exit using sys.exit() on Windows.
846
847- Issue #14936: curses_panel was converted to PEP 3121 and PEP 384 API.
848 Patch by Robin Schreiber.
849
850- Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
851 in struct tm, time.struct_time objects returned by time.gmtime(),
852 time.localtime() and time.strptime() functions now have tm_zone and
853 tm_gmtoff attributes. Original patch by Paul Boddie.
854
855- Rename adjusted attribute to adjustable in time.get_clock_info() result.
856
857- Issue #3518: Remove references to non-existent BaseManager.from_address()
858 method.
859
860- Issue #13857: Added textwrap.indent() function (initial patch by Ezra
861 Berch)
862
863- Issue #2736: Added datetime.timestamp() method.
864
865- Issue #13854: Make multiprocessing properly handle non-integer
866 non-string argument to SystemExit.
867
868- Issue #12157: Make pool.map() empty iterables correctly. Initial
869 patch by mouad.
870
871- Issue #11823: disassembly now shows argument counts on calls with keyword args.
872
873- Issue #14711: os.stat_float_times() has been deprecated.
874
875- LZMAFile now accepts the modes "rb"/"wb"/"ab" as synonyms of "r"/"w"/"a".
876
877- The bz2 and lzma modules now each contain an open() function, allowing
878 compressed files to readily be opened in text mode as well as binary mode.
879
880- BZ2File.__init__() and LZMAFile.__init__() now accept a file object as their
881 first argument, rather than requiring a separate "fileobj" argument.
882
883- gzip.open() now accepts file objects as well as filenames.
884
885- Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
886 when the path existed and had the S_ISGID mode bit set when it was
887 not explicitly asked for. This is no longer an exception as mkdir
888 cannot control if the OS sets that bit for it or not.
889
890- Issue #14989: Make the CGI enable option to http.server available via command
891 line.
892
893- Issue #14987: Add a missing import statement to inspect.
894
895- Issue #1079: email.header.decode_header now correctly parses all the examples
896 in RFC2047. There is a necessary visible behavior change: the leading and/or
897 trailing whitespace on ASCII parts is now preserved.
898
899- Issue #14969: Better handling of exception chaining in contextlib.ExitStack
900
901- Issue #14962: Update text coloring in IDLE shell window after changing
902 options. Patch by Roger Serwy.
903
904- Issue #14963: Convert contextlib.ExitStack.__exit__ to use an iterative
905 algorithm (Patch by Alon Horev)
906
907- Issue #14785: Add sys._debugmallocstats() to help debug low-level memory
908 allocation issues
909
910- Issue #14443: Ensure that .py files are byte-compiled with the correct Python
911 executable within bdist_rpm even on older versions of RPM
912
913C-API
914-----
915
916- Issue #13783: Inadvertent additions to the public C API in the PEP 380
917 implementation have either been removed or marked as private interfaces.
918
919Extension Modules
920-----------------
921
922- Issue #15000: Support the "unique" x32 architecture in _posixsubprocess.c.
923
924Documentation
925-------------
926
927- Issue #15081: Document PyState_FindModule.
928 Patch by Robin Schreiber.
929
930- Issue #14814: Added first draft of ipaddress module API reference
931
932Tests
933-----
934
935- Issue #14769: test_capi now has SkipitemTest, which cleverly checks
936 for "parity" between PyArg_ParseTuple() and the Python/getargs.c static
937 function skipitem() for all possible "format units".
938
939- test_nntplib now tolerates being run from behind NNTP gateways that add
940 "X-Antivirus" headers to articles
941
942- Issue #15043: test_gdb is now skipped entirely if gdb security settings
943 block loading of the gdb hooks
944
945- Issue #14963: Add test cases for exception handling behaviour
946 in contextlib.ExitStack (Initial patch by Alon Horev)
947
948Build
949-----
950
951- Issue #13590: Improve support for OS X Xcode 4:
952 * Try to avoid building Python or extension modules with problematic
953 llvm-gcc compiler.
954 * Since Xcode 4 removes ppc support, extension module builds now
955 check for ppc compiler support and automatically remove ppc and
956 ppc64 archs when not available.
957 * Since Xcode 4 no longer install SDKs in default locations,
958 extension module builds now revert to using installed headers
959 and libs if the SDK used to build the interpreter is not
960 available.
961 * Update ./configure to use better defaults for universal builds;
962 in particular, --enable-universalsdk=yes uses the Xcode default
963 SDK and --with-universal-archs now defaults to "intel" if ppc
964 not available.
965
966- Issue #14225: Fix Unicode support for curses (#12567) on OS X
967
968- Issue #14928: Fix importlib bootstrap issues by using a custom executable
969 (Modules/_freeze_importlib) to build Python/importlib.h.
970
971
972What's New in Python 3.3.0 Alpha 4?
973===================================
974
975*Release date: 31-May-2012*
976
977Core and Builtins
978-----------------
979
980- Issue #14835: Make plistlib output empty arrays & dicts like OS X.
981 Patch by Sidney San Martín.
982
983- Issue #14744: Use the new _PyUnicodeWriter internal API to speed up
984 str%args and str.format(args).
985
986- Issue #14930: Make memoryview objects weakrefable.
987
988- Issue #14775: Fix a potential quadratic dict build-up due to the garbage
989 collector repeatedly trying to untrack dicts.
990
991- Issue #14857: fix regression in references to PEP 3135 implicit __class__
992 closure variable (Reopens issue #12370)
993
994- Issue #14712 (PEP 405): Virtual environments. Implemented by Vinay Sajip.
995
996- Issue #14660 (PEP 420): Namespace packages. Implemented by Eric Smith.
997
998- Issue #14494: Fix __future__.py and its documentation to note that
999 absolute imports are the default behavior in 3.0 instead of 2.7.
1000 Patch by Sven Marnach.
1001
1002- Issue #9260: A finer-grained import lock. Most of the import sequence
1003 now uses per-module locks rather than the global import lock, eliminating
1004 well-known issues with threads and imports.
1005
1006- Issue #14624: UTF-16 decoding is now 3x to 4x faster on various inputs.
1007 Patch by Serhiy Storchaka.
1008
1009- asdl_seq and asdl_int_seq are now Py_ssize_t sized.
1010
1011- Issue #14133 (PEP 415): Implement suppression of __context__ display with an
1012 attribute on BaseException. This replaces the original mechanism of PEP 409.
1013
1014- Issue #14417: Mutating a dict during lookup now restarts the lookup instead
1015 of raising a RuntimeError (undoes issue #14205).
1016
1017- Issue #14738: Speed-up UTF-8 decoding on non-ASCII data. Patch by Serhiy
1018 Storchaka.
1019
1020- Issue #14700: Fix two broken and undefined-behaviour-inducing overflow checks
1021 in old-style string formatting.
1022
1023- Issue #14705: The PyArg_Parse() family of functions now support the 'p' format
1024 unit, which accepts a "boolean predicate" argument. It converts any Python
1025 value into an integer--0 if it is "false", and 1 otherwise.
1026
1027Library
1028-------
1029
1030- Issue #14690: Use monotonic clock instead of system clock in the sched,
1031 subprocess and trace modules.
1032
1033- Issue #14958: Change IDLE systax highlighting to recognize all string and
1034 byte literals supported in Python 3.3.
1035
1036- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
1037
1038- Issue #14443: Tell rpmbuild to use the correct version of Python in
1039 bdist_rpm. Initial patch by Ross Lagerwall.
1040
1041- Issue #14929: Stop Idle 3.x from closing on Unicode decode errors when
1042 grepping. Patch by Roger Serwy.
1043
1044- Issue #12515: email now registers a defect if it gets to EOF while parsing
1045 a MIME part without seeing the closing MIME boundary.
1046
1047- Issue #12510: Attempting to get invalid tooltip no longer closes Idle.
1048 Other tooltipss have been corrected or improved and the number of tests
1049 has been tripled. Original patch by Roger Serwy.
1050
1051- Issue #1672568: email now always decodes base64 payloads, adding padding and
1052 ignoring non-base64-alphabet characters if needed, and registering defects
1053 for any such problems.
1054
1055- Issue #14925: email now registers a defect when the parser decides that there
1056 is a missing header/body separator line. MalformedHeaderDefect, which the
1057 existing code would never actually generate, is deprecated.
1058
1059- Issue #10365: File open dialog now works instead of crashing even when
1060 the parent window is closed before the dialog. Patch by Roger Serwy.
1061
1062- Issue #8739: Updated smtpd to support RFC 5321, and added support for the
1063 RFC 1870 SIZE extension.
1064
1065- Issue #665194: Added a localtime function to email.utils to provide an
1066 aware local datetime for use in setting Date headers.
1067
1068- Issue #12586: Added new provisional policies that implement convenient
1069 unicode support for email headers. See What's New for details.
1070
1071- Issue #14731: Refactored email Policy framework to support full backward
1072 compatibility with Python 3.2 by default yet allow for the introduction of
1073 new features through new policies. Note that Policy.must_be_7bit is renamed
1074 to cte_type.
1075
1076- Issue #14876: Use user-selected font for highlight configuration.
1077
1078- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals.
1079 Have ascii characters in help.
1080
1081- Issue #14548: Make multiprocessing finalizers check pid before
1082 running to cope with possibility of gc running just after fork.
1083
1084- Issue #14863: Update the documentation of os.fdopen() to reflect the
1085 fact that it's only a thin wrapper around open() anymore.
1086
1087- Issue #14036: Add an additional check to validate that port in urlparse does
1088 not go in illegal range and returns None.
1089
1090- Issue #14862: Add missing names to os.__all__
1091
1092- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
1093
1094- Issue #13585: Added contextlib.ExitStack
1095
1096- PEP 3144, Issue #14814: Added the ipaddress module
1097
1098- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
1099 Header in Cookie.py.
1100
1101- Issue #14588: The types module now provide new_class() and prepare_class()
1102 functions to support PEP 3115 compliant dynamic class creation. Patch by
1103 Daniel Urban and Nick Coghlan.
1104
1105- Issue #13152: Allow to specify a custom tabsize for expanding tabs in
1106 textwrap. Patch by John Feuerstein.
1107
1108- Issue #14721: Send the correct 'Content-length: 0' header when the body is an
1109 empty string ''. Initial Patch contributed by Arve Knudsen.
1110
1111- Issue #14072: Fix parsing of 'tel' URIs in urlparse by making the check for
1112 ports stricter.
1113
1114- Issue #9374: Generic parsing of query and fragment portions of url for any
1115 scheme. Supported both by RFC3986 and RFC2396.
1116
1117- Issue #14798: Fix the functions in pyclbr to raise an ImportError
1118 when the first part of a dotted name is not a package. Patch by
1119 Xavier de Gaye.
1120
1121- Issue #12098: multiprocessing on Windows now starts child processes
1122 using the same sys.flags as the current process. Initial patch by
1123 Sergey Mezentsev.
1124
1125- Issue #13031: Small speed-up for tarfile when unzipping tarfiles.
1126 Patch by Justin Peel.
1127
1128- Issue #14780: urllib.request.urlopen() now has a ``cadefault`` argument
1129 to use the default certificate store. Initial patch by James Oakley.
1130
1131- Issue #14829: Fix bisect and range() indexing with large indices
1132 (>= 2 ** 32) under 64-bit Windows.
1133
1134- Issue #14732: The _csv module now uses PEP 3121 module initialization.
1135 Patch by Robin Schreiber.
1136
1137- Issue #14809: Add HTTP status codes introduced by RFC 6585 to http.server
1138 and http.client. Patch by EungJun Yi.
1139
1140- Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when
1141 accessing the Tk clipboard. Modify clipboad_get() to first request type
1142 UTF8_STRING when no specific type is requested in an X11 windowing
1143 environment, falling back to the current default type STRING if that fails.
1144 Original patch by Thomas Kluyver.
1145
1146- Issue #14773: Fix os.fwalk() failing on dangling symlinks.
1147
1148- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
1149 Authentation in urllib2.
1150
1151- Issue #14807: move undocumented tarfile.filemode() to stat.filemode() and add
1152 doc entry. Add tarfile.filemode alias with deprecation warning.
1153
1154- Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
1155
1156- Issue #14532: Add a secure_compare() helper to the hmac module, to mitigate
1157 timing attacks. Patch by Jon Oberheide.
1158
1159- Add importlib.util.resolve_name().
1160
1161- Issue #14366: Support lzma compression in zip files.
1162 Patch by Serhiy Storchaka.
1163
1164- Issue #13959: Introduce importlib.find_loader() and document
1165 imp.find_module/load_module as deprecated.
1166
1167- Issue #14082: shutil.copy2() now copies extended attributes, if possible.
1168 Patch by Hynek Schlawack.
1169
1170- Issue #13959: Make importlib.abc.FileLoader.load_module()/get_filename() and
1171 importlib.machinery.ExtensionFileLoader.load_module() have their single
1172 argument be optional. Allows for the replacement (and thus deprecation) of
1173 imp.load_source()/load_package()/load_compiled().
1174
1175- Issue #13959: imp.get_suffixes() has been deprecated in favour of the new
1176 attributes on importlib.machinery: SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
1177 OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES, and EXTENSION_SUFFIXES. This
1178 led to an indirect deprecation of inspect.getmoduleinfo().
1179
1180- Issue #14662: Prevent shutil failures on OS X when destination does not
1181 support chflag operations. Patch by Hynek Schlawack.
1182
1183- Issue #14157: Fix time.strptime failing without a year on February 29th.
1184 Patch by Hynek Schlawack.
1185
1186- Issue #14753: Make multiprocessing's handling of negative timeouts
1187 the same as it was in Python 3.2.
1188
1189- Issue #14583: Fix importlib bug when a package's __init__.py would first
1190 import one of its modules then raise an error.
1191
1192- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
1193
1194- Issue #14697: Fix missing support for set displays and set comprehensions in
1195 parser module.
1196
1197- Issue #14701: Fix missing support for 'raise ... from' in parser module.
1198
1199- Add support for timeouts to the acquire() methods of
1200 multiprocessing's lock/semaphore/condition proxies.
1201
1202- Issue #13989: Add support for text mode to gzip.open().
1203
1204- Issue #14127: The os.stat() result object now provides three additional
1205 fields: st_ctime_ns, st_mtime_ns, and st_atime_ns, providing those times as an
1206 integer with nanosecond resolution. The functions os.utime(), os.lutimes(),
1207 and os.futimes() now accept a new parameter, ns, which accepts mtime and atime
1208 as integers with nanosecond resolution.
1209
1210- Issue #14127 and #10148: shutil.copystat now preserves exact mtime and atime
1211 on filesystems providing nanosecond resolution.
1212
1213Tools/Demos
1214-----------
1215
1216- Issue #14695: Bring Tools/parser/unparse.py support up to date with
1217 the Python 3.3 Grammar.
1218
1219Build
1220-----
1221
1222- Issue #14472: Update .gitignore. Patch by Matej Cepl.
1223
1224- Upgrade Windows library versions: bzip 1.0.6, OpenSSL 1.0.1c.
1225
1226- Issue #14693: Under non-Windows platforms, hashlib's fallback modules are
1227 always compiled, even if OpenSSL is present at build time.
1228
1229- Issue #13210: Windows build now uses VS2010, ported from VS2008.
1230
1231Documentation
1232-------------
1233
1234- Issue #14588: The language reference now accurately documents the Python 3
1235 class definition process. Patch by Nick Coghlan.
1236
1237- Issue #14943: Correct a default argument value for winreg.OpenKey
1238 and correctly list the argument names in the function's explanation.
1239
1240
1241What's New in Python 3.3.0 Alpha 3?
1242===================================
1243
1244*Release date: 01-May-2012*
1245
1246Core and Builtins
1247-----------------
1248
1249- Issue #14699: Fix calling the classmethod descriptor directly.
1250
1251- Issue #14433: Prevent msvcrt crash in interactive prompt when stdin is closed.
1252
1253- Issue #14521: Make result of float('nan') and float('-nan') more consistent
1254 across platforms.
1255
1256- Issue #14646: __import__() sets __loader__ if the loader did not.
1257
1258- Issue #14605: No longer have implicit entries in sys.meta_path. If
1259 sys.meta_path is found to be empty, raise ImportWarning.
1260
1261- Issue #14605: No longer have implicit entries in sys.path_hooks. If
1262 sys.path_hooks is found to be empty, a warning will be raised. None is now
1263 inserted into sys.path_importer_cache if no finder was discovered. This also
1264 means imp.NullImporter is no longer implicitly used.
1265
1266- Issue #13903: Implement PEP 412. Individual dictionary instances can now share
1267 their keys with other dictionaries. Classes take advantage of this to share
1268 their instance dictionary keys for improved memory and performance.
1269
1270- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
1271 when repr() or str() is called on such an object.
1272
1273- Issue #14658: Fix binding a special method to a builtin implementation of a
1274 special method with a different name.
1275
1276- Issue #14630: Fix a memory access bug for instances of a subclass of int
1277 with value 0.
1278
1279- Issue #14339: Speed improvements to bin, oct and hex functions. Patch by
1280 Serhiy Storchaka.
1281
1282- Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.
1283 Patch by Stefan Behnel.
1284
1285- Issue #14385: It is now possible to use a custom type for the __builtins__
1286 namespace, instead of a dict. It can be used for sandboxing for example.
1287 Raise also a NameError instead of ImportError if __build_class__ name if not
1288 found in __builtins__.
1289
1290- Issue #12599: Be more strict in accepting None compared to a false-like
1291 object for importlib.util.module_for_loader and
1292 importlib.machinery.PathFinder.
1293
1294- Issue #14612: Fix jumping around with blocks by setting f_lineno.
1295
1296- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
1297 globals raises a KeyError.
1298
1299- Issue #14607: Fix keyword-only arguments which started with ``__``.
1300
1301- Issue #10854: The ImportError raised when an extension module on Windows
1302 fails to import now uses the new path and name attributes from
1303 Issue #1559549.
1304
1305- Issue #13889: Check and (if necessary) set FPU control word before calling
1306 any of the dtoa.c string <-> float conversion functions, on MSVC builds of
1307 Python. This fixes issues when embedding Python in a Delphi app.
1308
1309- __import__() now matches PEP 328 and documentation by defaulting 'index' to 0
1310 instead of -1 and removing support for negative values.
1311
1312- Issue #2377: Make importlib the implementation of __import__().
1313
1314- Issue #1559549: ImportError now has 'name' and 'path' attributes that are set
1315 using keyword arguments to its constructor. They are currently not set by
1316 import as they are meant for use by importlib.
1317
1318- Issue #14474: Save and restore exception state in thread.start_new_thread()
1319 while writing error message if the thread leaves a unhandled exception.
1320
1321- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
1322 by Suman Saha.
1323
1324Library
1325-------
1326
1327- Issue #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'.
1328
1329- Issue #14371: Support bzip2 in zipfile module. Patch by Serhiy Storchaka.
1330
1331- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running
1332 step. Patch by Xavier de Gaye.
1333
1334- Issue #14696: Fix parser module to understand 'nonlocal' declarations.
1335
1336- Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
1337 the DST transition. Patch by Joe Peterson.
1338
1339- Issue #9154: Fix parser module to understand function annotations.
1340
1341- Issue #6085: In http.server.py SimpleHTTPServer.address_string returns the
1342 client ip address instead client hostname. Patch by Charles-François Natali.
1343
1344- Issue #14309: Deprecate time.clock(), use time.perf_counter() or
1345 time.process_time() instead.
1346
1347- Issue #14428: Implement the PEP 418. Add time.get_clock_info(),
1348 time.perf_counter() and time.process_time() functions, and rename
1349 time.steady() to time.monotonic().
1350
1351- Issue #14646: importlib.util.module_for_loader() now sets __loader__ and
1352 __package__ (when possible).
1353
1354- Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a
1355 test class that doesn't inherit from TestCase (i.e. a mixin).
1356
1357- Issue #4892: multiprocessing Connections can now be transferred over
1358 multiprocessing Connections. Patch by Richard Oudkerk (sbt).
1359
1360- Issue #14160: TarFile.extractfile() failed to resolve symbolic links when
1361 the links were not located in an archive subdirectory.
1362
1363- Issue #14638: pydoc now treats non-string __name__ values as if they
1364 were missing, instead of raising an error.
1365
1366- Issue #13684: Fix httplib tunnel issue of infinite loops for certain sites
1367 which send EOF without trailing \r\n.
1368
1369- Issue #14605: Add importlib.abc.FileLoader, importlib.machinery.(FileFinder,
1370 SourceFileLoader, SourcelessFileLoader, ExtensionFileLoader).
1371
1372- Issue #13959: imp.cache_from_source()/source_from_cache() now follow
1373 os.path.join()/split() semantics for path manipulation instead of its prior,
1374 custom semantics of caring the right-most path separator forward in path
1375 joining.
1376
1377- Issue #2193: Allow ":" character in Cookie NAME values.
1378
1379- Issue #14629: tokenizer.detect_encoding will specify the filename in the
1380 SyntaxError exception if found at readline.__self__.name.
1381
1382- Issue #14629: Raise SyntaxError in tokenizer.detect_encoding if the
1383 first two lines have non-UTF-8 characters without an encoding declaration.
1384
1385- Issue #14308: Fix an exception when a "dummy" thread is in the threading
1386 module's active list after a fork().
1387
1388- Issue #11750: The Windows API functions scattered in the _subprocess and
1389 _multiprocessing.win32 modules now live in a single module "_winapi".
1390 Patch by sbt.
1391
1392- Issue #14087: multiprocessing: add Condition.wait_for(). Patch by sbt.
1393
1394- Issue #14538: HTMLParser can now parse correctly start tags that contain
1395 a bare '/'.
1396
1397- Issue #14452: SysLogHandler no longer inserts a UTF-8 BOM into the message.
1398
1399- Issue #14386: Expose the dict_proxy internal type as types.MappingProxyType.
1400
1401- Issue #13959: Make imp.reload() always use a module's __loader__ to perform
1402 the reload.
1403
1404- Issue #13959: Add imp.py and rename the built-in module to _imp, allowing for
1405 re-implementing parts of the module in pure Python.
1406
1407- Issue #13496: Fix potential overflow in bisect.bisect algorithm when applied
1408 to a collection of size > sys.maxsize / 2.
1409
1410- Have importlib take advantage of ImportError's new 'name' and 'path'
1411 attributes.
1412
1413- Issue #14399: zipfile now recognizes that the archive has been modified even
1414 if only the comment is changed. In addition, the TypeError that results from
1415 trying to set a non-binary value as a comment is now now raised at the time
1416 the comment is set rather than at the time the zipfile is written.
1417
1418- trace.CoverageResults.is_ignored_filename() now ignores any name that starts
1419 with "<" and ends with ">" instead of special-casing "<string>" and
1420 "<doctest ".
1421
1422- Issue #12537: The mailbox module no longer depends on knowledge of internal
1423 implementation details of the email package Message object.
1424
1425- Issue #7978: socketserver now restarts the select() call when EINTR is
1426 returned. This avoids crashing the server loop when a signal is received.
1427 Patch by Jerzy Kozera.
1428
1429- Issue #14522: Avoid duplicating socket handles in multiprocessing.connection.
1430 Patch by sbt.
1431
1432- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
1433
1434- Issue #8515: Set __file__ when run file in IDLE.
1435 Initial patch by Bruce Frederiksen.
1436
1437- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
1438 Patch by Popa Claudiu.
1439
1440- Issue #3033: Add displayof parameter to tkinter font. Patch by Guilherme Polo.
1441
1442- Issue #14482: Raise a ValueError, not a NameError, when trying to create
1443 a multiprocessing Client or Listener with an AF_UNIX type address under
1444 Windows. Patch by Popa Claudiu.
1445
1446- Issue #802310: Generate always unique tkinter font names if not directly passed.
1447
1448- Issue #14151: Raise a ValueError, not a NameError, when trying to create
1449 a multiprocessing Client or Listener with an AF_PIPE type address under
1450 non-Windows platforms. Patch by Popa Claudiu.
1451
1452- Issue #14493: Use gvfs-open or xdg-open in webbrowser.
1453
1454Build
1455-----
1456
1457- "make touch" will now touch generated files that are checked into Mercurial,
1458 after a "hg update" which failed to bring the timestamps into the right order.
1459
1460Tests
1461-----
1462
1463- Issue #14026: In test_cmd_line_script, check that sys.argv is populated
1464 correctly for the various invocation approaches (Patch by Jason Yeo)
1465
1466- Issue #14032: Fix incorrect variable name in test_cmd_line_script debugging
1467 message (Patch by Jason Yeo)
1468
1469- Issue #14589: Update certificate chain for sha256.tbs-internet.com, fixing
1470 a test failure in test_ssl.
1471
1472- Issue #14355: Regrtest now supports the standard unittest test loading, and
1473 will use it if a test file contains no `test_main` method.
1474
1475Tools / Demos
1476-------------
1477
1478- Issue #3561: The Windows installer now has an option, off by default, for
1479 placing the Python installation into the system "Path" environment variable.
1480
1481- Issue #13165: stringbench is now available in the Tools/stringbench folder.
1482 It used to live in its own SVN project.
1483
1484
1485What's New in Python 3.3.0 Alpha 2?
1486===================================
1487
1488*Release date: 01-Apr-2012*
1489
1490Core and Builtins
1491-----------------
1492
1493- Issue #1683368: object.__new__ and object.__init__ raise a TypeError if they
1494 are passed arguments and their complementary method is not overridden.
1495
1496- Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
1497 the module name that was not interned.
1498
1499- Issue #14331: Use significantly less stack space when importing modules by
1500 allocating path buffers on the heap instead of the stack.
1501
1502- Issue #14334: Prevent in a segfault in type.__getattribute__ when it was not
1503 passed strings.
1504
1505- Issue #1469629: Allow cycles through an object's __dict__ slot to be
1506 collected. (For example if ``x.__dict__ is x``).
1507
1508- Issue #14205: dict lookup raises a RuntimeError if the dict is modified
1509 during a lookup.
1510
1511- Issue #14220: When a generator is delegating to another iterator with the
1512 yield from syntax, it needs to have its ``gi_running`` flag set to True.
1513
1514- Issue #14435: Remove dedicated block allocator from floatobject.c and rely
1515 on the PyObject_Malloc() api like all other objects.
1516
1517- Issue #14471: Fix a possible buffer overrun in the winreg module.
1518
1519- Issue #14288: Allow the serialization of builtin iterators
1520
1521Library
1522-------
1523
1524- Issue #14300: Under Windows, sockets created using socket.dup() now allow
1525 overlapped I/O. Patch by sbt.
1526
1527- Issue #13872: socket.detach() now marks the socket closed (as mirrored
1528 in the socket repr()). Patch by Matt Joiner.
1529
1530- Issue #14406: Fix a race condition when using ``concurrent.futures.wait(
1531 return_when=ALL_COMPLETED)``. Patch by Matt Joiner.
1532
1533- Issue #5136: deprecate old, unused functions from tkinter.
1534
1535- Issue #14409: IDLE now properly executes commands in the Shell window
1536 when it cannot read the normal config files on startup and
1537 has to use the built-in default key bindings.
1538 There was previously a bug in one of the defaults.
1539
1540- Issue #14416: syslog now defines the LOG_ODELAY and LOG_AUTHPRIV constants
1541 if they are defined in <syslog.h>.
1542
1543- IDLE can be launched as python -m idlelib
1544
1545- Issue #14295: Add unittest.mock
1546
1547- Issue #7652: Add --with-system-libmpdec option to configure for linking
1548 the _decimal module against an installed libmpdec.
1549
1550- Issue #14380: MIMEText now defaults to utf-8 when passed non-ASCII unicode
1551 with no charset specified.
1552
1553- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on
1554 OSX; avoid to call handle_connect in case of a disconnected socket which
1555 was not meant to connect.
1556
1557- Issue #14204: The ssl module now has support for the Next Protocol
1558 Negotiation extension, if available in the underlying OpenSSL library.
1559 Patch by Colin Marc.
1560
1561- Issue #3035: Unused functions from tkinter are marked as pending deprecated.
1562
1563- Issue #12757: Fix the skipping of doctests when python is run with -OO so
1564 that it works in unittest's verbose mode as well as non-verbose mode.
1565
1566- Issue #7652: Integrate the decimal floating point libmpdec library to speed
1567 up the decimal module. Performance gains of the new C implementation are
1568 between 10x and 100x, depending on the application.
1569
1570- Issue #3573: IDLE hangs when passing invalid command line args
1571 (directory(ies) instead of file(s)) (Patch by Guilherme Polo)
1572
1573- Issue #14269: SMTPD now conforms to the RFC and requires a HELO command
1574 before MAIL, RCPT, or DATA.
1575
1576- Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
1577 attribute.
1578
1579- Issue #14344: fixed the repr of email.policy objects.
1580
1581- Issue #11686: Added missing entries to email package __all__ lists
1582 (mostly the new Bytes classes).
1583
1584- Issue #14335: multiprocessing's custom Pickler subclass now inherits from
1585 the C-accelerated implementation. Patch by sbt.
1586
1587- Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem.
1588
1589- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
1590
1591- Improve the memory utilization and speed of functools.lru_cache.
1592
1593- Issue #14222: Use the new time.steady() function instead of time.time() for
1594 timeout in queue and threading modules to not be affected of system time
1595 update.
1596
1597- Issue #13248: Remove lib2to3.pytree.Base.get_prefix/set_prefix.
1598
1599- Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash
1600 table internal to the pyexpat module's copy of the expat library to avoid a
1601 denial of service due to hash collisions. Patch by David Malcolm with some
1602 modifications by the expat project.
1603
1604- Issue #14200: Idle shell crash on printing non-BMP unicode character.
1605
1606- Issue #12818: format address no longer needlessly \ escapes ()s in names when
1607 the name ends up being quoted.
1608
1609- Issue #14062: BytesGenerator now correctly folds Header objects,
1610 including using linesep when folding.
1611
1612- Issue #13839: When invoked on the command-line, the pstats module now
1613 accepts several filenames of profile stat files and merges them all.
1614 Patch by Matt Joiner.
1615
1616- Issue #14291: Email now defaults to utf-8 for non-ASCII unicode headers
1617 instead of raising an error. This fixes a regression relative to 2.7.
1618
1619- Issue #989712: Support using Tk without a mainloop.
1620
1621- Issue #5219: Prevent event handler cascade in IDLE.
1622
1623- Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
1624
1625- Issue #2843: Add new Tk API to Tkinter.
1626
1627- Issue #14184: Increase the default stack size for secondary threads on
1628 Mac OS X to avoid interpreter crashes when using threads on 10.7.
1629
1630- Issue #14180: datetime.date.fromtimestamp(),
1631 datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp()
1632 now raise an OSError instead of ValueError if localtime() or gmtime() failed.
1633
1634- Issue #14180: time.ctime(), gmtime(), time.localtime(),
1635 datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and
1636 datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of
1637 a ValueError, if the timestamp does not fit in time_t.
1638
1639- Issue #14180: datetime.datetime.fromtimestamp() and
1640 datetime.datetime.utcfromtimestamp() now round microseconds towards zero
1641 instead of rounding to nearest with ties going away from zero.
1642
1643- Issue #10543: Fix unittest test discovery with Jython bytecode files.
1644
1645- Issue #1178863: Separate initialisation from setting when initializing
1646 Tkinter.Variables; harmonize exceptions to ValueError; only delete variables
1647 that have not been deleted; assert that variable names are strings.
1648
1649- Issue #14104: Implement time.monotonic() on Mac OS X, patch written by
1650 Nicholas Riley.
1651
1652- Issue #13394: the aifc module now uses warnings.warn() to signal warnings.
1653
1654- Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
1655 Windows when the child process has already exited.
1656
1657- Issue #14223: curses.addch() is no more limited to the range 0-255 when the
1658 Python curses is not linked to libncursesw. It was a regression introduced
1659 in Python 3.3a1.
1660
1661- Issue #14168: Check for presence of Element._attrs in minidom before
1662 accessing it.
1663
1664- Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows.
1665 Also, add a multiprocessing.connection.wait(rlist, timeout=None) function
1666 for polling multiple objects at once. Patch by sbt.
1667
1668- Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
1669 data or close method) for the Python implementation as well.
1670 Drop the no-op TreeBuilder().xml() method from the C implementation.
1671
1672- Issue #14210: pdb now has tab-completion not only for command names, but
1673 also for their arguments, wherever possible.
1674
1675- Issue #14310: Sockets can now be with other processes on Windows using
1676 the api socket.socket.share() and socket.fromshare().
1677
1678- Issue #10576: The gc module now has a 'callbacks' member that will get
1679 called when garbage collection takes place.
1680
1681Build
1682-----
1683
1684- Issue #14557: Fix extensions build on HP-UX. Patch by Adi Roiban.
1685
1686- Issue #14387: Do not include accu.h from Python.h.
1687
1688- Issue #14359: Only use O_CLOEXEC in _posixmodule.c if it is defined.
1689 Based on patch from Hervé Coatanhay.
1690
1691- Issue #14321: Do not run pgen during the build if files are up to date.
1692
1693Documentation
1694-------------
1695
1696- Issue #14034: added the argparse tutorial.
1697
1698- Issue #14324: Fix configure tests for cross builds.
1699
1700- Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in
1701 config.{guess,sub}. Don't use uname calls for cross builds.
1702
1703Extension Modules
1704-----------------
1705
1706- Issue #9041: An issue in ctypes.c_longdouble, ctypes.c_double, and
1707 ctypes.c_float that caused an incorrect exception to be returned in the
1708 case of overflow has been fixed.
1709
1710- Issue #14212: The re module didn't retain a reference to buffers it was
1711 scanning, resulting in segfaults.
1712
1713- Issue #14259: The finditer() method of re objects did not take any
1714 keyword arguments, contrary to the documentation.
1715
1716- Issue #10142: Support for SEEK_HOLE/SEEK_DATA (for example, under ZFS).
1717
1718Tests
1719-----
1720
1721- Issue #14442: Add missing errno import in test_smtplib.
1722
1723- Issue #8315: (partial fix) python -m unittest test.test_email now works.
1724
1725
1726What's New in Python 3.3.0 Alpha 1?
1727===================================
1728
1729*Release date: 05-Mar-2012*
1730
1731Core and Builtins
1732-----------------
1733
1734- Issue #14172: Fix reference leak when marshalling a buffer-like object
1735 (other than a bytes object).
1736
1737- Issue #13521: dict.setdefault() now does only one lookup for the given key,
1738 making it "atomic" for many purposes. Patch by Filip Gruszczyński.
1739
1740- PEP 409, Issue #6210: "raise X from None" is now supported as a means of
1741 suppressing the display of the chained exception context. The chained
1742 context still remains available as the __context__ attribute.
1743
1744- Issue #10181: New memoryview implementation fixes multiple ownership
1745 and lifetime issues of dynamically allocated Py_buffer members (#9990)
1746 as well as crashes (#8305, #7433). Many new features have been added
1747 (See whatsnew/3.3), and the documentation has been updated extensively.
1748 The ndarray test object from _testbuffer.c implements all aspects of
1749 PEP-3118, so further development towards the complete implementation
1750 of the PEP can proceed in a test-driven manner.
1751
1752 Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review
1753 and many ideas.
1754
1755- Issue #12834: Fix incorrect results of memoryview.tobytes() for
1756 non-contiguous arrays.
1757
1758- Issue #5231: Introduce memoryview.cast() method that allows changing
1759 format and shape without making a copy of the underlying memory.
1760
1761- Issue #14084: Fix a file descriptor leak when importing a module with a
1762 bad encoding.
1763
1764- Upgrade Unicode data to Unicode 6.1.
1765
1766- Issue #14040: Remove rarely used file name suffixes for C extensions
1767 (under POSIX mainly).
1768
1769- Issue #14051: Allow arbitrary attributes to be set of classmethod and
1770 staticmethod.
1771
1772- Issue #13703: oCERT-2011-003: Randomize hashes of str and bytes to protect
1773 against denial of service attacks due to hash collisions within the dict and
1774 set types. Patch by David Malcolm, based on work by Victor Stinner.
1775
1776- Issue #13020: Fix a reference leak when allocating a structsequence object
1777 fails. Patch by Suman Saha.
1778
1779- Issue #13908: Ready types returned from PyType_FromSpec.
1780
1781- Issue #11235: Fix OverflowError when trying to import a source file whose
1782 modification time doesn't fit in a 32-bit timestamp.
1783
1784- Issue #12705: A SyntaxError exception is now raised when attempting to
1785 compile multiple statements as a single interactive statement.
1786
1787- Fix the builtin module initialization code to store the init function for
1788 future reinitialization.
1789
1790- Issue #8052: The posix subprocess module would take a long time closing
1791 all possible file descriptors in the child process rather than just open
1792 file descriptors. It now closes only the open fds if possible for the
1793 default close_fds=True behavior.
1794
1795- Issue #13629: Renumber the tokens in token.h so that they match the indexes
1796 into _PyParser_TokenNames.
1797
1798- Issue #13752: Add a casefold() method to str.
1799
1800- Issue #13761: Add a "flush" keyword argument to the print() function,
1801 used to ensure flushing the output stream.
1802
1803- Issue #13645: pyc files now contain the size of the corresponding source
1804 code, to avoid timestamp collisions (especially on filesystems with a low
1805 timestamp resolution) when checking for freshness of the bytecode.
1806
1807- PEP 380, Issue #11682: Add "yield from <x>" to support easy delegation to
1808 subgenerators (initial patch by Greg Ewing, integration into 3.3 by
1809 Renaud Blanch, Ryan Kelly, Zbigniew Jędrzejewski-Szmek and Nick Coghlan)
1810
1811- Issue #13748: Raw bytes literals can now be written with the ``rb`` prefix
1812 as well as ``br``.
1813
1814- Issue #12736: Use full unicode case mappings for upper, lower, and title case.
1815
1816- Issue #12760: Add a create mode to open(). Patch by David Townshend.
1817
1818- Issue #13738: Simplify implementation of bytes.lower() and bytes.upper().
1819
1820- Issue #13577: Built-in methods and functions now have a __qualname__.
1821 Patch by sbt.
1822
1823- Issue #6695: Full garbage collection runs now clear the freelist of set
1824 objects. Initial patch by Matthias Troffaes.
1825
1826- Fix OSError.__init__ and OSError.__new__ so that each of them can be
1827 overriden and take additional arguments (followup to issue #12555).
1828
1829- Fix the fix for issue #12149: it was incorrect, although it had the side
1830 effect of appearing to resolve the issue. Thanks to Mark Shannon for
1831 noticing.
1832
1833- Issue #13505: Pickle bytes objects in a way that is compatible with
1834 Python 2 when using protocols <= 2.
1835
1836- Issue #11147: Fix an unused argument in _Py_ANNOTATE_MEMORY_ORDER. (Fix
1837 given by Campbell Barton).
1838
1839- Issue #13503: Use a more efficient reduction format for bytearrays with
1840 pickle protocol >= 3. The old reduction format is kept with older protocols
1841 in order to allow unpickling under Python 2. Patch by Irmen de Jong.
1842
1843- Issue #7111: Python can now be run without a stdin, stdout or stderr
1844 stream. It was already the case with Python 2. However, the corresponding
1845 sys module entries are now set to None (instead of an unusable file object).
1846
1847- Issue #11849: Ensure that free()d memory arenas are really released
1848 on POSIX systems supporting anonymous memory mappings. Patch by
1849 Charles-François Natali.
1850
1851- Issue #13452: PyUnicode_EncodeDecimal() doesn't support error handlers
1852 different than "strict" anymore. The caller was unable to compute the
1853 size of the output buffer: it depends on the error handler.
1854
1855- PEP 3155 / issue #13448: Qualified name for classes and functions.
1856
1857- Issue #13436: Fix a bogus error message when an AST object was passed
1858 an invalid integer value.
1859
1860- Issue #13411: memoryview objects are now hashable when the underlying
1861 object is hashable.
1862
1863- Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
1864 to allow compiling extension modules with -Wswitch-enum on gcc.
1865 Initial patch by Floris Bruynooghe.
1866
1867- Issue #10227: Add an allocation cache for a single slice object. Patch by
1868 Stefan Behnel.
1869
1870- Issue #13393: BufferedReader.read1() now asks the full requested size to
1871 the raw stream instead of limiting itself to the buffer size.
1872
1873- Issue #13392: Writing a pyc file should now be atomic under Windows as well.
1874
1875- Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder
1876 already accepts them).
1877
1878- Issue #13389: Full garbage collection passes now clear the freelists for
1879 list and dict objects. They already cleared other freelists in the
1880 interpreter.
1881
1882- Issue #13327: Remove the need for an explicit None as the second argument
1883 to os.utime, os.lutimes, os.futimes, os.futimens, os.futimesat, in
1884 order to update to the current time. Also added keyword argument
1885 handling to os.utimensat in order to remove the need for explicit None.
1886
1887- Issue #13350: Simplify some C code by replacing most usages of
1888 PyUnicode_Format by PyUnicode_FromFormat.
1889
1890- Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
1891 error handler in interactive mode (when calling into PyOS_Readline()).
1892
1893- Issue #9896: Add start, stop, and step attributes to range objects.
1894
1895- Issue #13343: Fix a SystemError when a lambda expression uses a global
1896 variable in the default value of a keyword-only argument: ``lambda *,
1897 arg=GLOBAL_NAME: None``
1898
1899- Issue #12797: Added custom opener parameter to builtin open() and
1900 FileIO.open().
1901
1902- Issue #10519: Avoid unnecessary recursive function calls in
1903 setobject.c.
1904
1905- Issue #10363: Deallocate global locks in Py_Finalize().
1906
1907- Issue #13018: Fix reference leaks in error paths in dictobject.c.
1908 Patch by Suman Saha.
1909
1910- Issue #13201: Define '==' and '!=' to compare range objects based on
1911 the sequence of values they define (instead of comparing based on
1912 object identity).
1913
1914- Issue #1294232: In a few cases involving metaclass inheritance, the
1915 interpreter would sometimes invoke the wrong metaclass when building a new
1916 class object. These cases now behave correctly. Patch by Daniel Urban.
1917
1918- Issue #12753: Add support for Unicode name aliases and named sequences.
1919 Both ``unicodedata.lookup()`` and '\N{...}' now resolve aliases,
1920 and ``unicodedata.lookup()`` resolves named sequences too.
1921
1922- Issue #12170: The count(), find(), rfind(), index() and rindex() methods
1923 of bytes and bytearray objects now accept an integer between 0 and 255
1924 as their first argument. Patch by Petri Lehtinen.
1925
1926- Issue #12604: VTRACE macro expanded to no-op in _sre.c to avoid compiler
1927 warnings. Patch by Josh Triplett and Petri Lehtinen.
1928
1929- Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
1930 error handlers on all Windows versions. The MBCS codec is now supporting all
1931 error handlers, instead of only replace to encode and ignore to decode.
1932
1933- Issue #13188: When called without an explicit traceback argument,
1934 generator.throw() now gets the traceback from the passed exception's
1935 ``__traceback__`` attribute. Patch by Petri Lehtinen.
1936
1937- Issue #13146: Writing a pyc file is now atomic under POSIX.
1938
1939- Issue #7833: Extension modules built using distutils on Windows will no
1940 longer include a "manifest" to prevent them failing at import time in some
1941 embedded situations.
1942
1943- PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
1944
1945- Add internal API for static strings (_Py_identifier et al.).
1946
1947- Issue #13063: the Windows error ERROR_NO_DATA (numbered 232 and described
1948 as "The pipe is being closed") is now mapped to POSIX errno EPIPE
1949 (previously EINVAL).
1950
1951- Issue #12911: Fix memory consumption when calculating the repr() of huge
1952 tuples or lists.
1953
1954- PEP 393: flexible string representation. Thanks to Torsten Becker for the
1955 initial implementation, and Victor Stinner for various bug fixes.
1956
1957- Issue #14081: The 'sep' and 'maxsplit' parameter to str.split, bytes.split,
1958 and bytearray.split may now be passed as keyword arguments.
1959
1960- Issue #13012: The 'keepends' parameter to str.splitlines may now be passed
1961 as a keyword argument: "my_string.splitlines(keepends=True)". The same
1962 change also applies to bytes.splitlines and bytearray.splitlines.
1963
1964- Issue #7732: Don't open a directory as a file anymore while importing a
1965 module. Ignore the direcotry if its name matchs the module name (e.g.
1966 "__init__.py") and raise a ImportError instead.
1967
1968- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for
1969 finding the bug and providing a patch.
1970
1971- Issue #12973: Fix overflow checks that relied on undefined behaviour in
1972 list_repeat (listobject.c) and islice_next (itertoolsmodule.c). These bugs
1973 caused test failures with recent versions of Clang.
1974
1975- Issue #12904: os.utime, os.futimes, os.lutimes, and os.futimesat now write
1976 atime and mtime with nanosecond precision on modern POSIX platforms.
1977
1978- Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
1979 mapped to POSIX errno ENOTDIR (previously EINVAL).
1980
1981- Issue #9200: The str.is* methods now work with strings that contain non-BMP
1982 characters even in narrow Unicode builds.
1983
1984- Issue #12791: Break reference cycles early when a generator exits with
1985 an exception.
1986
1987- Issue #12773: Make __doc__ mutable on user-defined classes.
1988
1989- Issue #12766: Raise a ValueError when creating a class with a class variable
1990 that conflicts with a name in __slots__.
1991
1992- Issue #12266: Fix str.capitalize() to correctly uppercase/lowercase
1993 titlecased and cased non-letter characters.
1994
1995- Issue #12732: In narrow unicode builds, allow Unicode identifiers which fall
1996 outside the BMP.
1997
1998- Issue #12575: Validate user-generated AST before it is compiled.
1999
2000- Make type(None), type(Ellipsis), and type(NotImplemented) callable. They
2001 return the respective singleton instances.
2002
2003- Forbid summing bytes with sum().
2004
2005- Verify the types of AST strings and identifiers provided by the user before
2006 compiling them.
2007
2008- Issue #12647: The None object now has a __bool__() method that returns False.
2009 Formerly, bool(None) returned False only because of special case logic
2010 in PyObject_IsTrue().
2011
2012- Issue #12579: str.format_map() now raises a ValueError if used on a
2013 format string that contains positional fields. Initial patch by
2014 Julian Berman.
2015
2016- Issue #10271: Allow warnings.showwarning() be any callable.
2017
2018- Issue #11627: Fix segfault when __new__ on a exception returns a
2019 non-exception class.
2020
2021- Issue #12149: Update the method cache after a type's dictionary gets
2022 cleared by the garbage collector. This fixes a segfault when an instance
2023 and its type get caught in a reference cycle, and the instance's
2024 deallocator calls one of the methods on the type (e.g. when subclassing
2025 IOBase). Diagnosis and patch by Davide Rizzo.
2026
2027- Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.
2028
2029- Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
2030 a new HAVE_MBCS define.
2031
2032- Issue #9642: Fix filesystem encoding initialization: use the ANSI code page
2033 on Windows if the mbcs codec is not available, and fail with a fatal error if
2034 we cannot get the locale encoding (if nl_langinfo(CODESET) is not available)
2035 instead of using UTF-8.
2036
2037- When a generator yields, do not retain the caller's exception state on the
2038 generator.
2039
2040- Issue #12475: Prevent generators from leaking their exception state into the
2041 caller's frame as they return for the last time.
2042
2043- Issue #12291: You can now load multiple marshalled objects from a stream,
2044 with other data interleaved between marshalled objects.
2045
2046- Issue #12356: When required positional or keyword-only arguments are not
2047 given, produce a informative error message which includes the name(s) of the
2048 missing arguments.
2049
2050- Issue #12370: Fix super with no arguments when __class__ is overriden in the
2051 class body.
2052
2053- Issue #12084: os.stat on Windows now works properly with relative symbolic
2054 links when called from any directory.
2055
2056- Loosen type restrictions on the __dir__ method. __dir__ can now return any
2057 sequence, which will be converted to a list and sorted by dir().
2058
2059- Issue #12265: Make error messages produced by passing an invalid set of
2060 arguments to a function more informative.
2061
2062- Issue #12225: Still allow Python to build if Python is not in its hg repo or
2063 mercurial is not installed.
2064
2065- Issue #1195: my_fgets() now always clears errors before calling fgets(). Fix
2066 the following case: sys.stdin.read() stopped with CTRL+d (end of file),
2067 raw_input() interrupted by CTRL+c.
2068
2069- Issue #12216: Allow unexpected EOF errors to happen on any line of the file.
2070
2071- Issue #12199: The TryExcept and TryFinally and AST nodes have been unified
2072 into a Try node.
2073
2074- Issue #9670: Increase the default stack size for secondary threads on
2075 Mac OS X and FreeBSD to reduce the chances of a crash instead of a
2076 "maximum recursion depth" RuntimeError exception.
2077 (patch by Ronald Oussoren)
2078
2079- Issue #12106: The use of the multiple-with shorthand syntax is now reflected
2080 in the AST.
2081
2082- Issue #12190: Try to use the same filename object when compiling unmarshalling
2083 a code objects in the same file.
2084
2085- Issue #12166: Move implementations of dir() specialized for various types into
2086 the __dir__() methods of those types.
2087
2088- Issue #5715: In socketserver, close the server socket in the child process.
2089
2090- Correct lookup of __dir__ on objects. Among other things, this causes errors
2091 besides AttributeError found on lookup to be propagated.
2092
2093- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal
2094 module. Patch written by Charles-François Natali.
2095
2096- Issue #1746656: Added the if_nameindex, if_indextoname, if_nametoindex
2097 methods to the socket module.
2098
2099- Issue #12044: Fixed subprocess.Popen when used as a context manager to
2100 wait for the process to end when exiting the context to avoid unintentionally
2101 leaving zombie processes around.
2102
2103- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
2104 clear the end-of-file indicator after CTRL+d.
2105
2106- Issue #1856: Avoid crashes and lockups when daemon threads run while the
2107 interpreter is shutting down; instead, these threads are now killed when
2108 they try to take the GIL.
2109
2110- Issue #9756: When calling a method descriptor or a slot wrapper descriptor,
2111 the check of the object type doesn't read the __class__ attribute anymore.
2112 Fix a crash if a class override its __class__ attribute (e.g. a proxy of the
2113 str type). Patch written by Andreas Stührk.
2114
2115- Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*
2116 APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch
2117 by Charles-François Natali.
2118
2119- Issue #10914: Initialize correctly the filesystem codec when creating a new
2120 subinterpreter to fix a bootstrap issue with codecs implemented in Python, as
2121 the ISO-8859-15 codec.
2122
2123- Issue #11918: OS/2 and VMS are no more supported because of the lack of
2124 maintainer.
2125
2126- Issue #6780: fix starts/endswith error message to mention that tuples are
2127 accepted too.
2128
2129- Issue #5057: fix a bug in the peepholer that led to non-portable pyc files
2130 between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP
2131 chars (e.g. "\U00012345"[0]).
2132
2133- Issue #11845: Fix typo in rangeobject.c that caused a crash in
2134 compute_slice_indices. Patch by Daniel Urban.
2135
2136- Issue #5673: Added a `timeout` keyword argument to subprocess.Popen.wait,
2137 subprocess.Popen.communicated, subprocess.call, subprocess.check_call, and
2138 subprocess.check_output. If the blocking operation takes more than `timeout`
2139 seconds, the `subprocess.TimeoutExpired` exception is raised.
2140
2141- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
2142 (EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
2143 written by Charles-Francois Natali.
2144
2145- Issue #9319: Include the filename in "Non-UTF8 code ..." syntax error.
2146
2147- Issue #10785: Store the filename as Unicode in the Python parser.
2148
2149- Issue #11619: _PyImport_LoadDynamicModule() doesn't encode the path to bytes
2150 on Windows.
2151
2152- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and
2153 Py_DivisionWarningFlag left over from Python 2.
2154
2155- Issue #11244: Remove an unnecessary peepholer check that was preventing
2156 negative zeros from being constant-folded properly.
2157
2158- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on
2159 Windows if the file is a TTY to workaround a Windows bug. The Windows console
2160 returns an error (12: not enough space error) on writing into stdout if
2161 stdout mode is binary and the length is greater than 66,000 bytes (or less,
2162 depending on heap usage).
2163
2164- Issue #11320: fix bogus memory management in Modules/getpath.c, leading to
2165 a possible crash when calling Py_SetPath().
2166
2167- Issue #11432: A bug was introduced in subprocess.Popen on posix systems with
2168 3.2.0 where the stdout or stderr file descriptor being the same as the stdin
2169 file descriptor would raise an exception. webbrowser.open would fail. fixed.
2170
2171- Issue #9856: Change object.__format__ with a non-empty format string
2172 to be a DeprecationWarning. In 3.2 it was a PendingDeprecationWarning.
2173 In 3.4 it will be a TypeError.
2174
2175- Issue #11244: The peephole optimizer is now able to constant-fold
2176 arbitrarily complex expressions. This also fixes a 3.2 regression where
2177 operations involving negative numbers were not constant-folded.
2178
2179- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
2180 there are many tags (e.g. when using mq). Patch by Nadeem Vawda.
2181
2182- Issue #11335: Fixed a memory leak in list.sort when the key function
2183 throws an exception.
2184
2185- Issue #8923: When a string is encoded to UTF-8 in strict mode, the result is
2186 cached into the object. Examples: str.encode(), str.encode('utf-8'),
2187 PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, "utf-8",
2188 NULL).
2189
2190- Issue #10831: PyUnicode_FromFormat() supports %li, %lli and %zi formats.
2191
2192- Issue #10829: Refactor PyUnicode_FromFormat(), use the same function to parse
2193 the format string in the 3 steps, fix crashs on invalid format strings.
2194
2195- Issue #13007: whichdb should recognize gdbm 1.9 magic numbers.
2196
2197- Issue #11246: Fix PyUnicode_FromFormat("%V") to decode the byte string from
2198 UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode).
2199 Patch written by Ray Allen.
2200
2201- Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with
2202 a buffer struct having a NULL data pointer.
2203
2204- Issue #11272: On Windows, input() strips '\r' (and not only '\n'), and
2205 sys.stdin uses universal newline (replace '\r\n' by '\n').
2206
2207- issue #11828: startswith and endswith don't accept None as slice index.
2208 Patch by Torsten Becker.
2209
2210- Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
2211 narrow build.
2212
2213- Issue #11168: Remove filename debug variable from PyEval_EvalFrameEx().
2214 It encoded the Unicode filename to UTF-8, but the encoding fails on
2215 undecodable filename (on surrogate characters) which raises an unexpected
2216 UnicodeEncodeError on recursion limit.
2217
2218- Issue #11187: Remove bootstrap code (use ASCII) of
2219 PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the
2220 locale encoding) in PyUnicode_EncodeFSDefault().
2221
2222- Check for NULL result in PyType_FromSpec.
2223
2224- Issue #10516: New copy() and clear() methods for lists and bytearrays.
2225
2226- Issue #11386: bytearray.pop() now throws IndexError when the bytearray is
2227 empty, instead of OverflowError.
2228
2229- Issue #12380: The rjust, ljust and center methods of bytes and bytearray
2230 now accept a bytearray argument.
2231
2232Library
2233-------
2234
2235- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly
2236 return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been
2237 fixed.
2238
2239- Issue #14166: Pickler objects now have an optional ``dispatch_table``
2240 attribute which allows to set custom per-pickler reduction functions.
2241 Patch by sbt.
2242
2243- Issue #14177: marshal.loads() now raises TypeError when given an unicode
2244 string. Patch by Guilherme Gonçalves.
2245
2246- Issue #13550: Remove the debug machinery from the threading module: remove
2247 verbose arguments from all threading classes and functions.
2248
2249- Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary,
2250 WeakValueDictionary) to return a better approximation when some objects
2251 are dead or dying. Moreover, the implementation is now O(1) rather than
2252 O(n).
2253
2254- Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode.
2255 Patch by Mikhail Novikov.
2256
2257- Issue #11841: Fix comparison bug with 'rc' versions in packaging.version.
2258 Patch by Filip Gruszczyński.
2259
2260- Issue #13447: Add a test file to host regression tests for bugs in the
2261 scripts found in the Tools directory.
2262
2263- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils
2264 on Windows. Also fixed in packaging.
2265
2266- Issue #8033: sqlite3: Fix 64-bit integer handling in user functions
2267 on 32-bit architectures. Initial patch by Philippe Devalkeneer.
2268
2269- HTMLParser is now able to handle slashes in the start tag.
2270
2271- Issue #13641: Decoding functions in the base64 module now accept ASCII-only
2272 unicode strings. Patch by Catalin Iacob.
2273
2274- Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a
2275 new importlib.invalidate_caches() function.
2276
2277- Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in
2278 SimpleXMLRPCServer upon malformed POST request.
2279
2280- Issue #13961: Move importlib over to using os.replace() for atomic renaming.
2281
2282- Do away with ambiguous level values (as suggested by PEP 328) in
2283 importlib.__import__() by raising ValueError when level < 0.
2284
2285- Issue #2489: pty.spawn could consume 100% cpu when it encountered an EOF.
2286
2287- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
2288
2289- Issue #13777: Add PF_SYSTEM sockets on OS X.
2290 Patch by Michael Goderbauer.
2291
2292- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
2293 Patch by Suman Saha.
2294
2295- Issue #1326113: distutils' and packaging's build_ext commands option now
2296 correctly parses multiple values (separated by whitespace or commas) given
2297 to their --libraries option.
2298
2299- Issue #10287: nntplib now queries the server's CAPABILITIES first before
2300 sending MODE READER, and only sends it if not already in READER mode.
2301 Patch by Hynek Schlawack.
2302
2303- Issue #13993: HTMLParser is now able to handle broken end tags when
2304 strict=False.
2305
2306- Issue #13930: lib2to3 now supports writing converted output files to another
2307 directory tree as well as copying unchanged files and altering the file
2308 suffix.
2309
2310- Issue #9750: Fix sqlite3.Connection.iterdump on tables and fields
2311 with a name that is a keyword or contains quotes. Patch by Marko
2312 Kohtala.
2313
2314- Issue #10287: nntplib now queries the server's CAPABILITIES again after
2315 authenticating (since the result may change, according to RFC 4643).
2316 Patch by Hynek Schlawack.
2317
2318- Issue #13989: Document that GzipFile does not support text mode, and give a
2319 more helpful error message when opened with an invalid mode string.
2320
2321- Issue #13590: On OS X 10.7 and 10.6 with Xcode 4.2, building
2322 Distutils-based packages with C extension modules may fail because
2323 Apple has removed gcc-4.2, the version used to build python.org
2324 64-bit/32-bit Pythons. If the user does not explicitly override
2325 the default C compiler by setting the CC environment variable,
2326 Distutils will now attempt to compile extension modules with clang
2327 if gcc-4.2 is required but not found. Also as a convenience, if
2328 the user does explicitly set CC, substitute its value as the default
2329 compiler in the Distutils LDSHARED configuration variable for OS X.
2330 (Note, the python.org 32-bit-only Pythons use gcc-4.0 and the 10.4u
2331 SDK, neither of which are available in Xcode 4. This change does not
2332 attempt to override settings to support their use with Xcode 4.)
2333
2334- Issue #13960: HTMLParser is now able to handle broken comments when
2335 strict=False.
2336
2337- Issue #13921: Undocument and clean up sqlite3.OptimizedUnicode,
2338 which is obsolete in Python 3.x. It's now aliased to str for
2339 backwards compatibility.
2340
2341- When '' is a path (e.g. in sys.path), make sure __file__ uses the current
2342 working directory instead of '' in importlib.
2343
2344- Issue #13609: Add two functions to query the terminal size:
2345 os.get_terminal_size (low level) and shutil.get_terminal_size (high level).
2346 Patch by Zbigniew Jędrzejewski-Szmek.
2347
2348- Issue #13845: On Windows, time.time() now uses GetSystemTimeAsFileTime()
2349 instead of ftime() to have a resolution of 100 ns instead of 1 ms (the clock
2350 accuracy is between 0.5 ms and 15 ms).
2351
2352- Issue #13846: Add time.monotonic(), monotonic clock.
2353
2354- Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on
2355 Connection sockets, and set FILE_FLAG_FIRST_PIPE_INSTANCE on named pipes, to
2356 make sure two listeners can't bind to the same socket/pipe (or any existing
2357 socket/pipe).
2358
2359- Issue #9021: Add an introduction to the copy module documentation.
2360
2361- Issue #6005: Examples in the socket library documentation use sendall, where
2362 relevant, instead send method.
2363
2364- Issue #10811: Fix recursive usage of cursors. Instead of crashing,
2365 raise a ProgrammingError now.
2366
2367- Issue #10881: Fix test_site failure with OS X framework builds.
2368
2369- Issue #964437: Make IDLE help window non-modal.
2370 Patch by Guilherme Polo and Roger Serwy.
2371
2372- Issue #13734: Add os.fwalk(), a directory walking function yielding file
2373 descriptors.
2374
2375- Issue #2945: Make the distutils upload command aware of bdist_rpm products.
2376
2377- Issue #13712: pysetup create should not convert package_data to extra_files.
2378
2379- Issue #11805: package_data in setup.cfg should allow more than one value.
2380
2381- Issue #13933: IDLE auto-complete did not work with some imported
2382 module, like hashlib. (Patch by Roger Serwy)
2383
2384- Issue #13901: Prevent test_distutils failures on OS X with --enable-shared.
2385
2386- Issue #13676: Handle strings with embedded zeros correctly in sqlite3.
2387
2388- Issue #13506: Add '' to path for IDLE Shell when started and restarted with Restart Shell.
2389 Original patches by Marco Scataglini and Roger Serwy.
2390
2391- Issue #8828: Add new function os.replace(), for cross-platform renaming
2392 with overwriting.
2393
2394- Issue #13848: open() and the FileIO constructor now check for NUL
2395 characters in the file name. Patch by Hynek Schlawack.
2396
2397- Issue #13806: The size check in audioop decompression functions was too
2398 strict and could reject valid compressed data. Patch by Oleg Plakhotnyuk.
2399
2400- Issue #13812: When a multiprocessing Process child raises an exception,
2401 flush stderr after printing the exception traceback.
2402
2403- Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC
2404 IV attack countermeasure.
2405
2406- Issue #13847: time.localtime() and time.gmtime() now raise an OSError instead
2407 of ValueError on failure. time.ctime() and time.asctime() now raises an
2408 OSError if localtime() failed. time.clock() now raises a RuntimeError if the
2409 processor time used is not available or its value cannot be represented
2410
2411- Issue #13862: Fix spurious failure in test_zlib due to runtime/compile time
2412 minor versions not matching.
2413
2414- Issue #12804: Fix test_socket and test_urllib2net failures when running tests
2415 on a system without internet access.
2416
2417- Issue #13772: In os.symlink() under Windows, do not try to guess the link
2418 target's type (file or directory). The detection was buggy and made the
2419 call non-atomic (therefore prone to race conditions).
2420
2421- Issue #6631: Disallow relative file paths in urllib urlopen methods.
2422
2423- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
2424 registry.
2425
2426- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
2427 opening for writing using a fileobj returned by os.fdopen().
2428
2429- Issue #13803: Under Solaris, distutils doesn't include bitness
2430 in the directory name.
2431
2432- Issue #10278: Add time.wallclock() function, monotonic clock.
2433
2434- Issue #13809: Fix regression where bz2 module wouldn't work when threads are
2435 disabled. Original patch by Amaury Forgeot d'Arc.
2436
2437- Issue #13589: Fix some serialization primitives in the aifc module.
2438 Patch by Oleg Plakhotnyuk.
2439
2440- Issue #13642: Unquote before b64encoding user:password during Basic
2441 Authentication. Patch contributed by Joonas Kuorilehto.
2442
2443- Issue #13726: Fix the ambiguous -S flag in regrtest. It is -o/--slow for slow
2444 tests.
2445
2446- Issue #12364: Fix a hang in concurrent.futures.ProcessPoolExecutor.
2447 The hang would occur when retrieving the result of a scheduled future after
2448 the executor had been shut down.
2449
2450- Issue #13502: threading: Fix a race condition in Event.wait() that made it
2451 return False when the event was set and cleared right after.
2452
2453- Issue #9993: When the source and destination are on different filesystems,
2454 and the source is a symlink, shutil.move() now recreates a symlink on the
2455 destination instead of copying the file contents. Patch by Jonathan Niehof
2456 and Hynek Schlawack.
2457
2458- Issue #12926: Fix a bug in tarfile's link extraction.
2459
2460- Issue #13696: Fix the 302 Relative URL Redirection problem.
2461
2462- Issue #13636: Weak ciphers are now disabled by default in the ssl module
2463 (except when SSLv2 is explicitly asked for).
2464
2465- Issue #12715: Add an optional symlinks argument to shutil functions
2466 (copyfile, copymode, copystat, copy, copy2). When that parameter is
2467 true, symlinks aren't dereferenced and the operation instead acts on the
2468 symlink itself (or creates one, if relevant). Patch by Hynek Schlawack.
2469
2470- Add a flags parameter to select.epoll.
2471
2472- Issue #12798: Updated the mimetypes documentation.
2473
2474- Issue #13626: Add support for SSL Diffie-Hellman key exchange, through the
2475 SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
2476
2477- Issue #11006: Don't issue low level warning in subprocess when pipe2() fails.
2478
2479- Issue #13620: Support for Chrome browser in webbrowser. Patch contributed
2480 by Arnaud Calmettes.
2481
2482- Issue #11829: Fix code execution holes in inspect.getattr_static for
2483 metaclasses with metaclasses. Patch by Andreas Stührk.
2484
2485- Issue #12708: Add starmap() and starmap_async() methods (similar to
2486 itertools.starmap()) to multiprocessing.Pool. Patch by Hynek Schlawack.
2487
2488- Issue #1785: Fix inspect and pydoc with misbehaving descriptors.
2489
2490- Issue #13637: "a2b" functions in the binascii module now accept ASCII-only
2491 unicode strings.
2492
2493- Issue #13634: Add support for querying and disabling SSL compression.
2494
2495- Issue #13627: Add support for SSL Elliptic Curve-based Diffie-Hellman
2496 key exchange, through the SSLContext.set_ecdh_curve() method and the
2497 ssl.OP_SINGLE_ECDH_USE option.
2498
2499- Issue #13635: Add ssl.OP_CIPHER_SERVER_PREFERENCE, so that SSL servers
2500 choose the cipher based on their own preferences, rather than on the
2501 client's.
2502
2503- Issue #11813: Fix inspect.getattr_static for modules. Patch by Andreas
2504 Stührk.
2505
2506- Issue #7502: Fix equality comparison for DocTestCase instances. Patch by
2507 Cédric Krier.
2508
2509- Issue #11870: threading: Properly reinitialize threads internal locks and
2510 condition variables to avoid deadlocks in child processes.
2511
2512- Issue #8035: urllib: Fix a bug where the client could remain stuck after a
2513 redirection or an error.
2514
2515- Issue #13560: os.strerror() now uses the current locale encoding instead of
2516 UTF-8.
2517
2518- Issue #13560: Add PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
2519 and PyUnicode_EncodeLocale() functions to the C API to decode/encode from/to
2520 the current locale encoding.
2521
2522- Issue #8373: The filesystem path of AF_UNIX sockets now uses the filesystem
2523 encoding and the surrogateescape error handler, rather than UTF-8. Patch
2524 by David Watson.
2525
2526- Issue #10350: Read and save errno before calling a function which might
2527 overwrite it. Original patch by Hallvard B Furuseth.
2528
2529- Issue #11610: Introduce a more general way to declare abstract properties.
2530
2531- Issue #13591: A bug in importlib has been fixed that caused import_module
2532 to load a module twice.
2533
2534- Issue #4625: If IDLE cannot write to its recent file or breakpoint files,
2535 display a message popup and continue rather than crash. Original patch by
2536 Roger Serwy.
2537
2538- Issue #13449 sched.scheduler.run() method has a new "blocking" parameter which
2539 when set to False makes run() execute the scheduled events due to expire
2540 soonest (if any) and then return. Patch by Giampaolo Rodolà.
2541
2542- Issue #8684 sched.scheduler class can be safely used in multi-threaded
2543 environments. Patch by Josiah Carlson and Giampaolo Rodolà.
2544
2545- Alias resource.error to OSError ala PEP 3151.
2546
2547- Issue #5689: Add support for lzma compression to the tarfile module.
2548
2549- Issue #13248: Turn 3.2's PendingDeprecationWarning into 3.3's
2550 DeprecationWarning. It covers 'cgi.escape', 'importlib.abc.PyLoader',
2551 'importlib.abc.PyPycLoader', 'nntplib.NNTP.xgtitle', 'nntplib.NNTP.xpath',
2552 and private attributes of 'smtpd.SMTPChannel'.
2553
2554- Issue #5905, #13560: time.strftime() is now using the current locale
2555 encoding, instead of UTF-8, if the wcsftime() function is not available.
2556
2557- Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..".
2558 Patch by Tal Einat.
2559
2560- Issue #13464: Add a readinto() method to http.client.HTTPResponse. Patch
2561 by Jon Kuhn.
2562
2563- tarfile.py: Correctly detect bzip2 compressed streams with blocksizes
2564 other than 900k.
2565
2566- Issue #13439: Fix many errors in turtle docstrings.
2567
2568- Issue #6715: Add a module 'lzma' for compression using the LZMA algorithm.
2569 Thanks to Per Øyvind Karlsen for the initial implementation.
2570
2571- Issue #13487: Make inspect.getmodule robust against changes done to
2572 sys.modules while it is iterating over it.
2573
2574- Issue #12618: Fix a bug that prevented py_compile from creating byte
2575 compiled files in the current directory. Initial patch by Sjoerd de Vries.
2576
2577- Issue #13444: When stdout has been closed explicitly, we should not attempt
2578 to flush it at shutdown and print an error.
2579
2580- Issue #12567: The curses module uses Unicode functions for Unicode arguments
2581 when it is linked to the ncurses library. It encodes also Unicode strings to
2582 the locale encoding instead of UTF-8.
2583
2584- Issue #12856: Ensure child processes do not inherit the parent's random
2585 seed for filename generation in the tempfile module. Patch by Brian
2586 Harring.
2587
2588- Issue #9957: SpooledTemporaryFile.truncate() now accepts an optional size
2589 parameter, as other file-like objects. Patch by Ryan Kelly.
2590
2591- Issue #13458: Fix a memory leak in the ssl module when decoding a
2592 certificate with a subjectAltName. Patch by Robert Xiao.
2593
2594- Issue #13415: os.unsetenv() doesn't ignore errors anymore.
2595
2596- Issue #13245: sched.scheduler class constructor's timefunc and
2597 delayfunct parameters are now optional.
2598 scheduler.enter and scheduler.enterabs methods gained a new kwargs parameter.
2599 Patch contributed by Chris Clark.
2600
2601- Issue #12328: Under Windows, refactor handling of Ctrl-C events and
2602 make _multiprocessing.win32.WaitForMultipleObjects interruptible when
2603 the wait_flag parameter is false. Patch by sbt.
2604
2605- Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError is
2606 raised when the wrapped raw file is non-blocking and the write would block.
2607 Previous code assumed that the raw write() would raise BlockingIOError, but
2608 RawIOBase.write() is defined to returned None when the call would block.
2609 Patch by sbt.
2610
2611- Issue #13358: HTMLParser now calls handle_data only once for each CDATA.
2612
2613- Issue #4147: minidom's toprettyxml no longer adds whitespace around a text
2614 node when it is the only child of an element. Initial patch by Dan
2615 Kenigsberg.
2616
2617- Issue #13374: The Windows bytes API has been deprecated in the os module. Use
2618 Unicode filenames instead of bytes filenames to not depend on the ANSI code
2619 page anymore and to support any filename.
2620
2621- Issue #13297: Use bytes type to send and receive binary data through XMLRPC.
2622
2623- Issue #6397: Support "/dev/poll" polling objects in select module,
2624 under Solaris & derivatives.
2625
2626- Issues #1745761, #755670, #13357, #12629, #1200313: HTMLParser now correctly
2627 handles non-valid attributes, including adjacent and unquoted attributes.
2628
2629- Issue #13193: Fix distutils.filelist.FileList and packaging.manifest.Manifest
2630 under Windows.
2631
2632- Issue #13384: Remove unnecessary __future__ import in Lib/random.py
2633
2634- Issue #13149: Speed up append-only StringIO objects.
2635
2636- Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
2637 when called with a timeout. Patch by Arnaud Ysmal.
2638
2639- Issue #13254: Fix Maildir initialization so that maildir contents
2640 are read correctly.
2641
2642- Issue #3067: locale.setlocale() now raises TypeError if the second
2643 argument is an invalid iterable. Its documentation and docstring
2644 were also updated. Initial patch by Jyrki Pulliainen.
2645
2646- Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.
2647
2648- Issue #13339: Fix compile error in posixmodule.c due to missing semicolon.
2649 Thanks to Robert Xiao.
2650
2651- Byte compilation in packaging is now isolated from the calling Python -B or
2652 -O options, instead of being disallowed under -B or buggy under -O.
2653
2654- Issue #10570: curses.putp() and curses.tparm() are now expecting a byte
2655 string, instead of a Unicode string.
2656
2657- Issue #13295: http.server now produces valid HTML 4.01 strict.
2658
2659- Issue #2892: preserve iterparse events in case of SyntaxError.
2660
2661- Issue #13287: urllib.request and urllib.error now contains an __all__
2662 attribute to expose only relevant classes and functions. Patch by Florent
2663 Xicluna.
2664
2665- Issue #670664: Fix HTMLParser to correctly handle the content of
2666 ``<script>...</script>`` and ``<style>...</style>``.
2667
2668- Issue #10817: Fix urlretrieve function to raise ContentTooShortError even
2669 when reporthook is None. Patch by Jyrki Pulliainen.
2670
2671- Issue #13296: Fix IDLE to clear compile __future__ flags on shell restart.
2672 (Patch by Roger Serwy)
2673
2674- Fix the xmlrpc.client user agent to return something similar to
2675 urllib.request user agent: "Python-xmlrpc/3.3".
2676
2677- Issue #13293: Better error message when trying to marshal bytes using
2678 xmlrpc.client.
2679
2680- Issue #13291: NameError in xmlrpc package.
2681
2682- Issue #13258: Use callable() built-in in the standard library.
2683
2684- Issue #13273: fix a bug that prevented HTMLParser to properly detect some
2685 tags when strict=False.
2686
2687- Issue #11183: Add finer-grained exceptions to the ssl module, so that
2688 you don't have to inspect the exception's attributes in the common case.
2689
2690- Issue #13216: Add cp65001 codec, the Windows UTF-8 (CP_UTF8).
2691
2692- Issue #13226: Add RTLD_xxx constants to the os module. These constants can be
2693 used with sys.setdlopenflags().
2694
2695- Issue #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants to
2696 the time module. time.clock_gettime(time.CLOCK_MONOTONIC) provides a
2697 monotonic clock
2698
2699- Issue #10332: multiprocessing: fix a race condition when a Pool is closed
2700 before all tasks have completed.
2701
2702- Issue #13255: wrong docstrings in array module.
2703
2704- Issue #8540: Remove deprecated Context._clamp attribute in Decimal module.
2705
2706- Issue #13235: Added PendingDeprecationWarning to warn() method and function.
2707
2708- Issue #9168: now smtpd is able to bind privileged port.
2709
2710- Issue #12529: fix cgi.parse_header issue on strings with double-quotes and
2711 semicolons together. Patch by Ben Darnell and Petri Lehtinen.
2712
2713- Issue #13227: functools.lru_cache() now has a option to distinguish
2714 calls with different argument types.
2715
2716- Issue #6090: zipfile raises a ValueError when a document with a timestamp
2717 earlier than 1980 is provided. Patch contributed by Petri Lehtinen.
2718
2719- Issue #13150: sysconfig no longer parses the Makefile and config.h files
2720 when imported, instead doing it at build time. This makes importing
2721 sysconfig faster and reduces Python startup time by 20%.
2722
2723- Issue #12448: smtplib now flushes stdout while running ``python -m smtplib``
2724 in order to display the prompt correctly.
2725
2726- Issue #12454: The mailbox module is now using ASCII, instead of the locale
2727 encoding, to read and write MH mailboxes (.mh_sequences files).
2728
2729- Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
2730 now available on Windows.
2731
2732- issue #1673007: urllib2 to support HEAD request via new method argument.
2733 Patch contributions by David Stanek, Patrick Westerhoff and Ezio Melotti.
2734
2735- Issue #12386: packaging does not fail anymore when writing the RESOURCES
2736 file.
2737
2738- Issue #13158: Fix decoding and encoding of GNU tar specific base-256 number
2739 fields in tarfile.
2740
2741- Issue #13025: mimetypes is now reading MIME types using the UTF-8 encoding,
2742 instead of the locale encoding.
2743
2744- Issue #10653: On Windows, use strftime() instead of wcsftime() because
2745 wcsftime() doesn't format time zone correctly.
2746
2747- Issue #13150: The tokenize module doesn't compile large regular expressions
2748 at startup anymore.
2749
2750- Issue #11171: Fix distutils.sysconfig.get_makefile_filename when Python was
2751 configured with different prefix and exec-prefix.
2752
2753- Issue #11254: Teach distutils and packaging to compile .pyc and .pyo files in
2754 PEP 3147-compliant __pycache__ directories.
2755
2756- Issue #7367: Fix pkgutil.walk_paths to skip directories whose
2757 contents cannot be read.
2758
2759- Issue #3163: The struct module gets new format characters 'n' and 'N'
2760 supporting C integer types ``ssize_t`` and ``size_t``, respectively.
2761
2762- Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
2763 Reported and diagnosed by Thomas Kluyver.
2764
2765- Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
2766 if the underlying raw stream is unseekable, even if the seek could be
2767 satisfied using the internal buffer. Patch by John O'Connor.
2768
2769- Issue #7689: Allow pickling of dynamically created classes when their
2770 metaclass is registered with copyreg. Patch by Nicolas M. Thiéry and Craig
2771 Citro.
2772
2773- Issue #4147: minidom's toprettyxml no longer adds whitespace to text nodes.
2774
2775- Issue #13034: When decoding some SSL certificates, the subjectAltName
2776 extension could be unreported.
2777
2778- Issue #9871: Prevent IDLE 3 crash when given byte stings
2779 with invalid hex escape sequences, like b'\x0'.
2780 (Original patch by Claudiu Popa.)
2781
2782- Issue #12306: Expose the runtime version of the zlib C library as a constant,
2783 ZLIB_RUNTIME_VERSION, in the zlib module. Patch by Torsten Landschoff.
2784
2785- Issue #12959: Add collections.ChainMap to collections.__all__.
2786
2787- Issue #8933: distutils' PKG-INFO files and packaging's METADATA files will
2788 now correctly report Metadata-Version: 1.1 instead of 1.0 if a Classifier or
2789 Download-URL field is present.
2790
2791- Issue #12567: Add curses.unget_wch() function. Push a character so the next
2792 get_wch() will return it.
2793
2794- Issue #9561: distutils and packaging now writes egg-info files using UTF-8,
2795 instead of the locale encoding.
2796
2797- Issue #8286: The distutils command sdist will print a warning message instead
2798 of crashing when an invalid path is given in the manifest template.
2799
2800- Issue #12841: tarfile unnecessarily checked the existence of numerical user
2801 and group ids on extraction. If one of them did not exist the respective id
2802 of the current user (i.e. root) was used for the file and ownership
2803 information was lost.
2804
2805- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
2806 more than 128 entities. Patch by Peter Otten.
2807
2808- Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses.
2809
2810- Issue #12636: IDLE reads the coding cookie when executing a Python script.
2811
2812- Issue #12494: On error, call(), check_call(), check_output() and
2813 getstatusoutput() functions of the subprocess module now kill the process,
2814 read its status (to avoid zombis) and close pipes.
2815
2816- Issue #12720: Expose low-level Linux extended file attribute functions in os.
2817
2818- Issue #10946: The distutils commands bdist_dumb, bdist_wininst and bdist_msi
2819 now respect a --skip-build option given to bdist. The packaging commands
2820 were fixed too.
2821
2822- Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
2823 the C pickle implementation.
2824
2825- Issue #11564: Avoid crashes when trying to pickle huge objects or containers
2826 (more than 2**31 items). Instead, in most cases, an OverflowError is raised.
2827
2828- Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
2829 greater than FD_SETSIZE.
2830
2831- Issue #12839: Fix crash in zlib module due to version mismatch.
2832 Fix by Richard M. Tew.
2833
2834- Issue #9923: The mailcap module now correctly uses the platform path
2835 separator for the MAILCAP environment variable on non-POSIX platforms.
2836
2837- Issue #12835: Follow up to #6560 that unconditionally prevents use of the
2838 unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets. Patch by David
2839 Watson.
2840
2841- Issue #12803: SSLContext.load_cert_chain() now accepts a password argument
2842 to be used if the private key is encrypted. Patch by Adam Simpkins.
2843
2844- Issue #11657: Fix sending file descriptors over 255 over a multiprocessing
2845 Pipe.
2846
2847- Issue #12811: tabnanny.check() now promptly closes checked files. Patch by
2848 Anthony Briggs.
2849
2850- Issue #6560: The sendmsg/recvmsg API is now exposed by the socket module
2851 when provided by the underlying platform, supporting processing of
2852 ancillary data in pure Python code. Patch by David Watson and Heiko Wundram.
2853
2854- Issue #12326: On Linux, sys.platform doesn't contain the major version
2855 anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending
2856 on the Linux version used to build Python.
2857
2858- Issue #12213: Fix a buffering bug with interleaved reads and writes that
2859 could appear on BufferedRandom streams.
2860
2861- Issue #12778: Reduce memory consumption when JSON-encoding a large
2862 container of many small objects.
2863
2864- Issue #12650: Fix a race condition where a subprocess.Popen could leak
2865 resources (FD/zombie) when killed at the wrong time.
2866
2867- Issue #12744: Fix inefficient representation of integers between 2**31 and
2868 2**63 on systems with a 64-bit C "long".
2869
2870- Issue #12646: Add an 'eof' attribute to zlib.Decompress, to make it easier to
2871 detect truncated input streams.
2872
2873- Issue #11513: Fix exception handling ``tarfile.TarFile.gzopen()`` when
2874 the file cannot be opened.
2875
2876- Issue #12687: Fix a possible buffering bug when unpickling text mode
2877 (protocol 0, mostly) pickles.
2878
2879- Issue #10087: Fix the html output format of the calendar module.
2880
2881- Issue #12540: Prevent zombie IDLE processes on Windows due to changes
2882 in os.kill().
2883
R David Murray3dc23d42012-10-06 16:30:46 -04002884- Issue #13121: add support for inplace math operators to collections.Counter.
2885
2886- Add support for unary plus and unary minus to collections.Counter.
Georg Brandl86dc7322012-10-01 18:58:45 +02002887
2888- Issue #12683: urlparse updated to include svn as schemes that uses relative
2889 paths. (svn from 1.5 onwards support relative path).
2890
2891- Issue #12655: Expose functions from sched.h in the os module: sched_yield(),
2892 sched_setscheduler(), sched_getscheduler(), sched_setparam(),
2893 sched_get_min_priority(), sched_get_max_priority(), sched_rr_get_interval(),
2894 sched_getaffinity(), sched_setaffinity().
2895
2896- Add ThreadError to threading.__all__.
2897
2898- Issues #11104, #8688: Fix the behavior of distutils' sdist command with
2899 manually-maintained MANIFEST files.
2900
2901- Issue #11281: smtplib.STMP gets source_address parameter, which adds the
2902 ability to bind to specific source address on a machine with multiple
2903 interfaces. Patch by Paulo Scardine.
2904
2905- Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow
2906 symlinks: fix it. Patch by Petri Lehtinen.
2907
2908- Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod')
2909 in Python code) now finds the doc of the method.
2910
R David Murrayd9c6ab42012-10-06 14:38:17 -04002911- Issue #10968: Remove indirection in threading. The public names (Event,
Georg Brandl86dc7322012-10-01 18:58:45 +02002912 Condition, etc.) used to be factory functions returning instances of hidden
R David Murrayd9c6ab42012-10-06 14:38:17 -04002913 classes (_Event, _Condition, etc.), because (if Guido recalls correctly) this
2914 code pre-dates the ability to subclass extension types. It is now possible
2915 to inherit from these classes without having to import the private
Georg Brandl86dc7322012-10-01 18:58:45 +02002916 underscored names like multiprocessing did.
2917
2918- Issue #9723: Add shlex.quote functions, to escape filenames and command
2919 lines.
2920
2921- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
2922
2923- Issue #12514: Use try/finally to assure the timeit module restores garbage
2924 collections when it is done.
2925
2926- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
2927 given as a low fd, it gets overwritten.
2928
2929- Issue #12590: IDLE editor window now always displays the first line
2930 when opening a long file. With Tk 8.5, the first line was hidden.
2931
2932- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates)
2933 Connection:close header.
2934
2935- Issue #12102: Document that buffered files must be flushed before being used
2936 with mmap. Patch by Steffen Daode Nurpmeso.
2937
2938- Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
2939
2940- Issue #1813: Fix codec lookup under Turkish locales.
2941
2942- Issue #12591: Improve support of "universal newlines" in the subprocess
2943 module: the piped streams can now be properly read from or written to.
2944
2945- Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
2946 a read1() method), and add a *write_through* parameter to mandate
2947 unbuffered writes.
2948
2949- Issue #10883: Fix socket leaks in urllib.request when using FTP.
2950
2951- Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
2952
2953- Issue #12372: POSIX semaphores are broken on AIX: don't use them.
2954
2955- Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
2956 to get channel binding data for the current SSL session (only the
2957 "tls-unique" channel binding is implemented). This allows the implementation
2958 of certain authentication mechanisms such as SCRAM-SHA-1-PLUS. Patch by
2959 Jacek Konieczny.
2960
2961- Issue #665194: email.utils now has format_datetime and parsedate_to_datetime
2962 functions, allowing for round tripping of RFC2822 format dates.
2963
2964- Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2
2965 directory, so that "import DLFCN" and other similar imports work on
2966 Linux 3.0.
2967
2968- Issue #7484: smtplib no longer puts <> around addresses in VRFY and EXPN
2969 commands; they aren't required and in fact postfix doesn't support that form.
2970
2971- Issue #12273: Remove ast.__version__. AST changes can be accounted for by
2972 checking sys.version_info or sys._mercurial.
2973
2974- Silence spurious "broken pipe" tracebacks when shutting down a
2975 ProcessPoolExecutor.
2976
2977- Fix potential resource leaks in concurrent.futures.ProcessPoolExecutor
2978 by joining all queues and processes when shutdown() is called.
2979
2980- Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by
2981 Andreas Stührk.
2982
2983- Issue #11321: Fix a crash with multiple imports of the _pickle module when
2984 embedding Python. Patch by Andreas Stührk.
2985
2986- Issue #6755: Add get_wch() method to curses.window class. Patch by Iñigo
2987 Serna.
2988
2989- Add cgi.closelog() function to close the log file.
2990
2991- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
2992
2993- Issue #4376: ctypes now supports nested structures in a endian different than
2994 the parent structure. Patch by Vlad Riscutia.
2995
2996- Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a
2997 TextIOWrapper to a huge value, not TypeError.
2998
2999- Issue #12504: Close file handles in a timely manner in packaging.database.
3000 This fixes a bug with the remove (uninstall) feature on Windows.
3001
3002- Issues #12169 and #10510: Factor out code used by various packaging commands
3003 to make HTTP POST requests, and make sure it uses CRLF.
3004
3005- Issue #12016: Multibyte CJK decoders now resynchronize faster. They only
3006 ignore the first byte of an invalid byte sequence. For example,
3007 b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of '\ufffd'.
3008
3009- Issue #12459: time.sleep() now raises a ValueError if the sleep length is
3010 negative, instead of an infinite sleep on Windows or raising an IOError on
3011 Linux for example, to have the same behaviour on all platforms.
3012
3013- Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support
3014 Python scripts using a encoding different than UTF-8 (read the coding cookie
3015 of the script).
3016
3017- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
3018 if the process has only one pipe.
3019
3020- Issue #12467: warnings: fix a race condition if a warning is emitted at
3021 shutdown, if globals()['__file__'] is None.
3022
3023- Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
3024 instead of text mode using the locale encoding, to avoid encoding issues.
3025
3026- Issue #12451: runpy: run_path() now opens the Python script in binary mode,
3027 instead of text mode using the locale encoding, to support other encodings
3028 than UTF-8 (scripts using the coding cookie).
3029
3030- Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead
3031 of the text mode (using the locale encoding) to avoid encoding issues.
3032
3033- Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better
3034 conformance to the RFCs: correctly handle Sender and Resent- headers.
3035
3036- Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
3037 the garbage collector while the Heap lock is held.
3038
R David Murray8155ff42012-10-02 18:26:31 -04003039- Issue #12462: time.sleep() now immediately calls the (Python) signal handler
Georg Brandl86dc7322012-10-01 18:58:45 +02003040 if it is interrupted by a signal, instead of having to wait until the next
3041 instruction.
3042
3043- Issue #12442: new shutil.disk_usage function, providing total, used and free
3044 disk space statistics.
3045
3046- Issue #12451: The XInclude default loader of xml.etree now decodes files from
3047 UTF-8 instead of the locale encoding if the encoding is not specified. It now
3048 also opens XML files for the parser in binary mode instead of the text mode
3049 to avoid encoding issues.
3050
3051- Issue #12451: doctest.debug_script() doesn't create a temporary file
3052 anymore to avoid encoding issues.
3053
3054- Issue #12451: pydoc.synopsis() now reads the encoding cookie if available,
3055 to read the Python script from the right encoding.
3056
3057- Issue #12451: distutils now opens the setup script in binary mode to read the
3058 encoding cookie, instead of opening it in UTF-8.
3059
3060- Issue #9516: On Mac OS X, change Distutils to no longer globally attempt to
3061 check or set the MACOSX_DEPLOYMENT_TARGET environment variable for the
3062 interpreter process. This could cause failures in non-Distutils subprocesses
3063 and was unreliable since tests or user programs could modify the interpreter
3064 environment after Distutils set it. Instead, have Distutils set the the
3065 deployment target only in the environment of each build subprocess. It is
3066 still possible to globally override the default by setting
3067 MACOSX_DEPLOYMENT_TARGET before launching the interpreter; its value must be
3068 greater or equal to the default value, the value with which the interpreter
3069 was built. Also, implement the same handling in packaging.
3070
3071- Issue #12422: In the copy module, don't store objects that are their own copy
3072 in the memo dict.
3073
3074- Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module.
3075
3076- Issue #12404: Remove C89 incompatible code from mmap module. Patch by Akira
3077 Kitada.
3078
3079- Issue #1874: email now detects and reports as a defect the presence of
3080 any CTE other than 7bit, 8bit, or binary on a multipart.
3081
3082- Issue #12383: Fix subprocess module with env={}: don't copy the environment
3083 variables, start with an empty environment.
3084
3085- Issue #11637: Fix support for importing packaging setup hooks from the
3086 project directory.
3087
3088- Issue #6771: Moved the curses.wrapper function from the single-function
3089 wrapper module into __init__, eliminating the module. Since __init__ was
3090 already importing the function to curses.wrapper, there is no API change.
3091
3092- Issue #11584: email.header.decode_header no longer fails if the header
3093 passed to it is a Header object, and Header/make_header no longer fail
3094 if given binary unknown-8bit input.
3095
3096- Issue #11700: mailbox proxy object close methods can now be called multiple
3097 times without error.
3098
3099- Issue #11767: Correct file descriptor leak in mailbox's __getitem__ method.
3100
3101- Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the HTTP
3102 connection if its getresponse() method fails with a socket error. Patch
3103 written by Ezio Melotti.
3104
3105- Issue #12240: Allow multiple setup hooks in packaging's setup.cfg files.
3106 Original patch by Erik Bray.
3107
3108- Issue #9284: Allow inspect.findsource() to find the source of doctest
3109 functions.
3110
3111- Issue #11595: Fix assorted bugs in packaging.util.cfg_to_args, a
3112 compatibility helper for the distutils-packaging transition. Original patch
3113 by Erik Bray.
3114
3115- Issue #12287: In ossaudiodev, check that the device isn't closed in several
3116 methods.
3117
3118- Issue #12009: Fixed regression in netrc file comment handling.
3119
3120- Issue #12246: Warn and fail when trying to install a third-party project from
3121 an uninstalled Python (built in a source checkout). Original patch by
3122 Tshepang Lekhonkhobe.
3123
3124- Issue #10694: zipfile now ignores garbage at the end of a zipfile.
3125
3126- Issue #12283: Fixed regression in smtplib quoting of leading dots in DATA.
3127
3128- Issue #10424: Argparse now includes the names of the missing required
3129 arguments in the missing arguments error message.
3130
3131- Issue #12168: SysLogHandler now allows NUL termination to be controlled using
3132 a new 'append_nul' attribute on the handler.
3133
3134- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
3135 instead of os.stat.
3136
3137- Issue #12021: Make mmap's read() method argument optional. Patch by Petri
3138 Lehtinen.
3139
3140- Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed
3141 children and raises BrokenProcessPool in such a situation. Previously it
3142 would reliably freeze/deadlock.
3143
3144- Issue #12040: Expose a new attribute ``sentinel`` on instances of
3145 ``multiprocessing.Process``. Also, fix Process.join() to not use polling
3146 anymore, when given a timeout.
3147
3148- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the
3149 smtplib module. Patch by Catalin Iacob.
3150
3151- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
3152 to compute.
3153
3154- Issue #12221: Remove __version__ attributes from pyexpat, pickle, tarfile,
3155 pydoc, tkinter, and xml.parsers.expat. This were useless version constants
3156 left over from the Mercurial transition
3157
3158- Named tuples now work correctly with vars().
3159
3160- Issue #12085: Fix an attribute error in subprocess.Popen destructor if the
3161 constructor has failed, e.g. because of an undeclared keyword argument. Patch
3162 written by Oleg Oshmyan.
3163
3164- Issue #12028: Make threading._get_ident() public, rename it to
3165 threading.get_ident() and document it. This function was already used using
3166 _thread.get_ident().
3167
3168- Issue #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls
3169 encreset() instead of decreset().
3170
3171- Issue #12218: Removed wsgiref.egg-info.
3172
3173- Issue #12196: Add pipe2() to the os module.
3174
3175- Issue #985064: Make plistlib more resilient to faulty input plists.
3176 Patch by Mher Movsisyan.
3177
3178- Issue #1625: BZ2File and bz2.decompress() now support multi-stream files.
3179 Initial patch by Nir Aides.
3180
3181- Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available.
3182
3183- Issue #12175: FileIO.readall() now only reads the file position and size
3184 once.
3185
3186- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
3187
3188- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
3189 if the file is closed.
3190
R David Murray6e7bd652012-10-01 21:47:57 -04003191- Issue #11109: New service_action method for BaseServer, used by ForkingMixIn
3192 class for cleanup. Initial Patch by Justin Warkentin.
Georg Brandl86dc7322012-10-01 18:58:45 +02003193
3194- Issue #12045: Avoid duplicate execution of command in
3195 ctypes.util._get_soname(). Patch by Sijin Joseph.
3196
3197- Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
3198 pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
3199 server.
3200
3201- Issue #1441530: In imaplib, read the data in one chunk to speed up large
3202 reads and simplify code.
3203
3204- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
3205 correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
3206
3207- Issue #12100: Don't reset incremental encoders of CJK codecs at each call to
3208 their encode() method anymore, but continue to call the reset() method if the
3209 final argument is True.
3210
3211- Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
3212 module.
3213
3214- Issue #6501: os.device_encoding() returns None on Windows if the application
3215 has no console.
3216
3217- Issue #12105: Add O_CLOEXEC to the os module.
3218
3219- Issue #12079: Decimal('Infinity').fma(Decimal('0'), (3.91224318126786e+19+0j))
3220 now raises TypeError (reflecting the invalid type of the 3rd argument) rather
3221 than Decimal.InvalidOperation.
3222
3223- Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
3224 to be able to unload the module.
3225
3226- Add the packaging module, an improved fork of distutils (also known as
3227 distutils2).
3228
3229- Issue #12065: connect_ex() on an SSL socket now returns the original errno
3230 when the socket's timeout expires (it used to return None).
3231
3232- Issue #8809: The SMTP_SSL constructor and SMTP.starttls() now support
3233 passing a ``context`` argument pointing to an ssl.SSLContext instance.
3234 Patch by Kasun Herath.
3235
3236- Issue #11088: don't crash when using F5 to run a script in IDLE on MacOSX
3237 with Tk 8.5.
3238
3239- Issue #9516: Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET
3240 is set in shell.
3241
3242- Issue #8650: Make zlib module 64-bit clean. compress(), decompress() and
3243 their incremental counterparts now raise OverflowError if given an input
3244 larger than 4GB, instead of silently truncating the input and returning
3245 an incorrect result.
3246
3247- Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
3248 attribute when called without a max_length argument.
3249
3250- Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
3251 on a file opened in read+write mode (namely: reading, seeking a bit forward,
3252 writing, then seeking before the previous write but still within buffered
3253 data, and writing again).
3254
3255- Issue #9971: Write an optimized implementation of BufferedReader.readinto().
3256 Patch by John O'Connor.
3257
3258- Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
3259 With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused
3260 IDLE to exit. Converted to valid Unicode null in PythonCmd().
3261
3262- Issue #11799: urllib.request Authentication Handlers will raise a ValueError
3263 when presented with an unsupported Authentication Scheme. Patch contributed
3264 by Yuval Greenfield.
3265
3266- Issue #10419, #6011: build_scripts command of distutils handles correctly
3267 non-ASCII path (path to the Python executable). Open and write the script in
3268 binary mode, but ensure that the shebang is decodable from UTF-8 and from the
3269 encoding of the script.
3270
3271- Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
3272 order to accept exactly one connection. Patch by Daniel Evers.
3273
3274- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
3275 instead of a RuntimeError: OSError has an errno attribute.
3276
3277- Issue #3709: add a flush_headers method to BaseHTTPRequestHandler, which
3278 manages the sending of headers to output stream and flushing the internal
3279 headers buffer. Patch contribution by Andrew Schaaf
3280
3281- Issue #11743: Rewrite multiprocessing connection classes in pure Python.
3282
3283- Issue #11164: Stop trying to use _xmlplus in the xml module.
3284
3285- Issue #11888: Add log2 function to math module. Patch written by Mark
3286 Dickinson.
3287
3288- Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional.
3289
3290- Issue #8407: The signal handler writes the signal number as a single byte
3291 instead of a nul byte into the wakeup file descriptor. So it is possible to
3292 wait more than one signal and know which signals were raised.
3293
3294- Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the
3295 signal module.
3296
3297- Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch
3298 by Kasun Herath.
3299
3300- Issue #12002: ftplib's abort() method raises TypeError.
3301
3302- Issue #11916: Add a number of MacOSX specific definitions to the errno module.
3303 Patch by Pierre Carrier.
3304
3305- Issue #11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
3306 detect mtime changes by comparing to the system clock instead of to the
3307 previous value of the mtime.
3308
3309- Issue #11072: added MLSD command (RFC-3659) support to ftplib.
3310
3311- Issue #8808: The IMAP4_SSL constructor now allows passing an SSLContext
3312 parameter to control parameters of the secure channel. Patch by Sijin
3313 Joseph.
3314
3315- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
3316 file on Windows XP. As noticed in issue #10684.
3317
3318- Issue #12000: When a SSL certificate has a subjectAltName without any
3319 dNSName entry, ssl.match_hostname() should use the subject's commonName.
3320 Patch by Nicolas Bareil.
3321
3322- Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and
3323 assertWarnsRegex now accept a keyword argument 'msg' when used as context
3324 managers. Initial patch by Winston Ewert.
3325
3326- Issue #10684: shutil.move used to delete a folder on case insensitive
3327 filesystems when the source and destination name where the same except
3328 for the case.
3329
3330- Issue #11647: objects created using contextlib.contextmanager now support
3331 more than one call to the function when used as a decorator. Initial patch
3332 by Ysj Ray.
3333
3334- Issue #11930: Removed deprecated time.accept2dyear variable.
3335 Removed year >= 1000 restriction from datetime.strftime.
3336
3337- logging: don't define QueueListener if Python has no thread support.
3338
3339- functools.cmp_to_key() now works with collections.Hashable().
3340
3341- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
3342 around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
3343
3344- Issue #8407: Add signal.pthread_sigmask() function to fetch and/or change the
3345 signal mask of the calling thread.
3346
3347- Issue #11858: configparser.ExtendedInterpolation expected lower-case section
3348 names.
3349
3350- Issue #11324: ConfigParser(interpolation=None) now works correctly.
3351
3352- Issue #11811: ssl.get_server_certificate() is now IPv6-compatible. Patch
3353 by Charles-François Natali.
3354
3355- Issue #11763: don't use difflib in TestCase.assertMultiLineEqual if the
3356 strings are too long.
3357
3358- Issue #11236: getpass.getpass responds to ctrl-c or ctrl-z on terminal.
3359
3360- Issue #11856: Speed up parsing of JSON numbers.
3361
3362- Issue #11005: threading.RLock()._release_save() raises a RuntimeError if the
3363 lock was not acquired.
3364
3365- Issue #11258: Speed up ctypes.util.find_library() under Linux by a factor
3366 of 5 to 10. Initial patch by Jonas H.
3367
3368- Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
3369 release the GIL. Patch by Charles-François Natali.
3370
3371- Issue #11223: Add threading._info() function providing informations about
3372 the thread implementation.
3373
3374- Issue #11731: simplify/enhance email parser/generator API by introducing
3375 policy objects.
3376
3377- Issue #11768: The signal handler of the signal module only calls
3378 Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or
3379 parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
3380
3381- Issue #11492: fix several issues with header folding in the email package.
3382
3383- Issue #11852: Add missing imports and update tests.
3384
3385- Issue #11875: collections.OrderedDict's __reduce__ was temporarily
3386 mutating the object instead of just working on a copy.
3387
3388- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
3389 specific part only digits. Patch by Santoso Wijaya.
3390
3391- collections.Counter().copy() now works correctly for subclasses.
3392
3393- Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows.
3394 Patch by Santoso Wijaya.
3395
3396- Issue #11684: complete email.parser bytes API by adding BytesHeaderParser.
3397
3398- The bz2 module now handles 4GiB+ input buffers correctly.
3399
3400- Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when
3401 _json is not available.
3402
3403- Issue #11830: Remove unnecessary introspection code in the decimal module.
3404
3405- Issue #11703: urllib2.geturl() does not return correct url when the original
3406 url contains #fragment.
3407
3408- Issue #10019: Fixed regression in json module where an indent of 0 stopped
3409 adding newlines and acted instead like 'None'.
3410
3411- Issue #11186: pydoc ignores a module if its name contains a surrogate
3412 character in the index of modules.
3413
3414- Issue #11815: Use a light-weight SimpleQueue for the result queue in
3415 concurrent.futures.ProcessPoolExecutor.
3416
3417- Issue #5162: Treat services like frozen executables to allow child spawning
3418 from multiprocessing.forking on Windows.
3419
3420- logging.basicConfig now supports an optional 'handlers' argument taking an
3421 iterable of handlers to be added to the root logger. Additional parameter
3422 checks were also added to basicConfig.
3423
3424- Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
3425
3426- Issue #11747: Fix range formatting in difflib.context_diff() and
3427 difflib.unified_diff().
3428
3429- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
3430 worker processes: new processes would be spawned while the pool is being
3431 shut down. Patch by Charles-François Natali.
3432
3433- Issue #2650: re.escape() no longer escapes the '_'.
3434
3435- Issue #11757: select.select() now raises ValueError when a negative timeout
3436 is passed (previously, a select.error with EINVAL would be raised). Patch
3437 by Charles-François Natali.
3438
3439- Issue #7311: fix html.parser to accept non-ASCII attribute values.
3440
3441- Issue #11605: email.parser.BytesFeedParser was incorrectly converting
3442 multipart subparts with an 8-bit CTE into unicode instead of preserving the
3443 bytes.
3444
3445- Issue #1690608: email.util.formataddr is now RFC 2047 aware: it now has a
3446 charset parameter that defaults to utf-8 and is used as the charset for RFC
3447 2047 encoding when the realname contains non-ASCII characters.
3448
3449- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
3450
3451- Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFile
3452 to be wrapped in a TextIOWrapper. Patch by Nadeem Vawda.
3453
3454- Issue #11707: Added a fast C version of functools.cmp_to_key().
3455 Patch by Filip Gruszczyński.
3456
3457- Issue #11688: Add sqlite3.Connection.set_trace_callback(). Patch by
3458 Torsten Landschoff.
3459
3460- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
3461 private keys.
3462
3463- Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept
3464 file-like objects using a new ``fileobj`` constructor argument. Patch by
3465 Nadeem Vawda.
3466
3467- unittest.TestCase.assertSameElements has been removed.
3468
3469- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
3470 called yet: detect bootstrap (startup) issues earlier.
3471
3472- Issue #11393: Add the new faulthandler module.
3473
3474- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
3475
3476- Removed the 'strict' argument to email.parser.Parser, which has been
3477 deprecated since Python 2.4.
3478
3479- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
3480 arguments.
3481
3482- Issue #11696: Fix ID generation in msilib.
3483
3484- itertools.accumulate now supports an optional *func* argument for
3485 a user-supplied binary function.
3486
3487- Issue #11692: Remove unnecessary demo functions in subprocess module.
3488
3489- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
3490 trying to pack a negative (in-range) integer.
3491
3492- Issue #11675: multiprocessing.[Raw]Array objects created from an integer size
3493 are now zeroed on creation. This matches the behaviour specified by the
3494 documentation.
3495
3496- Issue #7639: Fix short file name generation in bdist_msi
3497
3498- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
3499 Patch by Ben Hayden.
3500
3501- Issue #11635: Don't use polling in worker threads and processes launched by
3502 concurrent.futures.
3503
3504- Issue #6811: Allow importlib to change a code object's co_filename attribute
3505 to match the path to where the source code currently is, not where the code
3506 object originally came from.
3507
3508- Issue #8754: Have importlib use the repr of a module name in error messages.
3509
3510- Issue #11591: Prevent "import site" from modifying sys.path when python
3511 was started with -S.
3512
3513- collections.namedtuple() now adds a _source attribute to the generated
3514 class. This make the source more accessible than the outdated
3515 "verbose" option which prints to stdout but doesn't make the source
3516 string available.
3517
3518- Issue #11371: Mark getopt error messages as localizable. Patch by Filip
3519 Gruszczyński.
3520
3521- Issue #11333: Add __slots__ to collections ABCs.
3522
3523- Issue #11628: cmp_to_key generated class should use __slots__.
3524
3525- Issue #11666: let help() display named tuple attributes and methods
3526 that start with a leading underscore.
3527
3528- Issue #11662: Make urllib and urllib2 ignore redirections if the
3529 scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
3530
3531- Issue #5537: Fix time2isoz() and time2netscape() functions of
3532 httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
3533
3534- Issue #4391: Use proper gettext plural forms in optparse.
3535
3536- Issue #11127: Raise a TypeError when trying to pickle a socket object.
3537
3538- Issue #11563: Connection:close header is sent by requests using URLOpener
3539 class which helps in closing of sockets after connection is over. Patch
3540 contributions by Jeff McNeil and Nadeem Vawda.
3541
3542- Issue #11459: A ``bufsize`` value of 0 in subprocess.Popen() really creates
3543 unbuffered pipes, such that select() works properly on them.
3544
3545- Issue #5421: Fix misleading error message when one of socket.sendto()'s
3546 arguments has the wrong type. Patch by Nikita Vetoshkin.
3547
3548- Issue #10812: Add some extra posix functions to the os module.
3549
3550- Issue #10979: unittest stdout buffering now works with class and module
3551 setup and teardown.
3552
3553- Issue #11577: fix ResourceWarning triggered by improved binhex test coverage
3554
3555- Issue #11243: fix the parameter querying methods of Message to work if
3556 the headers contain un-encoded non-ASCII data.
3557
3558- Issue #11401: fix handling of headers with no value; this fixes a regression
3559 relative to Python2 and the result is now the same as it was in Python2.
3560
3561- Issue #9298: base64 bodies weren't being folded to line lengths less than 78,
3562 which was a regression relative to Python2. Unlike Python2, the last line
3563 of the folded body now ends with a carriage return.
3564
3565- Issue #11560: shutil.unpack_archive now correctly handles the format
3566 parameter. Patch by Evan Dandrea.
3567
3568- Issue #5870: Add `subprocess.DEVNULL` constant.
3569
3570- Issue #11133: fix two cases where inspect.getattr_static can trigger code
3571 execution. Patch by Andreas Stührk.
3572
3573- Issue #11569: use absolute path to the sysctl command in multiprocessing to
3574 ensure that it will be found regardless of the shell PATH. This ensures
3575 that multiprocessing.cpu_count works on default installs of MacOSX.
3576
3577- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is
3578 not installed. Instead, the zipfile.ZIP_STORED compression is used to create
3579 the ZipFile. Patch by Natalia B. Bidart.
3580
3581- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
3582 in a `with` statement. Contributed by Giampaolo Rodola.
3583
3584- Issue #11554: Fixed support for Japanese codecs; previously the body output
3585 encoding was not done if euc-jp or shift-jis was specified as the charset.
3586
3587- Issue #11509: Significantly increase test coverage of fileinput.
3588 Patch by Denver Coneybeare at PyCon 2011 Sprints.
3589
3590- Issue #11407: `TestCase.run` returns the result object used or created.
3591 Contributed by Janathan Hartley.
3592
3593- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
3594 IP addresses in the proxy exception list.
3595
3596- Issue #11491: dbm.error is no longer raised when dbm.open is called with
3597 the "n" as the flag argument and the file exists. The behavior matches
3598 the documentation and general logic.
3599
3600- Issue #1162477: Postel Principle adjustment to email date parsing: handle the
3601 fact that some non-compliant MUAs use '.' instead of ':' in time specs.
3602
3603- Issue #11131: Fix sign of zero in decimal.Decimal plus and minus
3604 operations when the rounding mode is ROUND_FLOOR.
3605
3606- Issue #9935: Speed up pickling of instances of user-defined classes.
3607
3608- Issue #5622: Fix curses.wrapper to raise correct exception if curses
3609 initialization fails.
3610
3611- Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when
3612 really necessary. Patch by Charles-François Natali.
3613
3614- Issue #11391: Writing to a mmap object created with
3615 ``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
3616 TypeError. Patch by Charles-François Natali.
3617
3618- Issue #9795: add context manager protocol support for nntplib.NNTP class.
3619
3620- Issue #11306: mailbox in certain cases adapts to an inability to open
3621 certain files in read-write mode. Previously it detected this by
3622 checking for EACCES, now it also checks for EROFS.
3623
3624- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
3625 on accept(), send() and recv().
3626
3627- Issue #11377: Deprecate platform.popen() and reimplement it with os.popen().
3628
3629- Issue #8513: On UNIX, subprocess supports bytes command string.
3630
3631- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall.
3632
3633- Issue #11140: Lock.release() now raises a RuntimeError when attempting
3634 to release an unacquired lock, as claimed in the threading documentation.
3635 The _thread.error exception is now an alias of RuntimeError. Patch by
3636 Filip Gruszczyński. Patch for _dummy_thread by Aymeric Augustin.
3637
3638- Issue #8594: ftplib now provides a source_address parameter to specify which
3639 (address, port) to bind to before connecting.
3640
3641- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
3642 and make it work for non-blocking connects.
3643
3644- Issue #11297: Add collections.ChainMap().
3645
3646- Issue #10755: Add the posix.flistdir() function. Patch by Ross Lagerwall.
3647
3648- Issue #4761: Add the ``*at()`` family of functions (openat(), etc.) to the
3649 posix module. Patch by Ross Lagerwall.
3650
3651- Issue #7322: Trying to read from a socket's file-like object after a timeout
3652 occurred now raises an error instead of silently losing data.
3653
3654- Issue #11291: poplib.POP no longer suppresses errors on quit().
3655
3656- Issue #11177: asyncore's create_socket() arguments can now be omitted.
3657
3658- Issue #6064: Add a ``daemon`` keyword argument to the threading.Thread
3659 and multiprocessing.Process constructors in order to override the
3660 default behaviour of inheriting the daemonic property from the current
3661 thread/process.
3662
3663- Issue #10956: Buffered I/O classes retry reading or writing after a signal
3664 has arrived and the handler returned successfully.
3665
3666- Issue #10784: New os.getpriority() and os.setpriority() functions.
3667
3668- Issue #11114: Fix catastrophic performance of tell() on text files (up
3669 to 1000x faster in some cases). It is still one to two order of magnitudes
3670 slower than binary tell().
3671
3672- Issue #10882: Add os.sendfile function.
3673
3674- Issue #10868: Allow usage of the register method of an ABC as a class
3675 decorator.
3676
3677- Issue #11224: Fixed a regression in tarfile that affected the file-like
3678 objects returned by TarFile.extractfile() regarding performance, memory
3679 consumption and failures with the stream interface.
3680
3681- Issue #10924: Adding salt and Modular Crypt Format to crypt library.
3682 Moved old C wrapper to _crypt, and added a Python wrapper with
3683 enhanced salt generation and simpler API for password generation.
3684
3685- Issue #11074: Make 'tokenize' so it can be reloaded.
3686
3687- Issue #11085: Moved collections abstract base classes into a separate
3688 module called collections.abc, following the pattern used by importlib.abc.
3689 For backwards compatibility, the names are imported into the collections
3690 module.
3691
3692- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
3693 4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for
3694 32-bit Windows.
3695
3696- Issue #11169: compileall module uses repr() to format filenames and paths to
3697 escape surrogate characters and show spaces.
3698
3699- Issue #11089: Fix performance issue limiting the use of ConfigParser()
3700 with large config files.
3701
3702- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
3703 larger than 4GB. Patch by Nadeem Vawda.
3704
3705- Issue #11388: Added a clear() method to MutableSequence
3706
3707- Issue #11174: Add argparse.MetavarTypeHelpFormatter, which uses type names
3708 for the names of optional and positional arguments in help messages.
3709
3710- Issue #9348: Raise an early error if argparse nargs and metavar don't match.
3711
3712- Issue #8982: Improve the documentation for the argparse Namespace object.
3713
3714- Issue #9343: Document that argparse parent parsers must be configured before
3715 their children.
3716
3717- Issue #9026: Fix order of argparse sub-commands in help messages.
3718
3719- Issue #9347: Fix formatting for tuples in argparse type= error messages.
3720
3721- Issue #12191: Added shutil.chown() to change user and/or group owner of a
3722 given path also specifying their names.
3723
3724- Issue #13988: The _elementtree accelerator is used whenever available.
3725 Now xml.etree.cElementTree becomes a deprecated alias to ElementTree.
3726
3727Build
3728-----
3729
3730- Issue #6807: Run msisupport.mak earlier.
3731
3732- Issue #10580: Minor grammar change in Windows installer.
3733
3734- Issue #13326: Clean __pycache__ directories correctly on OpenBSD.
3735
3736- PEP 393: the configure option --with-wide-unicode is removed.
3737
3738- Issue #12852: Set _XOPEN_SOURCE to 700, instead of 600, to get POSIX 2008
3739 functions on OpenBSD (e.g. fdopendir).
3740
3741- Issue #11863: Remove support for legacy systems deprecated in Python 3.2
3742 (following PEP 11). These systems are systems using Mach C Threads,
3743 SunOS lightweight processes, GNU pth threads and IRIX threads.
3744
3745- Issue #8746: Correct faulty configure checks so that os.chflags() and
3746 os.lchflags() are once again built on systems that support these
3747 functions (BSD and OS X). Also add new stat file flags for OS X
3748 (UF_HIDDEN and UF_COMPRESSED).
3749
3750- Issue #10645: Installing Python no longer creates a
3751 Python-X.Y.Z-pyX.Y.egg-info file in the lib-dynload directory.
3752
3753- Do not accidentally include the directory containing sqlite.h twice when
3754 building sqlite3.
3755
3756- Issue #11217: For 64-bit/32-bit Mac OS X universal framework builds,
3757 ensure "make install" creates symlinks in --prefix bin for the "-32"
3758 files in the framework bin directory like the installer does.
3759
3760- Issue #11347: Use --no-as-needed when linking libpython3.so.
3761
3762- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
3763
3764- Issue #11268: Prevent Mac OS X Installer failure if Documentation
3765 package had previously been installed.
3766
3767- Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2.
3768
3769
3770IDLE
3771----
3772
3773- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
3774 file in a package.
3775
3776Tools/Demos
3777-----------
3778
3779- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches.
3780 Patch by Francisco Martín Brugué.
3781
3782- Issue #13930: 2to3 is now able to write its converted output files to another
3783 directory tree as well as copying unchanged files and altering the file
3784 suffix. See its new -o, -W and --add-suffix options. This makes it more
3785 useful in many automated code translation workflows.
3786
3787- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
3788 traceback if Python is optimized.
3789
3790- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and
3791 add a smarter "py-bt" command printing a classic Python traceback.
3792
3793- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
3794
3795- Issue #10639: reindent.py no longer converts newlines and will raise
3796 an error if attempting to convert a file with mixed newlines.
3797 "--newline" option added to specify new line character.
3798
3799Extension Modules
3800-----------------
3801
3802- Issue #13840: The error message produced by ctypes.create_string_buffer
3803 when given a Unicode string has been fixed.
3804
3805- Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
3806 Vilmos Nebehaj.
3807
3808- Issue #7777: socket: Add Reliable Datagram Sockets (PF_RDS) support.
3809
3810- Issue #13159: FileIO and BZ2Compressor/BZ2Decompressor now use a linear-time
3811 buffer growth strategy instead of a quadratic-time one.
3812
3813- Issue #10141: socket: Add SocketCAN (PF_CAN) support. Initial patch by
3814 Matthias Fuchs, updated by Tiago Gonçalves.
3815
3816- Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
3817 would be finalized after the reference to its underlying BufferedRWPair's
3818 writer got cleared by the GC.
3819
3820- Issue #12881: ctypes: Fix segfault with large structure field names.
3821
3822- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
3823 Thomas Jarosch.
3824
3825- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
3826 Thanks to Suman Saha for finding the bug and providing a patch.
3827
3828- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
3829 file descriptor was actually received.
3830
3831- Issue #1172711: Add 'long long' support to the array module.
3832 Initial patch by Oren Tirosh and Hirokazu Yamamoto.
3833
3834- Issue #12483: ctypes: Fix a crash when the destruction of a callback
3835 object triggers the garbage collector.
3836
3837- Issue #12950: Fix passing file descriptors in multiprocessing, under
3838 OpenIndiana/Illumos.
3839
3840- Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
3841 a string.
3842
3843- Issue #11241: subclasses of ctypes.Array can now be subclassed.
3844
3845- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
3846 some functions like file.write().
3847
3848- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
3849 signature. Without this, architectures where sizeof void* != sizeof int are
3850 broken. Patch given by Hallvard B Furuseth.
3851
3852- Issue #12051: Fix segfault in json.dumps() while encoding highly-nested
3853 objects using the C accelerations.
3854
3855- Issue #12017: Fix segfault in json.loads() while decoding highly-nested
3856 objects using the C accelerations.
3857
3858- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
3859 to an instance of the class.
3860
3861Tests
3862-----
3863
3864- Issue #11689: Fix a variable scoping error in an sqlite3 test
3865
3866- Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
3867
3868- Issue #13725: Fix regrtest to recognize the documented -d flag.
3869 Patch by Erno Tukia.
3870
3871- Issue #13304: Skip test case if user site-packages disabled (-s or
3872 PYTHONNOUSERSITE). (Patch by Carl Meyer)
3873
3874- Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. Patch
3875 by Xavier de Gaye.
3876
3877- Issue #13218: Fix test_ssl failures on Debian/Ubuntu.
3878
3879- Re-enable lib2to3's test_parser.py tests, though with an expected failure
3880 (see issue 13125).
3881
3882- Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.
3883
3884- Issue #6484: Add unit tests for mailcap module (patch by Gregory Nofi)
3885
3886- Issue #11651: Improve the Makefile test targets to run more of the test suite
3887 more quickly. The --multiprocess option is now enabled by default, reducing
3888 the amount of time needed to run the tests. "make test" and "make quicktest"
3889 now include some resource-intensive tests, but no longer run the test suite
3890 twice to check for bugs in .pyc generation. Tools/scripts/run_test.py provides
3891 an easy platform-independent way to run test suite with sensible defaults.
3892
3893- Issue #12331: The test suite for the packaging module can now run from an
3894 installed Python.
3895
3896- Issue #12331: The test suite for lib2to3 can now run from an installed
3897 Python.
3898
3899- Issue #12626: In regrtest, allow to filter tests using a glob filter
3900 with the ``-m`` (or ``--match``) option. This works with all test cases
3901 using the unittest module. This is useful with long test suites
3902 such as test_io or test_subprocess.
3903
3904- Issue #12624: It is now possible to fail after the first failure when
3905 running in verbose mode (``-v`` or ``-W``), by using the ``--failfast``
3906 (or ``-G``) option to regrtest. This is useful with long test suites
3907 such as test_io or test_subprocess.
3908
3909- Issue #12587: Correct faulty test file and reference in test_tokenize.
3910 (Patch by Robert Xiao)
3911
3912- Issue #12573: Add resource checks for dangling Thread and Process objects.
3913
3914- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
3915 as the processor type on some Mac systems.
3916
3917- Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
3918 failure in name resolution.
3919
3920- Issue #11812: Solve transient socket failure to connect to 'localhost'
3921 in test_telnetlib.py.
3922
3923- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812.
3924
3925- Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
3926 an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
3927 Web site.
3928
3929- Avoid failing in test_urllibnet.test_bad_address when some overzealous
3930 DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test
3931 is now skipped instead.
3932
3933- Issue #12440: When testing whether some bits in SSLContext.options can be
3934 reset, check the version of the OpenSSL headers Python was compiled against,
3935 rather than the runtime version of the OpenSSL library.
3936
3937- Issue #11512: Add a test suite for the cgitb module. Patch by Robbie Clemons.
3938
3939- Issue #12497: Install test/data to prevent failures of the various codecmaps
3940 tests.
3941
3942- Issue #12496: Install test/capath directory to prevent test_connect_capath
3943 testcase failure in test_ssl.
3944
3945- Issue #12469: Run wakeup and pending signal tests in a subprocess to run the
3946 test in a fresh process with only one thread and to not change signal
3947 handling of the parent process.
3948
3949- Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
3950 test_tk or test_ttk_guionly under a username that is not currently logged
3951 in to the console windowserver (as may be the case under buildbot or ssh).
3952
3953- Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows.
3954
3955- Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
3956 the output and displays it on failure instead. regrtest -v doesn't print the
3957 error twice anymore if there is only one error.
3958
3959- Issue #12141: Install copies of template C module file so that
3960 test_build_ext of test_distutils and test_command_build_ext of
3961 test_packaging are no longer silently skipped when
3962 run outside of a build directory.
3963
3964- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
3965 Patch by Garrett Cooper.
3966
3967- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
3968 2.8 + on Mac OS X. (Patch by Ronald Oussoren)
3969
3970- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
3971 iso2022_kr).
3972
3973- Issue #12096: Fix a race condition in test_threading.test_waitfor(). Patch
3974 written by Charles-François Natali.
3975
3976- Issue #11614: import __hello__ prints "Hello World!". Patch written by
3977 Andreas Stührk.
3978
3979- Issue #5723: Improve json tests to be executed with and without accelerations.
3980
3981- Issue #12041: Make test_wait3 more robust.
3982
3983- Issue #11873: Change regex in test_compileall to fix occasional failures when
3984 when the randomly generated temporary path happened to match the regex.
3985
3986- Issue #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
3987 Patch written by Charles-Francois Natali.
3988
3989- Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use
3990 pthread_sigmask() to ensure that the SIGALRM signal is received by the main
3991 thread.
3992
3993- Issue #11811: Factor out detection of IPv6 support on the current host
3994 and make it available as ``test.support.IPV6_ENABLED``. Patch by
3995 Charles-François Natali.
3996
3997- Issue #10914: Add a minimal embedding test to test_capi.
3998
3999- Issue #11223: Skip test_lock_acquire_interruption() and
4000 test_rlock_acquire_interruption() of test_threadsignals if a thread lock is
4001 implemented using a POSIX mutex and a POSIX condition variable. A POSIX
4002 condition variable cannot be interrupted by a signal (e.g. on Linux, the
4003 futex system call is restarted).
4004
4005- Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition.
4006
4007- Fix possible "file already exists" error when running the tests in parallel.
4008
4009- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
4010 platforms. Patch by Nadeem Vawda.
4011
4012- Issue #11727: Add a --timeout option to regrtest: if a test takes more than
4013 TIMEOUT seconds, dumps the traceback of all threads and exits.
4014
4015- Issue #11653: fix -W with -j in regrtest.
4016
4017- The email test suite now lives in the Lib/test/test_email package. The test
4018 harness code has also been modernized to allow use of new unittest features.
4019
4020- regrtest now discovers test packages as well as test modules.
4021
4022- Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov.
4023
4024- New test_crashers added to exercise the scripts in the Lib/test/crashers
4025 directory and confirm they fail as expected
4026
4027- Issue #11578: added test for the timeit module. Patch by Michael Henry.
4028
4029- Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea.
4030
4031- Issue #11505: improves test coverage of string.py, increases granularity of
4032 string.Formatter tests. Initial patch by Alicia Arlen.
4033
4034- Issue #11548: Improve test coverage of the shutil module. Patch by
4035 Evan Dandrea.
4036
4037- Issue #11554: Reactivated test_email_codecs.
4038
4039- Issue #11505: improves test coverage of string.py. Patch by Alicia
4040 Arlen
4041
4042- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
4043 false positive if the last directory in the path is inaccessible.
4044
4045- Issue #11223: Fix test_threadsignals to fail, not hang, when the
4046 non-semaphore implementation of locks is used under POSIX.
4047
4048- Issue #10911: Add tests on CGI with non-ASCII characters. Patch written by
4049 Pierre Quentel.
4050
4051- Issue #9931: Fix hangs in GUI tests under Windows in certain conditions.
4052 Patch by Hirokazu Yamamoto.
4053
4054- Issue #10512: Properly close sockets under test.test_cgi.
4055
4056- Issue #10992: Make tests pass under coverage.
4057
4058- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
4059 to open door files.
4060
4061- Issue #10990: Prevent tests from clobbering a set trace function.
4062
4063C-API
4064-----
4065
4066- Add PyObject_GenericGetDict and PyObject_GeneriSetDict. They are generic
4067 implementations for the getter and setter of a ``__dict__`` descriptor of C
4068 types.
4069
4070- Issue #13727: Add 3 macros to access PyDateTime_Delta members:
4071 PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS,
4072 PyDateTime_DELTA_GET_MICROSECONDS.
4073
4074- Issue #10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE,
4075 Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE,
4076 Py_UNICODE_JOIN_SURROGATES.
4077
4078- Issue #12724: Add Py_RETURN_NOTIMPLEMENTED macro for returning NotImplemented.
4079
4080- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with
4081 Mercurial.
4082
4083- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const
4084 char *` instead of `char *`.
4085
4086- Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
4087
4088Documentation
4089-------------
4090
4091- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
4092 Initial patch for #13491 by Johannes Vogel.
4093
4094- Issue #13402: Document absoluteness of sys.executable.
4095
4096- Issue #13883: PYTHONCASEOK also works on OS X.
4097
4098- Issue #12949: Document the kwonlyargcount argument for the PyCode_New
4099 C API function.
4100
4101- Issue #13513: Fix io.IOBase documentation to correctly link to the
4102 io.IOBase.readline method instead of the readline module.
4103
4104- Issue #13237: Reorganise subprocess documentation to emphasise convenience
4105 functions and the most commonly needed arguments to Popen.
4106
4107- Issue #13141: Demonstrate recommended style for socketserver examples.
4108
4109- Issue #11818: Fix tempfile examples for Python 3.
4110
4111
4112What's New in Python 3.2?
4113=========================
4114
4115*Release date: 20-Feb-2011*
4116
4117Core and Builtins
4118-----------------
4119
4120- Issue #11249: Fix potential crashes when using the limited API.
4121
4122Build
4123-----
4124
4125- Issue #11222: Fix non-framework shared library build on Mac OS X.
4126
4127- Issue #11184: Fix large-file support on AIX.
4128
4129- Issue #941346: Fix broken shared library build on AIX.
4130
4131Documentation
4132-------------
4133
4134- Issue #10709: Add updated AIX notes in Misc/README.AIX.
4135
4136
4137What's New in Python 3.2 Release Candidate 3?
4138=============================================
4139
4140*Release date: 13-Feb-2011*
4141
4142Core and Builtins
4143-----------------
4144
4145- Issue #11134: Add missing fields to typeslots.h.
4146
4147- Issue #11135: Remove redundant doc field from PyType_Spec.
4148
4149- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
4150 ABI.
4151
4152- Issue #11118: Fix bogus export of None in python3.dll.
4153
4154Library
4155-------
4156
4157- Issue #11116: any error during addition of a message to a mailbox now causes a
4158 rollback, instead of leaving the mailbox partially modified.
4159
4160- Issue #11132: Fix passing of "optimize" parameter when recursing in
4161 compileall.compile_dir().
4162
4163- Issue #11110: Fix a potential decref of a NULL in sqlite3.
4164
4165- Issue #8275: Fix passing of callback arguments with ctypes under Win64. Patch
4166 by Stan Mihai.
4167
4168Build
4169-----
4170
4171- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
4172 installers now includes a link to the installed documentation and no longer
4173 includes an Extras directory. The Tools directory is now installed in the
4174 framework under share/doc.
4175
4176- Issue #11121: Fix building with --enable-shared.
4177
4178Tests
4179-----
4180
4181- Issue #10971: test_zipimport_support is once again compatible with the refleak
4182 hunter feature of test.regrtest.
4183
4184
4185What's New in Python 3.2 Release Candidate 2?
4186=============================================
4187
4188*Release date: 30-Jan-2011*
4189
4190Core and Builtins
4191-----------------
4192
4193- Issue #10451: memoryview objects could allow to mutate a readable buffer.
4194 Initial patch by Ross Lagerwall.
4195
4196Library
4197-------
4198
4199- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
4200 files in binary mode, using the email package's binary support to parse
4201 arbitrary email messages. StringIO and text file input is deprecated,
4202 and string input fails early if non-ASCII characters are used, where
4203 previously it would fail when the email was processed in a later step.
4204
4205- Issue #10845: Mitigate the incompatibility between the multiprocessing
4206 module on Windows and the use of package, zipfile or directory execution
4207 by special casing main modules that actually *are* called __main__.py.
4208
4209- Issue #11045: Protect logging call against None argument.
4210
4211- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
4212 commands.
4213
4214- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
4215 preventing a confusing hung appearance on OS X with the windows
4216 obscured.
4217
4218- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
4219 menu accelerators for Open Module, Go to Line, and New Indent Width.
4220 The accelerators still work but no longer appear in the menu items.
4221
4222- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
4223
4224- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
4225 conversion.
4226
4227- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
4228 with a None body.
4229
4230- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
4231 keyword-only argument. The preceding positional argument was deprecated,
4232 so it made no sense to add filter as a positional argument.
4233
4234- Issue #11004: Repaired edge case in deque.count().
4235
4236- Issue #10974: IDLE no longer crashes if its recent files list includes files
4237 with non-ASCII characters in their path names.
4238
4239- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
4240 return sets instead of one returning a tuple and the other a frozenset.
4241
4242- Issue #10987: Fix the recursion limit handling in the _pickle module.
4243
4244- Issue #10983: Fix several bugs making tunnel requests in http.client.
4245
4246- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
4247 filenames, at bootstrap, if the codec registry is not ready yet. It is still
4248 possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
4249 for all file entries in the ZIP file.
4250
4251- Issue #10949: Improved robustness of rotating file handlers.
4252
4253- Issue #10955: Fix a potential crash when trying to mmap() a file past its
4254 length. Initial patch by Ross Lagerwall.
4255
4256- Issue #10898: Allow compiling the posix module when the C library defines
4257 a symbol named FSTAT.
4258
4259- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
4260 encoding. This is the preferred encoding of PEP 3333 and the base encoding
4261 of HTTP 1.1.
4262
4263- To match the behaviour of HTTP server, the HTTP client library now also
4264 encodes headers with iso-8859-1 (latin1) encoding. It was already doing
4265 that for incoming headers which makes this behaviour now consistent in
4266 both incoming and outgoing direction.
4267
4268- Issue #9509: argparse now properly handles IOErrors raised by
4269 argparse.FileType.
4270
4271- Issue #10961: The new pydoc server now better handles exceptions raised
4272 during request handling.
4273
4274- Issue #10680: Fix mutually exclusive arguments for argument groups in
4275 argparse.
4276
4277Build
4278-----
4279
4280- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
4281 the system-provided Python.
4282
4283
4284What's New in Python 3.2 Release Candidate 1
4285============================================
4286
4287*Release date: 16-Jan-2011*
4288
4289Core and Builtins
4290-----------------
4291
4292- Issue #10889: range indexing and slicing now works correctly on ranges with
4293 a length that exceeds sys.maxsize.
4294
4295- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
4296 class.
4297
4298- Issue #8020: Avoid a crash where the small objects allocator would read
4299 non-Python managed memory while it is being modified by another thread. Patch
4300 by Matt Bandy.
4301
4302- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
4303 io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
4304 translates newlines (\r\n => \n).
4305
4306- Remove buffer API from stable ABI for now, see #10181.
4307
4308- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
4309 doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
4310 (length bigger than 2^31-1 bytes).
4311
4312- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
4313 stdprinter.write() clamp the length to INT_MAX on Windows.
4314
4315- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
4316 can now handle dates after 2038.
4317
4318- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
4319 PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
4320 filesystem encoding instead of UTF-8.
4321
4322- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
4323 encoding instead of UTF-8.
4324
4325- Add sys.flags attribute for the new -q command-line option.
4326
4327- Issue #11506: Trying to assign to a bytes literal should result in a
4328 SyntaxError.
4329
4330Library
4331-------
4332
4333- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
4334 and a non-zero offset, and an attempt to read past the end of file is made
4335 (IndexError is raised instead). Patch by Ross Lagerwall.
4336
4337- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
4338 of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
4339
4340- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
4341 than the currently problematic Apple-supplied one, when running with the
4342 64-/32-bit installer variant.
4343
4344- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
4345 as unicode, and accept binary files. Add encoding and errors attributes to
4346 cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
4347 Linderman).
4348
4349- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
4350
4351- Issue #10899: No function type annotations in the standard library. Removed
4352 function type annotations from _pyio.py.
4353
4354- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
4355
4356- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
4357 if available.
4358
4359- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
4360 twice.
4361
4362- Issue #5871: email.header.Header.encode now raises an error if any
4363 continuation line in the formatted value has no leading white space and looks
4364 like a header. Since Generator uses Header to format all headers, this check
4365 is made for all headers in any serialized message at serialization time. This
4366 provides protection against header injection attacks.
4367
4368- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
4369 private by renaming it to ``_GeneratorContextManager``.
4370
4371- Issue #10042: Fixed the total_ordering decorator to handle cross-type
4372 comparisons that could lead to infinite recursion.
4373
4374- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
4375 non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
4376 presentation, instead of replacing them with ?s.
4377
4378- email.header.Header was incorrectly encoding folding whitespace when
4379 rfc2047-encoding header values with embedded newlines, leaving them without
4380 folding whitespace. It now uses the continuation_ws, as it does for
4381 continuation lines that it creates itself.
4382
4383- Issue #1777412, #10827: Changed the rules for 2-digit years. The
4384 time.asctime(), time.ctime() and time.strftime() functions will now format
4385 any year when ``time.accept2dyear`` is False and will accept years >= 1000
4386 otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
4387 supported by the OS. With Visual Studio or on Solaris, the year is limited to
4388 the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
4389
4390- Issue #7858: Raise an error properly when os.utime() fails under Windows
4391 on an existing file.
4392
4393- Issue #3839: wsgiref should not override a Content-Length header set by
4394 the application. Initial patch by Clovis Fabricio.
4395
4396- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
4397 compilation (if the input is a string).
4398
4399- Issue #7995: When calling accept() on a socket with a timeout, the returned
4400 socket is now always blocking, regardless of the operating system.
4401
4402- Issue #10756: atexit normalizes the exception before displaying it. Patch by
4403 Andreas Stührk.
4404
4405- Issue #10790: email.header.Header.append's charset logic now works correctly
4406 for charsets whose output codec is different from its input codec.
4407
4408- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
4409 raising a ValueError, to fix repr().
4410
4411- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
4412 the input buffer length doesn't fit into an unsigned int (length bigger than
4413 2^32-1 bytes).
4414
4415- Issue #6643: Reinitialize locks held within the threading module after fork to
4416 avoid a potential rare deadlock or crash on some platforms.
4417
4418- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
4419 descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross
4420 Lagerwall.
4421
4422- `unittest.TestCase` can be instantiated without a method name; for simpler
4423 exploration from the interactive interpreter.
4424
4425- Issue #10798: Reject supporting concurrent.futures if the system has too
4426 few POSIX semaphores.
4427
4428- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
4429 the codec aliases. They are still accessible via codecs.lookup().
4430
4431- Issue #10801: In zipfile, support different encodings for the header and the
4432 filenames.
4433
4434- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
4435 David Daniels.
4436
4437- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
4438 define __missing__().
4439
4440- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
4441 time. `sys.stderr` now looked up at instantiation time. Fix contributed by
4442 Mark Roddy.
4443
4444- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
4445 won't be quoted when the URI is constructed by the wsgiref.util's request_uri
4446 method. According to RFC 3986, these characters can be a part of params in
4447 PATH component of URI and need not be quoted.
4448
4449- Issue #10738: Fix webbrowser.Opera.raise_opts.
4450
4451- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
4452 browsers actually parse cookies.
4453
4454- Issue #9333: os.symlink now available regardless of user privileges. The
4455 function now raises OSError on Windows >=6.0 when the user is unable to create
4456 symbolic links. XP and 2003 still raise NotImplementedError.
4457
4458- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
4459
4460- Issue #10730: Add SVG mime types to mimetypes module.
4461
4462- Issue #10768: Make the Tkinter ScrolledText widget work again.
4463
4464- Issue #10777: Fix "dictionary changed size during iteration" bug in
4465 ElementTree register_namespace().
4466
4467- Issue #10626: test_logging now preserves logger disabled states.
4468
4469- Issue #10774: test_logging now removes temp files created during tests.
4470
4471- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
4472 it now prints the filename, line number, and traceback to stderr and skips
4473 the rest of that individual file, instead of stopping processing entirely.
4474
4475- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
4476 pipes (bug specific to Windows).
4477
4478- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
4479 compliance (no "s around encoded values).
4480
4481- Improved the diff message in the unittest module's assertCountEqual().
4482
4483- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
4484 the '-' of a timezone field as well as before a '+'.
4485
4486- Issue #4871: The zipfile module now gives a more useful error message if
4487 an attempt is made to use a string to specify the archive password.
4488
4489- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
4490
4491- Deprecated assertDictContainsSubset() in the unittest module.
4492
4493C-API
4494-----
4495
4496- PyObject_CallMethod now passes along any underlying AttributeError from
4497 PyObject_GetAttr, instead of replacing it with something less informative
4498
4499- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
4500 PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
4501
4502- Issue #10333: Remove ancient GC API, which has been deprecated since Python
4503 2.2.
4504
4505Build
4506-----
4507
4508- Issue #10843: Update third-party library versions used in OS X 32-bit
4509 installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
4510 and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
4511
4512- Issue #10820: Fix OS X framework installs to support version-specific
4513 scripts (#10679).
4514
4515- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
4516 the configure script but use $GREP instead. Patch by Fabian Groffen.
4517
4518- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
4519 and DragonFly BSD. Patch by Nicolas Joly.
4520
4521- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
4522 a version-specific suffix on "make altinstall".
4523
4524- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
4525 timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
4526 support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
4527 only be present on OS X; the former is the correct one for Linux with GCC.
4528
4529- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
4530 using GCC 4.0.
4531
4532Tools/Demos
4533-----------
4534
4535- Issue #10843: Install the Tools directory on OS X in the applications Extras
4536 (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
4537 installed.
4538
4539- Issue #7962: The Demo directory is gone. Most of the old and unmaintained
4540 demos have been removed, others integrated in documentation or a new
4541 Tools/demo subdirectory.
4542
4543- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
4544 Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
4545 Curtin.
4546
4547Tests
4548-----
4549
4550- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
4551
4552- Fix test_startfile to wait for child process to terminate before finishing.
4553
4554- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
4555 by Ross Lagerwall.
4556
4557- Make the --coverage flag work for test.regrtest.
4558
4559- Issue #1677694: Refactor and improve test_timeout. Original patch by
4560 Björn Lindqvist.
4561
4562- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
4563 Patch by Jean-Paul Calderone and Sandro Tosi.
4564
4565- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default in
4566 whole runs and enabled selectively using ``--header`` when running an explicit
4567 list of tests. Original patch by Collin Winter.
4568
4569
4570What's New in Python 3.2 Beta 2?
4571================================
4572
4573*Release date: 19-Dec-2010*
4574
4575Core and Builtins
4576-----------------
4577
4578- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
4579 by signals on platforms using pthreads. Patch by Reid Kleckner.
4580
4581- Issue #4236: PyModule_Create2 now checks the import machinery directly
4582 rather than the Py_IsInitialized flag, avoiding a Fatal Python
4583 error in certain circumstances when an import is done in __del__.
4584
4585- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
4586 Daniel Urban.
4587
4588Library
4589-------
4590
4591- Issue #3243: Support iterable bodies in httplib. Patch Contributions by
4592 Xuanji Li and Chris AtLee.
4593
4594- Issue #10611: SystemExit exception will no longer kill a unittest run.
4595
4596- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
4597 up function.
4598
4599- Issue #10573: use actual/expected consistently in unittest methods.
4600 The order of the args of assertCountEqual is also changed.
4601
4602- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
4603 words in the local part of email addresses, thereby preserving the input.
4604
4605- Issue #6791: Limit header line length (to 65535 bytes) in http.client
4606 and http.server, to avoid denial of services from the other party.
4607
4608- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
4609
4610- Issue #9907: Fix tab handling on OSX when using editline by calling
4611 rl_initialize first, then setting our custom defaults, then reading .editrc.
4612
4613- Issue #4188: Avoid creating dummy thread objects when logging operations
4614 from the threading module (with the internal verbose flag activated).
4615
4616- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
4617 parameter to HTTPConnection and friends is deprecated.
4618
4619- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
4620 ';' character. Patch by Wes Chow.
4621
4622- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
4623 for security reasons. Initial patch by Ross Lagerwall.
4624
4625- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
4626
4627- Issue #10667: Fast path for collections.Counter().
4628
4629- Issue #10695: passing the port as a string value to telnetlib no longer
4630 causes debug mode to fail.
4631
4632- Issue #1078919: add_header now automatically RFC2231 encodes parameters
4633 that contain non-ascii values.
4634
4635- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
4636 a warning on sys.stderr rather than throwing a misleading exception
4637 if cleanup fails due to nulling out of modules during shutdown.
4638 Also avoids an AttributeError when mkdtemp call fails and issues
4639 a ResourceWarning on implicit cleanup via __del__.
4640
4641- Issue #10107: Warn about unsaved files in IDLE on OSX.
4642
4643- Issue #7213: subprocess.Popen's default for close_fds has been changed.
4644 It is now True in most cases other than on Windows when input, output or
4645 error handles are provided.
4646
4647- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
4648 added in 3.2beta1) to allow specifying a specific list of file descriptors
4649 to keep open in the child process.
4650
4651- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
4652 OSError exception when The OS had been told to ignore SIGCLD in our process
4653 or otherwise not wait for exiting child processes.
4654
4655Tests
4656-----
4657
4658- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
4659 encountering them.
4660
4661Tools/Demos
4662-----------
4663
4664- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
4665 Cocoa AquaTk.
4666
4667- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
4668
4669- Issue #10706: Remove outdated script runtests.sh. Either ``make test``
4670 or ``python -m test`` should be used instead.
4671
4672Build
4673-----
4674
4675- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
4676
4677- Issue #9234: argparse supports alias names for subparsers.
4678
4679
4680What's New in Python 3.2 Beta 1?
4681================================
4682
4683*Release date: 05-Dec-2010*
4684
4685Core and Builtins
4686-----------------
4687
4688- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
4689 methods.
4690
4691- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
4692 with respect to signed zeros. -4.0 % 4.0 should be 0.0, not -0.0.
4693
4694- Issue #1772833: Add the -q command-line option to suppress copyright and
4695 version output in interactive mode.
4696
4697- Provide an *optimize* parameter in the built-in compile() function.
4698
4699- Fixed several corner case issues on Windows in os.stat/os.lstat related to
4700 reparse points.
4701
4702- PEP 384 (Defining a Stable ABI) is implemented.
4703
4704- Issue #2690: Range objects support negative indices and slicing.
4705
4706- Issue #9915: Speed up sorting with a key.
4707
4708- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
4709 larger than operand ``b``. Patch by Andrew Bennetts.
4710
4711- Issue #10518: Bring back the callable() builtin.
4712
4713- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
4714 method of float, complex, and Decimal. This allows more precise control over
4715 when decimal points are displayed.
4716
4717- Issue #10474: range.count() should return integers.
4718
4719- Issue #1574217: isinstance now catches only AttributeError, rather than
4720 masking all errors.
4721
4722Library
4723-------
4724
4725- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
4726
4727- test.support: Added TestHandler and Matcher classes for better support of
4728 assertions about logging.
4729
4730- Issue #4391: Use proper plural forms in argparse.
4731
4732- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
4733 UnicodeEncodeError.
4734
4735- Add the "display" and "undisplay" pdb commands.
4736
4737- Issue #7245: Add a SIGINT handler in pdb that allows to break a program again
4738 after a "continue" command.
4739
4740- Add the "interact" pdb command.
4741
4742- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
4743
4744- Issue #1569291: Speed up array.repeat().
4745
4746- Provide an interface to set the optimization level of compilation in
4747 py_compile, compileall and zipfile.PyZipFile.
4748
4749- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
4750 RFC3986. Anything before :// is considered a scheme and is followed by an
4751 authority (or netloc) and by '/' led path, which is optional.
4752
4753- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
4754
4755- Issue #10620: `python -m unittest` can accept file paths instead of module
4756 names for running specific tests.
4757
4758- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
4759 `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
4760 and replace them with the correct methods in the Python test suite.
4761
4762- Issue #10272: The ssl module now raises socket.timeout instead of a generic
4763 SSLError on socket timeouts.
4764
4765- Issue #10528: Allow translators to reorder placeholders in localizable
4766 messages from argparse.
4767
4768- Issue #10497: Fix incorrect use of gettext in argparse.
4769
4770- Issue #10478: Reentrant calls inside buffered IO objects (for example by
4771 way of a signal handler) now raise a RuntimeError instead of freezing the
4772 current process.
4773
4774- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
4775
4776- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
4777
4778- Issue #2001: New HTML server with enhanced Web page features. Patch by Ron
4779 Adam.
4780
4781- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
4782 of non-weakrefable objects.
4783
4784- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
4785
4786- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
4787 DoS attacks. Patch by Savio Sena.
4788
4789- Issue #4925: Add filename to error message when executable can't be found in
4790 subprocess.
4791
4792- Issue #10391: Don't dereference invalid memory in error messages in the ast
4793 module.
4794
4795- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
4796 os.lstat. Patch by Hirokazu Yamamoto.
4797
4798- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
4799 held by the user's account, i.e., when the function can actually be used.
4800
4801- Issue #8879: Add os.link support for Windows.
4802
4803- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
4804 failure messages by default. Patch by Mark Roddy.
4805
4806- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
4807 guess at the correct parsing of invalid html.
4808
4809- Issue #10554: Add context manager support to subprocess.Popen objects.
4810
4811- Issue #8989: email.utils.make_msgid now has a domain parameter that can
4812 override the domain name used in the generated msgid.
4813
4814- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
4815 exists' exception when a target directory already exists with the specified
4816 mode. Patch by Ray Allen.
4817
4818- Issue #9573: os.fork() now works correctly when triggered as a side effect of
4819 a module import.
4820
4821- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
4822
4823- Added itertools.accumulate().
4824
4825- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
4826 Original patch by Daniel Urban.
4827
4828- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
4829 `assertRegex` and `assertRaisesRegex`.
4830
4831- Issue #10535: Enable silenced warnings in unittest by default.
4832
4833- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
4834 sequences as input in addition to character strings.
4835
4836- Issue #10586: The statistics API for the new functools.lru_cache has been
4837 changed to a single cache_info() method returning a named tuple.
4838
4839- Issue #10323: itertools.islice() now consumes the minimum number of inputs
4840 before stopping. Formerly, the final state of the underlying iterator was
4841 undefined.
4842
4843- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
4844 __next__.
4845
4846- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
4847 more informative name, unittest.CountEqual.
4848
4849- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
4850
4851- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
4852 be set to False to turn off the previously undocumented 'popularity'
4853 heuristic. Patch by Terry Reedy and Eli Bendersky.
4854
4855- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
4856 undocumented and now redundant isbjunk and isbpopular methods.
4857
4858- Issue #9846: zipfile is now correctly closing underlying file objects.
4859
4860- Issue #10459: Update CJK character names to Unicode 6.0.
4861
4862- Issue #4493: urllib.request adds '/' in front of path components which does not
4863 start with '/. Common behavior exhibited by browsers and other clients.
4864
4865- Issue #6378: idle.bat now runs with the appropriate Python version rather than
4866 the system default. Patch by Sridhar Ratnakumar.
4867
4868- Issue #10470: 'python -m unittest' will now run test discovery by default,
4869 when no extra arguments have been provided.
4870
4871- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
4872 output stream only when end_headers is invoked. This is a speedup and an
4873 internal optimization. Patch by Andrew Shaaf.
4874
4875- Issue #10220: Added inspect.getgeneratorstate. Initial patch by Rodolpho
4876 Eckhardt.
4877
4878- Issue #10453: compileall now uses argparse instead of getopt, and thus
4879 provides clean output when called with '-h'.
4880
4881- Issue #8078: Add constants for higher baud rates in the termios module. Patch
4882 by Rodolpho Eckhardt.
4883
4884- Issue #10407: Fix two NameErrors in distutils.
4885
4886- Issue #10371: Deprecated undocumented functions in the trace module.
4887
4888- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
4889 end of the file.
4890
4891- configparser: 100% test coverage.
4892
4893- Issue #10499: configparser supports pluggable interpolation handlers. The
4894 default classic interpolation handler is called BasicInterpolation. Another
4895 interpolation handler added (ExtendedInterpolation) which supports the syntax
4896 used by zc.buildout (e.g. interpolation between sections).
4897
4898- configparser: the SafeConfigParser class has been renamed to ConfigParser.
4899 The legacy ConfigParser class has been removed but its interpolation mechanism
4900 is still available as LegacyInterpolation.
4901
4902- configparser: Usage of RawConfigParser is now discouraged for new projects
4903 in favor of ConfigParser(interpolation=None).
4904
4905- Issue #1682942: configparser supports alternative option/value delimiters.
4906
4907- Issue #5412: configparser supports mapping protocol access.
4908
4909- Issue #9411: configparser supports specifying encoding for read operations.
4910
4911- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
4912 accept vars and default arguments just like get() does.
4913
4914- Issue #9452: configparser supports reading from strings and dictionaries
4915 (thanks to the mapping protocol API, the latter can be used to copy data
4916 between parsers).
4917
4918- configparser: accepted INI file structure is now customizable, including
4919 comment prefixes, name of the DEFAULT section, empty lines in multiline
4920 values, and indentation.
4921
4922- Issue #10326: unittest.TestCase instances can be pickled.
4923
4924- Issue #9926: Wrapped TestSuite subclass does not get __call__ executed.
4925
4926- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to complex
4927 zeros on systems where the log1p function fails to respect the sign of zero.
4928 This fixes a test failure on AIX.
4929
4930- Issue #9732: Addition of getattr_static to the inspect module.
4931
4932- Issue #10446: Module documentation generated by pydoc now links to a
4933 version-specific online reference manual.
4934
4935- Make the 'No module named' exception message from importlib consistent.
4936
4937- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
4938
4939- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
4940 Patch by Robert Collins.
4941
4942- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
4943 than strings.
4944
4945C-API
4946-----
4947
4948- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
4949 which transforms non-ASCII decimal digits in a Unicode string to their ASCII
4950 equivalents.
4951
4952- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
4953 zero-initialize all fields, fixing compiler warnings seen when building
4954 extension modules with gcc with "-Wmissing-field-initializers" (implied by
4955 "-W").
4956
4957- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
4958 Schemenauer.
4959
4960- structseq.h is now included in Python.h.
4961
4962- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
4963
4964Tests
4965-----
4966
4967- regrtest.py once again ensures the test directory is removed from sys.path
4968 when it is invoked directly as the __main__ module.
4969
4970- `python -m test` can be used to run the test suite as well as `python -m
4971 test.regrtest`.
4972
4973- Do not fail test_socket when the IP address of the local hostname cannot be
4974 looked up.
4975
4976- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
4977 Carstensen.
4978
4979Build
4980-----
4981
4982- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
4983 PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
4984
4985Documentation
4986-------------
4987
4988- Issue #10299: List the built-in functions in a table in functions.rst.
4989
4990
4991What's New in Python 3.2 Alpha 4?
4992=================================
4993
4994*Release date: 13-Nov-2010*
4995
4996Core and Builtins
4997-----------------
4998
4999- Issue #10372: Import the warnings module only after the IO library is
5000 initialized, so as to avoid bootstrap issues with the '-W' option.
5001
5002- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
5003 undocumented value PyBUF_SHADOW, and strangely-looking code in
5004 PyMemoryView_GetContiguous.
5005
5006- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
5007
5008- If FileIO.__init__ fails, close the file descriptor.
5009
5010- Issue #10221: dict.pop(k) now has a key error message that includes the
5011 missing key (same message d[k] returns for missing keys).
5012
5013- Issue #5437: A preallocated MemoryError instance should not keep traceback
5014 data (including local variables caught in the stack trace) alive infinitely.
5015
5016- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
5017 of the offending line.
5018
5019- Issue #10089: Add support for arbitrary -X options on the command line. They
5020 can be retrieved through a new attribute ``sys._xoptions``.
5021
5022- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
5023 the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment
5024 variable is not set, the locale encoding is ISO-8859-1, whereas most programs
5025 (including Python) expect UTF-8. Python already uses UTF-8 for the filesystem
5026 encoding and to encode command line arguments on this OS.
5027
5028- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
5029 filenames encoded to the filesystem encoding with the surrogateescape error
5030 handler (to support undecodable bytes), instead of UTF-8 in strict mode.
5031
5032- Issue #9997: Don't let the name "top" have special significance in scope
5033 resolution.
5034
5035- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
5036 the default 512 when compiling on AIX.
5037
5038- Use locale encoding instead of UTF-8 to encode and decode filenames if
5039 Py_FileSystemDefaultEncoding is not set.
5040
5041- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
5042 descriptor.
5043
5044- Issue #9418: Moved private string methods ``_formatter_parser`` and
5045 ``_formatter_field_name_split`` into a new ``_string`` module.
5046
5047- Issue #9992: Remove PYTHONFSENCODING environment variable.
5048
5049Library
5050-------
5051
5052- Issue #12943: python -m tokenize support has been added to tokenize.
5053
5054- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
5055
5056- Issue #10356: Decimal.__hash__(-1) should return -2.
5057
5058- Issue #1553375: logging: Added stack_info kwarg to display stack information.
5059
5060- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
5061
5062- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2. (See also issue
5063 #10356.)
5064
5065- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
5066 IMAP4 connections. Original patch by Lorenzo M. Catucci.
5067
5068- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
5069 there are non-base64 alphabet characters in the input.
5070
5071- Issue #10386: Add __all__ to token module; this simplifies importing in
5072 tokenize module and prevents leaking of private names through ``import *``.
5073
5074- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by Lorenzo
5075 M. Catucci.
5076
5077- Fix IMAP.login() to work properly.
5078
5079- Issue #9244: multiprocessing pool worker processes could terminate
5080 unexpectedly if the return value of a task could not be pickled. Only the
5081 ``repr`` of such errors are now sent back, wrapped in an
5082 ``MaybeEncodingError`` exception.
5083
5084- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
5085 ``multiprocessing.Pool`` now accepts a ``error_callback`` argument. This can
5086 be a callback with the signature ``callback(exc)``, which will be called if
5087 the target raises an exception.
5088
5089- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
5090 sockets now has additional items such as ``issuer`` and ``notBefore``.
5091
5092- ``usenetrc`` is now false by default for NNTP objects.
5093
5094- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
5095 Patch by Andrew Vant.
5096
5097- Issue #10335: Add tokenize.open(), detect the file encoding using
5098 tokenize.detect_encoding() and open it in read only mode.
5099
5100- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
5101 method send_message to send an email.message.Message object.
5102
5103- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
5104 handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
5105 code directory name contains a non-ASCII character and the locale encoding is
5106 ASCII.
5107
5108- Issue #10329: The trace module writes reports using the input Python script
5109 encoding, instead of the locale encoding. Patch written by Alexander
5110 Belopolsky.
5111
5112- Issue #10126: Fix distutils' test_build when Python was built with
5113 --enable-shared.
5114
5115- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
5116 Arfrever.
5117
5118- Issue #10229: Fix caching error in gettext.
5119
5120- Issue #10252: Close file objects in a timely manner in distutils code and
5121 tests. Patch by Brian Brazil, completed by Éric Araujo.
5122
5123- Issue #10180: Pickling file objects is now explicitly forbidden, since
5124 unpickling them produced nonsensical results.
5125
5126- Issue #10311: The signal module now restores errno before returning from its
5127 low-level signal handler. Patch by Hallvard B Furuseth.
5128
5129- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
5130
5131- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
5132
5133- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
5134 environment better, and to correct unicode environment values for WSGI 1.0.1.
5135
5136- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
5137 response, instead of raising an exception.
5138
5139- wsgiref now implements and validates PEP 3333, rather than an experimental
5140 extension of PEP 333. (Note: earlier versions of Python 3.x may have
5141 incorrectly validated some non-compliant applications as WSGI compliant; if
5142 your app validates with Python <3.2b1+, but not on this version, it is likely
5143 the case that your app was not compliant.)
5144
5145- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
5146 by the server.
5147
5148- Issue #10184: Touch directories only once when extracting a tarfile.
5149
5150- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
5151 that were formerly found under Demo/turtle.
5152
5153- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
5154
5155- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
5156 filename. Patch by Brian Brazil.
5157
5158- Issue #10110: Queue objects didn't recognize full queues when the maxsize
5159 parameter had been reduced.
5160
5161- Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
5162
5163- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
5164
5165- Issue #5729: json.dumps() now supports using a string such as '\t' for
5166 pretty-printing multilevel objects.
5167
5168- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
5169 append that isn't seekable. Patch by Brian Brazil.
5170
5171- Support context manager protocol for file-like objects returned by mailbox
5172 ``get_file()`` methods.
5173
5174- Issue #10246: uu.encode didn't close file objects explicitly when filenames
5175 were given to it. Patch by Brian Brazil.
5176
5177- Issue #10198: fix duplicate header written to wave files when writeframes() is
5178 called without data.
5179
5180- Close file objects in modulefinder in a timely manner.
5181
5182- Close a io.TextIOWrapper object in email.parser in a timely manner.
5183
5184- Close a file object in distutils.sysconfig in a timely manner.
5185
5186- Close a file object in pkgutil in a timely manner.
5187
5188- Issue #10233: Close file objects in a timely manner in the tarfile module and
5189 its test suite.
5190
5191- Issue #10093: ResourceWarnings are now issued when files and sockets are
5192 deallocated without explicit closing. These warnings are silenced by default,
5193 except in pydebug mode.
5194
5195- tarfile.py: Add support for all missing variants of the GNU sparse extensions
5196 and create files with holes when extracting sparse members.
5197
5198- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
5199
5200- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
5201 deprecate the old name ``zipfile.BadZipfile``.
5202
5203- Issue #5027: The standard ``xml`` namespace is now understood by
5204 xml.sax.saxutils.XMLGenerator as being bound to
5205 http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
5206
5207- Issue #5975: Add csv.unix_dialect class.
5208
5209- Issue #7761: telnetlib.interact failures on Windows fixed.
5210
5211- logging: Added style option to Formatter to allow %, {} or $-formatting.
5212
5213- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
5214 context manager.
5215
5216- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
5217 encode method now support a 'linesep' argument.
5218
5219- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
5220 order to support the TLS SNI extension. ``HTTPSConnection`` and ``urlopen()``
5221 also use this argument, so that HTTPS virtual hosts are now supported.
5222
5223- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
5224
5225- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
5226
5227- logging: Made StreamHandler terminator configurable.
5228
5229- logging: Allowed filters to be just callables.
5230
5231- logging: Added tests for _logRecordClass changes.
5232
5233- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
5234
5235- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
5236 increase flexibility of LogRecord creation.
5237
5238- Issue #5117: Case normalization was needed on ntpath.relpath(). Also fixed
5239 root directory issue on posixpath.relpath(). (Ported working fixes from
5240 ntpath.)
5241
5242- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
5243 short_empty_elements to direct it to use self-closing tags when appropriate.
5244
5245- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags. Add --abiflags
5246 switch to python-config for command line access.
5247
5248- Issue #6098: Don't claim DOM level 3 conformance in minidom.
5249
5250- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
5251 XML namespace attribute is encountered.
5252
5253- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
5254 characters by default. Deprecate ``cgi.escape()``.
5255
5256- Issue #9409: Fix the regex to match all kind of filenames, for interactive
5257 debugging in doctests.
5258
5259- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
5260 same instance as ``datetime.timezone.utc``.
5261
5262- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
5263 supported by the system. Patch by Nikita Vetoshkin.
5264
5265- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
5266 protocol. file:// urls had fallback to access remote hosts via ftp. This was
5267 not correct, change is made to raise a URLError when a remote host is tried to
5268 access via file:// scheme.
5269
5270- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
5271 created in modes 'a' or 'w' and then closed without adding any files. Raise
5272 BadZipfile (rather than IOError) when opening small non-ZIP files.
5273
5274- Issue #10041: The signature of optional arguments in socket.makefile() didn't
5275 match that of io.open(), and they also didn't get forwarded properly to
5276 TextIOWrapper in text mode. Patch by Kai Zhu.
5277
5278- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
5279 urllib.request.urlopen now take optional arguments to allow for server
5280 certificate checking, as recommended in public uses of HTTPS.
5281
5282- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
5283 current directory was deleted. Patch written by W. Trevor King.
5284
5285- Issue #3873: Speed up unpickling from file objects that have a peek() method.
5286
5287- Issue #10075: Add a session_stats() method to SSLContext objects.
5288
5289- Issue #9948: Fixed problem of losing filename case information.
5290
5291Extension Modules
5292-----------------
5293
5294- Issue #5109: array.array constructor will now use fast code when
5295 initial data is provided in an array object with correct type.
5296
5297- Issue #6317: Now winsound.PlaySound only accepts unicode.
5298
5299- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
5300
5301- Issue #9377: Use Unicode API for gethostname on Windows.
5302
5303- Issue #10143: Update "os.pathconf" values.
5304
5305- Issue #6518: Support context manager protcol for ossaudiodev types.
5306
5307- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
5308
5309- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
5310 version 2.0.1.
5311
5312- Issue #5355: Provide mappings from Expat error numbers to string descriptions
5313 and backwards, in order to actually make it possible to analyze error codes
5314 provided by ExpatError.
5315
5316- The Unicode database was updated to 6.0.0.
5317
5318C-API
5319-----
5320
5321- Issue #10288: The deprecated family of "char"-handling macros
5322 (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
5323
5324- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
5325 type has been introduced.
5326
5327Tools/Demos
5328-----------
5329
5330- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
5331 encoding other than ASCII or UTF-8. Source encoding is preserved when
5332 reindented code is written to a file.
5333
5334- Issue #7287: Demo/imputil/knee.py was removed.
5335
5336Tests
5337-----
5338
5339- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
5340 as unicode strings. Initial patch by Sandro Tosi.
5341
5342- Issue #10294: Remove dead code form test_unicode_file.
5343
5344- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
5345 test specific to unicode (non-ascii name and filename).
5346
5347Build
5348-----
5349
5350- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
5351
5352- Issue #8852: Allow the socket module to build on OpenSolaris.
5353
5354- Drop -OPT:Olimit compiler option.
5355
5356- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
5357
5358- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
5359
5360- Issue #7473: avoid link errors when building a framework with a different set
5361 of architectures than the one that is currently installed.
5362
5363
5364What's New in Python 3.2 Alpha 3?
5365=================================
5366
5367*Release date: 09-Oct-2010*
5368
5369Core and Builtins
5370-----------------
5371
5372- Issue #10068: Global objects which have reference cycles with their module's
5373 dict are now cleared again. This causes issue #7140 to appear again.
5374
5375- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
5376 encodings.
5377
5378- ast.literal_eval() can now handle negative numbers. It is also a little more
5379 liberal in what it accepts without compromising the safety of the evaluation.
5380 For example, 3j+4 and 3+4+5 are both accepted.
5381
5382- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
5383 result metaclasses can now be ABCs (see #9533).
5384
5385- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
5386
5387- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
5388 UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
5389 32 bits wchar_t (eg. Linux in narrow build).
5390
5391- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
5392 introduced by issue #9324.
5393
5394- Issue #9979: Create function PyUnicode_AsWideCharString().
5395
5396- Issue #7397: Mention that importlib.import_module() is probably what someone
5397 really wants to be using in __import__'s docstring.
5398
5399- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
5400 to use named arguments.
5401
5402- Issue #9930: Remove bogus subtype check that was causing (e.g.)
5403 float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
5404
5405- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
5406
5407- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
5408 threads are still running. Instead, reinitialize the GIL on a second call to
5409 Py_Initialize().
5410
5411- All SyntaxErrors now have a column offset and therefore a caret when the error
5412 is printed.
5413
5414- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
5415 module that was imported, but instead gets the module from sys.modules.
5416
5417- Issue #9213: The range type_items now provides index() and count() methods, to
5418 conform to the Sequence ABC. Patch by Daniel Urban and Daniel Stutzbach.
5419
5420- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
5421 with a non-empty format string. This is an effort to future-proof user
5422 code. If a derived class does not currently implement __format__ but later
5423 adds its own __format__, it would most likely break user code that had
5424 supplied a format string. This will be changed to a DeprecationWaring in
5425 Python 3.3 and it will be an error in Python 3.4.
5426
5427- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
5428 re-created on a subsequent call to Py_Initialize(). The problem (a crash)
5429 wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
5430
5431- Issue #9210: Configure option --with-wctype-functions was removed. Using the
5432 functions from the libc caused the methods .upper() and lower() to become
5433 locale aware and created subtly wrong results.
5434
5435- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
5436 non-ASCII byte in the format string.
5437
5438- Issue #4617: Previously it was illegal to delete a name from the local
5439 namespace if it occurs as a free variable in a nested block. This limitation
5440 of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
5441
5442- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
5443 ``\UXXXXXXXX``, regardless of whether the character is printable or not.
5444 Also, the "backslashreplace" error handler now joins surrogate pairs into a
5445 single character on UCS-2 builds.
5446
5447- Issue #9757: memoryview objects get a release() method to release the
5448 underlying buffer (previously this was only done when deallocating the
5449 memoryview), and gain support for the context management protocol.
5450
5451- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
5452 thread-local storage key.
5453
5454Library
5455-------
5456
5457- Issue #2236: distutils' mkpath ignored the mode parameter.
5458
5459- Fix typo in one sdist option (medata-check).
5460
5461- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
5462
5463- Issue #1718574: Fix options that were supposed to accept arguments but did
5464 not in build_clib.
5465
5466- Issue #9437: Fix building C extensions with non-default LDFLAGS.
5467
5468- Issue #4661: email can now parse bytes input and generate either converted
5469 7bit output or bytes output. Email version bumped to 5.1.0.
5470
5471- Issue #1589: Add ssl.match_hostname(), to help implement server identity
5472 verification for higher-level protocols.
5473
5474- Issue #9759: GzipFile now raises ValueError when an operation is attempted
5475 after the file is closed. Patch by Jeffrey Finkelstein.
5476
5477- Issue #9042: Fix interaction of custom translation classes and caching in
5478 gettext.
5479
5480- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
5481 returning a (sock, addr) pair which is called when a connection has been
5482 established with a new remote endpoint. This is supposed to be used as a
5483 replacement for old handle_accept() and avoids the user to call accept()
5484 directly.
5485
5486- Issue #9065: tarfile no longer uses "root" as the default for the uname and
5487 gname field.
5488
5489- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
5490 an environment that does not have docutils. Patch by Arfrever.
5491
5492- Issue #1050268: parseaddr now correctly quotes double quote and backslash
5493 characters that appear inside quoted strings in email addresses.
5494
5495- Issue #10004: quoprimime no longer generates a traceback when confronted with
5496 invalid characters after '=' in a Q-encoded word.
5497
5498- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
5499 sending a 200 OK for the Expect: 100-continue request header.
5500
5501- Issue #9360: Cleanup and improvements to the nntplib module. The API now
5502 conforms to the philosophy of bytes and unicode separation in Python 3. A
5503 test suite has also been added.
5504
5505- Issue #9962: GzipFile now has the peek() method.
5506
5507- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
5508 retry the select() loop instead of bailing out. This is because select() can
5509 incorrectly report a socket as ready for reading (for example, if it received
5510 some data with an invalid checksum).
5511
5512- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
5513
5514- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
5515 received. Now sendall() properly calls signal handlers if necessary, and
5516 retries sending if these returned successfully, including on sockets with a
5517 timeout.
5518
5519- Issue #9947: logging: Fixed locking bug in stopListening.
5520
5521- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
5522
5523- Issue #9936: Fixed executable lines' search in the trace module.
5524
5525- Issue #9790: Rework imports necessary for samefile and sameopenfile
5526 in ntpath.
5527
5528- Issue #9928: Properly initialize the types exported by the bz2 module.
5529
5530- Issue #1675951: Allow GzipFile to work with unseekable file objects. Patch by
5531 Florian Festi.
5532
5533- Logging: Added QueueListener class to facilitate logging usage for
5534 performance-critical threads.
5535
5536- Issue #9916: Add some missing errno symbols.
5537
5538- Issue #9877: Expose sysconfig.get_makefile_filename()
5539
5540- logging: Added hasHandlers() method to Logger and LoggerAdapter.
5541
5542- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
5543
5544- Issue #2643: msync() is not called anymore when deallocating an open mmap
5545 object, only munmap().
5546
5547- logging: Changed LoggerAdapter implementation internally, to make it easier to
5548 subclass in a useful way.
5549
5550- logging: hasHandlers method was added to Logger, and isEnabledFor,
5551 getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
5552 LoggerAdapter was introduced into the unit tests for logging.
5553
5554- Issue #1686: Fix string.Template when overriding the pattern attribute.
5555
5556- Issue #9854: SocketIO objects now observe the RawIOBase interface in
5557 non-blocking mode: they return None when an operation would block (instead of
5558 raising an exception).
5559
5560- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
5561 another kind.
5562
5563- Issue #9441: logging has better coverage for rotating file handlers.
5564
5565- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
5566
5567- Issue #9854: The default read() implementation in io.RawIOBase now handles
5568 non-blocking readinto() returning None correctly.
5569
5570- Issue #1552: socket.socketpair() now returns regular socket.socket objects
5571 supporting the whole socket API (rather than the "raw" _socket.socket
5572 objects).
5573
5574- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
5575 to match the corresponding socket methods.
5576
5577- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
5578 them handle recursive calls within the same thread.
5579
5580- logging: Enhanced HTTPHandler with secure and credentials initializers.
5581
5582- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
5583
5584- Issue #9837: The read() method of ZipExtFile objects (as returned by
5585 ZipFile.open()) could return more bytes than requested.
5586
5587- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
5588 d['x'] = d.
5589
5590- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
5591 it possible for the user to create self-referencing ordered dictionaries which
5592 become permanently uncollectable GC garbage. Reinstated the Python 3.1
5593 approach of using weakref proxies so that reference cycles never get created
5594 in the first place.
5595
5596- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
5597 encode the value with filesystem encoding and surrogateescape (instead of
5598 utf-8 in strict mode) . Patch written by David Watson.
5599
5600- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
5601 environment variable to set the filesystem encoding at Python startup.
5602 sys.setfilesystemencoding() creates inconsistencies because it is unable to
5603 reencode all filenames in all objects.
5604
5605- Issue #9410: Various optimizations to the pickle module, leading to speedups
5606 up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow;
5607 initial patch by Alexandre Vassalotti.
5608
5609- The pprint module now supports printing OrderedDicts in their given order
5610 (formerly, it would sort the keys).
5611
5612- Logging: Added QueueHandler class to facilitate logging usage with
5613 multiprocessing.
5614
5615- Issue #9707: Rewritten reference implementation of threading.local which is
5616 friendlier towards reference cycles. This change is not normally visible
5617 since an optimized C implementation (_thread._local) is used instead.
5618
5619- Issue #6394: os.getppid() is now supported on Windows. Note that it will
5620 still return the id of the parent process after it has exited. This process
5621 id may even have been reused by another unrelated process.
5622
5623- Issue #9792: In case of connection failure, socket.create_connection() would
5624 swallow the exception and raise a new one, making it impossible to fetch the
5625 original errno, or to filter timeout errors. Now the original error is
5626 re-raised.
5627
5628- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
5629 the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
5630 back after the system call. Original patch by Brian Brazil.
5631
5632- Updates to the random module:
5633
5634 * Document which parts of the module are guaranteed to stay the same across
5635 versions and which parts are subject to change.
5636
5637 * Update the seed() method to use all of the bits in a string instead of just
5638 the hash value. This makes better use of the seed value and assures the
5639 seeding is platform independent. Issue #7889.
5640
5641 * Improved the random()-->integer algorithm used in choice(), shuffle(),
5642 sample(), randrange(), and randint(). Formerly, it used int(n*random())
5643 which has a slight bias whenever n is not a power of two. Issue #9025.
5644
5645 * Improved documentation of arguments to randrange(). Issue #9379.
5646
5647- collections.OrderedDict now supports a new method for repositioning keys to
5648 either end.
5649
5650- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
5651 cases now also have assertWarns and assertWarnsRegexp methods to check that a
5652 given warning type was triggered by the code under test.
5653
5654- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
5655 their contents without duplicating them. The view is both readable and
5656 writable.
5657
5658- Issue #7566: Implement os.path.sameopenfile for Windows.
5659
5660- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
5661 unsupported operation is attempted (for example, writing to a file open only
5662 for reading).
5663
5664- hashlib has two new constant attributes: algorithms_guaranteed and
5665 algorithms_avaiable that respectively list the names of hash algorithms
5666 guaranteed to exist in all Python implementations and the names of hash
5667 algorithms available in the current process.
5668
5669- A new package ``concurrent.futures`` as defined by PEP 3148.
5670
5671C-API
5672-----
5673
5674- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
5675
5676- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
5677 PySequence_DelSlice when the object doesn't have any mapping operations
5678 defined.
5679
5680Tools/Demos
5681-----------
5682
5683- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
5684 wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
5685 and the interpreter under test.
5686
5687Tests
5688-----
5689
5690- Issue #9308: Added tests for importing encoded modules that do not
5691 depend on specific stdlib modules being encoded in a certain way.
5692
5693- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
5694 certificate and private key files used by SSL-related certs.
5695
5696- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
5697 in test_os)
5698
5699- Issue #7110: regrtest now sends test failure reports and single-failure
5700 tracebacks to stderr rather than stdout.
5701
5702- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
5703
5704- Issue #9899: Fix test_tkinter.test_font on various platforms. Patch by Ned
5705 Deily.
5706
5707- Issue #9894: Do not hardcode ENOENT in test_subprocess.
5708
5709- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
5710
5711- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
5712 case when running profile or trace, for example.
5713
5714- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
5715
5716Build
5717-----
5718
5719- Issue #10062: Allow building on platforms which do not have sem_timedwait.
5720
5721- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by Akira
5722 Kitada.
5723
5724- Issue #10055: Make json C89-compliant in UCS4 mode.
5725
5726- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
5727
5728- Issue #1633863: Don't ignore $CC under AIX.
5729
5730- Issue #9810: Compile bzip2 source files in Python's project file directly. It
5731 used to be built with bzip2's makefile.
5732
5733- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
5734 module.
5735
5736- Issue #9806: python-config now has an ``--extension-suffix`` option that
5737 outputs the suffix for dynamic libraries including the ABI version name
5738 defined by PEP 3149.
5739
5740- Issue #941346: Improve the build process under AIX and allow Python to be
5741 built as a shared library. Patch by Sébastien Sablé.
5742
5743- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
5744 Sablé.
5745
5746- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
5747 the "bin" directory inside the framework is on the shell's search path. This
5748 feature now also supports the ZSH shell.
5749
5750
5751What's New in Python 3.2 Alpha 2?
5752=================================
5753
5754*Release date: 05-Sep-2010*
5755
5756Core and Builtins
5757-----------------
5758
5759- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
5760 the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but our
5761 bytecode is a bit simplified. Patch by Demur Rumed.
5762
5763- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
5764 confusion with the proper variables names from 'warnings' itself.
5765
5766- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
5767 conform to the Set ABC. Patch by Daniel Urban.
5768
5769- Issue #9737: Fix a crash when trying to delete a slice or an item from a
5770 memoryview object.
5771
5772- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
5773 now removed, since their effect was inexistent in 3.x (the default encoding is
5774 hardcoded to utf-8 and cannot be changed).
5775
5776- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
5777 properly. Patch by Stefan Behnel.
5778
5779- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
5780 platforms. Previously, it inlined only when using Microsoft Visual C.
5781
5782- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
5783
5784- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
5785
5786- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
5787 the pyconfig.h generated by configure on other systems.
5788
5789- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
5790 occur during attribute lookup are now propagated to the caller.
5791
5792- Issue #8622: Add PYTHONFSENCODING environment variable to override the
5793 filesystem encoding.
5794
5795- Issue #5127: The C functions that access the Unicode Database now accept and
5796 return characters from the full Unicode range, even on narrow unicode builds
5797 (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
5798 in Python is that unicodedata.numeric() now returns the correct value for
5799 large code points, and repr() may consider more characters as printable.
5800
5801- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
5802 as a unicode object, instead of a byte string. Function needed to support
5803 unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
5804 function.
5805
5806- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
5807
5808- Issue #9612: The set object is now 64-bit clean under Windows.
5809
5810- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
5811 the module file to be executed with the -m command line option.
5812
5813- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
5814 write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
5815 sys.stderr.
5816
5817- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
5818 decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
5819 objects are output as-is.
5820
5821- Issue #9203: Computed gotos are now enabled by default on supported compilers
5822 (which are detected by the configure script). They can still be disable
5823 selectively by specifying --without-computed-gotos.
5824
5825- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
5826 use PyUnicode_FromFormatV() to format the warning message.
5827
5828- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
5829 array.
5830
5831- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
5832
5833- Issue #9337: The str() of a float or complex number is now identical to its
5834 repr().
5835
5836- Issue #9416: Fix some issues with complex formatting where the output with no
5837 type specifier failed to match the str output:
5838
5839 - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
5840 - format(complex(0.0, 2.0), '-') included a sign and parentheses.
5841
5842Extension Modules
5843-----------------
5844
5845- Issue #8013: time.asctime and time.ctime no longer call system
5846 asctime and ctime functions. The year range for time.asctime is now
5847 1900 through maxint. The range for time.ctime is the same as for
5848 time.localtime. The string produced by these functions is longer
5849 than 24 characters when year is greater than 9999.
5850
5851- Issue #6608: time.asctime is now checking struct tm fields its input
5852 before passing it to the system asctime. Patch by MunSic Jeong.
5853
5854- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
5855 descriptor is provided. Patch by Pascal Chambon.
5856
5857- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
5858 posix module. Patch by Marcin Bachry.
5859
5860- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
5861 socket module, and fix the width of socket descriptors to be correctly
5862 detected under 64-bit Windows.
5863
5864- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
5865 and gethostbyaddr. getnameinfo is now restricted to numeric addresses as
5866 input.
5867
5868- Issue #9214: Set operations on a KeysView or ItemsView in collections now
5869 correctly return a set. Patch by Eli Bendersky.
5870
5871- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
5872 Matthew Ahrens.
5873
5874- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
5875 the surrogate error handler.
5876
5877- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
5878 than ``TypeError`` raised by the iterator argument.
5879
5880- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
5881
5882- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
5883 Lock around all system calls. Original patch by Ryan Kelly.
5884
5885- Issue #8524: Add a detach() method to socket objects, so as to put the socket
5886 into the closed state without closing the underlying file descriptor.
5887
5888- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
5889
5890- Issue #6869: Fix a refcount problem in the _ctypes extension.
5891
5892- Issue #5504: ctypes should now work with systems where mmap can't be
5893 PROT_WRITE and PROT_EXEC.
5894
5895- Issue #9507: Named tuple repr will now automatically display the right name in
5896 a tuple subclass.
5897
5898- Issue #9324: Add parameter validation to signal.signal on Windows in order to
5899 prevent crashes.
5900
5901- Issue #9526: Remove some outdated (int) casts that were preventing the array
5902 module from working correctly with arrays of more than 2**31 elements.
5903
5904- Fix memory leak in ssl._ssl._test_decode_cert.
5905
5906- Issue #8065: Fix memory leak in readline module (from failure to free the
5907 result of history_get_history_state()).
5908
5909- Issue #9450: Fix memory leak in readline.replace_history_item and
5910 readline.remove_history_item for readline version >= 5.0.
5911
5912- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
5913
5914- Issue #8046: Add context manager protocol support and .closed property to mmap
5915 objects.
5916
5917Library
5918-------
5919
5920- Issue #7451: Improve decoding performance of JSON objects, and reduce the
5921 memory consumption of said decoded objects when they use the same strings as
5922 keys.
5923
5924- Issue #1100562: Fix deep-copying of objects derived from the list and dict
5925 types. Patch by Michele Orrù and Björn Lindqvist.
5926
5927- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
5928
5929- Issue #9421: Made the get<type> methods consistently accept the vars and
5930 default arguments on all parser classes.
5931
5932- Issue #7005: Fixed output of None values for RawConfigParser.write and
5933 ConfigParser.write.
5934
5935- Issue #8990: array.fromstring() and array.tostring() get renamed to
5936 frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
5937 array.frombytes(), array.extend() as well as the array.array() constructor now
5938 accept bytearray objects. Patch by Thomas Jollans.
5939
5940- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
5941 issues when socket.close is called from a __del__ method.
5942
5943- Issue #9706: ssl module provides a better error handling in various
5944 circumstances.
5945
5946- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
5947 rid of the cached copy of thread-local attribute dictionary.
5948
5949- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
5950 are rounded to the nearest integer.
5951
5952- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
5953 falling into recursion.
5954
5955- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
5956 character years even if the message contains RFC822 two character years.
5957
5958- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
5959 operations on its self, namely x -= x and x ^= x.
5960
5961- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
5962 handling when accepting a new connection.
5963
5964- Issue #9601: ftplib now provides a workaround for non-compliant
5965 implementations such as IIS shipped with Windows server 2003 returning invalid
5966 response codes for MKD and PWD commands.
5967
5968- Issue #658749: asyncore's connect() method now correctly interprets winsock
5969 errors.
5970
5971- Issue #9501: Fixed logging regressions in cleanup code.
5972
5973- Fix functools.total_ordering() to skip methods inherited from object.
5974
5975- Issue #9572: Importlib should not raise an exception if a directory it thought
5976 it needed to create was done concurrently by another process.
5977
5978- Issue #9617: Signals received during a low-level write operation aren't
5979 ignored by the buffered IO layer anymore.
5980
5981- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
5982
5983- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
5984 error handler, or strict error handler on Windows.
5985
5986- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
5987 ``gzip.decompress``. Original patch by Anand B. Pillai.
5988
5989- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
5990 ssl.SSLContext object allowing bundling SSL configuration options,
5991 certificates and private keys into a single (potentially long-lived)
5992 structure.
5993
5994- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
5995 single keyword arguments.
5996
5997- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
5998 compiler flag values over defining its own.
5999
6000- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
6001 formatted code information in a string rather than displaying on screen.
6002
6003- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
6004 pointing to the original callable.
6005
6006- Issue #3445: functools.update_wrapper now tolerates missing attributes on
6007 wrapped callables.
6008
6009- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
6010
6011- Issue #9605: posix.getlogin() decodes the username with file filesystem
6012 encoding and surrogateescape error handler. Patch written by David Watson.
6013
6014- Issue #9604: posix.initgroups() encodes the username using the fileystem
6015 encoding and surrogateescape error handler. Patch written by David Watson.
6016
6017- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
6018 using the filesystem encoding and surrogateescape error handler. Patch written
6019 by David Watson.
6020
6021- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
6022 for use with the statvfs() function. Patch by Adam Jackson.
6023
6024- Issue #8688: MANIFEST files created by distutils now include a magic comment
6025 indicating they are generated. Manually maintained MANIFESTs without this
6026 marker will not be overwritten or removed.
6027
6028- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
6029 BadZipfile error is raised if it doesn't match (as used to be the case in
6030 Python 2.5 and earlier).
6031
6032- Issue #9550: a BufferedReader could issue an additional read when the original
6033 read request had been satisfied, which could block indefinitely when the
6034 underlying raw IO channel was e.g. a socket. Report and original patch by
6035 Jason V. Miller.
6036
6037- Issue #3757: thread-local objects now support cyclic garbage collection.
6038 Thread-local objects involved in reference cycles will be deallocated timely
6039 by the cyclic GC, even if the underlying thread is still running.
6040
6041- Issue #9452: Add read_file, read_string, and read_dict to the configparser
6042 API; new source attribute to exceptions.
6043
6044- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
6045 node.
6046
6047- Issue #8047: Fix the xml.etree serializer to return bytes by default. Use
6048 ``encoding="unicode"`` to generate a Unicode string.
6049
6050- Issue #8280: urllib2's Request method will remove fragments in the url. This
6051 is how it is supposed to work, wget and curl do the same. Previous behavior
6052 was wrong.
6053
6054- Issue #6683: For SMTP logins we now try all authentication methods advertised
6055 by the server. Many servers are buggy and advertise authentication methods
6056 they do not support in reality.
6057
6058- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
6059 included in the set of attributes copied by default by functools.wraps and
6060 functools.update_wrapper. Patch by Terrence Cole.
6061
6062- Issue #2944: asyncore doesn't handle connection refused correctly.
6063
6064- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
6065 the private attributes. Add tests for smtpd module.
6066
6067- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
6068 encoded in base64 is lacking padding.
6069
6070- Issue #9444: Argparse now uses the first element of prefix_chars as the option
6071 character for the added 'h/help' option if prefix_chars does not contain a
6072 '-', instead of raising an error.
6073
6074- Issue #7372: Fix pstats regression when stripping paths from profile data
6075 generated with the profile module.
6076
6077- Issue #9428: Fix running scripts with the profile/cProfile modules from the
6078 command line.
6079
6080- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
6081 browser.
6082
6083- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
6084 expressions.
6085
6086- Update collections.OrderedDict to match the implementation in Py2.7 (based on
6087 lists instead of weakly referenced Link objects).
6088
6089- Issue #8397: Raise an error when attempting to mix iteration and regular reads
6090 on a BZ2File object, rather than returning incorrect results.
6091
6092- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
6093 re-initializing a buffered IO object by calling its ``__init__`` method.
6094
6095- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
6096 across devices.
6097
6098- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
6099
6100- Issue #1690103: Fix initial namespace for code run with trace.main().
6101
6102- Issue #7395: Fix tracebacks in pstats interactive browser.
6103
6104- Issue #8230: Fix Lib/test/sortperf.py.
6105
6106- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
6107 newline, it no longer truncates the last character of the last command line.
6108
6109- Issue #5146: Handle UID THREAD command correctly in imaplib.
6110
6111- Issue #5147: Fix the header generated for cookie files written by
6112 http.cookiejar.MozillaCookieJar.
6113
6114- Issue #8198: In pydoc, output all help text to the correct stream when
6115 sys.stdout is reassigned.
6116
6117- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
6118 in ntpath.normpath().
6119
6120- Issue #1286: Allow using fileinput.FileInput as a context manager.
6121
6122- Add lru_cache() decorator to the functools module.
6123
6124Tools/Demos
6125-----------
6126
6127- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
6128
6129- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
6130 non-ASCII content.
6131
6132Tests
6133-----
6134
6135- Issue #9601: Provide a test case for ftplib.parse257.
6136
6137- Issue #8857: Provide a test case for socket.getaddrinfo.
6138
6139- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
6140
6141- Issue #8433: Fix test_curses failure with newer versions of ncurses.
6142
6143- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
6144 Michele Orrù.
6145
6146- Issue #8687: provide a test suite for sched.py module.
6147
6148Build
6149-----
6150
6151- Issue #1303434: Generate ZIP file containing all PDBs.
6152
6153- Issue #9193: PEP 3149 is accepted.
6154
6155- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
6156 become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
6157
6158- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
6159 Sébastien Sablé.
6160
6161- Don't run pgen twice when using make -j.
6162
6163
6164What's New in Python 3.2 Alpha 1?
6165=================================
6166
6167*Release date: 01-Aug-2010*
6168
6169Core and Builtins
6170-----------------
6171
6172- Issue #8991: convertbuffer() rejects discontigious buffers.
6173
6174- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
6175 compiler.
6176
6177- Issue #8413: structsequence now subclasses tuple.
6178
6179- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
6180 start byte and the continuation byte(s) are now considered invalid, instead of
6181 the number of bytes specified by the start byte. E.g.:
6182 '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
6183 with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
6184 even if '\xf1' is the start byte of a 4-bytes sequence. Previous versions
6185 returned a single u'\ufffd'.
6186
6187- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
6188 rather than 0.0. So "-7j" is now exactly equivalent to "-(7j)".
6189
6190- Be more specific in error messages about positional arguments.
6191
6192- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
6193 objects, as described in the documentation.
6194
6195- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
6196 Fix the encoding of the modules filename. Patch written by Amaury Forgeot
6197 d'Arc.
6198
6199- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
6200 dealing with unary minus applied to a constant. The removed code was mutating
6201 the ST, causing a second compilation to fail.
6202
6203- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
6204 mode raises unicode errors. The encoder only supports "strict" and "replace"
6205 error handlers, the decoder only supports "strict" and "ignore" error
6206 handlers. Patch written by Mark Hammond.
6207
6208- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
6209 "w*" format instead. Add tests for "w*" format.
6210
6211- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
6212 formats if the string contains a null byte/character. Write unit tests for
6213 string formats.
6214
6215- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
6216 suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
6217 location of the raised exception.
6218
6219- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
6220 filenames and enable os.fsencode().
6221
6222- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
6223
6224- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
6225 interpreter with characters outside the Basic Multilingual Plane (higher than
6226 0x10000).
6227
6228- Issue #8950: (See also issue #5080). Py_ArgParse*() functions now raise
6229 TypeError instead of giving a DeprecationWarning when a float is parsed using
6230 the 'L' code (for long long). (All other integer codes already raise
6231 TypeError in this case.)
6232
6233- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
6234 enable shortcuts for upper case encoding name. Add also a shortcut for
6235 "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
6236
6237- Issue #8838: Remove codecs.charbuffer_encode() function. The buffer protocol
6238 doesn't support "char buffer" anymore in Python 3.
6239
6240- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
6241 instead. codecs.charbuffer_encode() now accepts modifiable buffer objects
6242 like bytearray.
6243
6244- Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is no
6245 used anymore and it was never documented.
6246
6247- In str.format(), raise a ValueError when indexes to arguments are too large.
6248
6249- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
6250 integers n (including n = -909).
6251
6252- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
6253 of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
6254 easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
6255 equal value.
6256
6257- Issue #8748: Fix two issues with comparisons between complex and integer
6258 objects. (1) The comparison could incorrectly return True in some cases
6259 (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
6260 (2) The comparison raised an OverflowError for large integers, leading to
6261 unpredictable exceptions when combining integers and complex objects in sets
6262 or dicts.
6263
6264- Issue #8766: Initialize _warnings module before importing the first module.
6265 Fix a crash if an empty directory called "encodings" exists in sys.path.
6266
6267- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
6268 encoding and surrogateescape error handler instead of the locale encoding to
6269 be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
6270
6271- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
6272 of strict) error handler to escape surrogates.
6273
6274- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
6275 object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
6276 handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall
6277 back to UTF-8.
6278
6279- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
6280 error handler, not only the default error handler (strict).
6281
6282- Issue #8610: Load file system codec at startup, and display a fatal error on
6283 failure. Set the file system encoding to utf-8 (instead of None) if getting
6284 the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
6285
6286- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
6287 PyUnicode_FromString() to support surrogates in the filename and use the right
6288 encoding.
6289
6290- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
6291
6292- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
6293
6294- Issue #8419: Prevent the dict constructor from accepting non-string keyword
6295 arguments.
6296
6297- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
6298 indirectly Python signal handlers anymore because mywrite() ignores exceptions
6299 (KeyboardInterrupt).
6300
6301- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
6302 unicode string (eg. backslashreplace).
6303
6304- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
6305 anymore, you have to convert your bytearray filenames to bytes.
6306
6307- Issue #7332: Remove the 16KB stack-based buffer in
6308 PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
6309 compared to the dynamic memory allocation fallback. Patch by Charles-François
6310 Natali.
6311
6312- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
6313 passed to bytes or bytearray.
6314
6315- Issue #7301: Add environment variable $PYTHONWARNINGS.
6316
6317- Issue #8329: Don't return the same lists from select.select when no fds are
6318 changed.
6319
6320- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
6321 64-bit machines. The shift count for either left or right shift is permitted
6322 to be up to sys.maxsize.
6323
6324- Ensure that tokenization of identifiers is not affected by locale.
6325
6326- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
6327
6328- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
6329
6330- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
6331 is set.
6332
6333- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
6334 is unknown.
6335
6336- Issue #1583863: A str subclass can now override the __str__ method.
6337
6338- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
6339 PyMemberDefs could produce an internal error; raise TypeError instead.
6340
6341- Issue #7845: Rich comparison methods on the complex type now return
6342 NotImplemented rather than raising a TypeError when comparing with an
6343 incompatible type; this allows user-defined classes to implement their own
6344 comparisons with complex.
6345
6346- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
6347 (SIGINT). If an error occurs while importing the site module, the error is
6348 printed and Python exits. Initialize the GIL before importing the site module.
6349
6350- Issue #7173: Generator finalization could invalidate sys.exc_info().
6351
6352- Issue #7544: Preallocate thread memory before creating the thread to avoid a
6353 fatal error in low memory condition.
6354
6355- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
6356 check fails.
6357
6358- Handle errors from looking up __prepare__ correctly.
6359
6360- Issue #5939: Add additional runtime checking to ensure a valid capsule in
6361 Modules/_ctypes/callproc.c.
6362
6363- Issue #7309: Fix unchecked attribute access when converting
6364 UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
6365
6366- Issue #6902: Fix problem with built-in types format incorrectly with 0
6367 padding.
6368
6369- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
6370 Now it matches other numeric types.
6371
6372- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
6373 PyOS_ascii_strtod, and PyOS_ascii_atof. Use PyOS_double_to_string and
6374 PyOS_string_to_double instead. See issue #5835 for the original deprecations.
6375
6376- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
6377 fails. Patch by Florent Xicluna.
6378
6379- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
6380 very large step value.
6381
6382- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
6383 add the additional members returned in an OSVERSIONINFOEX structure. The new
6384 members are service_pack_major, service_pack_minor, suite_mask, and
6385 product_type.
6386
6387- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
6388 crash in many places because of the PyByteArray_AS_STRING() macro returning
6389 NULL. The macro now returns a statically allocated empty string instead.
6390
6391- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
6392 where the right hand operand is a set of constants, by turning the set into a
6393 frozenset and pre-building it as a constant. The comparison operation is made
6394 against the constant instead of building a new set each time it is executed (a
6395 similar optimization already existed which turned a list of constants into a
6396 pre-built tuple). Patch and additional tests by Dave Malcolm.
6397
6398- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
6399 of bytes, bytearray and unicode objects by using a common implementation based
6400 on stringlib's fast search. Patch by Florent Xicluna.
6401
6402- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
6403 including: (1) a serious 'wrong output' bug that could occur for long (> 40
6404 digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
6405 parsing certain long numeric strings corresponding to subnormal values, (3) a
6406 memory leak for some values large enough to cause overflow, and (4) a number
6407 of flaws that could lead to incorrectly rounded results.
6408
6409- The __complex__ method is now looked up on the class of instances to make it
6410 consistent with other special methods.
6411
6412- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
6413 `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
6414
6415- Issue #7604: Deleting an unset slotted attribute did not raise an
6416 AttributeError.
6417
6418- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
6419 in ** operator. The behaviour now conforms to that described in C99 Annex F.
6420
6421- Issue #1811: improve accuracy and cross-platform consistency for true division
6422 of integers: the result of a/b is now correctly rounded for ints a and b (at
6423 least on IEEE 754 platforms), and in particular does not depend on the
6424 internal representation of an int.
6425
6426- Issue #6834: replace the implementation for the 'python' and 'pythonw'
6427 executables on OSX.
6428
6429 These executables now work properly with the arch(1) command: ``arch -ppc
6430 python`` will start a universal binary version of python in PPC mode (unlike
6431 previous releases).
6432
6433- Issue #7466: Segmentation fault when the garbage collector is called in the
6434 middle of populating a tuple. Patch by Florent Xicluna.
6435
6436- Issue #7419: setlocale() could crash the interpreter on Windows when called
6437 with invalid values.
6438
6439- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
6440 mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
6441
6442- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
6443 10.6.
6444
6445- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
6446
6447- Issue #6970: Remove redundant calls when comparing objects that don't
6448 implement the relevant rich comparison methods.
6449
6450- Issue #7298: Fixes for range and reversed(range(...)). Iteration over
6451 range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
6452 long but the length of the range did not. Also fix several cases where
6453 reversed(range(a, b, c)) gave wrong results, and fix a refleak for
6454 reversed(range(a, b, c)) with large arguments.
6455
6456- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
6457 during the formation of an output tuple.
6458
6459- Issue #3297: On wide unicode builds, do not split unicode characters into
6460 surrogates.
6461
6462- Remove length limitation when constructing a complex number from a string.
6463
6464- Issue #1087418: Boost performance of bitwise operations for longs.
6465
6466- Support for AtheOS has been completely removed from the code base. It was
6467 disabled since Python 3.0.
6468
6469- Support for several legacy threading libraries has been disabled. These
6470 libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
6471 will be entirely removed in 3.3.
6472
6473- Support for OSF* has been disabled. If nobody stands up, support will be
6474 removed in 3.3. See <http://bugs.python.org/issue8606>.
6475
6476- Peephole constant folding had missed UNARY_POSITIVE.
6477
6478- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
6479 fixes the problem of some exceptions being thrown at shutdown when the
6480 interpreter is killed. Patch by Adam Olsen.
6481
6482- Issue #7147: Remove support for compiling Python without complex number
6483 support.
6484
6485- Issue #7120: logging: Removed import of multiprocessing which is causing crash
6486 in GAE.
6487
6488- Issue #1754094: Improve the stack depth calculation in the compiler. There
6489 should be no other effect than a small decrease in memory use. Patch by
6490 Christopher Tur Lesniewski-Laas.
6491
6492- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
6493 byte values greater than 127. Patch by Derk Drukker.
6494
6495- Issue #1571184: The Unicode database contains properties for more characters.
6496 The tables for code points representing numeric values, white spaces or line
6497 breaks are now generated from the official Unicode Character Database files,
6498 and include information from the Unihan.txt file.
6499
6500- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
6501 producing internally inconsistent Python longs.
6502
6503- Issue #6990: Fix threading.local subclasses leaving old state around after a
6504 reference cycle GC which could be recycled by new locals.
6505
6506- Issue #5460: Fix an ambiguity in the grammar.
6507
6508- Issue #1766304: Improve performance of membership tests on range objects.
6509
6510- Issue #6713: Improve performance of integer -> string conversions.
6511
6512- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
6513
6514- Issue #6750: A text file opened with io.open() could duplicate its output when
6515 writing from multiple threads at the same time.
6516
6517- Issue #6707: dir() on an uninitialized module caused a crash.
6518
6519- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
6520
6521- Issue #6573: set.union() stopped processing inputs if an instance of self
6522 occurred in the argument chain.
6523
6524- Issue #6070: On posix platforms import no longer copies the execute bit from
6525 the .py file to the .pyc file if it is set.
6526
6527- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
6528
6529- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
6530 and not an int. Fix the corresponding error message, and the documentation.
6531
6532- The deprecated PyCObject has been removed.
6533
6534- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a
6535 build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
6536 of stdint.h on that platform.
6537
6538- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
6539 'surrogateescape' error handler, a string which contains unpaired surrogates.
6540
6541- Issue #4856: Remove checks for win NT.
6542
6543- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
6544 to construct a null-initialized bytes object.
6545
6546- Issue #1023290: Add from_bytes() and to_bytes() methods to integers. These
6547 methods allow the conversion of integers to bytes, and vice-versa.
6548
6549- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
6550 from being copied with copy.copy(), and bytes subclasses from being pickled
6551 properly.
6552
6553- Code objects now support weak references.
6554
6555- Issue #7072: isspace(0xa0) is true on Mac OS X.
6556
6557- Issue #8084: PEP 370 now conforms to system conventions for framework builds
6558 on MacOS X. That is, "python setup.py install --user" will install into
6559 "~/Library/Python/2.7" instead of "~/.local".
6560
6561C-API
6562-----
6563
6564- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
6565 variable argument list. `Py_VA_COPY` is equivalent to C99
6566 `va_copy`, but available on all python platforms.
6567
6568- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
6569 instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX]. This makes it safe to do
6570 "step = -step" when reversing a slice.
6571
6572- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
6573 interpreter to set sys.argv without also modifying sys.path. This helps fix
6574 `CVE-2008-5983
6575 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
6576
6577- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
6578 strings in an efficient manner.
6579
6580- Issue #8276: PyEval_CallObject() is now only available in macro form. The
6581 function declaration, which was kept for backwards compatibility reasons, is
6582 now removed (the macro was introduced in 1997!).
6583
6584- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
6585 PyLong_AsLongAndOverflow.
6586
6587- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
6588 has '\0' at the end.
6589
6590- Issue #5080: The argument parsing functions PyArg_ParseTuple,
6591 PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
6592 PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
6593 'L' format code. This will become a TypeError in a future version of Python,
6594 to match the behaviour of the other integer format codes.
6595
6596- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
6597
6598- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
6599 PyArg_ParseTupleAndKeywords.
6600
6601- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
6602 PyErr_Format, on machines with HAVE_LONG_LONG defined.
6603
6604- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
6605 PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be should used for
6606 accessing the d_type and d_name members of structures using PyDescr_COMMON.
6607
6608- Issue #6405: Remove duplicate type declarations in descrobject.h.
6609
6610- The code flags for old __future__ features are now available again.
6611
6612- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
6613 PyCode_Addr2Line().
6614
6615- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
6616 object at a specified file, function, and line number.
6617
6618- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
6619 ``const char *`` as the string is stored beyond the call.
6620
6621- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
6622 allocator will be automatically disabled when running under Valgrind. This
6623 gives improved memory leak detection when running under Valgrind, while taking
6624 advantage of pymalloc at other times.
6625
6626Library
6627-------
6628
6629- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
6630 old commands are restored.
6631
6632- For traceback debugging, the pdb listing now also shows the locations where
6633 the exception was originally (re)raised, if it differs from the last line
6634 executed (e.g. in case of finally clauses).
6635
6636- The pdb command "source" has been added. It displays the source code for a
6637 given object, if possible.
6638
6639- The pdb command "longlist" has been added. It displays the whole source code
6640 for the current function.
6641
6642- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
6643 output into methods.
6644
6645- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
6646 emit a message when a breakpoint is enabled or disabled.
6647
6648- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
6649 top-level debugged frame.
6650
6651- Issue #5727: Restore the ability to use readline when calling into pdb in
6652 doctests.
6653
6654- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
6655 source file to be debugged is in a non-builtin encoding.
6656
6657- Issue #8048: Prevent doctests from failing when sys.displayhook has been
6658 reassigned.
6659
6660- Issue #8015: In pdb, do not crash when an empty line is entered as a
6661 breakpoint command.
6662
6663- In pdb, allow giving a line number to the "until" command.
6664
6665- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
6666 files. Also, add a command-line option "-c" that runs a command as if given
6667 in .pdbrc.
6668
6669- Issue #4179: In pdb, allow "list ." as a command to return to the currently
6670 debugged line.
6671
6672- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
6673 entries, consider the first one.
6674
6675- Issue #6630: Allow customizing regex flags when subclassing the
6676 string.Template class.
6677
6678- Issue #9411: Allow specifying an encoding for config files in the configparser
6679 module.
6680
6681- Issue #1682942: Improvements to configparser: support alternate delimiters,
6682 alternate comment prefixes and empty lines in values.
6683
6684- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
6685
6686- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
6687
6688- Issue #9378: python -m pickle <pickle file> will now load and display the
6689 first object in the pickle file.
6690
6691- Issue #4770: Restrict binascii module to accept only bytes (as specified).
6692 And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
6693 before ASCII-to-binary decoding.
6694
6695- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
6696
6697- The default size of the re module's compiled regular expression cache has been
6698 increased from 100 to 500 and the cache replacement policy has changed from
6699 simply clearing the entire cache on overflow to forgetting the least recently
6700 used cached compiled regular expressions. This is a performance win for
6701 applications that use a lot of regular expressions and limits the impact of
6702 the performance hit anytime the cache is exceeded.
6703
6704- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
6705
6706- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
6707 error occurs when the server closes the socket and the client sends a big
6708 XML-RPC request.
6709
6710- Issue #4629: getopt raises an error if an argument ends with "=", whereas
6711 getopt doesn't accept a value (eg. --help= is rejected if getopt uses
6712 ['help='] long options).
6713
6714- Issue #7989: Added pure python implementation of the `datetime` module. The C
6715 module is renamed to `_datetime` and if available, overrides all classes
6716 defined in datetime with fast C impementation. Python implementation is based
6717 on the original python prototype for the datetime module by Tim Peters with
6718 minor modifications by the PyPy project. The test suite now tests `datetime`
6719 module with and without `_datetime` acceleration using the same test cases.
6720
6721- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
6722
6723- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the
6724 script being traced. Patch by Eli Bendersky.
6725
6726- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for
6727 the patch.
6728
6729- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
6730 parameters.
6731
6732- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
6733 which controls printing of opcode descriptions in ``dis()`` output.
6734
6735- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
6736 crosses an 8192 byte boundary.
6737
6738- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
6739
6740- ``ast.literal_eval()`` now allows byte literals.
6741
6742- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
6743 keyword arguments called 'self' or 'other' specially.
6744
6745- ``ast.literal_eval()`` now allows set literals.
6746
6747- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
6748
6749- Issue #7646: The fnmatch pattern cache no longer grows without bound.
6750
6751- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
6752 produced when profiling the decimal module. This was due to a dangerous
6753 iteration over 'locals()' in Context.__init__.
6754
6755- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
6756 and the exponent is tiny (for example, ``Decimal(10) **
6757 Decimal('1e-999999999')``).
6758
6759- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
6760
6761- Issue #9130: Fix validation of relative imports in parser module.
6762
6763- Issue #9128: Fix validation of class decorators in parser module.
6764
6765- Issue #9094: python -m pickletools will now disassemble pickle files listed in
6766 the command line arguments. See output of python -m pickletools -h for more
6767 details.
6768
6769- Issue #5468: urlencode to handle bytes type and other encodings in its query
6770 parameter. Patch by Dan Mahn.
6771
6772- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
6773 ensure that the input string length is a multiple of the frame size.
6774
6775- Issue #6507: Accept source strings in dis.dis(). Original patch by Daniel
6776 Urban.
6777
6778- Issue #7829: Clearly document that the dis module is exposing an
6779 implementation detail that is not stable between Python VMs or releases.
6780
6781- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
6782 raises an exception.
6783
6784- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
6785 that act as both context managers and decorators. contextmanager changes to
6786 use ContextDecorator.
6787
6788- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
6789 for removal in Python 3.4.
6790
6791- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
6792 giving the number of frames to go.
6793
6794- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
6795 ``str`` or ``bytes``.
6796
6797- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
6798 OpenSSL structure.
6799
6800- Issue #8682: The ssl module now temporary increments the reference count of a
6801 socket object got through ``PyWeakref_GetObject``, so as to avoid possible
6802 deallocation while the object is still being used.
6803
6804- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
6805 password instead of presenting an interactive prompt. Older behavior can be
6806 obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
6807
6808- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
6809 smart enough to find source files in the linecache.
6810
6811- Issue #5610: feedparser no longer eats extra characters at the end of a body
6812 part if the body part ends with a ``\r\n``.
6813
6814- Issue #8986: math.erfc was incorrectly raising OverflowError for values
6815 between -27.3 and -30.0 on some platforms.
6816
6817- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
6818
6819- Issue #8966: If a ctypes structure field is an array of c_char, convert its
6820 value to bytes instead of str (as done for c_char and c_char_p).
6821
6822- Issue #8188: Comparisons between Decimal and Fraction objects are now
6823 permitted, returning a result based on the exact numerical values of the
6824 operands. This builds on issue #2531, which allowed Decimal-to-float
6825 comparisons; all comparisons involving numeric types (bool, int, float,
6826 complex, Decimal, Fraction) should now act as expected.
6827
6828- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
6829 Thomas Jollans.
6830
6831- Issue #8899: time.struct_time now has class and attribute docstrings.
6832
6833- Issue #6470: Drop UNC prefix in FixTk.
6834
6835- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
6836 strings. They are now correctly converted to strings.
6837
6838- Issue #8833: tarfile created hard link entries with a size field != 0 by
6839 mistake.
6840
6841- Charset.body_encode now correctly handles base64 encoding by encoding with the
6842 output_charset before calling base64mime.encode. Passes the tests from 2.x
6843 issue #1368247.
6844
6845- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
6846 attribute that is True iff there are uncommitted changes.
6847
6848- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
6849 divided by float and int objects. Results are rounded to the nearest multiple
6850 of timedelta.resolution with ties resolved using round-half-to-even method.
6851
6852- Issue #7150: Raise OverflowError if the result of adding or subtracting
6853 timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
6854
6855- Issue #8806: add SSL contexts support to ftplib.
6856
6857- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
6858 and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
6859 API.
6860
6861- Issue #8770: Now sysconfig displays information when it's called as a script.
6862 Initial idea by Sridhar Ratnakumar.
6863
6864- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
6865 Fredrik Håård.
6866
6867- Issue #8540: Decimal module: rename the Context._clamp attribute to
6868 Context.clamp and make it public. This is useful in creating contexts that
6869 correspond to the decimal interchange formats specified in IEEE 754.
6870
6871- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
6872 twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
6873 StreamWriter classes.
6874
6875- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
6876 of the C file stderr, to use stderr encoding and error handler.
6877
6878- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
6879 of files without one.
6880
6881- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
6882 comparing to a non-mapping.
6883
6884- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
6885 correct encoding.
6886
6887- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
6888 ``OP_*`` constants to the `ssl` module. This allows to selectively disable
6889 protocol versions, when used in combination with `PROTOCOL_SSLv23`.
6890
6891- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
6892
6893- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
6894 compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
6895 stdout is not a TTY).
6896
6897- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
6898 subprocess.Popen() and os._execvpe() support bytes program name. Add
6899 os.supports_bytes_environ flag: True if the native OS type of the environment
6900 is bytes (eg. False on Windows).
6901
6902- Issue #8633: tarfile is now able to read and write archives with "raw" binary
6903 pax headers as described in POSIX.1-2008.
6904
6905- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
6906 unquote, unquote_to_bytes.
6907
6908- Issue #8688: Distutils now recalculates MANIFEST everytime.
6909
6910- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
6911 surrogates and bytes for the filename.
6912
6913- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
6914
6915- Issue #8681: Make the zlib module's error messages more informative when the
6916 zlib itself doesn't give any detailed explanation.
6917
6918- The audioop module now supports sound fragments of length greater than 2**31
6919 bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
6920
6921- Issue #4972: Add support for the context manager protocol to the ftplib.FTP
6922 class.
6923
6924- Issue #8664: In py_compile, create __pycache__ when the compiled path is
6925 given.
6926
6927- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
6928 for use in the file system, environment variables or the command line.
6929
6930- Issue #8571: Fix an internal error when compressing or decompressing a chunk
6931 larger than 1GB with the zlib module's compressor and decompressor objects.
6932
6933- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
6934 mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
6935 file system encoding with the surrogateescape error handler (instead of
6936 utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
6937
6938- Issue #8573: asyncore _strerror() function might throw ValueError.
6939
6940- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
6941 messages when accessing undefined class attributes because of the cheap
6942 inheritance with the underlying socket object. The cheap inheritance has been
6943 deprecated.
6944
6945- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
6946 Patch by Tres Seaver.
6947
6948- Issue #8390: tarfile uses surrogateescape as the default error handler
6949 (instead of replace in read mode or strict in write mode).
6950
6951- Issue #7755: Use an unencumbered audio file for tests.
6952
6953- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
6954 and any children created using ``os.fork`` on MacOS X 10.6.
6955
6956- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
6957 operation raises multiple signals and more than one of those signals is
6958 trapped, the specification determines the order in which the signals should be
6959 handled. In many cases this order wasn't being followed, leading to the wrong
6960 Python exception being raised.
6961
6962- Issue #7865: The close() method of ``io`` objects should not swallow
6963 exceptions raised by the implicit flush(). Also qensure that calling close()
6964 several times is supported. Patch by Pascal Chambon.
6965
6966- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
6967 gc.DEBUG_STATS.
6968
6969- Issue #8354: The siginterrupt setting is now preserved for all signals, not
6970 just SIGCHLD.
6971
6972- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
6973 webbrowser.get("safari").
6974
6975- Issue #8464: tarfile no longer creates files with execute permissions set when
6976 mode="w|" is used.
6977
6978- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
6979 the Linux kernel. Patch by Yaniv Aknin.
6980
6981- Issue #8295: Added shutil.unpack_archive.
6982
6983- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
6984 It should correctly return an empty response now.
6985
6986- Issue #8546: Reject None given as the buffering argument to _pyio.open.
6987
6988- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
6989 Sridhar Ratnakumar.
6990
6991- Issue #6656: fix locale.format_string to handle escaped percents
6992 and mappings.
6993
6994- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
6995 the method could block indefinitely if called just before the event loop
6996 started running. This also fixes the occasional freezes witnessed in
6997 test_httpservers.
6998
6999- Issue #8524: When creating an SSL socket, the timeout value of the original
7000 socket wasn't retained (instead, a socket with a positive timeout would be
7001 turned into a non-blocking SSL socket).
7002
7003- Issue #5103: SSL handshake would ignore the socket timeout and block
7004 indefinitely if the other end didn't respond.
7005
7006- The do_handshake() method of SSL objects now adjusts the blocking mode of the
7007 SSL structure if necessary (as other methods already do).
7008
7009- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
7010 bytes strings for environment keys and values.
7011
7012- Issue #8467: Pure Python implementation of subprocess encodes the error
7013 message using surrogatepass error handler to support surrogates in the
7014 message.
7015
7016- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
7017
7018- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
7019 string "python" as the *ident*. openlog() arguments are all optional and
7020 keywords.
7021
7022- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
7023 non-infinite timeout. Also make that method friendlier with applications
7024 wanting to continue using the socket in clear-text mode, by disabling
7025 OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
7026
7027- Issue #8496: make mailcap.lookup() always return a list, rather than an
7028 iterator. Patch by Gregory Nofi.
7029
7030- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
7031 collation name contains a surrogate character.
7032
7033- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
7034 extension, such that verification of some SSL certificates doesn't fail
7035 because of an "unknown algorithm".
7036
7037- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
7038
7039- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
7040
7041- Issue #4814: timeout parameter is now applied also for connections resulting
7042 from PORT/EPRT commands.
7043
7044- Issue #8463: added missing reference to bztar in shutil's documentation.
7045
7046- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
7047 long as the user didn't specify 'automatic proxy configuration').
7048
7049- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
7050 as stated in RFC-959 at chapter 5.4.
7051
7052- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
7053 surrogates.
7054
7055- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
7056 `threading.Semaphore` objects. Original patch by Torsten Landschoff.
7057
7058- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
7059 available cipher list. Helps fix test_ssl with OpenSSL 1.0.0.
7060
7061- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
7062 the current working directory.
7063
7064- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
7065 using backslashreplace error handler.
7066
7067- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
7068
7069- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
7070 Locke and Hans Ulrich Niedermann.
7071
7072- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
7073
7074- Issue #7316: The acquire() method of lock objects in the ``threading``
7075 module now takes an optional timeout argument in seconds. Timeout support
7076 relies on the system threading library, so as to avoid a semi-busy wait loop.
7077
7078- Issue #8383: pickle and pickletools use surrogatepass error handler when
7079 encoding unicode as utf8 to support lone surrogates and stay compatible with
7080 Python 2.x and 3.x.
7081
7082- Issue #7585: difflib context and unified diffs now place a tab between
7083 filename and date, conforming to the 'standards' they were originally designed
7084 to follow. This improves compatibility with patch tools.
7085
7086- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
7087 character sets will now consistently use a Content-Transfer-Encoding of 7bit
7088 rather than sometimes being marked as 8bit.
7089
7090- Issue #8375: test_distutils now checks if the temporary directory are still
7091 present before it cleans them.
7092
7093- Issue #8374: Update the internal alias table in the ``locale`` module to
7094 cover recent locale changes and additions.
7095
7096- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
7097 using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
7098 `ssl.OPENSSL_VERSION_NUMBER`.
7099
7100- Add functools.total_ordering() and functools.cmp_to_key().
7101
7102- Issue #8257: The Decimal construct now accepts a float instance directly,
7103 converting that float to a Decimal of equal value:
7104
7105 >>> Decimal(1.1)
7106 Decimal('1.100000000000000088817841970012523233890533447265625')
7107
7108- Issue #8294: The Fraction constructor now accepts Decimal and float instances
7109 directly.
7110
7111- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
7112 InvalidOperation instead of returning False. (Comparisons involving a quiet
7113 NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
7114 signaling NaNs remain unhashable.
7115
7116- Issue #2531: Comparison operations between floats and Decimal instances now
7117 return a result based on the numeric values of the operands; previously they
7118 returned an arbitrary result based on the relative ordering of id(float) and
7119 id(Decimal). See also issue #8188, which adds Decimal-to-Fraction
7120 comparisons.
7121
7122- Added a subtract() method to collections.Counter().
7123
7124- Issue #8233: When run as a script, py_compile.py optionally takes a single
7125 argument `-` which tells it to read files to compile from stdin. Each line is
7126 read on demand and the named file is compiled immediately. (Original patch by
7127 Piotr Ożarowski).
7128
7129- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
7130 form feed (0x0C) are now considered linebreaks, as specified in Unicode
7131 Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
7132
7133- Comparisons using one of <, <=, >, >= between a complex instance and a
7134 Fractions instance now raise TypeError instead of returning True/False. This
7135 makes Fraction <=> complex comparisons consistent with int <=> complex, float
7136 <=> complex, and complex <=> complex comparisons.
7137
7138- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
7139 methods (such as oss_mixer_device.fileno()) were not available. Initial patch
7140 by Bertrand Janin.
7141
7142- Issue #8205: Remove the "Modules" directory from sys.path when Python is
7143 running from the build directory (POSIX only).
7144
7145- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
7146 didn't support chflags() (for example ZFS under FreeBSD). The error is now
7147 silenced.
7148
7149- Issue #7860: platform.uname now reports the correct 'machine' type when Python
7150 is running in WOW64 mode on 64 bit Windows.
7151
7152- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
7153 Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
7154 reads and writes are always retried by OpenSSL itself.
7155
7156- Issue #4282: Fix the main function of the profile module for a non-ASCII
7157 script, open the file in binary mode and not in text mode with the default
7158 (utf8) encoding.
7159
7160- Issue #8179: Fix macpath.realpath() on a non-existing path.
7161
7162- Issue #8024: Update the Unicode database to 5.2.
7163
7164- Issue #8168: py_compile now handles files with utf-8 BOMS.
7165
7166- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
7167 detected.
7168
7169- Issue #6716/2: Backslash-replace error output in compilall.
7170
7171- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
7172 with Tcl/Tk-8.5.
7173
7174- Issue #8140: extend compileall to compile single files. Add -i option.
7175
7176- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
7177 locale.
7178
7179- The internals of the subprocess module on POSIX systems have been replaced by
7180 an extension module (_posixsubprocess) so that the fork()+exec() can be done
7181 safely without the possibility of deadlock in multithreaded applications.
7182
7183- subprocess.Popen now has restore_signals and start_new_session features. The
7184 default of restore_signals=True is a new behavior compared to earlier Python
7185 versions. This means that signals such as SIGPIPE are not ignored by default
7186 in subprocesses launched by Python (Issue #1652).
7187
7188- Issue #6472: The xml.etree package is updated to ElementTree 1.3. The
7189 cElementTree module is updated too.
7190
7191- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
7192 an non existent program name and Python is unable to retrieve the real program
7193 name.
7194
7195- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
7196
7197- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
7198 replacement were all bytes. Patch by Antoine Pitrou.
7199
7200- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
7201 bugs and allows loading SQLite extensions from shared libraries.
7202
7203- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
7204 Review Issue #29 (http://unicode.org/review/pr-29.html).
7205
7206- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
7207 reset also the pointer to the current pointer context.
7208
7209- Issue #7232: Add support for the context manager protocol to the TarFile
7210 class.
7211
7212- Issue #7250: Fix info leak of os.environ across multi-run uses of
7213 wsgiref.handlers.CGIHandler.
7214
7215- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
7216
7217- Issue #691291: codecs.open() should not convert end of lines on reading and
7218 writing.
7219
7220- Issue #7869: logging: improved diagnostic for format-time errors.
7221
7222- Issue #7868: logging: added loggerClass attribute to Manager.
7223
7224- logging: Implemented PEP 391.
7225
7226- Issue #1537721: Add a writeheader() method to csv.DictWriter.
7227
7228- Issue #7959: ctypes callback functions are now registered correctly with the
7229 cycle garbage collector.
7230
7231- Issue #5801: removed spurious empty lines in wsgiref.
7232
7233- Issue #6666: fix bug in trace.py that applied the list of directories to be
7234 ignored only to the first file. Noted by Bogdan Opanchuk.
7235
7236- Issue #7597: curses.use_env() can now be called before initscr(). Noted by
7237 Kan-Ru Chen.
7238
7239- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
7240
7241- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
7242 messages parsed by email.Parser.HeaderParser.
7243
7244- Issue #7361: Importlib was not properly checking the number of bytes in
7245 bytecode file when it was less then 8 bytes.
7246
7247- Issue #7633: In the decimal module, Context class methods (with the exception
7248 of canonical and is_canonical) now accept instances of int and long wherever a
7249 Decimal instance is accepted, and implicitly convert that argument to Decimal.
7250 Previously only some arguments were converted.
7251
7252- Issue #7835: shelve should no longer produce mysterious warnings during
7253 interpreter shutdown.
7254
7255- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
7256 processing instructions and comments. These raw characters are allowed by the
7257 XML specification, and are necessary when outputting e.g. PHP code in a
7258 processing instruction. Patch by Neil Muller.
7259
7260- Issue #6233: ElementTree failed converting unicode characters to XML entities
7261 when they could't be represented in the requested output encoding. Patch by
7262 Jerry Chen.
7263
7264- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
7265 compression type.
7266
7267- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
7268 specified, rather than fall through to AF_PACKET (in the `socket` module).
7269 Also, raise ValueError rather than TypeError when an unknown TIPC address type
7270 is specified. Patch by Brian Curtin.
7271
7272- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
7273 position when calling `truncate()`. It would previously change the file
7274 position to the given argument, which goes against the tradition of
7275 ftruncate() and other truncation APIs. Patch by Pascal Chambon.
7276
7277- Issue #7610: Reworked implementation of the internal
7278 ``zipfile.ZipExtFile`` class used to represent files stored inside an
7279 archive. The new implementation is significantly faster and can be wrapped in
7280 a ``io.BufferedReader`` object for more speedups. It also solves an
7281 issue where interleaved calls to `read()` and `readline()` give wrong results.
7282 Patch by Nir Aides.
7283
7284- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
7285 allowing for a maximum number of tasks within the pool to be completed by the
7286 worker before that worker is terminated, and a new one created to replace it.
7287
7288- Issue #7792: Registering non-classes to ABCs raised an obscure error.
7289
7290- Issue #7785: Don't accept bytes in FileIO.write().
7291
7292- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
7293
7294- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
7295 the release file is empty.
7296
7297- Issue #7561: Fix crashes when using bytearray objects with the posix
7298 module.
7299
7300- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
7301 multipart/signed MIME parts, which fixes one of the sources of invalid
7302 modifications to such parts by Generator.
7303
7304- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`. Patch
7305 by Florent Xicluna, along with some additional tests.
7306
7307- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
7308 argument. Patch by Victor Stinner.
7309
7310- Issue #3299: Fix possible crash in the _sre module when given bad argument
7311 values in debug mode. Patch by Victor Stinner.
7312
7313- Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch
7314 by Brian Curtin.
7315
7316- Issue #7681: Use floor division in appropiate places in the wave module.
7317
7318- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
7319 Extension extra options may change the output without changing the .c
7320 file). Initial patch by Collin Winter.
7321
7322- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
7323 when it has a fully qualified configuration prefix. Initial patch by Arfrever.
7324
7325- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
7326 destruction of weakref'ed objects while iterating.
7327
7328- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
7329 Stinner.
7330
7331- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
7332 properly handles EINTR within the read, readline, write & flush methods. The
7333 socket.sendall() method now properly handles interrupted system calls.
7334
7335- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
7336 make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
7337 wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
7338
7339- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
7340 parameter to allow specifying where your connections come from.
7341
7342- socket.create_connection now accepts an optional source_address parameter.
7343
7344- Issue #5511: now zipfile.ZipFile can be used as a context manager. Initial
7345 patch by Brian Curtin.
7346
7347- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
7348 Manifest file in text mode so string patterns can be used in regular
7349 expressions.
7350
7351- Issue #7552: Removed line feed in the base64 Authorization header in the
7352 Distutils upload command to avoid an error when PyPI reads it. This occurs on
7353 long passwords. Initial patch by JP St. Pierre.
7354
7355- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
7356 Tatsuhiro Tsujikawa.
7357
7358- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
7359 TypeError when given an `str` object (rather than a `bytes`-like object).
7360 Patch by Victor Stinner and Florent Xicluna.
7361
7362- Issue #7349: Make methods of file objects in the io module accept None as an
7363 argument where file-like objects (ie StringIO and BytesIO) accept them to mean
7364 the same as passing no argument.
7365
7366- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
7367
7368- Issue #5949: added check for correct lineends in input from IMAP server in
7369 imaplib.
7370
7371- Add count() and reverse() methods to collections.deque().
7372
7373- Fix variations of extending deques: d.extend(d) d.extendleft(d) d+=d
7374
7375- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
7376 parameter types. Patch by Victor Stinner.
7377
7378- Issue #7457: added a read_pkg_file method to
7379 distutils.dist.DistributionMetadata.
7380
7381- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
7382 TLS with authentication credentials.
7383
7384- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
7385 in Distutils. Patch by Stephen Emslie.
7386
7387- Issue #4120: Drop reference to CRT from manifest when building extensions with
7388 msvc9compiler.
7389
7390- Issue #7333: The `posix` module gains an `initgroups()` function providing
7391 access to the initgroups(3) C library call on Unix systems which implement it.
7392 Patch by Jean-Paul Calderone.
7393
7394- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
7395 ownership when the group is not forced, because the group may be different
7396 from the user's group and inherit from its container when the test is run.
7397
7398- Issue #4486: When an exception has an explicit cause, do not print its
7399 implicit context too. This affects the `traceback` module as well as built-in
7400 exception printing.
7401
7402- Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert
7403 Collins.
7404
7405- Issue #7403: logging: Fixed possible race condition in lock creation.
7406
7407- Issue #6845: Add restart support for binary upload in ftplib. The
7408 `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
7409 argument. Patch by Pablo Mouzo.
7410
7411- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
7412 returning the total number of seconds in the duration. Patch by Brian
7413 Quinlan.
7414
7415- Issue #7133: SSL objects now support the new buffer API.
7416
7417- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
7418
7419- Issue #6123: tarfile now opens empty archives correctly and consistently
7420 raises ReadError on empty files.
7421
7422- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
7423
7424- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
7425 of __str__.
7426
7427- Issue #7341: Close the internal file object in the TarFile constructor in case
7428 of an error.
7429
7430- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
7431 Windows box. Help provided by David Bolen.
7432
7433- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
7434 or SSL. Patch by Giampaolo Rodola'.
7435
7436- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
7437
7438- Issue #4969: The mimetypes module now reads the MIME database from the
7439 registry under Windows. Patch by Gabriel Genellina.
7440
7441- Issue #6816: runpy now provides a run_path function that allows Python code to
7442 execute file paths that refer to source or compiled Python files as well as
7443 zipfiles, directories and other valid sys.path entries that contain a
7444 __main__.py file. This allows applications that run other Python scripts to
7445 support the same flexibility as the CPython command line itself.
7446
7447- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
7448 connection with another process, rather than looping endlessly. The default
7449 timeout is 20 seconds, which should be amply sufficient for local connections.
7450
7451- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
7452 unpickled. This fixes crashes under Windows when trying to run
7453 test_multiprocessing in verbose mode.
7454
7455- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
7456 argument added to the TextTestRunner constructor allowing a different result
7457 class to be used without having to subclass.
7458
7459- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
7460 name in failure reports even if the test has a docstring.
7461
7462- Issue #3001: Add a C implementation of recursive locks which is used by
7463 default when instantiating a `threading.RLock` object. This makes recursive
7464 locks as fast as regular non-recursive locks (previously, they were slower by
7465 10x to 15x).
7466
7467- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
7468 those started through `threading.Thread` (for example, using
7469 `_thread.start_new_thread()`).
7470
7471- Issue #7187: Importlib would not silence the IOError raised when trying to
7472 write new bytecode when it was made read-only.
7473
7474- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
7475 which are part of a reference cycle.
7476
7477- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
7478 objects on 64-bit systems. Patch by Michael Broghton.
7479
7480- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
7481 modification is done through it. This fixes inconsistencies and test failures
7482 on systems with slightly bogus mtime behaviour.
7483
7484- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
7485 from stdin so that existing input does not confuse it and lead to incorrect
7486 entry or an IOError. It also properly flushes it afterwards to avoid the
7487 terminal echoing the input afterwards on OSes such as Solaris.
7488
7489- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
7490 they accept an int or long as the second argument. Also fix buggy handling of
7491 large arguments (those with coefficient longer than the current precision) in
7492 shift and rotate.
7493
7494- Issue #4750: Store the basename of the original filename in the gzip FNAME
7495 header as required by RFC 1952.
7496
7497- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
7498 Distutils.
7499
7500- Issue #7218: Fix test_site for win32, the directory comparison was done with
7501 an uppercase.
7502
7503- Issue #7205: Fix a possible deadlock when using a BZ2File object from
7504 several threads at once.
7505
7506- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
7507
7508- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
7509 larger than emax.
7510
7511- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
7512 platforms, and assorted locale fixes by Derk Drukker.
7513
7514- Issue #5833: Fix extra space character in readline completion with the GNU
7515 readline library version 6.0.
7516
7517- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
7518
7519- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
7520 anachronisms in the code which were a relic of 1.5.2 compatibility.
7521
7522- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
7523 to look for it is the Content-Type header.
7524
7525- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
7526 builtin tokenizer.
7527
7528- Issue #7048: Force Decimal.logb to round its result when that result is too
7529 large to fit in the current precision.
7530
7531- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
7532 other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
7533
7534- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
7535 always result in NULL.
7536
7537- Issue #5042: Structure sub-subclass does now initialize correctly with base
7538 class positional arguments.
7539
7540- Issue #6882: Import uuid creates zombies processes.
7541
7542- Issue #6635: Fix profiler printing usage message.
7543
7544- Issue #6856: Add a filter keyword argument to TarFile.add().
7545
7546- Issue #6888: pdb's alias command was broken when no arguments were given.
7547
7548- Issue #6857: Default format() alignment should be '>' for Decimal instances.
7549
7550- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
7551 NaN or raising InvalidContext. Also, fix infinite recursion in
7552 long(Decimal('nan')).
7553
7554- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
7555 type specifier.
7556
7557- Issue #6239: ctypes.c_char_p return value must return bytes.
7558
7559- Issue #6838: Use a list to accumulate the value instead of repeatedly
7560 concatenating strings in http.client's HTTPResponse._read_chunked providing a
7561 significant speed increase when downloading large files servend with a
7562 Transfer-Encoding of 'chunked'.
7563
7564- Trying to import a submodule from a module that is not a package, ImportError
7565 should be raised, not AttributeError.
7566
7567- When the globals past to importlib.__import__() has __package__ set to None,
7568 fall back to computing what __package__ should be instead of giving up.
7569
7570- Raise a TypeError when the name of a module to be imported for
7571 importlib.__import__ is not a string (was raising an AttributeError before).
7572
7573- Allow the fromlist passed into importlib.__import__ to be any iterable.
7574
7575- Have importlib raise ImportError if None is found in sys.modules.
7576
7577- Issue #6054: Do not normalize stored pathnames in tarfile.
7578
7579- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
7580 payloads are now ordered by integer value rather than lexicographically.
7581
7582- Issue #1356969: Add missing info methods in tix.HList.
7583
7584- Issue #1522587: New constants and methods for the tix.Grid widget.
7585
7586- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
7587
7588- Issue #1119673: Do not override tkinter.Text methods when creating a
7589 ScrolledText.
7590
7591- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
7592
7593- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
7594 and yview* methods.
7595
7596- Issue #6629: Fix a data corruption issue in the new I/O library, which could
7597 occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
7598 "wb+" mode) after having buffered a certain amount of data for reading. This
7599 bug was not present in the pure Python implementation.
7600
7601- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
7602 POP3.apop.
7603
7604- Issue #2715: Remove remnants of Carbon.File from binhex module.
7605
7606- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
7607 digits in input, as recommended by the standard. Previously it was restricted
7608 to accepting [0-9].
7609
7610- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
7611 DO/DONT correctly.
7612
7613- Issue #1424152: Fix for http.client, urllib.request to support SSL while
7614 working through proxy. Original patch by Christopher Li, changes made by
7615 Senthil Kumaran.
7616
7617- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
7618 loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
7619 PyPycLoader inherit from this class and provide implementations in relation to
7620 other methods required by the ABCs.
7621
7622- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
7623 the documentation said it did even though the code in PyLoader relied on the
7624 abstract method required by ResourceLoader.
7625
7626- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
7627 to handle a comparison without loss of precision. Also add correct handling
7628 of infinities and nans for comparisons with float.
7629
7630- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
7631
7632- Issue #6358: The exit status of a command started with os.popen() was reported
7633 differently than it did with python 2.x.
7634
7635- Issue #6323: The pdb debugger did not exit when running a script with a syntax
7636 error.
7637
7638- Issue #3392: The subprocess communicate() method no longer fails in select()
7639 when file descriptors are large; communicate() now uses poll() when possible.
7640
7641- Issue #6369: Fix an RLE decompression bug in the binhex module.
7642
7643- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
7644
7645- The deprecated function string.maketrans has been removed.
7646
7647- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
7648 sys.path.
7649
7650- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
7651
7652- The os.get_exec_path() function to return the list of directories that will be
7653 searched for an executable when launching a subprocess was added.
7654
7655- Issue #7481: When a threading.Thread failed to start it would leave the
7656 instance stuck in initial state and present in threading.enumerate().
7657
7658- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
7659 and os.read system calls where appropriate.
7660
7661- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
7662
7663- Issue #6247: The argparse module has been added to the standard library.
7664
7665- Issue #8235: _socket: Add the constant ``SO_SETFIB``. SO_SETFIB is a socket
7666 option available on FreeBSD 7.1 and newer.
7667
7668- Issue #9315: Fix for the trace module to record correct class name
7669 for tracing methods.
7670
7671Extension Modules
7672-----------------
7673
7674- Issue #9959: Tweak formula used for computing math.log of an integer,
7675 making it marginally more accurate for exact powers of 2.
7676
7677- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
7678
7679- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
7680 compared to other unix systems. In particular, os.getgroups() does not reflect
7681 any changes made using os.setgroups() but basicly always returns the same
7682 information as the id command. os.getgroups() can now return more than 16
7683 groups on MacOSX.
7684
7685- Issue #6095: Make directory argument to os.listdir optional.
7686
7687- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
7688 struct.pack('>?')): if conversion to bool raised an exception then that
7689 exception wasn't properly propagated on machines where char is unsigned.
7690
7691- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
7692 they contain instances of old-style classes.
7693
7694- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
7695 existing isinf and isnan functions.
7696
7697- Issue #1578269: Implement os.symlink for Windows 6.0+. Patch by Jason
7698 R. Coombs.
7699
7700- In struct.pack, correctly propogate exceptions from computing the truth of an
7701 object in the '?' format.
7702
7703- Issue #9000: datetime.timezone objects now have eval-friendly repr.
7704
7705- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
7706 special methods.
7707
7708- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
7709 Prior to this change, timezone adjustment in utctimetuple() could produce
7710 tm_year value of 0 or 10,000. Now an OverflowError is raised in these edge
7711 cases.
7712
7713- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
7714 directive. When the ``%z`` directive is present in the format string, an
7715 aware ``datetime`` object is returned with ``tzinfo`` bound to a
7716 ``datetime.timezone`` instance constructed from the parsed offset. If both
7717 ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
7718 name, but ``%Z`` data without ``%z`` is discarded.
7719
7720- Issue #5094: The ``datetime`` module now has a simple concrete class
7721 implementing ``datetime.tzinfo`` interface. Instances of the new class,
7722 ``datetime.timezone``, return fixed name and UTC offset from their
7723 ``tzname(dt)`` and ``utcoffset(dt)`` methods. The ``dst(dt)`` method always
7724 returns ``None``. A class attribute, ``utc`` contains an instance
7725 representing the UTC timezone. Original patch by Rafe Kaplan.
7726
7727- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
7728 includes documentation for the struct.Struct class.
7729
7730- Issue #3129: Trailing digits in struct format string are no longer ignored.
7731 For example, "1" or "ilib123" are now invalid formats and cause
7732 ``struct.error`` to be raised. Patch by Caleb Deveraux.
7733
7734- Issue #7384: If the system readline library is linked against ncurses, the
7735 curses module must be linked against ncurses as well. Otherwise it is not safe
7736 to load both the readline and curses modules in an application.
7737
7738- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
7739 requiring a re-try in order to get the complete result.
7740
7741- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
7742 with an improved 'binary-split' algorithm that uses fewer multiplications and
7743 allows many of the multiplications to be performed using plain C integer
7744 arithmetic instead of PyLong arithmetic. Also uses a lookup table for small
7745 arguments.
7746
7747- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
7748 overflow checks in the audioop module.
7749
7750- Issue #8644: The accuracy of td.total_seconds() has been improved (by
7751 calculating with integer arithmetic instead of float arithmetic internally):
7752 the result is now always correctly rounded, and is equivalent to ``td /
7753 timedelta(seconds=1)``.
7754
7755- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
7756 timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
7757 timedelta) are all supported.
7758
7759- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
7760
7761- Issue #8300: When passing a non-integer argument to struct.pack with any
7762 integer format code, struct.pack first attempts to convert the non-integer
7763 using its __index__ method. If that method is non-existent or raises
7764 TypeError it goes on to try the __int__ method, as described below.
7765
7766- Issue #8142: Update libffi to the 3.0.9 release.
7767
7768- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
7769
7770- Issue #6544: Fix a reference leak in the kqueue implementation's error
7771 handling.
7772
7773- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
7774 msvcr100.dll is not a platform assembly anymore.
7775
7776- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
7777
7778- Issue #7078: Set struct.__doc__ from _struct.__doc__.
7779
7780- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
7781
7782- Issue #6877: It is now possible to link the readline extension to the libedit
7783 readline emulation on OSX 10.5 or later.
7784
7785- Issue #6848: Fix curses module build failure on OS X 10.6.
7786
7787- Fix a segfault that could be triggered by expat with specially formed input.
7788
7789- Issue #6561: '\d' in a regex now matches only characters with Unicode category
7790 'Nd' (Number, Decimal Digit). Previously it also matched characters with
7791 category 'No'.
7792
7793- Issue #4509: Array objects are no longer modified after an operation failing
7794 due to the resize restriction in-place when the object has exported buffers.
7795
7796- Issue #2389: Array objects are now pickled in a portable manner.
7797
7798- Expat: Fix DoS via XML document with malformed UTF-8 sequences
7799 (CVE_2009_3560).
7800
7801- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
7802 could raise an incorrect RuntimeError about not holding the import lock. The
7803 import lock is now reinitialized after fork.
7804
7805- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
7806 parameter on some platforms such as OS X.
7807
7808- Build the ossaudio extension on GNU/kFreeBSD.
7809
7810- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
7811 the return value of QueryReflectionKey.
7812
7813- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
7814
7815Build
7816-----
7817
7818- Use OpenSSL 1.0.0a on Windows.
7819
7820- Issue #9280: Make sharedinstall depend on sharedmods.
7821
7822- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
7823 override the configure and makefile defaults, without deleting options the
7824 user didn't intend to override. Developers should no longer need to specify
7825 OPT or EXTRA_CFLAGS, although those variables are still present for
7826 backward-compatibility.
7827
7828- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
7829
7830- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
7831 multiprocessing only.
7832
7833- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
7834 (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
7835 result of the issue #1628484 fix, combined with autoconf's strange choice of
7836 default CFLAGS produced by AC_PROG_CC for gcc.)
7837
7838- Issue #3646: It is now easily possible to install a Python framework into your
7839 home directory on MacOSX, see Mac/README for more information.
7840
7841- Issue #3928: os.mknod() now available in Solaris, also.
7842
7843- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
7844 give false warnings.
7845
7846- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
7847 anymore. It also forwards the LDFLAGS settings to the linker when building a
7848 shared library.
7849
7850- Issue #6716: Quote -x arguments of compileall in MSI installer. Exclude 2to3
7851 tests from compileall.
7852
7853- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
7854
7855- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
7856 memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
7857 instead. Also disable caching of powers of 5.
7858
7859- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
7860
7861- Issue #6943: Use pkg-config to find the libffi headers when the
7862 --with-system-ffi flag is used.
7863
7864- Issue #7609: Add a --with-system-expat option that causes the system's expat
7865 library to be used for the pyexpat module instead of the one included with
7866 Python.
7867
7868- Issue #7589: Only build the nis module when the correct header files are
7869 found.
7870
7871- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
7872
7873- Issue #5792: Extend the short float repr support to x86 systems using
7874 icc or suncc.
7875
7876- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
7877 correctly under gcc on x86-64. This fixes a reported problem with the
7878 --with-tsc build on x86-64.
7879
7880- Issue #6802: Fix build issues on MacOSX 10.6.
7881
7882- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
7883
7884- Issue #4601: 'make install' did not set the appropriate permissions on
7885 directories.
7886
7887- Issue #5390: Add uninstall icon independent of whether file extensions are
7888 installed.
7889
7890- Issue #7541: When using ``python-config`` with a framework install the
7891 compiler might use the wrong library.
7892
7893- python-config now supports multiple options on the same command line.
7894
7895- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
7896
7897- Issue #8510: Update to autoconf2.65.
7898
7899Documentation
7900-------------
7901
7902- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
7903 to Doc/license.rst.
7904
7905- Issue #9524: Document that two CTRL* signals are meant for use only
7906 with os.kill.
7907
7908- Issue #9255: Document that the 'test' package is meant for internal Python use
7909 only.
7910
7911- A small WSGI server was added as Tools/scripts/serve.py, and is used to
7912 implement a local documentation server via 'make serve' in the doc directory.
7913
7914- Updating `Using Python` documentation to include description of CPython's -J
7915 and -X options.
7916
7917- Document that importing a module that has None in sys.modules triggers an
7918 ImportError.
7919
7920- Issue #6556: Fixed the Distutils configuration files location explanation for
7921 Windows.
7922
7923- Update python manual page (options -B, -O0, -s, environment variables
7924 PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
7925
7926- Issue #8909: Added the size of the bitmap used in the installer created by
7927 distutils' bdist_wininst. Patch by Anatoly Techtonik.
7928
7929Tests
7930-----
7931
7932- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
7933 import lock was disabled.
7934
7935- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
7936
7937- Issue #7449: Skip test_socketserver if threading support is disabled.
7938
7939- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
7940 by a decompressor object without errors (it returns incomplete uncompressed
7941 data).
7942
7943- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
7944 UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
7945
7946- Issue #8576: Remove use of find_unused_port() in test_smtplib and
7947 test_multiprocessing. Patch by Paul Moore.
7948
7949- Issue #7449: Fix many tests to support Python compiled without thread
7950 support. Patches written by Jerry Seutter.
7951
7952- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
7953 SSL shutdowns.
7954
7955- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
7956 by Dave Malcolm.
7957
7958- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
7959 thread was previously started, most likely due to a platform bug.
7960
7961- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
7962
7963- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
7964
7965- Issue #8263: Now regrtest.py will report a failure if it receives a
7966 KeyboardInterrupt (SIGINT).
7967
7968- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
7969 Unicode normalization cases.
7970
7971- Issue #7783: test.support.open_urlresource invalidates the outdated files from
7972 the local cache.
7973
7974- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
7975 effectively raised.
7976
7977- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
7978 TestCase for some tests: test_genericpath.CommonTest.
7979
7980- Print platform information when running the whole test suite, or using the
7981 --verbose flag.
7982
7983- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
7984 filesystem encoding.
7985
7986- Issue #6292: for the moment at least, the test suite runs cleanly if python is
7987 run with the -OO flag. Tests requiring docstrings are skipped.
7988
7989- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
7990 also used by regrtest to run all the tests in a temporary directory. The
7991 original CWD is saved in `support.SAVEDCWD`. Thanks to Florent Xicluna who
7992 helped with the patch.
7993
7994- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
7995 (only seen so far on platforms where the curses module wasn't built), due to
7996 an uncleared exception.
7997
7998- Issue #7728: test_timeout was changed to use support.bind_port instead of a
7999 hard coded port.
8000
8001- Issue #7376: Instead of running a self-test (which was failing) when called
8002 with no arguments, doctest.py now gives a usage message.
8003
8004- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
8005
8006- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
8007 instead of a hardcoded port number in test_rapid_restart.
8008
8009- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
8010 in the Lib/test directory, which might be read-only for the user running the
8011 tests.
8012
8013- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
8014 of an option with no handler.
8015
8016- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
8017 fails. Can be combined with -j.
8018
8019- Issue #6551: test_zipimport could import and then destroy some modules of the
8020 encodings package, which would make other tests fail further down the road
8021 because the internally cached encoders and decoders would point to empty
8022 global variables.
8023
8024- Issue #7295: Do not use a hardcoded file name in test_tarfile.
8025
8026- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
8027 primitives such as Lock, RLock, Condition, Event and Semaphore.
8028
8029- Issue #7248 (part 2): Use a unique temporary directory for importlib source
8030 tests instead of tempfile.tempdir. This prevents the tests from sharing state
8031 between concurrent executions on the same system.
8032
8033- Issue #7248: In importlib.test.source.util a try/finally block did not make
8034 sure that some referenced objects actually were created in the block before
8035 calling methods on the object.
8036
8037- Issue #7222: Make thread "reaping" more reliable so that reference
8038 leak-chasing test runs give sensible results. The previous method of reaping
8039 threads could return successfully while some Thread objects were still
8040 referenced. This also introduces a new private function:
8041 ``_thread._count()``.
8042
8043- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
8044 runs the risk of causing the worker thread to fail.
8045
8046- Issue #7055: test___all__ now greedily detects all modules which have an
8047 __all__ attribute, rather than using a hardcoded and incomplete list.
8048
8049- Issue #7058: Added save/restore for things like sys.argv and cwd to
8050 runtest_inner in regrtest, with warnings if the called test modifies them, and
8051 a new section in the summary report at the end.
8052
8053- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
8054
8055- Fixed tests in importlib.test.source.test_abc_loader that were masking the
8056 proper exceptions that should be raised for missing or improper code object
8057 bytecode.
8058
8059- Removed importlib's custom test discovery code and switched to
8060 unittest.TestLoader.discover().
8061
8062Tools/Demos
8063-----------
8064
8065- Issue #5464, #8974: Implement plural forms in msgfmt.py.
8066
8067- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
8068 added to the `Tools/` directory. They were previously living in the sandbox.
8069
8070
8071What's New in Python 3.1?
8072=========================
8073
8074*Release date: 27-June-2009*
8075
8076Core and Builtins
8077-----------------
8078
8079- Issue #6334: Fix bug in range length calculation for ranges with
8080 large arguments.
8081
8082- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
8083 because it wasn't recognized as a sequence).
8084
8085Library
8086-------
8087
8088- Issue #6126: Fixed pdb command-line usage.
8089
8090- Issue #6314: logging: performs extra checks on the "level" argument.
8091
8092- Issue #6274: Fixed possible file descriptors leak in subprocess.py
8093
8094- Accessing io.StringIO.buffer now raises an AttributeError instead of
8095 io.UnsupportedOperation.
8096
8097- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
8098 (On Unix)
8099
8100- Issue #1202: zipfile module would cause a struct.error when attempting to
8101 store files with a CRC32 > 2**31-1.
8102
8103Extension Modules
8104-----------------
8105
8106- Issue #5590: Remove unused global variable in pyexpat extension.
8107
8108
8109What's New in Python 3.1 Release Candidate 2?
8110=============================================
8111
8112*Release date: 13-June-2009*
8113
8114Core and Builtins
8115-----------------
8116
8117- Fixed SystemError triggered by "range([], 1, -1)".
8118
8119- Issue #5924: On Windows, a large PYTHONPATH environment variable
8120 (more than 255 characters) would be completely ignored.
8121
8122- Issue #4547: When debugging a very large function, it was not always
8123 possible to update the lineno attribute of the current frame.
8124
8125- Issue #5330: C functions called with keyword arguments were not reported by
8126 the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
8127
8128Library
8129-------
8130
8131- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
8132 expression string pattern was trying to match against a bytes returned by
8133 Popen. Tested under win32 to build the py-postgresql project.
8134
8135- Issue #6258: Support AMD64 in bdist_msi.
8136
8137- Issue #6195: fixed doctest to no longer try to read 'source' data from
8138 binary files.
8139
8140- Issue #5262: Fixed bug in next rollover time computation in
8141 TimedRotatingFileHandler.
8142
8143- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
8144 errors property. Additionally, the errors and encoding properties of StringIO
8145 are always None now.
8146
8147- Issue #6137: The pickle module now translates module names when loading
8148 or dumping pickles with a 2.x-compatible protocol, in order to make data
8149 sharing and migration easier. This behaviour can be disabled using the
8150 new `fix_imports` optional argument.
8151
8152- Removed the ipaddr module.
8153
8154- Issue #3613: base64.{encode,decode}string are now called
8155 base64.{encode,decode}bytes which reflects what type they accept and return.
8156 The old names are still there as deprecated aliases.
8157
8158- Issue #5767: Remove sgmlop support from xmlrpc.client.
8159
8160- Issue #6150: Fix test_unicode on wide-unicode builds.
8161
8162- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
8163 parameters.
8164
8165Windows
8166-------
8167
8168- Issue #6221: Delete test registry key before running the test.
8169
8170- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
8171
8172C-API
8173-----
8174
8175- Issue #5735: Python compiled with --with-pydebug should throw an
8176 ImportError when trying to import modules compiled without
8177 --with-pydebug, and vice-versa.
8178
8179
8180Build
8181-----
8182
8183- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
8184 added LIBS to OS X framework builds.
8185
8186- Issue #5809: Specifying both --enable-framework and --enable-shared is
8187 an error. Configure now explicity tells you about this.
8188
8189
8190
8191What's New in Python 3.1 release candidate 1?
8192=============================================
8193
8194*Release date: 2009-05-30*
8195
8196Core and Builtins
8197-----------------
8198
8199- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
8200 of the command line.
8201
8202- Issue #6012: Add cleanup support to O& argument parsing.
8203
8204- Issue #6089: Fixed str.format with certain invalid field specifiers
8205 that would raise SystemError.
8206
8207- Issue #5982: staticmethod and classmethod now expose the wrapped
8208 function with __func__.
8209
8210- Added support for multiple context managers in the same with-statement.
8211 Deprecated contextlib.nested() which is no longer needed.
8212
8213- Issue #5829: complex("1e500") no longer raises OverflowError. This
8214 makes it consistent with float("1e500") and interpretation of real
8215 and imaginary literals.
8216
8217- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
8218
8219- Issue #5994: the marshal module now has docstrings.
8220
8221- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
8222 (1) inf and nan strings with trailing whitespace were incorrectly
8223 rejected; (2) parsing of strings representing infinities and nans
8224 was locale aware; and (3) the interpretation of fromhex('-nan')
8225 didn't match that of float('-nan').
8226
8227Library
8228-------
8229
8230- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
8231
8232- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
8233
8234- Issue #6121: pydoc now ignores leading and trailing spaces in the
8235 argument to the 'help' function.
8236
8237- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
8238 arguments for strings with a space in them.
8239
8240- collections.namedtuple() was not working with the following field
8241 names: cls, self, tuple, itemgetter, and property.
8242
8243- In unittest, using a skipping decorator on a class is now equivalent to
8244 skipping every test on the class. The ClassTestSuite class has been removed.
8245
8246- Issue #6050: Don't fail extracting a directory from a zipfile if
8247 the directory already exists.
8248
8249- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
8250 than an int, which makes some operations possible under 64-bit Linux (e.g.
8251 DN_MULTISHOT with F_NOTIFY).
8252
8253- Issue #5761: Add the name of the underlying file to the repr() of various
8254 IO objects.
8255
8256- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix
8257 by Musashi Tamura, tests by Marcin Bachry.
8258
8259- Issue #1983: Fix functions taking or returning a process identifier to use
8260 the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
8261 a process identifier type wider than the standard C integer type.
8262
8263- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
8264 Patch by Farhan Ahmad, test by Marcin Bachry.
8265
8266- Issue #2116: Weak references and weak dictionaries now support copy()ing and
8267 deepcopy()ing.
8268
8269- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
8270
8271- Issue #5918: Fix a crash in the parser module.
8272
8273- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
8274
8275- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
8276 library. This means, for example, that opening an UTF-16 text file in
8277 append mode doesn't add a BOM at the end of the file if the file isn't
8278 empty.
8279
8280- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
8281 file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix
8282 corrects a pydoc regression.
8283
8284- Issue #5955: aifc's close method did not close the file it wrapped,
8285 now it does. This also means getfp method now returns the real fp.
8286
8287Installation
8288------------
8289
8290- Issue #6047: fullinstall has been removed because Python 3's executable will
8291 now be known as python3.
8292
8293- Lib/smtpd.py is no longer installed as a script.
8294
8295Extension Modules
8296-----------------
8297
8298- Issue #3061: Use wcsftime for time.strftime where available.
8299
8300- Issue #4873: Fix resource leaks in error cases of pwd and grp.
8301
8302- Issue #6093: Fix off-by-one error in locale.strxfrm.
8303
8304- The _functools and _locale modules are now built into the libpython shared
8305 library instead of as extension modules.
8306
8307Build
8308-----
8309
8310- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
8311 and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
8312 Clinton Roy.
8313
8314Tests
8315-----
8316
8317- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
8318 tests on darwin even when the OS was installed on a case-sensitive
8319 filesystem. Also fixed tests that should not be run when
8320 sys.dont_write_bytecode is true.
8321
8322
8323What's New in Python 3.1 beta 1?
8324================================
8325
8326*Release date: 2009-05-06*
8327
8328Core and Builtins
8329-----------------
8330
8331- Issue #5914: Add new C API function PyOS_string_to_double, and
8332 deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
8333
8334- Issue #3382: float.__format__, complex.__format__, and %-formatting
8335 no longer map 'F' to 'f'. Because of issue #5859 (below), this only
8336 affects nan -> NAN and inf -> INF.
8337
8338- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
8339 in all operations, including splitdrive, split, etc. splitunc() now issues
8340 a PendingDeprecation warning.
8341
8342- Issue #5920: For float.__format__, change the behavior with the
8343 empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
8344 to be like 'g' but with at least one decimal point and with a
8345 default precision of 12. Previously, the behavior the same but with
8346 a default precision of 6. This more closely matches str(), and
8347 reduces surprises when adding alignment flags to the empty
8348 presentation type. This also affects the new complex.__format__ in
8349 the same way.
8350
8351- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
8352
8353- Issue #5890: in subclasses of 'property' the __doc__ attribute was
8354 shadowed by classtype's, even if it was None. property now
8355 inserts the __doc__ into the subclass instance __dict__.
8356
8357- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
8358 sequences. Patch by Nick Barnes and Victor Stinner.
8359
8360- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
8361
8362- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
8363 received a new method, detach(). detach() disconnects the underlying stream
8364 from the buffer or text IO and returns it.
8365
8366- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
8367 floats with absolute value over 1e50. Also remove length
8368 restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
8369 12.34 no longer raise an exception.
8370
8371- Issue #1588: Add complex.__format__. For example,
8372 format(complex(1, 2./3), '.5') now produces a sensible result.
8373
8374- Issue #5864: Fix empty format code formatting for floats so that it
8375 never gives more than the requested number of significant digits.
8376
8377- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
8378 new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
8379
8380- Issue #5835: Deprecate PyOS_ascii_formatd.
8381
8382- Issue #4971: Fix titlecase for characters that are their own
8383 titlecase, but not their own uppercase.
8384
8385- Issue #5283: Setting __class__ in __del__ caused a segfault.
8386
8387- Issue #5816: complex(repr(z)) now recovers z exactly, even when
8388 z involves nans, infs or negative zeros.
8389
8390- Issue #3166: Make int -> float conversions correctly rounded.
8391
8392- Issue #1869 (and many duplicates): make round(x, n) correctly
8393 rounded for a float x, by using the decimal <-> binary conversions
8394 from Python/dtoa.c. As a consequence, (e.g.) round(x, 2) now
8395 consistently agrees with format(x, '.2f').
8396
8397- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
8398 some builtin types.
8399
8400- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
8401
8402- Issue #5515: str.format() type 'n' combined with commas and leading
8403 zeros no longer gives odd results with ints and floats.
8404
8405- Implement PEP 378, Format Specifier for Thousands Separator, for
8406 floats.
8407
8408- The str function switches to exponential notation at
8409 1e11, not 1e12. This avoids printing 13 significant digits in
8410 situations where only 12 of them are correct. Example problem
8411 value: str(1e11 + 0.5). (This minor issue has existed in 2.x for a
8412 long time.)
8413
8414- Issue #1580: On most platforms, use a 'short' float repr: for a
8415 finite float x, repr(x) now outputs a string based on the shortest
8416 sequence of decimal digits that rounds to x. Previous behaviour was
8417 to output 17 significant digits and then strip trailing zeros.
8418 Another minor difference is that the new repr switches to
8419 exponential notation at 1e16 instead of the previous 1e17; this
8420 avoids misleading output in some cases.
8421
8422 There's a new sys attribute sys.float_repr_style, which takes
8423 the value 'short' to indicate that we're using short float repr,
8424 and 'legacy' if the short float repr isn't available for one
8425 reason or another.
8426
8427 The float repr change involves incorporating David Gay's 'perfect
8428 rounding' code into the Python core (it's in Python/dtoa.c). As a
8429 secondary consequence, all string-to-float and float-to-string
8430 conversions (including all float formatting operations) will be
8431 correctly rounded on these platforms.
8432
8433 See issue #1580 discussions for details of platforms for which
8434 this change does not apply.
8435
8436- Issue #5759: float() didn't call __float__ on str subclasses.
8437
8438- The string.maketrans() function is deprecated; there is a new static method
8439 maketrans() on the bytes and bytearray classes. This removes confusion about
8440 the types string.maketrans() is supposed to work with, and mirrors the
8441 methods available on the str class.
8442
8443- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
8444 its clarity and its speed.
8445
8446- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
8447 to avoid compiler warnings.
8448
8449- Issue #3739: The unicode-internal encoder now reports the number of characters
8450 consumed like any other encoder (instead of the number of bytes).
8451
8452Installation
8453------------
8454
8455- Issue #5756: Install idle and pydoc with a 3 suffix.
8456
8457Library
8458-------
8459
8460- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
8461
8462- Issue #5311: bdist_msi can now build packages that do not depend on a
8463 specific Python version.
8464
8465- Issue #5150: IDLE's format menu now has an option to strip trailing
8466 whitespace.
8467
8468- Issue #5940: distutils.command.build_clib.check_library_list was not doing
8469 the right type checkings anymore.
8470
8471- Issue #4875: On win32, ctypes.util.find_library does no longer
8472 return directories.
8473
8474- Issue #5142: Add the ability to skip modules while stepping to pdb.
8475
8476- Issue #1309567: Fix linecache behavior of stripping subdirectories when
8477 looking for files given by a relative filename.
8478
8479- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
8480 turtle demos in Demo/turtle.
8481
8482- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
8483 extracting a file to the root directory.
8484
8485- Issue #5913: os.listdir() should fail for empty path on windows.
8486
8487- Issue #5084: unpickling now interns the attribute names of pickled objects,
8488 saving memory and avoiding growth in size of subsequent pickles. Proposal
8489 and original patch by Jake McGuire.
8490
8491- The json module now works exclusively with str and not bytes.
8492
8493- Issue #3959: The ipaddr module has been added to the standard library.
8494 Contributed by Google.
8495
8496- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
8497 error when a named pipe is encountered, rather than blocking infinitely.
8498
8499- Issue #5857: tokenize.tokenize() now returns named tuples.
8500
8501- Issue #4305: ctypes should now build again on mipsel-linux-gnu
8502
8503- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
8504 string is already in normalized form, by performing a quick check beforehand.
8505 Original patch by Rauli Ruohonen.
8506
8507- Issue #5853: calling a function of the mimetypes module from several threads
8508 at once could hit the recursion limit if the mimetypes database hadn't been
8509 initialized before.
8510
8511- Issue #5854: Updated __all__ to include some missing names and remove some
8512 names which should not be exported.
8513
8514- Issue #3102: All global symbols that the _ctypes extension defines
8515 are now prefixed with 'Py' or '_ctypes'.
8516
8517- Issue #5041: ctypes does now allow pickling wide character.
8518
8519- Issue #5812: For the two-argument form of the Fraction constructor,
8520 Fraction(m, n), m and n are permitted to be arbitrary Rational
8521 instances.
8522
8523- Issue #5812: Fraction('1e6') is valid: more generally, any string
8524 that's valid for float() is now valid for Fraction(), with the
8525 exception of strings representing NaNs and infinities.
8526
8527- Issue #5734: BufferedRWPair was poorly tested and had several glaring
8528 bugs. Patch by Brian Quinlan.
8529
8530- Issue #1161031: fix readwrite select flag handling: POLLPRI now
8531 results in a handle_expt_event call, not handle_read_event, and POLLERR
8532 and POLLNVAL now call handle_close, not handle_expt_event. Also,
8533 dispatcher now has an 'ignore_log_types' attribute for suppressing
8534 log messages, which is set to 'warning' by default.
8535
8536- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
8537 new arguments introduced in 2.5.
8538
8539- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
8540 makeunicodedata.py and regenerated the Unicode database (This fixes
8541 u'\u1d79'.lower() == '\x00').
8542
8543Extension Modules
8544-----------------
8545
8546- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
8547 pwd.
8548
8549- Issue #5463: In struct module, remove deprecated float coercion
8550 for integer type codes: struct.pack('L', 0.3) should now raise
8551 an error. The _PY_STRUCT_FLOAT_COERCE constant has been removed.
8552 The version number has been bumped to 0.3.
8553
8554- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
8555 using Berkeley DB.
8556
8557Tests
8558-----
8559
8560- Issue #5354: New test support function import_fresh_module() makes
8561 it easy to import both normal and optimised versions of modules.
8562 test_heapq and test_warnings have been adjusted to use it, tests for
8563 other modules with both C and Python implementations in the stdlib
8564 can be adjusted to use it over time.
8565
8566- Issue #5837: Certain sequences of calls to set() and unset() for
8567 support.EnvironmentVarGuard objects restored the environment variables
8568 incorrectly on __exit__.
8569
8570C-API
8571-----
8572
8573- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
8574
8575
8576What's New in Python 3.1 alpha 2?
8577=================================
8578
8579*Release date: 2009-4-4*
8580
8581Core and Builtins
8582-----------------
8583
8584- Implement PEP 378, Format Specifier for Thousands Separator, for
8585 integers.
8586
8587- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
8588
8589- Issue #5499: The 'c' code for argument parsing functions now only accepts a
8590 byte, and the 'C' code only accepts a unicode character.
8591
8592- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
8593 when hitting the recursion limit under certain circumstances.
8594
8595- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
8596
8597- Fix a segfault when running test_exceptions with coverage, caused by
8598 insufficient checks in accessors of Exception.__context__.
8599
8600- Issue #5604: non-ASCII characters in module name passed to
8601 imp.find_module() were converted to UTF-8 while the path is
8602 converted to the default filesystem encoding, causing nonsense.
8603
8604- Issue #5126: str.isprintable() returned False for space characters.
8605
8606- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
8607 the end sys.path, for compatibility with the system install of Python.
8608
8609- Issue #4688: Add a heuristic so that tuples and dicts containing only
8610 untrackable objects are not tracked by the garbage collector. This can
8611 reduce the size of collections and therefore the garbage collection overhead
8612 on long-running programs, depending on their particular use of datatypes.
8613
8614- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
8615 improve its performance. Long divisions and remainder operations
8616 are now between 50% and 150% faster.
8617
8618- Issue #4258: Make it possible to use base 2**30 instead of base
8619 2**15 for the internal representation of integers, for performance
8620 reasons. Base 2**30 is enabled by default on 64-bit machines. Add
8621 --enable-big-digits option to configure, which overrides the
8622 default. Add sys.int_info structseq to provide information about
8623 the internal format.
8624
8625- Issue #4474: PyUnicode_FromWideChar now converts characters outside
8626 the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
8627 and sizeof(Py_UNICODE) == 2.
8628
8629- Issue #5237: Allow auto-numbered fields in str.format(). For
8630 example: '{} {}'.format(1, 2) == '1 2'.
8631
8632- Issue #5392: when a very low recursion limit was set, the interpreter would
8633 abort with a fatal error after the recursion limit was hit twice.
8634
8635- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
8636 short file names.
8637
8638Library
8639-------
8640
8641- Issue #2625: added missing items() call to the for loop in
8642 mailbox.MH.get_message().
8643
8644- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
8645 error substitutions from non-strict codec error callbacks in
8646 incrementalencoder and StreamWriter.
8647
8648- Issue #5656: Fix the coverage reporting when running the test suite with
8649 the -T argument.
8650
8651- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
8652
8653- Issue #5624: Fix the _winreg module name still used in several modules.
8654
8655- Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
8656
8657- Issue #5619: Multiprocessing children disobey the debug flag and causes
8658 popups on windows buildbots. Patch applied to work around this issue.
8659
8660- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
8661
8662- Issue #5387: Fixed mmap.move crash by integer overflow.
8663
8664- Issue #5261: Patch multiprocessing's semaphore.c to support context
8665 manager use: "with multiprocessing.Lock()" works now.
8666
8667- Issue #5236: Change time.strptime() to only take strings. Didn't work with
8668 bytes already but the failure was non-obvious.
8669
8670- Issue #5177: Multiprocessing's SocketListener class now uses
8671 socket.SO_REUSEADDR on all connections so that the user no longer needs
8672 to wait 120 seconds for the socket to expire.
8673
8674- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
8675
8676- Issue #1174606: Calling read() without arguments of an unbounded file
8677 (typically /dev/zero under Unix) could crash the interpreter.
8678
8679- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
8680 io.BufferedRandom have been deprecated for removal in Python 3.2.
8681
8682- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
8683 forever on incomplete input. That caused tarfile.open() to hang when used
8684 with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
8685 partial bzip2 compressed data.
8686
8687- Issue #2110: Add support for thousands separator and 'n' type
8688 specifier to Decimal.__format__
8689
8690- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
8691 '>' alignment characters.
8692
8693- The error detection code in FileIO.close() could fail to reflect the `errno`
8694 value, and report it as -1 instead.
8695
8696- Issue #5016: FileIO.seekable() could return False if the file position
8697 was negative when truncated to a C int. Patch by Victor Stinner.
8698
8699Extension Modules
8700-----------------
8701
8702- Issue #5391: mmap now deals exclusively with bytes.
8703
8704- Issue #5463: In struct module, remove deprecated overflow wrapping
8705 when packing an integer: struct.pack('=L', -1) now raises
8706 struct.error instead of returning b'\xff\xff\xff\xff'. The
8707 _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
8708 have been removed from the struct module.
8709
8710
8711What's New in Python 3.1 alpha 1
8712================================
8713
8714*Release date: 2009-03-07*
8715
8716Core and Builtins
8717-----------------
8718
8719- The io module has been reimplemented in C for speed.
8720
8721- Give dict views an informative __repr__.
8722
8723- Issue #5247: Improve error message when unknown format codes are
8724 used when using str.format() with str, int, and float arguments.
8725
8726- Issue #5249: time.strftime returned malformed string when format string
8727 contained non ascii character on windows.
8728
8729- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
8730 source has already been decoded into str.
8731
8732- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
8733 rotating the object pointer by 4 bits to the right.
8734
8735- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
8736 it now forces its argument to double before testing for infinity.
8737
8738- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
8739 returns a non-number type.
8740
8741- Issue #5182: Removed memoryview.__str__.
8742
8743- Issue #1717: Removed builtin cmp() function, dropped tp_compare
8744 slot, the C API functions PyObject_Compare and PyUnicode_Compare and
8745 the type definition cmpfunc. The tp_compare slot has been renamed
8746 to tp_reserved, and is reserved for future usage.
8747
8748- Issue #1242657: the __len__() and __length_hint__() calls in several tools
8749 were suppressing all exceptions. These include list() and bytearray().
8750
8751- Issue #4707: round(x, n) now returns an integer if x is an integer.
8752 Previously it returned a float.
8753
8754- Issue #4753: By enabling a configure option named '--with-computed-gotos'
8755 on compilers that support it (notably: gcc, SunPro, icc), the bytecode
8756 evaluation loop is compiled with a new dispatch mechanism which gives
8757 speedups of up to 20%, depending on the system, on various benchmarks.
8758
8759- Issue #4874: Most builtin decoders now reject unicode input.
8760
8761- Issue #4842: Don't allow trailing 'L' when constructing an integer
8762 from a string.
8763
8764- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
8765
8766- Issue #4838: When a module is deallocated, free the memory backing the
8767 optional module state data.
8768
8769- Issue #4910: Rename nb_long slot to nb_reserved, and change its
8770 type to ``(void *)``.
8771
8772- Issue #4935: The overflow checking code in the expandtabs() method common
8773 to str, bytes and bytearray could be optimized away by the compiler, letting
8774 the interpreter segfault instead of raising an error.
8775
8776- Issue #3720: Fix a crash when an iterator modifies its class and removes its
8777 __next__ method.
8778
8779- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
8780 function no longer attempt to call the __long__ slot to convert an object
8781 to an integer. Only the __int__ and __trunc__ slots are examined.
8782
8783- Issue #4893: Use NT threading on CE.
8784
8785- Issue #4915: Port sysmodule to Windows CE.
8786
8787- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
8788 common cases are optimized thanks to a dedicated fast path and a moderate
8789 amount of loop unrolling.
8790
8791- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
8792 collecting the oldest generation) so that allocating lots of objects without
8793 destroying them does not show quadratic performance. Based on a proposal by
8794 Martin von Löwis at
8795 http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
8796
8797- Issue #4604: Some objects of the I/O library could still be used after
8798 having been closed (for instance, a read() call could return some
8799 previously buffered data). Patch by Dmitry Vasiliev.
8800
8801- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
8802 flag to work properly. Furthermore, when specifying -u, the text stdout
8803 and stderr streams have line-by-line buffering enabled (the default being
8804 to buffer arbitrary chunks of data).
8805
8806- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
8807 instead of ints (reducing its size from 4 to 8 times thereby reducing
8808 Python's overall memory).
8809
8810- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
8811 an existing .py counterpart, override the co_filename attributes of all
8812 code objects if the original filename is obsolete (which can happen if the
8813 file has been renamed, moved, or if it is accessed through different paths).
8814 Patch by Ziga Seilnacht and Jean-Paul Calderone.
8815
8816- Issue #4580: Fix slicing of memoryviews when the item size is greater than
8817 one byte. Also fixes the meaning of len() so that it returns the number of
8818 items, rather than the size in bytes.
8819
8820- Issue #4075: Use OutputDebugStringW in Py_FatalError.
8821
8822- Issue #4747: When the terminal does not use utf-8, executing a script with
8823 non-ascii characters in its name could fail with a "SyntaxError: None" error.
8824
8825- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
8826 to open file with a bytes filename on Windows.
8827
8828- Issue #3680: Reference cycles created through a dict, set or deque iterator
8829 did not get collected.
8830
8831- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
8832 where the tp_hash and tp_dict slots are both NULL.
8833
8834- Issue #4759: None is now allowed as the first argument of
8835 bytearray.translate(). It was always allowed for bytes.translate().
8836
8837- Added test case to ensure attempts to read from a file opened for writing
8838 fail.
8839
8840- Issue #3106: Speedup some comparisons (str/str and int/int).
8841
8842- Issue #2183: Simplify and optimize bytecode for list, dict and set
8843 comprehensions. Original patch for list comprehensions by Neal Norwitz.
8844
8845- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
8846 print elapsed times, not only when some objects are uncollectable /
8847 unreachable. Original patch by Neil Schemenauer.
8848
8849- Issue #3439: Add a bit_length method to int.
8850
8851- Issue #2173: When getting device encoding, check that return value of
8852 nl_langinfo is not the empty string. This was causing silent build
8853 failures on OS X.
8854
8855- Issue #4597: Fixed several opcodes that weren't always propagating
8856 exceptions.
8857
8858- Issue #4589: Fixed exception handling when the __exit__ function of a
8859 context manager returns a value that cannot be converted to a bool.
8860
8861- Issue #4445: Replace "sizeof(PyBytesObject)" with
8862 "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
8863 bytes instances. On a typical machine this saves 3 bytes of memory
8864 (on average) per allocation of a bytes instance.
8865
8866- Issue #4533: File read operation was dreadfully slow due to a slowly
8867 growing read buffer. Fixed by using the same growth rate algorithm as
8868 Python 2.x.
8869
8870- Issue #4509: Various issues surrounding resize of bytearray objects to
8871 which there are buffer exports (e.g. memoryview instances).
8872
8873- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
8874 method on file objects with closefd=False. The file descriptor is still
8875 kept open but the file object behaves like a closed file. The ``FileIO``
8876 object also got a new readonly attribute ``closefd``.
8877
8878- Issue #4569: Interpreter crash when mutating a memoryview with an item size
8879 larger than 1.
8880
8881- Issue #4748: Lambda generators no longer return a value.
8882
8883- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
8884
8885- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
8886 PyUnicode_DecodeUTF8() once, remember the result and output it in a second
8887 step. This avoids problems with counting UTF-8 bytes that ignores the effect
8888 of using the replace error handler in PyUnicode_DecodeUTF8().
8889
8890Library
8891-------
8892
8893- Issue #7071: byte-compilation in Distutils is now done with respect to
8894 sys.dont_write_bytecode.
8895
8896- Issue #7066: archive_util.make_archive now restores the cwd if an error is
8897 raised. Initial patch by Ezio Melotti.
8898
8899- Issue #6516: Added owner/group support when creating tar archives in
8900 Distutils.
8901
8902- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
8903
8904- Issue #6163: Fixed HP-UX runtime library dir options in
8905 distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
8906 Michael Haubenwallner.
8907
8908- Issue #6693: New functions in site.py to get user/global site packages paths.
8909
8910- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
8911 opening an empty or very small file.
8912
8913- Issue #6545: Removed assert statements in distutils.Extension, so the
8914 behavior is similar when used with -O.
8915
8916- unittest has been split up into a package. All old names should still work.
8917
8918- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
8919 uses the same refactored function to get gcc/ld/dllwrap versions numbers.
8920 It's `distutils.util.get_compiler_versions`. Added deprecation warnings
8921 for the obsolete get_versions() functions.
8922
8923- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
8924
8925- Issue #6314: logging: Extra checks on the "level" argument in more places.
8926
8927- Issue #2622: Fixed an ImportError when importing email.message from a
8928 standalone application built with py2exe or py2app.
8929
8930- Issue #6455: Fixed test_build_ext under win32.
8931
8932- Issue #6377: Enabled the compiler option, and deprecate its usage as an
8933 attribute.
8934
8935- Issue #6413: Fixed the log level in distutils.dist for announce.
8936
8937- Issue #6403: Fixed package path usage in build_ext.
8938
8939- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
8940 unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
8941 descriptor errors
8942
8943- Issue #6365: Distutils build_ext inplace mode was copying the compiled
8944 extension in a subdirectory if the extension name had dots.
8945
8946- Issue #6164: Added an AIX specific linker argument in Distutils
8947 unixcompiler. Original patch by Sridhar Ratnakumar.
8948
8949- Issue #6286: Now Distutils upload command is based on urllib2 instead of
8950 httplib, allowing the usage of http_proxy.
8951
8952- Issue #6287: Added the license field in Distutils documentation.
8953
8954- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
8955
8956- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
8957 in Makefiles. This prevents compile errors when using syntax like:
8958 `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
8959
8960- Issue #6131: test_modulefinder leaked when run after test_distutils.
8961 Patch by Hirokazu Yamamoto.
8962
8963- Issue #6048: Now Distutils uses the tarfile module in archive_util.
8964
8965- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
8966 and tests on pywin32 by Tim Golden.
8967
8968- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
8969
8970- Issue #6046: Fixed the library extension when distutils build_ext is used
8971 inplace. Initial patch by Roumen Petrov.
8972
8973- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
8974 subcommand.
8975
8976- Issue #6022: a test file was created in the current working directory by
8977 test_get_outputs in Distutils.
8978
8979- Issue #5977: distutils build_ext.get_outputs was not taking into account the
8980 inplace option. Initial patch by kxroberto.
8981
8982- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
8983 for old-style extensions.
8984
8985- Issue #5976: Fixed Distutils test_check_environ.
8986
8987- Issue #5941: Distutils build_clib command was not working anymore because
8988 of an incomplete costumization of the archiver command. Added ARFLAGS in the
8989 Makefile besides AR and make Distutils use it. Original patch by David
8990 Cournapeau.
8991
8992- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
8993
8994- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
8995 anymore.
8996
8997- Issue #5810: Fixed Distutils test_build_scripts so it uses
8998 sysconfig.get_config_vars.
8999
9000- Issue #4951: Fixed failure in test_httpservers.
9001
9002- Issue #5795: Fixed test_distutils failure on Debian ppc.
9003
9004- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
9005
9006- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
9007 a value in SafeConfigParser.
9008
9009- Issue #5732: added a new command in Distutils: check.
9010
9011- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
9012 platforms. Initial patch by Paul Moore.
9013
9014- Issue #5095: Added bdist_msi to the list of bdist supported formats.
9015 Initial fix by Steven Bethard.
9016
9017- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
9018 Initial fix by Wayne Davison.
9019
9020- Issue #5694: removed spurious test output in Distutils (test_clean).
9021
9022- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
9023
9024- Issue #1665206 (partially): Move imports in cgitb to the top of the module
9025 instead of performing them in functions. Helps prevent import deadlocking in
9026 threads.
9027
9028- Issue #2522: locale.format now checks its first argument to ensure it has
9029 been passed only one pattern, avoiding mysterious errors where it appeared
9030 that it was failing to do localization.
9031
9032- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
9033 Brandl.
9034
9035- Issue #1222: locale.format() bug when the thousands separator is a space
9036 character.
9037
9038- Issue #5472: Fixed distutils.test_util tear down. Original patch by
9039 Tim Golden.
9040
9041- collections.deque() objects now have a read-only attribute called maxlen.
9042
9043- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
9044 it is has been populated and properly configured in order to prevent
9045 window flashing.
9046
9047- Issue #4792: Prevent a segfault in _tkinter by using the
9048 guaranteed to be safe interp argument given to the PythonCmd in place of
9049 the Tcl interpreter taken from a PythonCmd_ClientData.
9050
9051- Issue #5193: Guarantee that tkinter.Text.search returns a string.
9052
9053- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
9054 Original patch by Akira Kitada.
9055
9056- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
9057
9058- Issue #5385: Fixed mmap crash after resize failure on windows.
9059
9060- Issue #5179: Fixed subprocess handle leak on failure on windows.
9061
9062- PEP 372: Added collections.OrderedDict().
9063
9064- The _asdict() for method for namedtuples now returns an OrderedDict().
9065
9066- configparser now defaults to using an ordered dictionary.
9067
9068- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
9069 import guess_extension`` was used.
9070
9071- Issue #1733986: Fixed mmap crash in accessing elements of second map object
9072 with same tagname but larger size than first map. (Windows)
9073
9074- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
9075 overrun.
9076
9077- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
9078 bdist_rpm command.
9079
9080- Issue #5378: added --quiet option to Distutils bdist_rpm command.
9081
9082- Issue #5052: make Distutils compatible with 2.3 again.
9083
9084- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
9085 in Distutils tests.
9086
9087- Issue #5287: Add exception handling around findCaller() call to help out
9088 IronPython.
9089
9090- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
9091 The file was resized to wrong size.
9092
9093- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
9094
9095- Issue #2279: distutils.sdist.add_defaults now add files
9096 from the package_data and the data_files metadata.
9097
9098- Issue #5257: refactored all tests in distutils, so they use
9099 support.TempdirManager, to avoid writing in the tests directory.
9100
9101- Issue #4524: distutils build_script command failed with --with-suffix=3.
9102 Initial patch by Amaury Forgeot d'Arc.
9103
9104- Issue #2461: added tests for distutils.util
9105
9106- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
9107 which inherited from numbers.py which did not have __slots__ defined. The
9108 numbers hierarchy now has its own __slots__ declarations.
9109
9110- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
9111 encoding.
9112
9113- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
9114 function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
9115
9116- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
9117 under NT and OS2. Patch by Philip Jenvey.
9118
9119- Issue #5128: Make compileall properly inspect bytecode to determine if needs
9120 to be recreated. This avoids a timing hole thanks to the old reliance on the
9121 ctime of the files involved.
9122
9123- Issue #5122: Synchronize tk load failure check to prevent a potential
9124 deadlock.
9125
9126- Issue #1818: collections.namedtuple() now supports a keyword argument
9127 'rename' which lets invalid fieldnames be automatically converted to
9128 positional names in the form, _1, _2, ...
9129
9130- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
9131
9132- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
9133 public documented method ``ZipImporter.get_filename()``.
9134
9135- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
9136 the execution of packages by looking for and executing a ``__main__``
9137 submodule when a package name is supplied. Initial patch by Andi
9138 Vajda.
9139
9140- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
9141 not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
9142 Tkapp_Call when calling from a thread different than the one that created
9143 the Tcl interpreter. Patch by Robert Hancock.
9144
9145- Issue #4285: Change sys.version_info to be a named tuple. Patch by
9146 Ross Light.
9147
9148- Issue #1520877: Now distutils.sysconfig reads $AR from the
9149 environment/Makefile. Patch by Douglas Greiman.
9150
9151- Issue #1276768: The verbose option was not used in the code of
9152 distutils.file_util and distutils.dir_util.
9153
9154- Issue #5132: Fixed trouble building extensions under Solaris with
9155 --enabled-shared activated. Initial patch by Dave Peterson.
9156
9157- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
9158
9159- The shelve module now defaults to pickle protocol 3.
9160
9161- Fix a bug in the trace module where a bytes object from co_lnotab had its
9162 items being passed through ord().
9163
9164- Issue #2047: shutil.move() could believe that its destination path was
9165 inside its source path if it began with the same letters (e.g. "src" vs.
9166 "src.new").
9167
9168- Added the ttk module. See issue #2983: Ttk support for Tkinter.
9169
9170- Removed isSequenceType(), isMappingType, and isNumberType() from the
9171 operator module; use the abstract base classes instead. Also removed
9172 the repeat() function; use mul() instead.
9173
9174- Issue #5021: doctest.testfile() did not create __name__ and
9175 collections.namedtuple() relied on __name__ being defined.
9176
9177- Backport importlib from Python 3.1. Only the import_module() function has
9178 been backported to help facilitate transitions from 2.7 to 3.1.
9179
9180- Issue #1885: distutils. When running sdist with --formats=tar,gztar
9181 the tar file was overriden by the gztar one.
9182
9183- Issue #4863: distutils.mwerkscompiler has been removed.
9184
9185- Added a new itertools functions: combinations_with_replacement()
9186 and compress().
9187
9188- Issue #5032: added a step argument to itertools.count() and
9189 allowed non-integer arguments.
9190
9191- Fix and properly document the multiprocessing module's logging
9192 support, expose the internal levels and provide proper usage
9193 examples.
9194
9195- Issue #1672332: fix unpickling of subnormal floats, which was
9196 producing a ValueError on some platforms.
9197
9198- Issue #3881: Help Tcl to load even when started through the
9199 unreadable local symlink to "Program Files" on Vista.
9200
9201- Issue #4710: Extract directories properly in the zipfile module;
9202 allow adding directories to a zipfile.
9203
9204- Issue #3807: _multiprocessing build fails when configure is passed
9205 --without-threads argument. When this occurs, _multiprocessing will
9206 be disabled, and not compiled.
9207
9208- Issue #5008: When a file is opened in append mode with the new IO library,
9209 do an explicit seek to the end of file (so that e.g. tell() returns the
9210 file size rather than 0). This is consistent with the behaviour of the
9211 traditional 2.x file object.
9212
9213- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
9214 parameter was set.
9215
9216- Issue #4842: Always append a trailing 'L' when pickling longs using
9217 pickle protocol 0. When reading, the 'L' is optional.
9218
9219- Add the importlib package.
9220
9221- Issue #4301: Patch the logging module to add processName support, remove
9222 _check_logger_class from multiprocessing.
9223
9224- Issue #3325: Remove python2.x try: except: imports for old cPickle from
9225 multiprocessing.
9226
9227- Issue #4959: inspect.formatargspec now works for keyword only arguments
9228 without defaults.
9229
9230- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
9231 for Unix machines for negative handles and large int handles. Without this check
9232 it is possible to segfault the interpreter.
9233
9234- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
9235 in sharedctypes.py.
9236
9237- Issue #1225107: inspect.isclass() returned True for instances with a custom
9238 __getattr__.
9239
9240- Issue #3826 and #4791: The socket module now closes the underlying socket
9241 appropriately when it is being used via socket.makefile() objects
9242 rather than delaying the close by waiting for garbage collection to do it.
9243
9244- Issue #1696199: Add collections.Counter() for rapid and convenient
9245 counting.
9246
9247- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
9248
9249- Issue #4867: Fixed a crash in ctypes when passing a string to a
9250 function without defining argtypes.
9251
9252- Issue #4272: Add an optional argument to the GzipFile constructor to override
9253 the timestamp in the gzip stream. The default value remains the current time.
9254 The information can be used by e.g. gunzip when decompressing. Patch by
9255 Jacques Frechet.
9256
9257- Restore Python 2.3 compatibility for decimal.py.
9258
9259- Issue #3638: Remove functions from _tkinter module level that depend on
9260 TkappObject to work with multiple threads.
9261
9262- Issue #4718: Adapt the wsgiref package so that it actually works with
9263 Python 3.x, in accordance with the `official amendments of the spec
9264 <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
9265
9266- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
9267 to the decimal module.
9268
9269- Fractions.from_float() no longer loses precision for integers too big to
9270 cast as floats.
9271
9272- Issue #4812: add missing underscore prefix to some internal-use-only
9273 constants in the decimal module. (Dec_0 becomes _Dec_0, etc.)
9274
9275- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
9276 did unnecessary work in the common case where no key function was specified.
9277
9278- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
9279 the function is not a generator.
9280
9281- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
9282 no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
9283
9284- Issue #4646: distutils was choking on empty options arg in the setup
9285 function. Original patch by Thomas Heller.
9286
9287- Issue #3767: Convert Tk object to string in tkColorChooser.
9288
9289- Issue #3248: Allow placing ScrolledText in a PanedWindow.
9290
9291- Issue #4444: Allow assertRaises() to be used as a context handler, so that
9292 the code under test can be written inline if more practical.
9293
9294- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
9295 works as expected in the interactive environment.
9296
9297- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
9298 Gabriel Genellina.
9299
9300- Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char
9301 boundary.
9302
9303- Issue #4223: inspect.getsource() will now correctly display source code
9304 for packages loaded via zipimport (or any other conformant PEP 302
9305 loader). Original patch by Alexander Belopolsky.
9306
9307- Issue #4201: pdb can now access and display source code loaded via
9308 zipimport (or any other conformant PEP 302 loader). Original patch by
9309 Alexander Belopolsky.
9310
9311- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
9312 302 conformant loader) will now work correctly in most cases (they
9313 are still subject to the constraints that exist for all code running
9314 from inside a module loaded via a PEP 302 loader and attempting to
9315 perform IO operations based on __file__). Original patch by
9316 Alexander Belopolsky.
9317
9318- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
9319 allows backporting to maintenance branches. Original patch by
9320 Alexander Belopolsky.
9321
9322- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
9323 a non-ASCII letter.
9324
9325- Issue #4616: TarFile.utime(): Restore directory times on Windows.
9326
9327- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
9328 codec cannot be found. This is for compatibility with the builtin behavior.
9329
9330- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
9331 give correct results in the case where one argument is a quiet NaN
9332 and the other is a finite number that requires rounding.
9333
9334- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
9335 libs.
9336
9337- Added the subprocess.check_call_output() convenience function to get output
9338 from a subprocess on success or raise an exception on error.
9339
9340- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
9341 support unusual filenames (such as those containing semi-colons) in
9342 Content-Disposition headers.
9343
9344- Issue #4384: Added logging integration with warnings module using
9345 captureWarnings(). This change includes a NullHandler which does nothing;
9346 it will be of use to library developers who want to avoid the "No handlers
9347 could be found for logger XXX" message which can appear if the library user
9348 doesn't configure logging.
9349
9350- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
9351 exception.
9352
9353- Issue #4529: fix the parser module's validation of try-except-finally
9354 statements.
9355
9356- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
9357 not a malformed option.
9358
9359- Added the subprocess.check_output() convenience function to get output
9360 from a subprocess on success or raise an exception on error.
9361
9362- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
9363 the corresponding tests now pass.
9364
9365- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
9366 it was calling the wrong open() function.
9367
9368- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
9369 support unusual filenames (such as those containing semi-colons) in
9370 Content-Disposition headers.
9371
9372- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
9373 biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
9374
9375- Issue #5104: The socket module now raises OverflowError when 16-bit port and
9376 protocol numbers are supplied outside the allowed 0-65536 range on bind()
9377 and getservbyport().
9378
9379- Windows locale mapping updated to Vista.
9380
9381Tools/Demos
9382-----------
9383
9384- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
9385 and make it 2.6-compatible.
9386
9387- Ttk demos added in Demo/tkinter/ttk/
9388
9389- Issue #4677: add two list comprehension tests to pybench.
9390
9391
9392Build
9393-----
9394
9395- Issue #6094: Build correctly with Subversion 1.7.
9396
9397- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
9398
9399- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
9400 linker, rather than always exit successfully. Patch by Floris Bruynooghe.
9401
9402- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
9403 the order that backends for the dbm extension are checked.
9404
9405- Link the shared python library with $(MODLIBS).
9406
9407- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
9408
9409- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
9410
9411- Issue #4895: Use _strdup on Windows CE.
9412
9413- Issue #4472: "configure --enable-shared" now works on OSX
9414
9415- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
9416
9417- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
9418
9419- Issue #4289: Remove Cancel button from AdvancedDlg.
9420
9421- Issue #1656675: Register a drop handler for .py* files on Windows.
9422
9423- Issue #4120: Exclude manifest from extension modules in VS2008.
9424
9425- Issue #4091: Install pythonxy.dll in system32 again.
9426
9427- Issue #4018: Disable "for me" installations on Vista.
9428
9429- Issue #3758: Add ``patchcheck`` build target to .PHONY.
9430
9431- Issue #4204: Fixed module build errors on FreeBSD 4.
9432
9433
9434C-API
9435-----
9436
9437- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
9438 NUL: Bogus TypeError detail string.
9439
9440- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
9441 for negative arguments. Previously, it raised TypeError.
9442
9443- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
9444
9445- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
9446 the GIL is released, or owned by another thread.
9447
9448- Issue #4122: On Windows, fix a compilation error when using the
9449 Py_UNICODE_ISSPACE macro in an extension module.
9450
9451
9452Extension Modules
9453-----------------
9454
9455- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
9456 supporting objects as input no matter how it was compiled (built in
9457 implementations or external openssl library).
9458
9459- Issue #4397: Fix occasional test_socket failure on OS X.
9460
9461- Issue #4279: Fix build of parsermodule under Cygwin.
9462
9463- Issue #4751: hashlib now releases the GIL when hashing large buffers
9464 (with a hardwired threshold of 2048 bytes), allowing better parallelization
9465 on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
9466
9467- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
9468
9469- Issue #4738: Each zlib object now has a separate lock, allowing to compress
9470 or decompress several streams at once on multi-CPU systems. Also, the GIL
9471 is now released when computing the CRC of a large buffer. Patch by ebfe.
9472
9473- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
9474
9475- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
9476
9477- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
9478 OpenBSD.
9479
9480- Issue #4583: array.array would not always prohibit resizing when a buffer
9481 has been exported, resulting in an interpreter crash when accessing the
9482 buffer.
9483
9484
9485- Issue #5228: Make functools.partial objects can now be pickled.
9486
9487Tests
9488-----
9489
9490- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
9491 regression tests in parallel, shortening the total runtime.
9492
9493- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
9494 Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
9495 the same behaviour as test_ttkguionly (and now also test_tk) which is to
9496 skip the tests if DISPLAY is defined but can't be used.
9497
9498- regrtest no longer treats ImportError as equivalent to SkipTest. Imports
9499 that should cause a test to be skipped are now done using import_module
9500 from test support, which does the conversion.
9501
9502- Issue #5083: New 'gui' resource for regrtest.
9503
9504
9505Docs
9506----
9507
9508
Barry Warsaw97f005d2008-12-03 16:46:14 +00009509What's New in Python 3.0 final
9510==============================
9511
9512*Release date: 03-Dec-2008*
9513
9514Core and Builtins
9515-----------------
9516
9517- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
9518 interpreter to abort ("Fatal Python error: Could not reset the stack!")
9519 instead of throwing a MemoryError.
9520
9521- Issue #3689: The list reversed iterator now supports __length_hint__
9522 instead of __len__. Behavior now matches other reversed iterators.
9523
9524- Issue #4367: Python would segfault during compiling when the unicodedata
9525 module couldn't be imported and \N escapes were present.
9526
9527- Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
9528
9529Library
9530-------
9531
9532- Issue #4387: binascii now refuses to accept str as binary input.
9533
9534- Issue #4073: Add 2to3 support to build_scripts, refactor that support
9535 in build_py.
9536
9537- IDLE would print a "Unhandled server exception!" message when internal
9538 debugging is enabled.
9539
9540- Issue #4455: IDLE failed to display the windows list when two windows have
9541 the same title.
9542
9543- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
9544 exception.
9545
9546- Issue #4433: Fixed an access violation when garbage collecting
9547 _ctypes.COMError instances.
9548
9549- Issue #4429: Fixed UnicodeDecodeError in ctypes.
9550
9551- Issue #4373: Corrected a potential reference leak in the pickle module and
9552 silenced a false positive ref leak in distutils.tests.test_build_ext.
9553
9554- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
9555 files.
9556
9557- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
9558 fail to properly display the error message.
9559
9560Build
9561-----
9562
9563- Issue #4407: Fix source file that caused the compileall step in Windows installer
9564 to fail.
9565
9566Docs
9567----
9568
9569- Issue #4449: Fixed multiprocessing examples
9570
9571- Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
9572 for keys and values which will be converted to bytes before committal.
9573
9574
9575What's New in Python 3.0 release candidate 3?
9576=============================================
9577
9578*Release date: 20-Nov-2008*
9579
9580
9581Core and Builtins
9582-----------------
9583
9584- Issue #4349: sys.path included a non-existent platform directory because of a
9585 faulty Makefile.
9586
9587- Issue #3327: Don't overallocate in the modules_by_index list.
9588
9589- Issue #1721812: Binary set operations and copy() returned the input type
9590 instead of the appropriate base type. This was incorrect because set
9591 subclasses would be created without their __init__() method being called.
9592 The corrected behavior brings sets into line with lists and dicts.
9593
9594- Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates to
9595 True, even when x doesn't compare equal to itself. This was a regression
9596 from 2.6.
9597
9598- Issue #3705: Command-line arguments were not correctly decoded when the
9599 terminal does not use UTF8.
9600
9601Library
9602-------
9603
9604- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
9605 the ctypes module is not present.
9606
9607- FileIO's mode attribute now always includes ``"b"``.
9608
9609- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String
9610 keys are now written out in UTF-8.
9611
9612- Issue #4338: Fix distutils upload command.
9613
9614- Issue #4354: Fix distutils register command.
9615
9616- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
9617
9618- Issue #4307: The named tuple that ``inspect.getfullargspec()`` returns now
9619 uses ``kwonlydefaults`` instead of ``kwdefaults``.
9620
9621- Issue #4298: Fix a segfault when pickle.loads is passed a ill-formed input.
9622
9623- Issue #4283: Fix a left-over "iteritems" call in distutils.
9624
9625Build
9626-----
9627
9628- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
9629
9630- Issue #4289: Remove Cancel button from AdvancedDlg.
9631
9632- Issue #1656675: Register a drop handler for .py* files on Windows.
9633
9634Tools/Demos
9635-----------
9636
9637- Demos of the socketserver module now work with Python 3.
9638
9639
9640What's New in Python 3.0 release candidate 2
9641============================================
9642
9643*Release date: 05-Nov-2008*
9644
9645Core and Builtins
9646-----------------
9647
9648- Issue #4211: The __path__ attribute of frozen packages is now a list instead
9649 of a string as required by PEP 302.
9650
9651- Issue #3727: Fixed poplib.
9652
9653- Issue #3714: Fixed nntplib by using bytes where appropriate.
9654
9655- Issue #1210: Fixed imaplib and its documentation.
9656
9657- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
9658 method on file objects with closefd=False. The file descriptor is still
9659 kept open but the file object behaves like a closed file. The ``FileIO``
9660 object also got a new readonly attribute ``closefd``.
9661
9662- Issue #3626: On cygwin, starting python with a non-existent script name
9663 would not display anything if the file name is only 1 character long.
9664
9665- Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
9666 method does not return iterators for the 4th and 5th items.
9667
9668- Issue #3723: Fixed initialization of subinterpreters.
9669
9670- Issue #4213: The file system encoding is now normalized by the
9671 codec subsystem, for example UTF-8 is turned into utf-8.
9672
9673- Issue #4200: Changed the atexit module to store its state in its
9674 PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
9675
9676- Issue #4237: io.FileIO() was raising invalid warnings caused by
9677 insufficient initialization of PyFileIOObject struct members.
9678
9679- Issue #4170: Pickling a collections.defaultdict object would crash the
9680 interpreter.
9681
9682- Issue #4146: Compilation on OpenBSD has been restored.
9683
9684- Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
9685
9686- Issues #2384 and #3975: Tracebacks were not correctly printed when the
9687 source file contains a ``coding:`` header: the wrong line was displayed, and
9688 the encoding was not respected.
9689
9690- Issue #3740: Null-initialize module state.
9691
9692- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
9693
9694- Issue #1688: On Windows, the input() prompt was not correctly displayed if it
9695 contains non-ascii characters.
9696
9697- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
9698
9699Library
9700-------
9701
9702- Issue #3664: The pickle module could segfault if a subclass of Pickler fails
9703 to call the base __init__ method.
9704
9705- Issue #3725: telnetlib now works completely in bytes.
9706
9707- Issue #4072: Restore build_py_2to3.
9708
9709- Issue #4014: Don't claim that Python has an Alpha release status, in addition
9710 to claiming it is Mature.
9711
9712- Issue #3187: Add sys.setfilesystemencoding.
9713
9714- Issue #3187: Better support for "undecodable" filenames. Code by Victor
9715 Stinner, with small tweaks by GvR.
9716
9717- Issue #3965: Allow repeated calls to turtle.Screen, by making it a
9718 true singleton object.
9719
9720- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
9721
9722- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
9723 raise a TypeError: "'tuple' object is not callable" instead of the expected
9724 dbm.error.
9725
9726- Bug #3884: Make the turtle module toplevel again.
9727
9728- Issue #3547: Fixed ctypes structures bitfields of varying integer
9729 sizes.
9730
9731Extension Modules
9732-----------------
9733
9734- Issue #3659: Subclasses of str didn't work as SQL parameters.
9735
9736Build
9737-----
9738
9739- Issue #4120: Exclude manifest from extension modules in VS2008.
9740
9741- Issue #4091: Install pythonxy.dll in system32 again.
9742
9743- Issue #4018: Disable "for me" installations on Vista.
9744
9745- Issue #4204: Fixed module build errors on FreeBSD 4.
9746
9747Tools/Demos
9748-----------
9749
9750- Issue #3717: Fix Demo/embed/demo.c.
9751
9752- Issue #4072: Add a distutils demo for build_py_2to3.
9753
9754
9755What's New in Python 3.0 release candidate 1
9756============================================
9757
9758*Release date: 17-Sep-2008*
9759
9760Core and Builtins
9761-----------------
9762
9763- Issue #3827: memoryview lost its size attribute in favor of using len(view).
9764
9765- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
9766
9767- Issue #3705: fix crash when given a non-ascii value on the command line for
9768 the "-c" and "-m" parameters. Now the behaviour is as expected under Linux,
9769 although under Windows it fails at a later point.
9770
9771- Issue #3279: Importing site at interpreter was failing silently because the
9772 site module uses the open builtin which was not initialized at the time.
9773
9774- Issue #3660: Corrected a reference leak in str.encode() when the encoder
9775 does not return a bytes object.
9776
9777- Issue #3774: Added a few more checks in PyTokenizer_FindEncoding to handle
9778 error conditions.
9779
9780- Issue #3594: Fix Parser/tokenizer.c:fp_setreadl() to open the file being
9781 tokenized by either a file path or file pointer for the benefit of
9782 PyTokenizer_FindEncoding().
9783
9784- Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin. On
9785 these systems, the mbstowcs() function is slightly buggy and must be
9786 replaced with strlen() for the purpose of counting of number of wide
9787 characters needed to represent the multi-byte character string.
9788
9789- Issue #3697: "Fatal Python error: Cannot recover from stack overflow"
9790 could be easily encountered under Windows in debug mode when exercising
9791 the recursion limit checking code, due to bogus handling of recursion
9792 limit when USE_STACKCHEK was enabled.
9793
9794- Issue 3639: The _warnings module could segfault the interpreter when
9795 unexpected types were passed in as arguments.
9796
9797- Issue #3712: The memoryview object had a reference leak and didn't support
9798 cyclic garbage collection.
9799
9800- Issue #3668: Fix a memory leak with the "s*" argument parser in
9801 PyArg_ParseTuple and friends, which occurred when the argument for "s*"
9802 was correctly parsed but parsing of subsequent arguments failed.
9803
9804- Issue #3611: An exception __context__ could be cleared in a complex pattern
9805 involving a __del__ method re-raising an exception.
9806
9807- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
9808 match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
9809 mechanism. In the process, fix a bug where isinstance() and issubclass(),
9810 when given a tuple of classes as second argument, were looking up
9811 __instancecheck__ / __subclasscheck__ on the tuple rather than on each
9812 type object.
9813
9814- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
9815
9816- Issue #3651: Fix various memory leaks when using the buffer
9817 interface, or when the "s#" code of PyArg_ParseTuple is given a
9818 bytes object.
9819
9820- Issue #3657: Fix uninitialized memory read when pickling longs.
9821 Found by valgrind.
9822
9823- Apply security patches from Apple.
9824
9825- Fix crashes on memory allocation failure found with failmalloc.
9826
9827- Fix memory leaks found with valgrind and update suppressions file.
9828
9829- Fix compiler warnings in opt mode which would lead to invalid memory reads.
9830
9831- Fix problem using wrong name in decimal module reported by pychecker.
9832
9833- Issue #3650: Fixed a reference leak in bytes.split('x').
9834
9835- bytes(o) now tries to use o.__bytes__() before using fallbacks.
9836
9837- Issue #1204: The configure script now tests for additional libraries
9838 that may be required when linking against readline. This fixes issues
9839 with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
9840
9841C API
9842-----
9843
9844- PyObject_Bytes and PyBytes_FromObject were added.
9845
9846Library
9847-------
9848
9849- Issue #3756: make re.escape() handle bytes as well as str.
9850
9851- Issue #3800: fix filter() related bug in formatter.py.
9852
9853- Issue #874900: fix behaviour of threading module after a fork.
9854
9855- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
9856
9857- Issue #3776: Deprecate the bsddb package for removal in 3.0.
9858
9859- Issue #3762: platform.architecture() fails if python is lanched via
9860 its symbolic link.
9861
9862- Issue #3660: fix a memory leak in the C accelerator of the pickle module.
9863
9864- Issue #3160: the "bdist_wininst" distutils command didn't work.
9865
9866- Issue #1658: tkinter changes dict size during iteration in both
9867 tkinter.BaseWidget and tkinter.scrolledtext.ScrolledText.
9868
9869- The bsddb module (and therefore the dbm.bsd module) has been removed.
9870 It is now maintained outside of the standard library at
9871 http://www.jcea.es/programacion/pybsddb.htm.
9872
9873- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
9874 to the urlparse one. Added a DeprecationWarning in the old module, it
9875 will be deprecated in the future.
9876
9877- Issue #3719: platform.architecture() fails if there are spaces in the
9878 path to the Python binary.
9879
9880- Issue 3602: As part of the merge of r66135, make the parameters on
9881 warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning.
9882
9883- The deprecation warnings for the camelCase threading API names were removed.
9884
9885- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
9886 SEM_VALUE_MAX.
9887
9888Extension Modules
9889-----------------
9890
9891- Issue #3782: os.write() must not accept unicode strings.
9892
9893- Issue #2975: When compiling several extension modules with Visual Studio 2008
9894 from the same python interpreter, some environment variables would grow
9895 without limit.
9896
9897- Issue #3643: Added a few more checks to _testcapi to prevent segfaults by
9898 exploitation of poor argument checking.
9899
9900- bsddb code updated to version 4.7.3pre2. This code is the same than
9901 Python 2.6 one, since the intention is to keep an unified 2.x/3.x codebase.
9902 The Python code is automatically translated using "2to3". Please, do not
9903 update this code in Python 3.0 by hand. Update the 2.6 one and then
9904 do "2to3".
9905
9906- The _bytesio and _stringio modules are now compiled into the python binary.
9907
9908- Issue #3492 and #3790: Fixed the zlib module and zipimport module uses of
9909 mutable bytearray objects where they should have been using immutable bytes.
9910
9911- Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to
9912 return bytes objects instead of bytearray objects.
9913
9914
9915Tools/Demos
9916-----------
9917
9918- Fix Misc/gdbinit so it works.
9919
9920
9921Build
9922-----
9923
9924- Issue #3812: Failed to build python if configure --without-threads.
9925
9926- Issue #3791: Remove the bsddb module from the Windows installer, and the
9927 core bsddb library from the Windows build files.
9928
9929
9930What's new in Python 3.0b3?
9931===========================
9932
9933*Release date: 20-Aug-2008*
9934
9935Core and Builtins
9936-----------------
9937
9938- Issue #3653: Fix a segfault when sys.excepthook was called with invalid
9939 arguments.
9940
9941- Issue #2394: implement more of the memoryview API, with the caveat that
9942 only one-dimensional contiguous buffers are supported and exercised right
9943 now. Slicing, slice assignment and comparison (equality and inequality)
9944 have been added. Also, the tolist() method has been implemented, but only
Georg Brandl98b52ef2009-05-25 22:20:44 +00009945 for byte buffers. Finally, the API has been updated to return bytes objects
Barry Warsaw97f005d2008-12-03 16:46:14 +00009946 wherever it used to return bytearrays.
9947
9948- Issue #3560: clean up the new C PyMemoryView API so that naming is
9949 internally consistent; add macros PyMemoryView_GET_BASE() and
9950 PyMemoryView_GET_BUFFER() to access useful properties of a memory views
9951 without relying on a particular implementation; remove the ill-named
9952 PyMemoryView() function (PyMemoryView_GET_BUFFER() can be used instead).
9953
9954- ctypes function pointers that are COM methods have a boolean True
9955 value again.
9956
9957- Issue #1819: function calls with several named parameters are now on
9958 average 35% faster (as measured by pybench).
9959
9960- The undocumented C APIs PyUnicode_AsString() and
9961 PyUnicode_AsStringAndSize() were made private to the interpreter, in
9962 order to be able to refine their interfaces for Python 3.1.
9963
9964 If you need to access the UTF-8 representation of a Unicode object
9965 as bytes string, please use PyUnicode_AsUTF8String() instead.
9966
9967- Issue #3460: PyUnicode_Join() implementation is 10% to 80% faster thanks
9968 to Python 3.0's stricter semantics which allow to avoid successive
9969 reallocations of the result string (this also affects str.join()).
9970
9971
9972Library
9973-------
9974
9975- Issue #1276: Added temporary aliases for CJK Mac encodings to resolve
9976 a build problem on MacOS with CJK locales. It adds four temporary
9977 mappings to existing legacy codecs that are virtually compatible
9978 with Mac encodings. They will be replaced by codecs correctly
9979 implemented in 3.1.
9980
9981- Issue #3614: Corrected a typo in xmlrpc.client, leading to a NameError
9982 "global name 'header' is not defined".
9983
9984- Issue #2834: update the regular expression library to match the unicode
9985 standards of py3k. In other words, mixing bytes and unicode strings
9986 (be it as pattern, search string or replacement string) raises a TypeError.
9987 Moreover, the re.UNICODE flag is enabled automatically for unicode patterns,
9988 and can be disabled by specifying a new re.ASCII flag; as for bytes
9989 patterns, ASCII matching is the only option and trying to specify re.UNICODE
9990 for such patterns raises a ValueError.
9991
9992- Issue #3300: make urllib.parse.[un]quote() default to UTF-8.
9993 Code contributed by Matt Giuca. quote() now encodes the input
9994 before quoting, unquote() decodes after unquoting. There are
9995 new arguments to change the encoding and errors settings.
9996 There are also new APIs to skip the encode/decode steps.
9997 [un]quote_plus() are also affected.
9998
9999- Issue #2235: numbers.Number now blocks inheritance of the default id()
10000 based hash because that hash mechanism is not correct for numeric types.
10001 All concrete numeric types that inherit from Number (rather than just
10002 registering with it) must explicitly provide a hash implementation in
10003 order for their instances to be hashable.
10004
10005- Issue #2676: in the email package, content-type parsing was hanging on
10006 pathological input because of quadratic or exponential behaviour of a
10007 regular expression.
10008
10009- Issue #3476: binary buffered reading through the new "io" library is now
10010 thread-safe.
10011
10012- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
10013 menu entries were not deleted.
10014
10015- Remove the TarFileCompat class from tarfile.py.
10016
10017- Issue #2491: os.fdopen is now almost an alias for the built-in open(), and
10018 accepts the same parameters. It just checks that its first argument is an
10019 integer.
10020
10021- Issue #3394: zipfile.writestr sets external attributes when passed a
10022 file name rather than a ZipInfo instance, so files are extracted with
10023 mode 0600 rather than 000 under Unix.
10024
10025- Issue #2523: Fix quadratic behaviour when read()ing a binary file without
10026 asking for a specific length.
10027
10028Extension Modules
10029-----------------
10030
10031- Bug #3542: Support Unicode strings in _msi module.
10032
10033What's new in Python 3.0b2?
10034===========================
10035
10036*Release date: 17-Jul-2008*
10037
10038Core and Builtins
10039-----------------
10040
10041- Issue #3008: the float type has a new instance method 'float.hex'
10042 and a new class method 'float.fromhex' to convert floating-point
10043 numbers to and from hexadecimal strings, respectively.
10044
10045- Issue #3083: Add alternate (#) formatting for bin, oct, hex output
10046 for str.format(). This adds the prefix 0b, 0o, or 0x, respectively.
10047
10048- Issue #3280: like chr(), the "%c" format now accepts unicode code points
10049 beyond the Basic Multilingual Plane (above 0xffff) on all configurations. On
10050 "narrow Unicode" builds, the result is a string of 2 code units, forming a
10051 UTF-16 surrogate pair.
10052
10053- Issue #3282: str.isprintable() should return False for undefined
10054 Unicode characters.
10055
10056- Issue #3236: Return small longs from PyLong_FromString.
10057
10058- Exception tracebacks now support exception chaining.
10059
10060Library
10061-------
10062
10063- Removed the sunaudio module. Use sunau instead.
10064
10065- Issue #3554: ctypes.string_at and ctypes.wstring_at did call Python
10066 api functions without holding the GIL, which could lead to a fatal
10067 error when they failed.
10068
10069- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
10070
10071- Removed "ast" function aliases from the parser module.
10072
10073- Issue #3313: Fixed a crash when a failed dlopen() call does not set
10074 a valid dlerror() message.
10075
10076- Issue #3258: Fixed a crash when a ctypes POINTER type to an
10077 incomplete structure was created.
10078
10079- Issue #2683: Fix inconsistency in subprocess.Popen.communicate(): the
10080 argument now must be a bytes object in any case.
10081
10082- Issue #3145: help("modules whatever") failed when trying to load the source
10083 code of every single module of the standard library, including invalid files
10084 used in the test suite.
10085
10086- The gettext library now consistently uses Unicode strings for message ids
10087 and message strings, and ``ugettext()`` and the like don't exist anymore.
10088
10089- The traceback module has been expanded to handle chained exceptions.
10090
10091C API
10092-----
10093
10094- Issue #3247: the function Py_FindMethod was removed. Modern types should
10095 use the tp_methods slot instead.
10096
10097Tools/Demos
10098-----------
10099
10100- The Mac/Demos directory has been removed.
10101
10102- All of the Mac scripts have been removed (including BuildApplet.py).
10103
10104
10105What's new in Python 3.0b1?
10106===========================
10107
10108*Release date: 18-Jun-2008*
10109
10110Core and Builtins
10111-----------------
10112
10113- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
10114 argument being anything other than a dict or None. Also fixed a bug in error
10115 handling when 'message' and 'category' were both set to None, triggering a
10116 bus error.
10117
10118- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
10119 holds the last (strong) reference to its referent.
10120
10121- Issue #2630: implement PEP 3138. repr() now returns printable
10122 Unicode characters unescaped, to get an ASCII-only representation
10123 of an object use ascii().
10124
10125- Issue #1342: On windows, Python could not start when installed in a
10126 directory with non-ascii characters.
10127
10128- Implement PEP 3121: new module initialization and finalization API.
10129
10130- Removed the already-defunct ``-t`` option.
10131
10132- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
10133 unmarshalling many code objects, which happens when importing a
10134 large .pyc file (~1000 functions).
10135
10136- Issue #2963: fix merging oversight that disabled method cache for
10137 all types.
10138
10139- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
10140
10141- Issue #2895: Don't crash when given bytes objects as keyword names.
10142
10143- Issue #2798: When parsing arguments with PyArg_ParseTuple, the "s"
10144 code now allows any unicode string and returns a utf-8 encoded
10145 buffer, just like the "s#" code already does. The "z" code was
10146 corrected as well.
10147
10148- Issue #2863: generators now have a ``gen.__name__`` attribute that
10149 equals ``gen.gi_code.co_name``, like ``func.__name___`` that equals
10150 ``func.func_code.co_name``. The repr() of a generator now also
10151 contains this name.
10152
10153- Issue #2831: enumerate() now has a ``start`` argument.
10154
10155- Issue #2801: fix bug in the float.is_integer method where a
10156 ValueError was sometimes incorrectly raised.
10157
10158- The ``--with-toolbox-glue`` option (and the associated
10159 pymactoolbox.h) have been removed.
10160
10161- Issue #2196: hasattr() now lets exceptions which do not inherit
10162 Exception (KeyboardInterrupt, and SystemExit) propagate instead of
10163 ignoring them.
10164
10165- #3021 Exception reraising sematics have been significantly improved. However,
10166 f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
10167 code anymore.
10168
10169- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
10170 removed.
10171
10172Extension Modules
10173-----------------
10174
10175- Renamed ``_winreg`` module to ``winreg``.
10176
10177- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the
10178 platform.
10179
10180- Support for Windows 9x has been removed from the winsound module.
10181
10182- Issue #2870: cmathmodule.c compile error.
10183
10184Library
10185-------
10186
10187- The methods ``is_in_tuple()``, ``is_vararg()``, and ``is_keywordarg()`` of
10188 symtable.Symbol have been removed.
10189
10190- Patch #3133: http.server.CGIHTTPRequestHandler did not work on windows.
10191
10192- a new ``urllib`` package was created. It consists of code from
10193 ``urllib``, ``urllib2``, ``urlparse``, and ``robotparser``. The old
10194 modules have all been removed. The new package has five submodules:
10195 ``urllib.parse``, ``urllib.request``, ``urllib.response``,
10196 ``urllib.error``, and ``urllib.robotparser``. The
10197 ``urllib.request.urlopen()`` function uses the url opener from
10198 ``urllib2``. (Note that the unittests have not been renamed for the
10199 beta, but they will be renamed in the future.)
10200
10201- rfc822 has been removed in favor of the email package.
10202
10203- mimetools has been removed in favor of the email package.
10204
10205- Patch #2849: Remove use of rfc822 module from standard library.
10206
10207- Added C optimized implementation of io.StringIO.
10208
10209- The ``pickle`` module is now automatically use an optimized C
10210 implementation of Pickler and Unpickler when available. The
10211 ``cPickle`` module is no longer needed.
10212
10213- Removed the ``htmllib`` and ``sgmllib`` modules.
10214
10215- The deprecated ``SmartCookie`` and ``SimpleCookie`` classes have
10216 been removed from ``http.cookies``.
10217
10218- The ``commands`` module has been removed. Its getoutput() and
10219 getstatusoutput() functions have been moved to the ``subprocess`` module.
10220
10221- The ``http`` package was created; it contains the old ``httplib``
10222 as ``http.client``, ``Cookie`` as ``http.cookies``, ``cookielib``
10223 as ``http.cookiejar``, and the content of the three ``HTTPServer``
10224 modules as ``http.server``.
10225
10226- The ``xmlrpc`` package was created; it contains the old
10227 ``xmlrpclib`` module as ``xmlrpc.client`` and the content of
10228 the old ``SimpleXMLRPCServer`` and ``DocXMLRPCServer`` modules
10229 as ``xmlrpc.server``.
10230
10231- The ``dbm`` package was created, containing the old modules
10232 ``anydbm`` and ``whichdb`` in its ``__init__.py``, and having
10233 ``dbm.gnu`` (was ``gdbm``), ``dbm.bsd`` (was ``dbhash``),
10234 ``dbm.ndbm`` (was ``dbm``) and ``dbm.dumb`` (was ``dumbdbm``)
10235 as submodules.
10236
10237- The ``repr`` module has been renamed to ``reprlib``.
10238
10239- The ``statvfs`` module has been removed.
10240
10241- Issue #1713041: fix pprint's handling of maximum depth.
10242
10243- Issue #2250: Exceptions raised during evaluation of names in
10244 rlcompleter's ``Completer.complete()`` method are now caught and
10245 ignored.
10246
10247- Patch #2659: Added ``break_on_hyphens`` option to textwrap's
10248 ``TextWrapper`` class.
10249
10250- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
10251 large to fit in a C long. ldexp(x, n) now returns a zero (with
10252 suitable sign) if n is large and negative; previously, it raised
10253 OverflowError.
10254
10255- The ``ConfigParser`` module has been renamed to ``configparser``.
10256
10257- Issue #2865: webbrowser.open() works again in a KDE environment.
10258
10259- The ``multifile`` module has been removed.
10260
10261- The ``SocketServer`` module has been renamed to ``socketserver``.
10262
10263- Fixed the ``__all__`` setting on ``collections`` to include
10264 ``UserList`` and ``UserString``.
10265
10266- The sre module has been removed.
10267
10268- The Queue module has been renamed to queue.
10269
10270- The copy_reg module has been renamed to copyreg.
10271
10272- The mhlib module has been removed.
10273
10274- The ihooks module has been removed.
10275
10276- The fpformat module has been removed.
10277
10278- The dircache module has been removed.
10279
10280- The Canvas module has been removed.
10281
10282- The Decimal module gained the magic methods __round__, __ceil__,
10283 __floor__ and __trunc__, to give support for round, math.ceil,
10284 math.floor and math.trunc.
10285
10286- The user module has been removed.
10287
10288- The mutex module has been removed.
10289
10290- The imputil module has been removed.
10291
10292- os.path.walk has been removed in favor of os.walk.
10293
10294- pdb gained the "until" command.
10295
10296- The test.test_support module has been renamed to test.support.
10297
10298- The threading module API was renamed to be PEP 8 compliant. The
10299 old names are still present, but will be removed in the near future.
10300
10301Tools/Demos
10302-----------
10303
10304- The bgen tool has been removed.
10305
10306Build
10307-----
10308
10309
10310What's New in Python 3.0a5?
10311===========================
10312
10313*Release date: 08-May-2008*
10314
10315Core and Builtins
10316-----------------
10317
10318- Fixed misbehaviour of PyLong_FromSsize_t on systems where
10319 sizeof(size_t) > sizeof(long).
10320
10321- Issue #2221: Corrected a SystemError "error return without exception
10322 set", when the code executed by exec() raises an exception, and
10323 sys.stdout.flush() also raises an error.
10324
10325- Bug #2565: The repr() of type objects now calls them 'class', not
10326 'type' - whether they are builtin types or not.
10327
10328- The command line processing was converted to pass Unicode strings
10329 through as unmodified as possible; as a consequence, the C API
10330 related to command line arguments was changed to use wchar_t.
10331
10332- All backslashes in raw strings are interpreted literally. This
10333 means that '\u' and '\U' escapes are not treated specially.
10334
10335Extension Modules
10336-----------------
10337
10338Library
10339-------
10340
10341- ctypes objects now support the PEP3118 buffer interface.
10342
10343- Issue #2682: ctypes callback functions now longer contain a cyclic
10344 reference to themselves.
10345
10346- Issue #2058: Remove the buf attribute and add __slots__ to the
10347 TarInfo class in order to reduce tarfile's memory usage.
10348
10349- Bug #2606: Avoid calling .sort() on a dict_keys object.
10350
10351- The bundled libffi copy is now in sync with the recently released
10352 libffi3.0.5 version, apart from some small changes to
10353 Modules/_ctypes/libffi/configure.ac.
10354
10355Build
10356-----
10357
10358- Issue #1496032: On alpha, use -mieee when gcc is the compiler.
10359
10360- "make install" is now an alias for "make altinstall", to prevent
10361 accidentally overwriting a Python 2.x installation. Use "make
10362 fullinstall" to force Python 3.0 to be installed as "python".
10363
10364- Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when
10365 gcc is used as compiler.
10366
10367
10368What's New in Python 3.0a4?
10369===========================
10370
10371*Release date: 02-Apr-2008*
10372
10373Core and Builtins
10374-----------------
10375
10376- Bug #2301: Don't try decoding the source code into the original
10377 encoding for syntax errors.
10378
10379Extension Modules
10380-----------------
10381
10382- The dl module was removed, use the ctypes module instead.
10383
10384- Use wchar_t functions in _locale module.
10385
10386Library
10387-------
10388
10389- The class distutils.commands.build_py.build_py_2to3 can be used as a
10390 build_py replacement to automatically run 2to3 on modules that are
10391 going to be installed.
10392
10393- A new pickle protocol (protocol 3) is added with explicit support
10394 for bytes. This is the default protocol. It intentionally cannot
10395 be unpickled by Python 2.x.
10396
10397- When a pickle written by Python 2.x contains an (8-bit) str
10398 instance, this is now decoded to a (Unicode) str instance. The
10399 encoding used to do this defaults to ASCII, but can be overridden
10400 via two new keyword arguments to the Unpickler class. Previously
10401 this would create bytes instances, which is usually wrong: str
10402 instances are often used to pickle attribute names etc., and text is
10403 more common than binary data anyway.
10404
10405- Default to ASCII as the locale.getpreferredencoding, if the POSIX
10406 system doesn't support CODESET and LANG isn't set or doesn't allow
10407 deduction of an encoding.
10408
10409- Issue #1202: zlib.crc32 and zlib.adler32 now return an unsigned
10410 value.
10411
10412- Issue #719888: Updated tokenize to use a bytes API. generate_tokens
10413 has been renamed tokenize and now works with bytes rather than
10414 strings. A new detect_encoding function has been added for
10415 determining source file encoding according to PEP-0263. Token
10416 sequences returned by tokenize always start with an ENCODING token
10417 which specifies the encoding used to decode the file. This token is
10418 used to encode the output of untokenize back to bytes.
10419
10420
10421What's New in Python 3.0a3?
10422===========================
10423
10424*Release date: 29-Feb-2008*
10425
10426Core and Builtins
10427-----------------
10428
10429- Issue #2282: io.TextIOWrapper was not overriding seekable() from
10430 io.IOBase.
10431
10432- Issue #2115: Important speedup in setting __slot__ attributes. Also
10433 prevent a possible crash: an Abstract Base Class would try to access
10434 a slot on a registered virtual subclass.
10435
10436- Fixed repr() and str() of complex numbers with infinity or nan as
10437 real or imaginary part.
10438
10439- Clear all free list during a gc.collect() of the highest generation
10440 in order to allow pymalloc to free more arenas. Python may give back
10441 memory to the OS earlier.
10442
10443- Issue #2045: Fix an infinite recursion triggered when printing a
10444 subclass of collections.defaultdict, if its default_factory is set
10445 to a bound method.
10446
10447- Fixed a minor memory leak in dictobject.c. The content of the free
10448 list was not freed on interpreter shutdown.
10449
10450- Limit free list of method and builtin function objects to 256
10451 entries each.
10452
10453- Patch #1953: Added ``sys._compact_freelists()`` and the C API
10454 functions ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
10455 to compact the internal free lists of pre-allocted ints and floats.
10456
10457- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
10458 Python expected the return type int but the fork familie returns
10459 pi_t.
10460
10461- Issue #1678380: Fix a bug that identifies 0j and -0j when they
10462 appear in the same code unit.
10463
10464- Issue #2025: Added tuple.count() and tuple.index() methods to comply
10465 with the collections.Sequence API.
10466
10467- Fixed multiple reinitialization of the Python interpreter. The small
10468 int list in longobject.c has caused a seg fault during the third
10469 finalization.
10470
10471- Issue #1973: bytes.fromhex('') raised SystemError.
10472
10473- Issue #1771: remove cmp parameter from sorted() and list.sort().
10474
10475- Issue #1969: split and rsplit in bytearray are inconsistent.
10476
10477- map() no longer accepts None for the first argument. Use zip()
10478 instead.
10479
10480- Issue #1769: Now int("- 1") is not allowed any more.
10481
10482- Object/longobject.c: long(float('nan')) raises an OverflowError
10483 instead of returning 0.
10484
10485- Issue #1762972: __file__ points to the source file instead of the
10486 pyc/pyo file if the py file exists.
10487
10488- Issue #1393: object_richcompare() returns NotImplemented instead of
10489 False if the objects aren't equal, to give the other side a chance.
10490
10491- Issue #1692: Interpreter was not displaying location of SyntaxError.
10492
10493- Improve some exception messages when Windows fails to load an
10494 extension module. Now we get for example '%1 is not a valid Win32
10495 application' instead of 'error code 193'. Also use Unicode strings
10496 to deal with non-English locales.
10497
10498- Issue #1587: Added instancemethod wrapper for PyCFunctions. The
10499 Python C API has gained a new type *PyInstanceMethod_Type* and the
10500 functions *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)*
10501 and *PyInstanceMethod_Function(im)*.
10502
10503- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed
10504 from the gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE
10505 are now enough to print the corresponding list of objects considered
10506 by the garbage collector.
10507
10508- Issue #1573: Improper use of the keyword-only syntax makes the
10509 parser crash.
10510
10511- Issue #1564: The set implementation should special-case PyUnicode
10512 instead of PyString.
10513
10514- Patch #1031213: Decode source line in SyntaxErrors back to its
10515 original source encoding.
10516
10517- inspect.getsource() includes the decorators again.
10518
10519- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
10520 mountpoint.
10521
10522- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when
10523 the first chunk fed to the decoder started with a BOM, but was
10524 longer than 3 bytes.
10525
10526Extension Modules
10527-----------------
10528
10529- Code for itertools ifilter(), imap(), and izip() moved to bultins
10530 and renamed to filter(), map(), and zip(). Also, renamed
10531 izip_longest() to zip_longest() and ifilterfalse() to filterfalse().
10532
10533- Issue #1762972: Readded the reload() function as imp.reload().
10534
10535- Bug #2111: mmap segfaults when trying to write a block opened with
10536 PROT_READ.
10537
10538- Issue #2063: correct order of utime and stime in os.times() result
10539 on Windows.
10540
10541Library
10542-------
10543
10544- Weakref dictionaries now inherit from MutableMapping.
10545
10546- Created new UserDict class in collections module. This one inherits
10547 from and complies with the MutableMapping ABC. Also, moved
10548 UserString and UserList to the collections module. The
10549 MutableUserString class was removed.
10550
10551- Removed UserDict.DictMixin. Replaced all its uses with
10552 collections.MutableMapping.
10553
10554- Issue #1703: getpass() should flush after writing prompt.
10555
10556- Issue #1585: IDLE uses non-existent xrange() function.
10557
10558- Issue #1578: Problems in win_getpass.
10559
10560Build
10561-----
10562
10563- Renamed --enable-unicode configure flag to --with-wide-unicode,
10564 since Unicode strings can't be disabled anymore.
10565
10566C API
10567-----
10568
10569- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
10570 Py_TYPE and Py_REFCNT.
10571
10572- New API PyImport_ImportModuleNoBlock(), works like
10573 PyImport_ImportModule() but won't block on the import lock
10574 (returning an error instead).
10575
10576
10577What's New in Python 3.0a2?
10578===========================
10579
10580*Release date: 07-Dec-2007*
10581
10582(Note: this list is incomplete.)
10583
10584Core and Builtins
10585-----------------
10586
10587- str8 now has the same construction signature as bytes.
10588
10589- Comparisons between str and str8 now return False/True for ==/!=.
10590 sqlite3 returns str8 when recreating on object from it's __conform__
10591 value. The struct module returns str8 for all string-related
10592 formats. This was true before this change, but becomes more
10593 apparent thanks to string comparisons always being False.
10594
10595- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode,
10596 buffer, encoding, newline)`.
10597
10598- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
10599
10600- Changed `__file__` and `co_filename` to unicode. The path names are decoded
10601 with `Py_FileSystemDefaultEncoding` and a new API method
10602 `PyUnicode_DecodeFSDefault(char*)` was added.
10603
10604- io.open() and _fileio.FileIO have grown a new argument closefd. A
10605 false value disables the closing of the file descriptor.
10606
10607- Added a new option -b to issues warnings (-bb for errors) about
10608 certain operations between bytes/buffer and str like str(b'') and
10609 comparison.
10610
10611- The standards streams sys.stdin, stdout and stderr may be None when
10612 the when the C runtime library returns an invalid file descriptor
10613 for the streams (fileno(stdin) < 0). For now this happens only for
10614 Windows GUI apps and scripts started with `pythonw.exe`.
10615
10616- Added PCbuild9 directory for VS 2008.
10617
10618- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to
10619 work around a name clash with VS 2008 on Windows.
10620
10621- Unbound methods are gone for good. ClassObject.method returns an
10622 ordinary function object, instance.method still returns a bound
10623 method object. The API of bound methods is cleaned up, too. The
10624 im_class attribute is removed and im_func + im_self are renamed to
10625 __func__ and __self__. The factory PyMethod_New takes only func and
10626 instance as argument.
10627
10628- intobject.h is no longer included by Python.h. The remains were
10629 moved to longobject.h. It still exists to define several aliases
10630 from PyInt to PyLong functions.
10631
10632- Removed sys.maxint, use sys.maxsize instead.
10633
10634Extension Modules
10635-----------------
10636
10637- The `hotshot` profiler has been removed; use `cProfile` instead.
10638
10639Library
10640-------
10641
10642- When loading an external file using testfile(), the passed-in
10643 encoding argument was being ignored if __loader__ is defined and
10644 forcing the source to be UTF-8.
10645
10646- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have
10647 been removed in favor of the tempfile module.
10648
10649- Removed the 'new' module.
10650
10651- Removed all types from the 'types' module that are easily accessable
10652 through builtins.
10653
10654
10655What's New in Python 3.0a1?
10656===========================
10657
10658*Release date: 31-Aug-2007*
10659
10660Core and Builtins
10661-----------------
10662
10663- PEP 3131: Support non-ASCII identifiers.
10664
10665- PEP 3120: Change default encoding to UTF-8.
10666
10667- PEP 3123: Use proper C inheritance for PyObject.
10668
10669- Removed the __oct__ and __hex__ special methods and added a bin()
10670 builtin function.
10671
10672- PEP 3127: octal literals now start with "0o". Old-style octal
10673 literals are invalid. There are binary literals with a prefix of
10674 "0b". This also affects int(x, 0).
10675
10676- None, True, False are now keywords.
10677
10678- PEP 3119: isinstance() and issubclass() can be overridden.
10679
10680- Remove BaseException.message.
10681
10682- Remove tuple parameter unpacking (PEP 3113).
10683
10684- Remove the f_restricted attribute from frames. This naturally leads
10685 to the removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
10686
10687- PEP 3132 was accepted. That means that you can do ``a, *b =
10688 range(5)`` to assign 0 to a and [1, 2, 3, 4] to b.
10689
10690- range() now returns an iterator rather than a list. Floats are not
10691 allowed. xrange() is no longer defined.
10692
10693- Patch #1660500: hide iteration variable in list comps, add set comps
10694 and use common code to handle compilation of iterative expressions.
10695
10696- By default, != returns the opposite of ==, unless the latter returns
10697 NotImplemented.
10698
10699- Patch #1680961: sys.exitfunc has been removed and replaced with a
10700 private C-level API.
10701
10702- PEP 3115: new metaclasses: the metaclass is now specified as a
10703 keyword arg in the class statement, which can now use the full
10704 syntax of a parameter list. Also, the metaclass can implement a
10705 __prepare__ function which will be called to create the dictionary
10706 for the new class namespace.
10707
10708- The long-deprecated argument "pend" of PyFloat_FromString() has been
10709 removed.
10710
10711- The dir() function has been extended to call the __dir__() method on
10712 its argument, if it exists. If not, it will work like before. This
10713 allows customizing the output of dir() in the presence of a
10714 __getattr__().
10715
10716- Removed support for __members__ and __methods__.
10717
10718- Removed indexing/slicing on BaseException.
10719
10720- input() became raw_input(): the name input() now implements the
10721 functionality formerly known as raw_input(); the name raw_input() is
10722 no longer defined.
10723
10724- Classes listed in an 'except' clause must inherit from
10725 BaseException.
10726
10727- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
10728 and .keys(), .items(), .values() return dict views, which behave
10729 like sets.
10730
10731- PEP 3105: print is now a function. Also (not in the PEP) the
10732 'softspace' attribute of files is now gone (since print() doesn't
10733 use it). A side effect of this change is that you can get
10734 incomplete output lines in interactive sessions:
10735
10736 >>> print(42, end="")
10737 42>>>
10738
10739 We may be able to fix this after the I/O library rewrite.
10740
10741- PEP 3102: keyword-only arguments.
10742
10743- Int/Long unification is complete. The 'long' built-in type and
10744 literals with trailing 'L' or 'l' have been removed. Performance
10745 may be sub-optimal (haven't really benchmarked).
10746
10747- 'except E, V' must now be spelled as 'except E as V' and deletes V
10748 at the end of the except clause; V must be a simple name.
10749
10750- Added function annotations per PEP 3107.
10751
10752- Added nonlocal declaration from PEP 3104:
10753
10754 >>> def f(x):
10755 ... def inc():
10756 ... nonlocal x
10757 ... x += 1
10758 ... return x
10759 ... return inc
10760 ...
10761 >>> inc = f(0)
10762 >>> inc()
10763 1
10764 >>> inc()
10765 2
10766
10767- Moved intern() to sys.intern().
10768
10769- exec is now a function.
10770
10771- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
10772
10773- Classic classes are a thing of the past. All classes are new style.
10774
10775- Exceptions *must* derive from BaseException.
10776
10777- Integer division always returns a float. The -Q option is no more.
10778 All the following are gone:
10779
10780 * PyNumber_Divide and PyNumber_InPlaceDivide
10781 * __div__, __rdiv__, and __idiv__
10782 * nb_divide, nb_inplace_divide
10783 * operator.div, operator.idiv, operator.__div__, operator.__idiv__
10784 (Only __truediv__ and __floordiv__ remain, not sure how to handle
10785 them if we want to re-use __div__ and friends. If we do, it will
10786 make it harder to write code for both 2.x and 3.x.)
10787
10788- 'as' and 'with' are keywords.
10789
10790- Absolute import is the default behavior for 'import foo' etc.
10791
10792- Removed support for syntax: backticks (ie, `x`), <>.
10793
10794- Removed these Python builtins: apply(), callable(), coerce(),
10795 execfile(), file(), reduce(), reload().
10796
10797- Removed these Python methods: {}.has_key.
10798
10799- Removed these opcodes: BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT.
10800
10801- Remove C API support for restricted execution.
10802
10803- zip(), map() and filter() now return iterators, behaving like their
10804 itertools counterparts. This also affect map()'s behavior on
10805 sequences of unequal length -- it now stops after the shortest one
10806 is exhausted.
10807
10808- Additions: set literals, set comprehensions, ellipsis literal.
10809
10810- Added class decorators per PEP 3129.
10811
10812
10813Extension Modules
10814-----------------
10815
10816- Removed the imageop module. Obsolete long with its unit tests
10817 becoming useless from the removal of rgbimg and imgfile.
10818
10819- Removed these attributes from the operator module: div, idiv,
10820 __div__, __idiv__, isCallable, sequenceIncludes.
10821
10822- Removed these attributes from the sys module: exc_clear(), exc_type,
10823 exc_value, exc_traceback.
10824
10825
10826Library
10827-------
10828
10829- Removed the compiler package. Use of the _ast module and (an
10830 eventual) AST -> bytecode mechanism.
10831
10832- Removed these modules: audiodev, Bastion, bsddb185, exceptions,
10833 linuxaudiodev, md5, MimeWriter, mimify, popen2, rexec, sets, sha,
10834 stringold, strop, sunaudiodev, timing, xmllib.
10835
10836- Moved the toaiff module to Tools/Demos.
10837
10838- Removed obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL,
10839 DEVICE, ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile,
10840 IOCTL, jpeg, panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
10841
10842- Removed obsolete functions: commands.getstatus(), os.popen*().
10843
10844- Removed functions in the string module that are also string methods;
10845 Remove string.{letters, lowercase, uppercase}.
10846
10847- Removed support for long obsolete platforms: plat-aix3, plat-irix5.
10848
10849- Removed xmlrpclib.SlowParser. It was based on xmllib.
10850
10851- Patch #1680961: atexit has been reimplemented in C.
10852
10853- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
10854
10855Build
10856-----
10857
10858C API
10859-----
10860
10861- Removed these Python slots: __coerce__, __div__, __idiv__, __rdiv__.
10862
10863- Removed these C APIs: PyNumber_Coerce(), PyNumber_CoerceEx(),
10864 PyMember_Get, PyMember_Set.
10865
10866- Removed these C slots/fields: nb_divide, nb_inplace_divide.
10867
10868- Removed these macros: staticforward, statichere, PyArg_GetInt,
10869 PyArg_NoArgs, _PyObject_Del.
10870
10871- Removed these typedefs: intargfunc, intintargfunc, intobjargproc,
10872 intintobjargproc, getreadbufferproc, getwritebufferproc,
10873 getsegcountproc, getcharbufferproc, memberlist.
10874
10875Tests
10876-----
10877
10878- Removed test.testall as test.regrtest replaces it.
10879
10880Documentation
10881-------------
10882
10883Mac
10884---
10885
10886- The cfmfile module was removed.
10887
10888Platforms
10889---------
10890
10891- Support for BeOS and AtheOS was removed (according to PEP 11).
10892
10893- Support for RiscOS, Irix, Tru64 was removed (alledgedly).
10894
10895Tools/Demos
10896-----------
10897
10898
Christian Heimesc3f30c42008-02-22 16:37:40 +000010899What's New in Python 2.5 release candidate 1?
10900=============================================
10901
10902*Release date: 17-AUG-2006*
10903
10904Core and builtins
10905-----------------
10906
10907- Unicode objects will no longer raise an exception when being
10908 compared equal or unequal to a string and a UnicodeDecodeError
10909 exception occurs, e.g. as result of a decoding failure.
10910
10911 Instead, the equal (==) and unequal (!=) comparison operators will
10912 now issue a UnicodeWarning and interpret the two objects as
10913 unequal. The UnicodeWarning can be filtered as desired using
10914 the warning framework, e.g. silenced completely, turned into an
10915 exception, logged, etc.
10916
10917 Note that compare operators other than equal and unequal will still
10918 raise UnicodeDecodeError exceptions as they've always done.
10919
10920- Fix segfault when doing string formatting on subclasses of long.
10921
10922- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
10923 with new-style classes.
10924
10925- Fix bug related to __len__ functions returning negative values with
10926 classic classes.
10927
10928- Patch #1538606, Fix __index__() clipping. There were some problems
10929 discovered with the API and how integers that didn't fit into Py_ssize_t
10930 were handled. This patch attempts to provide enough alternatives
10931 to effectively use __index__.
10932
10933- Bug #1536021: __hash__ may now return long int; the final hash
10934 value is obtained by invoking hash on the long int.
10935
10936- Bug #1536786: buffer comparison could emit a RuntimeWarning.
10937
10938- Bug #1535165: fixed a segfault in input() and raw_input() when
10939 sys.stdin is closed.
10940
10941- On Windows, the PyErr_Warn function is now exported from
10942 the Python dll again.
10943
10944- Bug #1191458: tracing over for loops now produces a line event
10945 on each iteration. Fixing this problem required changing the .pyc
10946 magic number. This means that .pyc files generated before 2.5c1
10947 will be regenerated.
10948
10949- Bug #1333982: string/number constants were inappropriately stored
10950 in the byte code and co_consts even if they were not used, ie
10951 immediately popped off the stack.
10952
10953- Fixed a reference-counting problem in property().
10954
10955
10956Library
10957-------
10958
10959- Fix a bug in the ``compiler`` package that caused invalid code to be
10960 generated for generator expressions.
10961
10962- The distutils version has been changed to 2.5.0. The change to
10963 keep it programmatically in sync with the Python version running
10964 the code (introduced in 2.5b3) has been reverted. It will continue
10965 to be maintained manually as static string literal.
10966
10967- If the Python part of a ctypes callback function returns None,
10968 and this cannot be converted to the required C type, an exception is
10969 printed with PyErr_WriteUnraisable. Before this change, the C
10970 callback returned arbitrary values to the calling code.
10971
10972- The __repr__ method of a NULL ctypes.py_object() no longer raises
10973 an exception.
10974
10975- uuid.UUID now has a bytes_le attribute. This returns the UUID in
10976 little-endian byte order for Windows. In addition, uuid.py gained some
10977 workarounds for clocks with low resolution, to stop the code yielding
10978 duplicate UUIDs.
10979
10980- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
10981 before raising SystemExit, allowing IDLE to honor quit() and exit().
10982
10983- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
10984
10985- Patch #1536071: trace.py should now find the full module name of a
10986 file correctly even on Windows.
10987
10988- logging's atexit hook now runs even if the rest of the module has
10989 already been cleaned up.
10990
10991- Bug #1112549, fix DoS attack on cgi.FieldStorage.
10992
10993- Bug #1531405, format_exception no longer raises an exception if
10994 str(exception) raised an exception.
10995
10996- Fix a bug in the ``compiler`` package that caused invalid code to be
10997 generated for nested functions.
10998
10999
11000Extension Modules
11001-----------------
11002
11003- Patch #1511317: don't crash on invalid hostname (alias) info.
11004
11005- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
11006 raises the correct exceptions.
11007
11008- Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The
11009 '-no-stack-protector' compiler flag for OpenBSD has been removed.
11010
11011- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
11012 uses the _as_parameter_ attribute when objects are passed to foreign
11013 function calls. The ctypes version number was changed to 1.0.1.
11014
11015- Bug #1530559, struct.pack raises TypeError where it used to convert.
11016 Passing float arguments to struct.pack when integers are expected
11017 now triggers a DeprecationWarning.
11018
11019
11020Tests
11021-----
11022
11023- test_socketserver should now work on cygwin and not fail sporadically
11024 on other platforms.
11025
11026- test_mailbox should now work on cygwin versions 2006-08-10 and later.
11027
11028- Bug #1535182: really test the xreadlines() method of bz2 objects.
11029
11030- test_threading now skips testing alternate thread stack sizes on
11031 platforms that don't support changing thread stack size.
11032
11033
11034Documentation
11035-------------
11036
11037- Patch #1534922: unittest docs were corrected and enhanced.
11038
11039
11040Build
11041-----
11042
11043- Bug #1535502, build _hashlib on Windows, and use masm assembler
11044 code in OpenSSL.
11045
11046- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
11047
11048- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
11049
11050
11051C API
11052-----
11053
11054- New API for Unicode rich comparisons: PyUnicode_RichCompare()
11055
11056- Bug #1069160. Internal correctness changes were made to
11057 ``PyThreadState_SetAsyncExc()``. A test case was added, and
11058 the documentation was changed to state that the return value
11059 is always 1 (normal) or 0 (if the specified thread wasn't found).
11060
11061
11062What's New in Python 2.5 beta 3?
11063================================
11064
11065*Release date: 03-AUG-2006*
11066
11067Core and builtins
11068-----------------
11069
11070- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
11071 returned a long (see PEP 353).
11072
11073- Bug #1515471: string.replace() accepts character buffers again.
11074
11075- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
11076 This provides the proper warning for struct.pack().
11077 PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
11078
11079- Patch #1531113: Fix augmented assignment with yield expressions.
11080 Also fix a SystemError when trying to assign to yield expressions.
11081
11082- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
11083 with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
11084 used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
11085 excessive filesystem operations during imports.
11086
11087- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
11088 operations on signed longs that are formally undefined by C.
11089 Unfortunately, at least one compiler now cares about that, so complicated
11090 the code to make that compiler happy again.
11091
11092- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
11093
11094- Patch #1232023: Stop including current directory in search
11095 path on Windows.
11096
11097- Fix some potential crashes found with failmalloc.
11098
11099- Fix warnings reported by Klocwork's static analysis tool.
11100
11101- Bug #1512814, Fix incorrect lineno's when code within a function
11102 had more than 255 blank lines.
11103
11104- Patch #1521179: Python now accepts the standard options ``--help`` and
11105 ``--version`` as well as ``/?`` on Windows.
11106
11107- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
11108 again. Fixing this problem required changing the .pyc magic number.
11109 This means that .pyc files generated before 2.5b3 will be regenerated.
11110
11111- Bug #1524317: Compiling Python ``--without-threads`` failed.
11112 The Python core compiles again, and, in a build without threads, the
11113 new ``sys._current_frames()`` returns a dictionary with one entry,
11114 mapping the faux "thread id" 0 to the current frame.
11115
11116- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
11117
11118
11119Library
11120-------
11121
11122- Fix #1693149. Now you can pass several modules separated by
11123 comma to trace.py in the same --ignore-module option.
11124
11125- Correction of patch #1455898: In the mbcs decoder, set final=False
11126 for stream decoder, but final=True for the decode function.
11127
11128- os.urandom no longer masks unrelated exceptions like SystemExit or
11129 KeyboardInterrupt.
11130
11131- Bug #1525866: Don't copy directory stat times in
11132 shutil.copytree on Windows
11133
11134- Bug #1002398: The documentation for os.path.sameopenfile now correctly
11135 refers to file descriptors, not file objects.
11136
11137- The renaming of the xml package to xmlcore, and the import hackery done
11138 to make it appear at both names, has been removed. Bug #1511497,
11139 #1513611, and probably others.
11140
11141- Bug #1441397: The compiler module now recognizes module and function
11142 docstrings correctly as it did in Python 2.4.
11143
11144- Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
11145 lost that tests are sorted by name before being run. This rarely
11146 matters for well-written tests, but can create baffling symptoms if
11147 side effects from one test to the next affect outcomes. ``DocTestFinder``
11148 has been changed to sort the list of tests it returns.
11149
11150- The distutils version has been changed to 2.5.0, and is now kept
11151 in sync with sys.version_info[:3].
11152
11153- Bug #978833: Really close underlying socket in _socketobject.close.
11154
11155- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
11156 title().
11157
11158- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
11159 to recursive calls and call it with the failing package name.
11160
11161- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
11162
11163- Patch #1515343: Fix printing of deprecated string exceptions with a
11164 value in the traceback module.
11165
11166- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
11167
11168- Patch #1524429: Use repr() instead of backticks in Tkinter again.
11169
11170- Bug #1520914: Change time.strftime() to accept a zero for any position in its
11171 argument tuple. For arguments where zero is illegal, the value is forced to
11172 the minimum value that is correct. This is to support an undocumented but
11173 common way people used to fill in inconsequential information in the time
11174 tuple pre-2.4.
11175
11176- Patch #1220874: Update the binhex module for Mach-O.
11177
11178- The email package has improved RFC 2231 support, specifically for
11179 recognizing the difference between encoded (name*0*=<blah>) and non-encoded
11180 (name*0=<blah>) parameter continuations. This may change the types of
11181 values returned from email.message.Message.get_param() and friends.
11182 Specifically in some cases where non-encoded continuations were used,
11183 get_param() used to return a 3-tuple of (None, None, string) whereas now it
11184 will just return the string (since non-encoded continuations don't have
11185 charset and language parts).
11186
11187 Also, whereas % values were decoded in all parameter continuations, they are
11188 now only decoded in encoded parameter parts.
11189
11190- Bug #1517990: IDLE keybindings on MacOS X now work correctly
11191
11192- Bug #1517996: IDLE now longer shows the default Tk menu when a
11193 path browser, class browser or debugger is the frontmost window on MacOS X
11194
11195- Patch #1520294: Support for getset and member descriptors in types.py,
11196 inspect.py, and pydoc.py. Specifically, this allows for querying the type
11197 of an object against these built-in types and more importantly, for getting
11198 their docstrings printed in the interactive interpreter's help() function.
11199
11200
11201Extension Modules
11202-----------------
11203
11204- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
11205 a socket operation on a socket with a timeout, the exception will be
11206 caught correctly. Previously, the exception was not caught.
11207
11208- Patch #1529514: The _ctypes extension is now compiled on more
11209 openbsd target platforms.
11210
11211- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
11212 a memory leak, affecting pickles and deep copies.
11213
11214- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
11215 Paul Eggert.
11216
11217- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
11218
11219- Patch #1521817: Index range checking on ctypes arrays containing
11220 exactly one element enabled again. This allows iterating over these
11221 arrays, without the need to check the array size before.
11222
11223- Bug #1521375: When the code in ctypes.util.find_library was
11224 run with root privileges, it could overwrite or delete
11225 /dev/null in certain cases; this is now fixed.
11226
11227- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
11228 default mode for loading shared libraries in ctypes.
11229
11230- Because of a misspelled preprocessor symbol, ctypes was always
11231 compiled without thread support; this is now fixed.
11232
11233- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
11234 methods now allow their database parameter to be None as the
11235 sleepycat API allows.
11236
11237- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
11238 bluetooth API compared with Linux and FreeBSD.
11239
11240Tests
11241-----
11242
11243- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
11244 how long the test file should take to play. Now accepts taking 2.93 secs
11245 (exact time) +/- 10% instead of the hard-coded 3.1 sec.
11246
11247- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
11248 ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
11249 run via ``regrtest.py``. Now they do.
11250
11251Build
11252-----
11253
11254- Bug #1439538: Drop usage of test -e in configure as it is not portable.
11255
11256Mac
11257---
11258
11259- PythonLauncher now works correctly when the path to the script contains
11260 characters that are treated specially by the shell (such as quotes).
11261
11262- Bug #1527397: PythonLauncher now launches scripts with the working directory
11263 set to the directory that contains the script instead of the user home
11264 directory. That latter was an implementation accident and not what users
11265 expect.
11266
11267
11268What's New in Python 2.5 beta 2?
11269================================
11270
11271*Release date: 11-JUL-2006*
11272
11273Core and builtins
11274-----------------
11275
11276- Bug #1441486: The literal representation of -(sys.maxint - 1)
11277 again evaluates to a int object, not a long.
11278
11279- Bug #1501934: The scope of global variables that are locally assigned
11280 using augmented assignment is now correctly determined.
11281
11282- Bug #927248: Recursive method-wrapper objects can now safely
11283 be released.
11284
11285- Bug #1417699: Reject locale-specific decimal point in float()
11286 and atof().
11287
11288- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
11289 omit a default "error" argument for NULL pointer. This allows
11290 the parser to take a codec from cjkcodecs again.
11291
11292- Bug #1519018: 'as' is now validated properly in import statements.
11293
11294- On 64 bit systems, int literals that use less than 64 bits are
11295 now ints rather than longs.
11296
11297- Bug #1512814, Fix incorrect lineno's when code at module scope
11298 started after line 256.
11299
11300- New function ``sys._current_frames()`` returns a dict mapping thread
11301 id to topmost thread stack frame. This is for expert use, and is
11302 especially useful for debugging application deadlocks. The functionality
11303 was previously available in Fazal Majid's ``threadframe`` extension
11304 module, but it wasn't possible to do this in a wholly threadsafe way from
11305 an extension.
11306
11307Library
11308-------
11309
11310- Bug #1257728: Mention Cygwin in distutils error message about a missing
11311 VS 2003.
11312
11313- Patch #1519566: Update turtle demo, make begin_fill idempotent.
11314
11315- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
11316 environment variable to be set in order to the SDK environment
11317 for finding the compiler, include files, etc.
11318
11319- Bug #1515998: Properly generate logical ids for files in bdist_msi.
11320
11321- warnings.py now ignores ImportWarning by default
11322
11323- string.Template() now correctly handles tuple-values. Previously,
11324 multi-value tuples would raise an exception and single-value tuples would
11325 be treated as the value they contain, instead.
11326
11327- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
11328 even if some data are received.
11329
11330- Bug #1267547: Put proper recursive setup.py call into the
11331 spec file generated by bdist_rpm.
11332
11333- Bug #1514693: Update turtle's heading when switching between
11334 degrees and radians.
11335
11336- Reimplement turtle.circle using a polyline, to allow correct
11337 filling of arcs.
11338
11339- Bug #1514703: Only setup canvas window in turtle when the canvas
11340 is created.
11341
11342- Bug #1513223: .close() of a _socketobj now releases the underlying
11343 socket again, which then gets closed as it becomes unreferenced.
11344
11345- Bug #1504333: Make sgmllib support angle brackets in quoted
11346 attribute values.
11347
11348- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
11349 sgmllib ('[' and ']' were not accepted).
11350
11351- Fix a bug in the turtle module's end_fill function.
11352
11353- Bug #1510580: The 'warnings' module improperly required that a Warning
11354 category be either a types.ClassType and a subclass of Warning. The proper
11355 check is just that it is a subclass with Warning as the documentation states.
11356
11357- The compiler module now correctly compiles the new try-except-finally
11358 statement (bug #1509132).
11359
11360- The wsgiref package is now installed properly on Unix.
11361
11362- A bug was fixed in logging.config.fileConfig() which caused a crash on
11363 shutdown when fileConfig() was called multiple times.
11364
11365- The sqlite3 module did cut off data from the SQLite database at the first
11366 null character before sending it to a custom converter. This has been fixed
11367 now.
11368
11369Extension Modules
11370-----------------
11371
11372- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
11373 means that select() on sockets > FD_SETSIZE (typically 1024) work again.
11374 The patch makes sockets use poll() internally where available.
11375
11376- Assigning None to pointer type fields in ctypes structures possible
11377 overwrote the wrong fields, this is fixed now.
11378
11379- Fixed a segfault in _ctypes when ctypes.wintypes were imported
11380 on non-Windows platforms.
11381
11382- Bug #1518190: The ctypes.c_void_p constructor now accepts any
11383 integer or long, without range checking.
11384
11385- Patch #1517790: It is now possible to use custom objects in the ctypes
11386 foreign function argtypes sequence as long as they provide a from_param
11387 method, no longer is it required that the object is a ctypes type.
11388
11389- The '_ctypes' extension module now works when Python is configured
11390 with the --without-threads option.
11391
11392- Bug #1513646: os.access on Windows now correctly determines write
11393 access, again.
11394
11395- Bug #1512695: cPickle.loads could crash if it was interrupted with
11396 a KeyboardInterrupt.
11397
11398- Bug #1296433: parsing XML with a non-default encoding and
11399 a CharacterDataHandler could crash the interpreter in pyexpat.
11400
11401- Patch #1516912: improve Modules support for OpenVMS.
11402
11403Build
11404-----
11405
11406- Automate Windows build process for the Win64 SSL module.
11407
11408- 'configure' now detects the zlib library the same way as distutils.
11409 Previously, the slight difference could cause compilation errors of the
11410 'zlib' module on systems with more than one version of zlib.
11411
11412- The MSI compileall step was fixed to also support a TARGETDIR
11413 with spaces in it.
11414
11415- Bug #1517388: sqlite3.dll is now installed on Windows independent
11416 of Tcl/Tk.
11417
11418- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
11419 trying to be installed even though it's empty.
11420
11421Tests
11422-----
11423
11424- Call os.waitpid() at the end of tests that spawn child processes in order
11425 to minimize resources (zombies).
11426
11427Documentation
11428-------------
11429
11430- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
11431 documentation for the warnings module.
11432
11433- Patch #1509163: MS Toolkit Compiler no longer available.
11434
11435- Patch #1504046: Add documentation for xml.etree.
11436
11437
11438What's New in Python 2.5 beta 1?
11439================================
11440
11441*Release date: 20-JUN-2006*
11442
11443Core and builtins
11444-----------------
11445
11446- Patch #1507676: Error messages returned by invalid abstract object operations
11447 (such as iterating over an integer) have been improved and now include the
11448 type of the offending object to help with debugging.
11449
11450- Bug #992017: A classic class that defined a __coerce__() method that returned
11451 its arguments swapped would infinitely recurse and segfault the interpreter.
11452
11453- Fix the socket tests so they can be run concurrently.
11454
11455- Removed 5 integers from C frame objects (PyFrameObject).
11456 f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
11457
11458- Bug #532646: object.__call__() will continue looking for the __call__
11459 attribute on objects until one without one is found. This leads to recursion
11460 when you take a class and set its __call__ attribute to an instance of the
11461 class. Originally fixed for classic classes, but this fix is for new-style.
11462 Removes the infinite_rec_3 crasher.
11463
11464- The string and unicode methods startswith() and endswith() now accept
11465 a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
11466
11467- Buffer objects, at the C level, never used the char buffer
11468 implementation even when the char buffer for the wrapped object was
11469 explicitly requested (originally returned the read or write buffer).
11470 Now a TypeError is raised if the char buffer is not present but is
11471 requested.
11472
11473- Patch #1346214: Statements like "if 0: suite" are now again optimized
11474 away like they were in Python 2.4.
11475
11476- Builtin exceptions are now full-blown new-style classes instead of
11477 instances pretending to be classes, which speeds up exception handling
11478 by about 80% in comparison to 2.5a2.
11479
11480- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
11481 Unicode 4.1.
11482
11483- Patch #921466: sys.path_importer_cache is now used to cache valid and
11484 invalid file paths for the built-in import machinery which leads to
11485 fewer open calls on startup.
11486
11487- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
11488 of-2 bases. The largest speedup is for inputs with about 1000 decimal
11489 digits. Conversion from non-power-of-2 bases remains quadratic-time in
11490 the number of input digits (it was and remains linear-time for bases
11491 2, 4, 8, 16 and 32).
11492
11493- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
11494 when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
11495 an integer close to ``sys.maxint``. This was repaired by patch
11496 #1335972, which also gives a nice speedup.
11497
11498- Patch #1337051: reduced size of frame objects.
11499
11500- PyErr_NewException now accepts a tuple of base classes as its
11501 "base" parameter.
11502
11503- Patch #876206: function call speedup by retaining allocated frame
11504 objects.
11505
11506- Bug #1462152: file() now checks more thoroughly for invalid mode
11507 strings and removes a possible "U" before passing the mode to the
11508 C library function.
11509
11510- Patch #1488312, Fix memory alignment problem on SPARC in unicode
11511
11512- Bug #1487966: Fix SystemError with conditional expression in assignment
11513
11514- WindowsError now has two error code attributes: errno, which carries
11515 the error values from errno.h, and winerror, which carries the error
11516 values from winerror.h. Previous versions put the winerror.h values
11517 (from GetLastError()) into the errno attribute.
11518
11519- Patch #1475845: Raise IndentationError for unexpected indent.
11520
11521- Patch #1479181: split open() and file() from being aliases for each other.
11522
11523- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
11524 methods were always silently ignored by dictionaries when comparing keys.
11525 They are now passed through (except when using the C API function
11526 ``PyDict_GetItem()``, whose semantics did not change).
11527
11528- Bug #1456209: In some obscure cases it was possible for a class with a
11529 custom ``__eq__()`` method to confuse dict internals when class instances
11530 were used as a dict's keys and the ``__eq__()`` method mutated the dict.
11531 No, you don't have any code that did this ;-)
11532
11533Extension Modules
11534-----------------
11535
11536- Bug #1295808: expat symbols should be namespaced in pyexpat
11537
11538- Patch #1462338: Upgrade pyexpat to expat 2.0.0
11539
11540- Change binascii.hexlify to accept a read-only buffer instead of only a char
11541 buffer and actually follow its documentation.
11542
11543- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
11544
11545- Patch #1478788 (modified version): The functional extension module has
11546 been renamed to _functools and a functools Python wrapper module added.
11547 This provides a home for additional function related utilities that are
11548 not specifically about functional programming. See PEP 309.
11549
11550- Patch #1493701: performance enhancements for struct module.
11551
11552- Patch #1490224: time.altzone is now set correctly on Cygwin.
11553
11554- Patch #1435422: zlib's compress and decompress objects now have a
11555 copy() method.
11556
11557- Patch #1454481: thread stack size is now tunable at runtime for thread
11558 enabled builds on Windows and systems with Posix threads support.
11559
11560- On Win32, os.listdir now supports arbitrarily-long Unicode path names
11561 (up to the system limit of 32K characters).
11562
11563- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
11564 As a result, these functions now raise WindowsError instead of OSError.
11565
11566- ``time.clock()`` on Win64 should use the high-performance Windows
11567 ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
11568 Windows platforms).
11569
11570- Calling Tk_Init twice is refused if the first call failed as that
11571 may deadlock.
11572
11573- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
11574 accept it without potentially using an uninitialized pointer.
11575
11576- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
11577 assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
11578 patch numbers 1494885 and 1494902]
11579
11580- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
11581 [pybsddb project SF patch number 1466734]
11582
11583- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
11584 parameter is supplied. [SF pybsddb bug #1477863]
11585
11586- bsddb: the __len__ method of a DB object has been fixed to return correct
11587 results. It could previously incorrectly return 0 in some cases.
11588 Fixes SF bug 1493322 (pybsddb bug 1184012).
11589
11590- bsddb: the bsddb.dbtables Modify method now raises the proper error and
11591 aborts the db transaction safely when a modifier callback fails.
11592 Fixes SF python patch/bug #1408584.
11593
11594- bsddb: multithreaded DB access using the simple bsddb module interface
11595 now works reliably. It has been updated to use automatic BerkeleyDB
11596 deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
11597 database calls that would previously deadlock. [SF python bug #775414]
11598
11599- Patch #1446489: add support for the ZIP64 extensions to zipfile.
11600
11601- Patch #1506645: add Python wrappers for the curses functions
11602 is_term_resized, resize_term and resizeterm.
11603
11604Library
11605-------
11606
11607- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
11608 functions.
11609
11610- Patch #812986: Update turtle output even if not tracing.
11611
11612- Patch #1494750: Destroy master after deleting children in
11613 Tkinter.BaseWidget.
11614
11615- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
11616
11617- Patch #763580: Add name and value arguments to Tkinter variable
11618 classes.
11619
11620- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
11621 mime.types file for determining MIME types.
11622
11623- Bug #1339007: Shelf objects now don't raise an exception in their
11624 __del__ method when initialization failed.
11625
11626- Patch #1455898: The MBCS codec now supports the incremental mode for
11627 double-byte encodings.
11628
11629- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
11630 guarantee that adjacent triples in the return list always describe
11631 non-adjacent blocks. Previously, a pair of matching blocks could end
11632 up being described by multiple adjacent triples that formed a partition
11633 of the matching pair.
11634
11635- Bug #1498146: fix optparse to handle Unicode strings in option help,
11636 description, and epilog.
11637
11638- Bug #1366250: minor optparse documentation error.
11639
11640- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
11641 clarify docs.
11642
11643- The wsgiref package has been added to the standard library.
11644
11645- The functions update_wrapper() and wraps() have been added to the functools
11646 module. These make it easier to copy relevant metadata from the original
11647 function when writing wrapper functions.
11648
11649- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
11650 ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
11651
11652- Patch #1359618: Speed up charmap encoder by using a trie structure
11653 for lookup.
11654
11655- The functions in the ``pprint`` module now sort dictionaries by key
11656 before computing the display. Before 2.5, ``pprint`` sorted a dictionary
11657 if and only if its display required more than one line, although that
11658 wasn't documented. The new behavior increases predictability; e.g.,
11659 using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
11660
11661- Patch #1497027: try HTTP digest auth before basic auth in urllib2
11662 (thanks for J. J. Lee).
11663
11664- Patch #1496206: improve urllib2 handling of passwords with respect to
11665 default HTTP and HTTPS ports.
11666
11667- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
11668
11669- Patch #1281707: speed up gzip.readline.
11670
11671- Patch #1180296: Two new functions were added to the locale module:
11672 format_string() to get the effect of "format % items" but locale-aware,
11673 and currency() to format a monetary number with currency sign.
11674
11675- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
11676 and several features added, such as speed and geometry control.
11677
11678- Patch #1488881: add support for external file objects in bz2 compressed
11679 tarfiles.
11680
11681- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
11682 stdout arguments, making it possible to redirect input and output
11683 for remote debugging.
11684
11685- Patch #1484695: Update the tarfile module to version 0.8. This fixes
11686 a couple of issues, notably handling of long file names using the
11687 GNU LONGNAME extension.
11688
11689- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
11690 new flag when ``name`` is already the name of an option flag.
11691
11692- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
11693 package.
11694
11695- Patch #1472854: make the rlcompleter.Completer class usable on non-
11696 UNIX platforms.
11697
11698- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
11699
11700- Bug #1472827: correctly escape newlines and tabs in attribute values in
11701 the saxutils.XMLGenerator class.
11702
11703
11704Build
11705-----
11706
11707- Bug #1502728: Correctly link against librt library on HP-UX.
11708
11709- OpenBSD 3.9 is supported now.
11710
11711- Patch #1492356: Port to Windows CE.
11712
11713- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
11714
11715- Patch #1471883: Add --enable-universalsdk.
11716
11717C API
11718-----
11719
11720Tests
11721-----
11722
11723Tools
11724-----
11725
11726Documentation
11727-------------
11728
11729
11730
11731What's New in Python 2.5 alpha 2?
11732=================================
11733
11734*Release date: 27-APR-2006*
11735
11736Core and builtins
11737-----------------
11738
11739- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
11740 by converting these apis from macros into exported functions again:
11741
11742 PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
11743 PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
11744 PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
11745 PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
11746 PyRun_String Py_CompileString
11747
11748- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
11749
11750- All uses of PyStructSequence_InitType have been changed to initialize
11751 the type objects only once, even if the interpreter is initialized
11752 multiple times.
11753
11754- Bug #1454485, array.array('u') could crash the interpreter. This was
11755 due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
11756 to unicode when it didn't make sense. 'u#' now requires a unicode string.
11757
11758- Py_UNICODE is unsigned. It was always documented as unsigned, but
11759 due to a bug had a signed value in previous versions.
11760
11761- Patch #837242: ``id()`` of any Python object always gives a positive
11762 number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
11763 ``PyLong_AsVoidPtr`` have been changed accordingly. Note that it has
11764 never been correct to implement a ``__hash()__`` method that returns the
11765 ``id()`` of an object:
11766
11767 def __hash__(self):
11768 return id(self) # WRONG
11769
11770 because a hash result must be a (short) Python int but it was always
11771 possible for ``id()`` to return a Python long. However, because ``id()``
11772 could return negative values before, on a 32-bit box an ``id()`` result
11773 was always usable as a hash value before this patch. That's no longer
11774 necessarily so.
11775
11776- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
11777 to load extension modules and now provides the dl module. As a result,
11778 sys.setdlopenflags() now works correctly on these systems. (SF patch
11779 #1454844)
11780
11781- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
11782 involving generators that have paused outside of any ``try`` or ``with``
11783 blocks. (In 2.5a1, a paused generator that was part of a reference
11784 cycle could not be garbage collected, regardless of whether it was
11785 paused in a ``try`` or ``with`` block.)
11786
11787Extension Modules
11788-----------------
11789
11790- Patch #1191065: Fix preprocessor problems on systems where recvfrom
11791 is a macro.
11792
11793- Bug #1467952: os.listdir() now correctly raises an error if readdir()
11794 fails with an error condition.
11795
11796- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
11797
11798- Bug #1117761: bsddb.*open() no longer raises an exception when using
11799 the cachesize parameter.
11800
11801- Bug #1149413: bsddb.*open() no longer raises an exception when using
11802 a temporary db (file=None) with the 'n' flag to truncate on open.
11803
11804- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
11805 as older versions cause excessive test failures.
11806
11807- Patch #1062014: AF_UNIX sockets under Linux have a special
11808 abstract namespace that is now fully supported.
11809
11810Library
11811-------
11812
11813- Bug #1223937: subprocess.CalledProcessError reports the exit status
11814 of the process using the returncode attribute, instead of
11815 abusing errno.
11816
11817- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
11818 a doctest to be skipped (the code is not run, and the expected output
11819 or exception is ignored).
11820
11821- Fixed contextlib.nested to cope with exceptions being raised and
11822 caught inside exit handlers.
11823
11824- Updated optparse module to Optik 1.5.1 (allow numeric constants in
11825 hex, octal, or binary; add ``append_const`` action; keep going if
11826 gettext cannot be imported; added ``OptionParser.destroy()`` method;
11827 added ``epilog`` for better help generation).
11828
11829- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
11830 called from a thread spawned as a side effect of importing a module.
11831
11832- The pydoc module now supports documenting packages contained in
11833 .zip or .egg files.
11834
11835- The pkgutil module now has several new utility functions, such
11836 as ``walk_packages()`` to support working with packages that are either
11837 in the filesystem or zip files.
11838
11839- The mailbox module can now modify and delete messages from
11840 mailboxes, in addition to simply reading them. Thanks to Gregory
11841 K. Johnson for writing the code, and to the 2005 Google Summer of
11842 Code for funding his work.
11843
11844- The ``__del__`` method of class ``local`` in module ``_threading_local``
11845 returned before accomplishing any of its intended cleanup.
11846
11847- Patch #790710: Add breakpoint command lists in pdb.
11848
11849- Patch #1063914: Add Tkinter.Misc.clipboard_get().
11850
11851- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
11852
11853- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
11854 Windows. Bug #1469163.
11855
11856- The warnings, linecache, inspect, traceback, site, and doctest modules
11857 were updated to work correctly with modules imported from zipfiles or
11858 via other PEP 302 __loader__ objects.
11859
11860- Patch #1467770: Reduce usage of subprocess._active to processes which
11861 the application hasn't waited on.
11862
11863- Patch #1462222: Fix Tix.Grid.
11864
11865- Fix exception when doing glob.glob('anything*/')
11866
11867- The pstats.Stats class accepts an optional stream keyword argument to
11868 direct output to an alternate file-like object.
11869
11870Build
11871-----
11872
11873- The Makefile now has a reindent target, which runs reindent.py on
11874 the library.
11875
11876- Patch #1470875: Building Python with MS Free Compiler
11877
11878- Patch #1161914: Add a python-config script.
11879
11880- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
11881 --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
11882 specified. (Can be overridden by explicitly setting LINKCC.) Decouple
11883 CXX from --with-cxx-main, see description in README.
11884
11885- Patch #1429775: Link extension modules with the shared libpython.
11886
11887- Fixed a libffi build problem on MIPS systems.
11888
11889- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
11890 now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
11891 and "%zu" for unsigned integers of type ``size_t``.
11892
11893Tests
11894-----
11895
11896- test_contextlib now checks contextlib.nested can cope with exceptions
11897 being raised and caught inside exit handlers.
11898
11899- test_cmd_line now checks operation of the -m and -c command switches
11900
11901- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
11902 it separately and by hand. It also wasn't cleaning up its changes to
11903 the current Decimal context.
11904
11905- regrtest.py now has a -M option to run tests that test the new limits of
11906 containers, on 64-bit architectures. Running these tests is only sensible
11907 on 64-bit machines with more than two gigabytes of memory. The argument
11908 passed is the maximum amount of memory for the tests to use.
11909
11910Tools
11911-----
11912
11913- Added the Python benchmark suite pybench to the Tools/ directory;
11914 contributed by Marc-Andre Lemburg.
11915
11916Documentation
11917-------------
11918
11919- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
11920
11921- PEP 343: Added Context Types section to the library reference
11922 and attempted to bring other PEP 343 related documentation into
11923 line with the implementation and/or python-dev discussions.
11924
11925- Bug #1337990: clarified that ``doctest`` does not support examples
11926 requiring both expected output and an exception.
11927
11928
11929What's New in Python 2.5 alpha 1?
11930=================================
11931
11932*Release date: 05-APR-2006*
11933
11934Core and builtins
11935-----------------
11936
11937- PEP 338: -m command line switch now delegates to runpy.run_module
11938 allowing it to support modules in packages and zipfiles
11939
11940- On Windows, .DLL is not an accepted file name extension for
11941 extension modules anymore; extensions are only found if they
11942 end in .PYD.
11943
11944- Bug #1421664: sys.stderr.encoding is now set to the same value as
11945 sys.stdout.encoding.
11946
11947- __import__ accepts keyword arguments.
11948
11949- Patch #1460496: round() now accepts keyword arguments.
11950
11951- Fixed bug #1459029 - unicode reprs were double-escaped.
11952
11953- Patch #1396919: The system scope threads are reenabled on FreeBSD
11954 5.4 and later versions.
11955
11956- Bug #1115379: Compiling a Unicode string with an encoding declaration
11957 now gives a SyntaxError.
11958
11959- Previously, Python code had no easy way to access the contents of a
11960 cell object. Now, a ``cell_contents`` attribute has been added
11961 (closes patch #1170323).
11962
11963- Patch #1123430: Python's small-object allocator now returns an arena to
11964 the system ``free()`` when all memory within an arena becomes unused
11965 again. Prior to Python 2.5, arenas (256KB chunks of memory) were never
11966 freed. Some applications will see a drop in virtual memory size now,
11967 especially long-running applications that, from time to time, temporarily
11968 use a large number of small objects. Note that when Python returns an
11969 arena to the platform C's ``free()``, there's no guarantee that the
11970 platform C library will in turn return that memory to the operating system.
11971 The effect of the patch is to stop making that impossible, and in tests it
11972 appears to be effective at least on Microsoft C and gcc-based systems.
11973 Thanks to Evan Jones for hard work and patience.
11974
11975- Patch #1434038: property() now uses the getter's docstring if there is
11976 no "doc" argument given. This makes it possible to legitimately use
11977 property() as a decorator to produce a read-only property.
11978
11979- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
11980 nb_index slot to the PyNumberMethods struct. The slot is consulted instead
11981 of requiring an int or long in slicing and a few other contexts, enabling
11982 other objects (e.g. Numeric Python's integers) to be used as slice indices.
11983
11984- Fixed various bugs reported by Coverity's Prevent tool.
11985
11986- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
11987 new exception base class, BaseException, which has a new message attribute.
11988 KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
11989 Raising a string exception now raises a DeprecationWarning.
11990
11991- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
11992 explicitly relative, using 'from .module import name' to mean 'from the same
11993 package as this module is in. Imports without dots still default to the
11994 old relative-then-absolute, unless 'from __future__ import
11995 absolute_import' is used.
11996
11997- Properly check if 'warnings' raises an exception (usually when a filter set
11998 to "error" is triggered) when raising a warning for raising string
11999 exceptions.
12000
12001- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
12002 The name was removed from Include/code.h.
12003
12004- PEP 308: conditional expressions were added: (x if cond else y).
12005
12006- Patch 1433928:
12007 - The copy module now "copies" function objects (as atomic objects).
12008 - dict.__getitem__ now looks for a __missing__ hook before raising
12009 KeyError.
12010
12011- PEP 343: with statement implemented. Needs ``from __future__ import
12012 with_statement``. Use of 'with' as a variable will generate a warning.
12013 Use of 'as' as a variable will also generate a warning (unless it's
12014 part of an import statement).
12015 The following objects have __context__ methods:
12016 - The built-in file type.
12017 - The thread.LockType type.
12018 - The following types defined by the threading module:
12019 Lock, RLock, Condition, Semaphore, BoundedSemaphore.
12020 - The decimal.Context class.
12021
12022- Fix the encodings package codec search function to only search
12023 inside its own package. Fixes problem reported in patch #1433198.
12024
12025 Note: Codec packages should implement and register their own
12026 codec search function. PEP 100 has the details.
12027
12028- PEP 353: Using ``Py_ssize_t`` as the index type.
12029
12030- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
12031 info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
12032 now allow Python to make use of memory blocks exceeding 2**32 bytes for
12033 some purposes on 64-bit boxes. A ``PYMALLOC_DEBUG`` build was limited
12034 to 4-byte allocations before.
12035
12036- Patch #1400181, fix unicode string formatting to not use the locale.
12037 This is how string objects work. u'%f' could use , instead of .
12038 for the decimal point. Now both strings and unicode always use periods.
12039
12040- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
12041 configure would break checking curses.h.
12042
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012043- Bug #959576: The pwd module is now built in. This allows Python to be
Christian Heimesc3f30c42008-02-22 16:37:40 +000012044 built on UNIX platforms without $HOME set.
12045
12046- Bug #1072182, fix some potential problems if characters are signed.
12047
12048- Bug #889500, fix line number on SyntaxWarning for global declarations.
12049
12050- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
12051
12052- Support for converting hex strings to floats no longer works.
12053 This was not portable. float('0x3') now raises a ValueError.
12054
12055- Patch #1382163: Expose Subversion revision number to Python. New C API
12056 function Py_GetBuildNumber(). New attribute sys.subversion. Build number
12057 is now displayed in interactive prompt banner.
12058
12059- Implementation of PEP 341 - Unification of try/except and try/finally.
12060 "except" clauses can now be written together with a "finally" clause in
12061 one try statement instead of two nested ones. Patch #1355913.
12062
12063- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
12064 now encodes backslash correctly.
12065
12066- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
12067
12068- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
12069 and long longs.
12070
12071- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
12072 It was possible for dlerror() to return a NULL pointer, so
12073 it will now use a default error message in this case.
12074
12075- Replaced most Unicode charmap codecs with new ones using the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012076 new Unicode translate string feature in the built-in charmap
Christian Heimesc3f30c42008-02-22 16:37:40 +000012077 codec; the codecs were created from the mapping tables available
12078 at ftp.unicode.org and contain a few updates (e.g. the Mac OS
12079 encodings now include a mapping for the Apple logo)
12080
12081- Added a few more codecs for Mac OS encodings
12082
12083- Sped up some Unicode operations.
12084
12085- A new AST parser implementation was completed. The abstract
12086 syntax tree is available for read-only (non-compile) access
12087 to Python code; an _ast module was added.
12088
12089- SF bug #1167751: fix incorrect code being produced for generator expressions.
12090 The following code now raises a SyntaxError: foo(a = i for i in range(10))
12091
12092- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
12093
12094- SF Bug #887946: fix segfault when redirecting stdin from a directory.
12095 Provide a warning when a directory is passed on the command line.
12096
12097- Fix segfault with invalid coding.
12098
12099- SF bug #772896: unknown encoding results in MemoryError.
12100
12101- All iterators now have a Boolean value of True. Formerly, some iterators
12102 supported a __len__() method which evaluated to False when the iterator
12103 was empty.
12104
12105- On 64-bit platforms, when __len__() returns a value that cannot be
12106 represented as a C int, raise OverflowError.
12107
12108- test__locale is skipped on OS X < 10.4 (only partial locale support is
12109 present).
12110
12111- SF bug #893549: parsing keyword arguments was broken with a few format
12112 codes.
12113
12114- Changes donated by Elemental Security to make it work on AIX 5.3
12115 with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
12116 bug #105470: test_pwd fails on 64bit system (Opteron).
12117
12118- Changes donated by Elemental Security to make it work on HP-UX 11 on
12119 Itanium2 with HP's 64-bit compiler (SF patch #1225212).
12120
12121- Disallow keyword arguments for type constructors that don't use them
12122 (fixes bug #1119418).
12123
12124- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
12125
12126- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
12127 exceptions that cause a function to exit.
12128
12129- The implementation of set() and frozenset() was revised to use its
12130 own internal data structure. Memory consumption is reduced by 1/3
12131 and there are modest speed-ups as well. The API is unchanged.
12132
12133- SF bug #1238681: freed pointer is used in longobject.c:long_pow().
12134
12135- SF bug #1229429: PyObject_CallMethod failed to decrement some
12136 reference counts in some error exit cases.
12137
12138- SF bug #1185883: Python's small-object memory allocator took over
12139 a block managed by the platform C library whenever a realloc specified
12140 a small new size. However, there's no portable way to know then how
12141 much of the address space following the pointer is valid, so there's no
12142 portable way to copy data from the C-managed block into Python's
12143 small-object space without risking a memory fault. Python's small-object
12144 realloc now leaves such blocks under the control of the platform C
12145 realloc.
12146
12147- SF bug #1232517: An overflow error was not detected properly when
12148 attempting to convert a large float to an int in os.utime().
12149
12150- SF bug #1224347: hex longs now print with lowercase letters just
12151 like their int counterparts.
12152
12153- SF bug #1163563: the original fix for bug #1010677 ("thread Module
12154 Breaks PyGILState_Ensure()") broke badly in the case of multiple
12155 interpreter states; back out that fix and do a better job (see
12156 http://mail.python.org/pipermail/python-dev/2005-June/054258.html
12157 for a longer write-up of the problem).
12158
12159- SF patch #1180995: marshal now uses a binary format by default when
12160 serializing floats.
12161
12162- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
12163 the routines that promise to produce IEEE 754 binary representations
12164 of floats now simply copy bytes around.
12165
12166- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
12167 278.
12168
12169- patch #1109424: int, long, float, complex, and unicode now check for the
12170 proper magic slot for type conversions when subclassed. Previously the
12171 magic slot was ignored during conversion. Semantics now match the way
12172 subclasses of str always behaved. int/long/float, conversion of an instance
12173 to the base class has been moved to the proper nb_* magic slot and out of
12174 PyNumber_*().
Antoine Pitroufbd4f802012-08-11 16:51:50 +020012175 Thanks Walter Dörwald.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012176
12177- Descriptors defined in C with a PyGetSetDef structure, where the setter is
12178 NULL, now raise an AttributeError when attempting to set or delete the
12179 attribute. Previously a TypeError was raised, but this was inconsistent
12180 with the equivalent pure-Python implementation.
12181
12182- It is now safe to call PyGILState_Release() before
12183 PyEval_InitThreads() (note that if there is reason to believe there
12184 are multiple threads around you still must call PyEval_InitThreads()
12185 before using the Python API; this fix is for extension modules that
12186 have no way of knowing if Python is multi-threaded yet).
12187
12188- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
12189 disabled caused a crash.
12190
12191- Bug #1165306: instancemethod_new allowed the creation of a method
12192 with im_class == im_self == NULL, which caused a crash when called.
12193
12194- Move exception finalisation later in the shutdown process - this
12195 fixes the crash seen in bug #1165761
12196
12197- Added two new builtins, any() and all().
12198
12199- Defining a class with empty parentheses is now allowed
12200 (e.g., ``class C(): pass`` is no longer a syntax error).
12201 Patch #1176012 added support to the 'parser' module and 'compiler' package
12202 (thanks to logistix for that added support).
12203
12204- Patch #1115086: Support PY_LONGLONG in structmember.
12205
12206- Bug #1155938: new style classes did not check that __init__() was
12207 returning None.
12208
12209- Patch #802188: Report characters after line continuation character
12210 ('\') with a specific error message.
12211
12212- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
12213
12214- Bug #1124295: the __name__ attribute of file objects was
12215 inadvertently made inaccessible in restricted mode.
12216
12217- Bug #1074011: closing sys.std{out,err} now causes a flush() and
12218 an ferror() call.
12219
12220- min() and max() now support key= arguments with the same meaning as in
12221 list.sort().
12222
12223- The peephole optimizer now performs simple constant folding in expressions:
12224 (2+3) --> (5).
12225
12226- set and frozenset objects can now be marshalled. SF #1098985.
12227
12228- Bug #1077106: Poor argument checking could cause memory corruption
12229 in calls to os.read().
12230
12231- The parser did not complain about future statements in illegal
12232 positions. It once again reports a syntax error if a future
12233 statement occurs after anything other than a doc string.
12234
12235- Change the %s format specifier for str objects so that it returns a
12236 unicode instance if the argument is not an instance of basestring and
12237 calling __str__ on the argument returns a unicode instance.
12238
12239- Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
12240 current thread state when the auto-GIL-state machinery knows about
12241 it (since the thread state is being deleted, continuing to remember it
12242 can't help, but can hurt if another thread happens to get created with
12243 the same thread id).
12244
12245Extension Modules
12246-----------------
12247
12248- Patch #1380952: fix SSL objects timing out on consecutive read()s
12249
12250- Patch #1309579: wait3 and wait4 were added to the posix module.
12251
12252- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
12253 In addition, the existing ulaw code was updated.
12254
12255- RFE #567972: Socket objects' family, type and proto properties are
12256 now exposed via new attributes.
12257
12258- Everything under lib-old was removed. This includes the following modules:
12259 Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
12260 lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
12261 util, whatsound, whrandom, zmod
12262
12263- The following modules were removed: regsub, reconvert, regex, regex_syntax.
12264
12265- re and sre were swapped, so help(re) provides full help. importing sre
12266 is deprecated. The undocumented re.engine variable no longer exists.
12267
12268- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
12269 SS2 (single-shift 2) escape sequences correctly.
12270
12271- The unicodedata module was updated to the 4.1 version of the Unicode
12272 database. The 3.2 version is still available as unicodedata.db_3_2_0
12273 for applications that require this specific version (such as IDNA).
12274
12275- The timing module is no longer built by default. It was deprecated
12276 in PEP 4 in Python 2.0 or earlier.
12277
12278- Patch 1433928: Added a new type, defaultdict, to the collections module.
12279 This uses the new __missing__ hook behavior added to dict (see above).
12280
12281- Bug #854823: socketmodule now builds on Sun platforms even when
12282 INET_ADDRSTRLEN is not defined.
12283
12284- Patch #1393157: os.startfile() now has an optional argument to specify
12285 a "command verb" to invoke on the file.
12286
12287- Bug #876637, prevent stack corruption when socket descriptor
12288 is larger than FD_SETSIZE.
12289
12290- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
12291 mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
12292 mmap.mmap(0, size) should not be used on Windows for anonymous memory.
12293
12294- Patch #1422385: The nis module now supports access to domains other
12295 than the system default domain.
12296
12297- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
12298 are reported, the limit on path name lengths is removed, and stat reports
12299 WindowsError now (instead of OSError).
12300
12301- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
12302
12303- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
12304 before the env.
12305
12306- Patch #1103116: Basic AF_NETLINK support.
12307
12308- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
12309
12310- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
12311 Also fix ungetmouse() which did not accept arguments properly.
12312 The code now conforms to the documented signature.
12313
12314- Bug #1400115, Fix segfault when calling curses.panel.userptr()
12315 without prior setting of the userptr.
12316
12317- Fix 64-bit problems in bsddb.
12318
12319- Patch #1365916: fix some unsafe 64-bit mmap methods.
12320
12321- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
12322 problem on AIX.
12323
12324- Bug #869197: os.setgroups rejects long integer arguments
12325
12326- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
12327
12328- Bug #1344508, Fix UNIX mmap leaking file descriptors
12329
12330- Patch #1338314, Bug #1336623: fix tarfile so it can extract
12331 REGTYPE directories from tarfiles written by old programs.
12332
12333- Patch #1407992, fixes broken bsddb module db associate when using
12334 BerkeleyDB 3.3, 4.0 or 4.1.
12335
12336- Get bsddb module to build with BerkeleyDB version 4.4
12337
12338- Get bsddb module to build with BerkeleyDB version 3.2
12339
12340- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
12341 but Python incorrectly assumes it is in UTF-8 format
12342
12343- Fix parse errors in the readline module when compiling without threads.
12344
12345- Patch #1288833: Removed thread lock from socket.getaddrinfo on
12346 FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
12347
12348- Patches #1298449 and #1298499: Add some missing checks for error
12349 returns in cStringIO.c.
12350
12351- Patch #1297028: fix segfault if call type on MultibyteCodec,
12352 MultibyteStreamReader, or MultibyteStreamWriter
12353
12354- Fix memory leak in posix.access().
12355
12356- Patch #1213831: Fix typo in unicodedata._getcode.
12357
12358- Bug #1007046: os.startfile() did not accept unicode strings encoded in
12359 the file system encoding.
12360
12361- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
12362 platforms that don't have inet_aton().
12363
12364- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
12365
12366- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
12367 line without newlines.
12368
12369- Bug #728515: mmap.resize() now resizes the file on Unix as it did
12370 on Windows.
12371
12372- Patch #1180695: Add nanosecond stat resolution, and st_gen,
12373 st_birthtime for FreeBSD.
12374
12375- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
12376 the request code argument, which results in more C-like behaviour
12377 for large or negative values.
12378
12379- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
12380 implementation treated all integer values except 1 as false.
12381
12382- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
12383
12384- Patch #1212117: os.stat().st_flags is now accessible as a attribute
12385 if available on the platform.
12386
12387- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
12388 available on the platform.
12389
12390- Bug #1166660: The readline module could segfault if hook functions
12391 were set in a different thread than that which called readline.
12392
12393- collections.deque objects now support a remove() method.
12394
12395- operator.itemgetter() and operator.attrgetter() now support retrieving
12396 multiple fields. This provides direct support for sorting on multiple
12397 keys (primary, secondary, etc).
12398
12399- os.access now supports Unicode path names on non-Win32 systems.
12400
12401- Patches #925152, #1118602: Avoid reading after the end of the buffer
12402 in pyexpat.GetInputContext.
12403
12404- Patches #749830, #1144555: allow UNIX mmap size to default to current
12405 file size.
12406
12407- Added functional.partial(). See PEP309.
12408
12409- Patch #1093585: raise a ValueError for negative history items in readline.
12410 {remove_history,replace_history}
12411
12412- The spwd module has been added, allowing access to the shadow password
12413 database.
12414
12415- stat_float_times is now True.
12416
12417- array.array objects are now picklable.
12418
12419- the cPickle module no longer accepts the deprecated None option in the
12420 args tuple returned by __reduce__().
12421
12422- itertools.islice() now accepts None for the start and step arguments.
12423 This allows islice() to work more readily with slices:
12424 islice(s.start, s.stop, s.step)
12425
12426- datetime.datetime() now has a strptime class method which can be used to
12427 create datetime object using a string and format.
12428
12429- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
12430 with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
12431
12432Library
12433-------
12434
12435- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
12436 been renamed to have only a single underscore prefix. This was done to
12437 make subclassing easier.
12438
12439- PEP 338: new module runpy defines a run_module function to support
12440 executing modules which provide access to source code or a code object
12441 via the PEP 302 import mechanisms.
12442
12443- The email module's parsedate_tz function now sets the daylight savings
12444 flag to -1 (unknown) since it can't tell from the date whether it should
12445 be set.
12446
12447- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
12448 now sport attributes that provide access to the parts of the result.
12449
12450- Patch #1462498: sgmllib now handles entity and character references
12451 in attribute values.
12452
12453- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
12454 a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
12455 later to build this - if you have an earlier version, the C extension
12456 module will not be built.
12457
12458- Bug #1460340: ``random.sample(dict)`` failed in various ways. Dicts
12459 aren't officially supported here, and trying to use them will probably
12460 raise an exception some day. But dicts have been allowed, and "mostly
12461 worked", so support for them won't go away without warning.
12462
12463- Bug #1445068: getpass.getpass() can now be given an explicit stream
12464 argument to specify where to write the prompt.
12465
12466- Patch #1462313, bug #1443328: the pickle modules now can handle classes
12467 that have __private names in their __slots__.
12468
12469- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
12470
12471- patch #1457316: "setup.py upload" now supports --identity to select the
12472 key to be used for signing the uploaded code.
12473
12474- Queue.Queue objects now support .task_done() and .join() methods
12475 to make it easier to monitor when daemon threads have completed
12476 processing all enqueued tasks. Patch #1455676.
12477
12478- popen2.Popen objects now preserve the command in a .cmd attribute.
12479
12480- Added the ctypes ffi package.
12481
12482- email 4.0 package now integrated. This is largely the same as the email 3.0
12483 package that was included in Python 2.3, except that PEP 8 module names are
12484 now used (e.g. mail.message instead of email.Message). The MIME classes
12485 have been moved to a subpackage (e.g. email.mime.text instead of
12486 email.MIMEText). The old names are still supported for now. Several
12487 deprecated Message methods have been removed and lots of bugs have been
12488 fixed. More details can be found in the email package documentation.
12489
12490- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
12491 (a subclass of tuple) that provides incremental decoders and encoders
12492 (a way to use stateful codecs without the stream API). Python functions
12493 codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
12494 as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
12495 have been added.
12496
12497- Patch #1359365: Calling next() on a closed StringIO.String object raises
12498 a ValueError instead of a StopIteration now (like file and cString.String do).
12499 cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
12500 called before (like file and StringIO.StringIO do).
12501
12502- A regrtest option -w was added to re-run failed tests in verbose mode.
12503
12504- Patch #1446372: quit and exit can now be called from the interactive
12505 interpreter to exit.
12506
12507- The function get_count() has been added to the gc module, and gc.collect()
12508 grew an optional 'generation' argument.
12509
12510- A library msilib to generate Windows Installer files, and a distutils
12511 command bdist_msi have been added.
12512
12513- PEP 343: new module contextlib.py defines decorator @contextmanager
12514 and helpful context managers nested() and closing().
12515
12516- The compiler package now supports future imports after the module docstring.
12517
12518- Bug #1413790: zipfile now sanitizes absolute archive names that are
12519 not allowed by the specs.
12520
12521- Patch #1215184: FileInput now can be given an opening hook which can
12522 be used to control how files are opened.
12523
12524- Patch #1212287: fileinput.input() now has a mode parameter for
12525 specifying the file mode input files should be opened with.
12526
12527- Patch #1215184: fileinput now has a fileno() function for getting the
12528 current file number.
12529
12530- Patch #1349274: gettext.install() now optionally installs additional
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012531 translation functions other than _() in the builtins namespace.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012532
12533- Patch #1337756: fileinput now accepts Unicode filenames.
12534
12535- Patch #1373643: The chunk module can now read chunks larger than
12536 two gigabytes.
12537
12538- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
12539
12540- Bug #1430298: It is now possible to send a mail with an empty
12541 return address using smtplib.
12542
12543- Bug #1432260: The names of lambda functions are now properly displayed
12544 in pydoc.
12545
12546- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
12547 unless the system is Win32.
12548
12549- Patch #1349118: urllib now supports user:pass@ style proxy
12550 specifications, raises IOErrors when proxies for unsupported protocols
12551 are defined, and uses the https proxy on https redirections.
12552
12553- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
12554
12555- Bug #1407902: Add support for sftp:// URIs to urlparse.
12556
12557- Bug #1371247: Update Windows locale identifiers in locale.py.
12558
12559- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
12560 any more.
12561
12562- Bug #1403410: The warnings module now doesn't get confused
12563 when it can't find out the module name it generates a warning for.
12564
12565- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
12566
12567- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
12568
12569- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
12570 LoadError as documented, instead of IOError. For compatibility,
12571 LoadError subclasses IOError.
12572
12573- Added the hashlib module. It provides secure hash functions for MD5 and
12574 SHA1, 224, 256, 384, and 512. Note that recent developments make the
12575 historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
12576 In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
12577 Ronald L. Rivest offered this advice for Python:
12578
12579 "The consensus of researchers in this area (at least as
12580 expressed at the NIST Hash Function Workshop 10/31/05),
12581 is that SHA-256 is a good choice for the time being, but
12582 that research should continue, and other alternatives may
12583 arise from this research. The larger SHA's also seem OK."
12584
12585- Added a subset of Fredrik Lundh's ElementTree package. Available
12586 modules are xml.etree.ElementTree, xml.etree.ElementPath, and
12587 xml.etree.ElementInclude, from ElementTree 1.2.6.
12588
12589- Patch #1162825: Support non-ASCII characters in IDLE window titles.
12590
12591- Bug #1365984: urllib now opens "data:" URLs again.
12592
12593- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
12594 is raised within the method itself on a previous call (e.g., passing in an
12595 illegal argument)
12596
12597- Bug #1340337: change time.strptime() to always return ValueError when there
12598 is an error in the format string.
12599
12600- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
12601
12602- Bug #729103: pydoc.py: Fix docother() method to accept additional
12603 "parent" argument.
12604
12605- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
12606 for padding.
12607
12608- Bug #1296004: httplib.py: Limit maximal amount of data read from the
12609 socket to avoid a MemoryError on Windows.
12610
12611- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
12612 to get the correct encoding.
12613
12614- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
12615 languages.
12616
12617- Patch #1268314: Cache lines in StreamReader.readlines for performance.
12618
12619- Bug #1290505: Fix clearing the regex cache for time.strptime().
12620
12621- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
12622
12623- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
12624 functionality.
12625
12626- Bug #1163178: Make IDNA return an empty string when the input is empty.
12627
12628- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
12629 separator and do not output trailing semicolon.
12630
12631- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
12632 ContentTooShortException, when the actually downloaded size does not
12633 match the Content-Length header.
12634
12635- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
12636
12637- Bug #1178484: Return complete lines from codec stream readers
12638 even if there is an exception in later lines, resulting in
12639 correct line numbers for decoding errors in source code.
12640
12641- Bug #1192315: Disallow negative arguments to clear() in pdb.
12642
12643- Patch #827386: Support absolute source paths in msvccompiler.py.
12644
12645- Patch #1105730: Apply the new implementation of commonprefix in posixpath
12646 to ntpath, macpath, os2emxpath and riscospath.
12647
12648- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
12649 __hasattr__ and __delattr__ methods on class Tk that were breaking
12650 Tkdnd.
12651
12652- Bug #1015140: disambiguated the term "article id" in nntplib docs and
12653 docstrings to either "article number" or "message id".
12654
12655- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
12656 parameter, but uses the usual "kwargs=None".
12657
12658- textwrap now processes text chunks at O(n) speed instead of O(n**2).
12659 Patch #1209527 (Contributed by Connelly).
12660
12661- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
12662 to W3C name (404 -> 'Not Found'). RFE #1216944.
12663
12664- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
12665 as this can cause problems with apps closing all file descriptors.
12666
12667- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
12668 it can be missing in embedded interpreters
12669
12670- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
12671
12672- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
12673 error messages.
12674
12675- Bug #1108948: Cookie.py produced invalid JavaScript code.
12676
12677- The tokenize module now detects and reports indentation errors.
12678 Bug #1224621.
12679
12680- The tokenize module has a new untokenize() function to support a full
12681 roundtrip from lexed tokens back to Python source code. In addition,
12682 the generate_tokens() function now accepts a callable argument that
12683 terminates by raising StopIteration.
12684
12685- Bug #1196315: fix weakref.WeakValueDictionary constructor.
12686
12687- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
12688 component of the path.
12689
12690- Patch #1120353: The xmlrpclib module provides better, more transparent,
12691 support for datetime.{datetime,date,time} objects. With use_datetime set
12692 to True, applications shouldn't have to fiddle with the DateTime wrapper
12693 class at all.
12694
12695- distutils.commands.upload was added to support uploading distribution
12696 files to PyPI.
12697
12698- distutils.commands.register now encodes the data as UTF-8 before posting
12699 them to PyPI.
12700
12701- decimal operator and comparison methods now return NotImplemented
12702 instead of raising a TypeError when interacting with other types. This
12703 allows other classes to implement __radd__ style methods and have them
12704 work as expected.
12705
12706- Bug #1163325: Decimal infinities failed to hash. Attempting to
12707 hash a NaN raised an InvalidOperation instead of a TypeError.
12708
12709- Patch #918101: Add tarfile open mode r|* for auto-detection of the
12710 stream compression; add, for symmetry reasons, r:* as a synonym of r.
12711
12712- Patch #1043890: Add extractall method to tarfile.
12713
12714- Patch #1075887: Don't require MSVC in distutils if there is nothing
12715 to build.
12716
12717- Patch #1103407: Properly deal with tarfile iterators when untarring
12718 symbolic links on Windows.
12719
12720- Patch #645894: Use getrusage for computing the time consumption in
12721 profile.py if available.
12722
12723- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
12724
12725- Patch #1117454: Remove code to special-case cookies without values
12726 in LWPCookieJar.
12727
12728- Patch #1117339: Add cookielib special name tests.
12729
12730- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
12731
12732- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
12733
12734- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
12735
12736- Patch #1104111: Alter setup.py --help and --help-commands.
12737
12738- Patch #1121234: Properly cleanup _exit and tkerror commands.
12739
12740- Patch #1049151: xdrlib now unpacks booleans as True or False.
12741
12742- Fixed bug in a NameError bug in cookielib. Patch #1116583.
12743
12744- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
12745 disables recursive traversal through instance attributes, which can
12746 be exploited in various ways.
12747
12748- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
12749 flags on the HTTP listening socket.
12750
12751- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
12752 Fixed by reading the HTTP body in chunks instead of one big socket.read().
12753
12754- Patches #893642, #1039083: add allow_none, encoding arguments to
12755 constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
12756
12757- Bug #1110478: Revert os.environ.update to do putenv again.
12758
12759- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
12760
12761- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
12762
12763- Enhancements to the csv module:
12764
12765 + Dialects are now validated by the underlying C code, better
12766 reflecting its capabilities, and improving its compliance with
12767 PEP 305.
12768 + Dialect parameter parsing has been re-implemented to improve error
12769 reporting.
12770 + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
12771 dictates.
12772 + the parser now removes the escapechar prefix from escaped characters.
12773 + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
12774 types, rather than any object that can be represented as a numeric.
12775 + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
12776 to floats.
12777 + reader now allows \r characters to be quoted (previously it only allowed
12778 \n to be quoted).
12779 + writer doublequote handling improved.
12780 + Dialect classes passed to the module are no longer instantiated by
12781 the module before being parsed (the former validation scheme required
12782 this, but the mechanism was unreliable).
12783 + The dialect registry now contains instances of the internal
12784 C-coded dialect type, rather than references to python objects.
12785 + the internal c-coded dialect type is now immutable.
12786 + register_dialect now accepts the same keyword dialect specifications
12787 as the reader and writer, allowing the user to register dialects
12788 without first creating a dialect class.
12789 + a configurable limit to the size of parsed fields has been added -
12790 previously, an unmatched quote character could result in the entire
12791 file being read into the field buffer before an error was reported.
12792 + A new module method csv.field_size_limit() has been added that sets
12793 the parser field size limit (returning the former limit). The initial
12794 limit is 128kB.
12795 + A line_num attribute has been added to the reader object, which tracks
12796 the number of lines read from the source iterator. This is not
12797 the same as the number of records returned, as records can span
12798 multiple lines.
12799 + reader and writer objects were not being registered with the cyclic-GC.
12800 This has been fixed.
12801
12802- _DummyThread objects in the threading module now delete self.__block that is
12803 inherited from _Thread since it uses up a lock allocated by 'thread'. The
12804 lock primitives tend to be limited in number and thus should not be wasted on
12805 a _DummyThread object. Fixes bug #1089632.
12806
12807- The imghdr module now detects Exif files.
12808
12809- StringIO.truncate() now correctly adjusts the size attribute.
12810 (Bug #951915).
12811
12812- locale.py now uses an updated locale alias table (built using
12813 Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
12814 alias file); the encoding lookup was enhanced to use Python's
12815 encoding alias table.
12816
12817- moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
12818
12819- the pickle module no longer accepts the deprecated None option in the
12820 args tuple returned by __reduce__().
12821
12822- optparse now optionally imports gettext. This allows its use in setup.py.
12823
12824- the pickle module no longer uses the deprecated bin parameter.
12825
12826- the shelve module no longer uses the deprecated binary parameter.
12827
12828- the pstats module no longer uses the deprecated ignore() method.
12829
12830- the filecmp module no longer uses the deprecated use_statcache argument.
12831
12832- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
12833 extended or overridden by subclasses. Formerly, the subclassed method would
12834 be ignored by the rest of the module. (Bug #1078905).
12835
12836- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
12837 the same meaning as in list.sort().
12838
12839- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
12840 once when a size argument is given. This prevents a buffer overflow in the
12841 tokenizer with very long source lines.
12842
12843- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
12844 immediately after creating the object, without any intervening
12845 ``.decompress()`` calls.
12846
12847- The reconvert.quote function can now emit triple-quoted strings. The
12848 reconvert module now has some simple documentation.
12849
12850- ``UserString.MutableString`` now supports negative indices in
12851 ``__setitem__`` and ``__delitem__``
12852
12853- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
12854 correctly.
12855
12856- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
12857 ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
12858 character even if the user has passed a size parameter to get a proper
12859 line ending. Remove the special handling of a "\r\n" that has been split
12860 between two lines.
12861
12862- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
12863 about illegal code points. The codec now supports PEP 293 style error
12864 handlers.
12865
12866- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
12867 from the input stream, so that the output is a byte string in the correct
12868 encoding instead of a unicode string.
12869
12870- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
12871 considering it exactly like a '*'.
12872
12873- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
12874 ``encodings.aliases``.
12875
12876- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
12877
12878- Patch #1413711: Certain patterns of differences were making difflib
12879 touch the recursion limit.
12880
12881- Bug #947906: An object oriented interface has been added to the calendar
12882 module. It's possible to generate HTML calendar now and the module can be
12883 called as a script (e.g. via ``python -mcalendar``). Localized month and
12884 weekday names can be ouput (even if an exotic encoding is used) using
12885 special classes that use unicode.
12886
12887Build
12888-----
12889
12890- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
12891 by using -mieee gcc option.
12892
12893- Patch #1432345: Make python compile on DragonFly.
12894
12895- Build support for Win64-AMD64 was added.
12896
12897- Patch #1428494: Prefer linking against ncursesw over ncurses library.
12898
12899- Patch #881820: look for openpty and forkpty also in libbsd.
12900
12901- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012902 The zlib module is now built in on Windows.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012903
12904- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
12905
12906- Bug #1189330: configure did not correctly determine the necessary
12907 value of LINKCC if python was built with GCC 4.0.
12908
12909- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
12910 vulnerability in zlib 1.2.1 and 1.2.2.
12911
12912- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
12913 flags that change binary compatibility. Changes were also made to
12914 distutils.sysconfig to also use the environment variable when used during
12915 compilation of the interpreter and of C extensions through distutils.
12916
12917- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
12918 and linking has changed (prebinding is now deprecated, and libcc_dynamic
12919 no longer exists). This configure patch makes things right.
12920
12921- Bug #1158607: Build with --disable-unicode again.
12922
12923- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
12924 defined. Discovered as a result of not being able to build on OS X.
12925
12926- setup.py now uses the directories specified in LDFLAGS using the -L option
12927 and in CPPFLAGS using the -I option for adding library and include
12928 directories, respectively, for compiling extension modules against. This has
12929 led to the core being compiled using the values in CPPFLAGS. It also removes
12930 the need for the special-casing of both DarwinPorts and Fink for darwin since
12931 the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
12932 ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
12933 Fink, ``-I/opt/local/include`` for DarwinPorts).
12934
12935- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
12936 to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
12937 Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
12938 Closes bug #1096244. Thanks Gregory Bond.
12939
12940C API
12941-----
12942
12943- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
12944 ``PyObject_{Free, FREE}``. They map to the system ``free()`` now. If memory
12945 is obtained via the ``PyObject_`` family, it must be released via the
12946 ``PyObject_`` family, and likewise for the ``PyMem_`` family. This has
12947 always been officially true, but when Python's small-object allocator was
12948 introduced, an attempt was made to cater to a few extension modules
12949 discovered at the time that obtained memory via ``PyObject_New`` but
12950 released it via ``PyMem_DEL``. It's years later, and if such code still
12951 exists it will fail now (probably with segfaults, but calling wrong
12952 low-level memory management functions can yield many symptoms).
12953
12954- Added a C API for set and frozenset objects.
12955
12956- Removed PyRange_New().
12957
12958- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
12959 mapping argument now. This string is used as a mapping table. Byte values
12960 greater than the length of the string and 0xFFFE are treated as undefined
12961 mappings.
12962
12963
12964Tests
12965-----
12966
12967- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
12968
12969- Patch #1276356: New resource "urlfetch" is implemented. This enables
12970 even impatient people to run tests that require remote files.
12971
12972
12973Documentation
12974-------------
12975
12976- Bug #1402224: Add warning to dl docs about crashes.
12977
12978- Bug #1396471: Document that Windows' ftell() can return invalid
12979 values for text files with UNIX-style line endings.
12980
12981- Bug #1274828: Document os.path.splitunc().
12982
12983- Bug #1190204: Clarify which directories are searched by site.py.
12984
12985- Bug #1193849: Clarify os.path.expanduser() documentation.
12986
12987- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
12988
12989- Bug #755617: Document the effects of os.chown() on Windows.
12990
12991- Patch #1180012: The documentation for modulefinder is now in the library reference.
12992
12993- Patch #1213031: Document that os.chown() accepts argument values of -1.
12994
12995- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
12996
12997- Bug #1175022: Correct the example code for property().
12998
12999- Document the IterableUserDict class in the UserDict module.
13000 Closes bug #1166582.
13001
13002- Remove all latent references for "Macintosh" that referred to semantics for
13003 Mac OS 9 and change to reflect the state for OS X.
13004 Closes patch #1095802. Thanks Jack Jansen.
13005
13006Mac
13007---
13008
13009
13010New platforms
13011-------------
13012
13013- FreeBSD 7 support is added.
13014
13015
13016Tools/Demos
13017-----------
13018
13019- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
13020 directory for syntax highlighting in Vim. Vim directory was added and placed
13021 vimrc to it (was previous up a level).
13022
13023- Added two new files to Tools/scripts: pysource.py, which recursively
13024 finds Python source files, and findnocoding.py, which finds Python
13025 source files that need an encoding declaration.
13026 Patch #784089, credits to Oleg Broytmann.
13027
13028- Bug #1072853: pindent.py used an uninitialized variable.
13029
13030- Patch #1177597: Correct Complex.__init__.
13031
13032- Fixed a display glitch in Pynche, which could cause the right arrow to
13033 wiggle over by a pixel.
13034
13035
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013036What's New in Python 2.4 final?
13037===============================
13038
13039*Release date: 30-NOV-2004*
13040
13041Core and builtins
13042-----------------
13043
13044- Bug 875692: Improve signal handling, especially when using threads, by
13045 forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
13046 things_to_do is not cleared by Py_MakePendingCalls().
13047
13048
13049What's New in Python 2.4 (release candidate 1)
13050==============================================
13051
13052*Release date: 18-NOV-2004*
13053
13054Core and builtins
13055-----------------
13056
13057- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
13058 the years-old thread shutdown race bug 225673. Numeric history lesson
13059 aside, all bugs in all three reports are fixed now.
13060
13061
13062Library
13063-------
13064
13065- Bug 1052242: If exceptions are raised by an atexit handler function an
13066 attempt is made to execute the remaining handlers. The last exception
13067 raised is re-raised.
13068
13069- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
13070 doctests was broken in a dramatic but shallow way. Fixed.
13071
13072- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
13073 and ``month_abbr`` attributes emulate sequences of locale-correct
13074 spellings of month and day names. Because the locale can change at
13075 any time, the correct spelling is recomputed whenever one of these is
13076 indexed. In the worst case, the index may be a slice object, so these
13077 recomputed every day or month name each time they were indexed. This is
13078 much slower than necessary in the usual case, when the index is just an
13079 integer. In that case, only the single spelling needed is recomputed
13080 now; and, when the index is a slice object, only the spellings needed
13081 by the slice are recomputed now.
13082
13083- Patch 1061679: Added ``__all__`` to pickletools.py.
13084
13085Build
13086-----
13087
13088- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
13089 and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
13090 which has no known users. Thanks Bob Ippolito.
13091
13092C API
13093-----
13094
13095- The PyRange_New() function is deprecated.
13096
13097
13098What's New in Python 2.4 beta 2?
13099================================
13100
13101*Release date: 03-NOV-2004*
13102
13103License
13104-------
13105
13106The Python Software Foundation changed the license under which Python
13107is released, to remove Python version numbers. There were no other
13108changes to the license. So, for example, wherever the license for
13109Python 2.3 said "Python 2.3", the new license says "Python". The
13110intent is to make it possible to refer to the PSF license in a more
13111durable way. For example, some people say they're confused by that
13112the Open Source Initiative's entry for the Python Software Foundation
13113License::
13114
13115 http://www.opensource.org/licenses/PythonSoftFoundation.php
13116
13117says "Python 2.1.1" all over it, wondering whether it applies only
13118to Python 2.1.1.
13119
13120The official name of the new license is the Python Software Foundation
13121License Version 2.
13122
13123Core and builtins
13124-----------------
13125
13126- Bug #1055820 Cyclic garbage collection was not protecting against that
13127 calling a live weakref to a piece of cyclic trash could resurrect an
13128 insane mutation of the trash if any Python code ran during gc (via
13129 running a dead object's __del__ method, running another callback on a
13130 weakref to a dead object, or via any Python code run in any other thread
13131 that managed to obtain the GIL while a __del__ or callback was running
13132 in the thread doing gc). The most likely symptom was "impossible"
13133 ``AttributeError`` exceptions, appearing seemingly at random, on weakly
13134 referenced objects. The cure was to clear all weakrefs to unreachable
13135 objects before allowing any callbacks to run.
13136
13137- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
13138
13139Extension Modules
13140-----------------
13141
13142- Bug #1048870: the compiler now generates distinct code objects for
13143 functions with identical bodies. This was producing confusing
13144 traceback messages which pointed to the function where the code
13145 object was first defined rather than the function being executed.
13146
13147Library
13148-------
13149
13150- Patch #1056967 changes the semantics of Template.safe_substitute() so that
13151 no ValueError is raised on an 'invalid' match group. Now the delimiter is
13152 returned.
13153
13154- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
13155
13156- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
13157 paths with a base path before checking os.path.isfile().
13158
13159- The whichdb module can now be run from the command line.
13160
13161- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
13162 the year) when the day of the week and year are also specified.
13163
13164- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
13165
13166- Bug #1017553: fix bug in tarfile.filemode()
13167
13168- Patch #737473: fix bug that old source code is shown in tracebacks even if
13169 the source code is updated and reloaded.
13170
13171Build
13172-----
13173
13174- Patch #1044395: --enable-shared is allowed in FreeBSD also.
13175
13176What's New in Python 2.4 beta 1?
13177================================
13178
13179*Release date: 15-OCT-2004*
13180
13181Core and builtins
13182-----------------
13183
13184- Patch #975056: Restartable signals were not correctly disabled on
13185 BSD systems. Consistently use PyOS_setsig() instead of signal().
13186
13187- The internal portable implementation of thread-local storage (TLS), used
13188 by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
13189 thread-correct. This could lead to a variety of problems, up to and
13190 including segfaults. See bug 1041645 for an example.
13191
13192- Added a command line option, -m module, which searches sys.path for the
13193 module and then runs it. (Contributed by Nick Coghlan.)
13194
13195- The bytecode optimizer now folds tuples of constants into a single
13196 constant.
13197
13198- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
13199 an integer was compared to a float, the integer was coerced to a float.
13200 That could yield spurious overflow errors (if the integer was very
13201 large), and to anomalies such as
13202 ``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
13203 longer performed, and cases like ``long(1e200)-1 < 1e200``,
13204 ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
13205 correctly now.
13206
13207Extension modules
13208-----------------
13209
13210- ``collections.deque`` objects didn't play quite right with garbage
13211 collection, which could lead to a segfault in a release build, or
13212 an assert failure in a debug build. Also, added overflow checks,
13213 better detection of mutation during iteration, and shielded deque
13214 comparisons from unusual subclass overrides of the __iter__() method.
13215
13216Library
13217-------
13218
13219- Patch 1046644: distutils build_ext grew two new options - --swig for
13220 specifying the swig executable to use, and --swig-opts to specify
13221 options to pass to swig. --swig-opts="-c++" is the new way to spell
13222 --swig-cpp.
13223
13224- Patch 983206: distutils now obeys environment variable LDSHARED, if
13225 it is set.
13226
13227- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
13228
13229- time.strptime() now properly escapes timezones and all other locale-specific
13230 strings for regex-specific symbols. Was breaking under Japanese Windows when
13231 the timezone was specified as "Tokyo (standard time)".
13232 Closes bug #1039270.
13233
13234- Updates for the email package:
13235
13236 + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
13237 + All deprecated APIs that in email 2.x issued warnings have been removed:
13238 _encoder argument to the MIMEText constructor, Message.add_payload(),
13239 Utils.dump_address_pair(), Utils.decode(), Utils.encode()
13240 + New deprecations: Generator.__call__(), Message.get_type(),
13241 Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
13242 the Parser constructor. These will be removed in email 3.1.
13243 + Support for Python earlier than 2.3 has been removed (see PEP 291).
13244 + All defect classes have been renamed to end in 'Defect'.
13245 + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
13246 added to messages that claim to be multipart but really aren't.
13247 + Updates to documentation.
13248
13249- re's findall() and finditer() functions now take an optional flags argument
13250 just like the compile(), search(), and match() functions. Also, documented
13251 the previously existing start and stop parameters for the findall() and
13252 finditer() methods of regular expression objects.
13253
13254- rfc822 Messages now support iterating over the headers.
13255
13256- The (undocumented) tarfile.Tarfile.membernames has been removed;
13257 applications should use the getmember function.
13258
13259- httplib now offers symbolic constants for the HTTP status codes.
13260
13261- SF bug #1028306: Trying to compare a ``datetime.date`` to a
13262 ``datetime.datetime`` mistakenly compared only the year, month and day.
13263 Now it acts like a mixed-type comparison: ``False`` for ``==``,
13264 ``True`` for ``!=``, and raises ``TypeError`` for other comparison
13265 operators. Because datetime is a subclass of date, comparing only the
13266 base class (date) members can still be done, if that's desired, by
13267 forcing using of the approprate date method; e.g.,
13268 ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
13269 and day members of ``a_date`` and ``a_datetime`` are equal.
13270
13271- bdist_rpm now supports command line options --force-arch,
13272 {pre,post}-install, {pre,post}-uninstall, and
13273 {prep,build,install,clean,verify}-script.
13274
13275- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
13276 decoding incomplete input (when the input stream is temporarily exhausted).
13277 ``codecs.StreamReader`` now implements buffering, which enables proper
13278 readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
13279 has a new argument ``chars`` which specifies the number of characters to
13280 return. ``codecs.StreamReader.readline()`` and
13281 ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
13282 Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
13283
13284- The documentation for doctest is greatly expanded, and now covers all
13285 the new public features (of which there are many).
13286
13287- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
13288 updates it. This isn't good, because every ``testmod()`` call
13289 contributes to bloating the "hidden" state of ``doctest.master``, but
13290 some old code apparently relies on it. For now, all we can do is
13291 encourage people to stitch doctests together via doctest's unittest
13292 integration features instead.
13293
13294- httplib now handles ipv6 address/port pairs.
13295
13296- SF bug #1017864: ConfigParser now correctly handles default keys,
13297 processing them with ``ConfigParser.optionxform`` when supplied,
13298 consistent with the handling of config file entries and runtime-set
13299 options.
13300
13301- SF bug #997050: Document, test, & check for non-string values in
13302 ConfigParser. Moved the new string-only restriction added in
13303 rev. 1.65 to the SafeConfigParser class, leaving existing
13304 ConfigParser & RawConfigParser behavior alone, and documented the
13305 conditions under which non-string values work.
13306
13307Build
13308-----
13309
13310- Building on darwin now includes /opt/local/include and /opt/local/lib for
13311 building extension modules. This is so as to include software installed as
13312 a DarwinPorts port <http://darwinports.opendarwin.org/>
13313
13314- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
13315 platform C computes true for ``x != x`` if and only if X is a NaN.
13316 Other platforms can override the default definition with a platform-
13317 specific spelling in that platform's pyconfig.h. You can also override
13318 pyport.h's default Py_IS_INFINITY definition now.
13319
13320C API
13321-----
13322
13323- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
13324 non-zero if PyEval_InitThreads() has been called.
13325
13326- The undocumented and unused extern int ``_PyThread_Started`` was removed.
13327
13328- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
13329 are two of the very few advertised as being safe to call without holding
13330 the GIL. However, this wasn't true in a debug build, as bug 1041645
13331 demonstrated. In a debug build, Python redirects the ``PyMem`` family
13332 of calls to Python's small-object allocator, to get the benefit of
13333 its extra debugging capabilities. But Python's small-object allocator
13334 isn't threadsafe, relying on the GIL to avoid the expense of doing its
13335 own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
13336 call the platform ``malloc()`` directly now, regardless of build type.
13337
13338- PyLong_AsUnsignedLong[Mask] now support int objects as well.
13339
13340- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
13341 ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
13342 decoding.
13343
13344Tests
13345-----
13346
13347- test__locale ported to unittest
13348
13349Mac
13350---
13351
13352- ``plistlib`` now supports non-dict root objects. There is also a new
13353 interface for reading and writing plist files: ``readPlist(pathOrFile)``
13354 and ``writePlist(rootObject, pathOrFile)``
13355
13356Tools/Demos
13357-----------
13358
13359- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
13360 read the input files in universal-newline mode. This spares them
13361 from consuming a great deal of time to deduce the useless result that,
13362 e.g., a file with Windows line ends and a file with Linux line ends
13363 have no lines in common.
13364
13365
13366What's New in Python 2.4 alpha 3?
13367=================================
13368
13369*Release date: 02-SEP-2004*
13370
13371Core and builtins
13372-----------------
13373
13374- SF patch #1007189: ``from ... import ...`` statements now allow the name
13375 list to be surrounded by parentheses.
13376
13377- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
13378 multiplication was sped a little by optimizing the C code. Gradeschool
13379 squaring was sped by about a factor of 2, by exploiting that about half
13380 the digit products are duplicates in a square. Because exponentiation
13381 uses squaring often, this also speeds long power. For example, the time
13382 to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
13383 to this much. The cutoff for Karatsuba multiplication was raised,
13384 since gradeschool multiplication got quicker, and the cutoff was
13385 aggressively small regardless. The exponentiation algorithm was switched
13386 from right-to-left to left-to-right, which is more efficient for small
13387 bases. In addition, if the exponent is large, the algorithm now does
13388 5 bits (instead of 1 bit) at a time. That cut the time to compute
13389 17**1000000 on my box in half again, down to about 4.5 seconds.
13390
13391- OverflowWarning is no longer generated. PEP 237 scheduled this to
13392 occur in Python 2.3, but since OverflowWarning was disabled by default,
13393 nobody realized it was still being generated. On the chance that user
13394 code is still using them, the Python builtin OverflowWarning, and
13395 corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
13396
13397- Py_InitializeEx has been added.
13398
13399- Fix the order of application of decorators. The proper order is bottom-up;
13400 the first decorator listed is the last one called.
13401
13402- SF patch #1005778. Fix a seg fault if the list size changed while
13403 calling list.index(). This could happen if a rich comparison function
13404 modified the list.
13405
13406- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
13407 functions is now writable.
13408
13409- code_new (a.k.a new.code()) now checks its arguments sufficiently
13410 carefully that passing them on to PyCode_New() won't trigger calls
13411 to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
13412 that the returned code object might be entirely insane.
13413
13414- Subclasses of string can no longer be interned. The semantics of
13415 interning were not clear here -- a subclass could be mutable, for
13416 example -- and had bugs. Explicitly interning a subclass of string
13417 via intern() will raise a TypeError. Internal operations that attempt
13418 to intern a string subclass will have no effect.
13419
13420- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
13421 what xrange() intends, and repaired tests accordingly.
13422
13423Extension modules
13424-----------------
13425
13426- difflib now supports HTML side-by-side diff.
13427
13428- os.urandom has been added for systems that support sources of random
13429 data.
13430
Sean Reifscheider54cf12b2007-09-17 17:55:36 +000013431- Patch 1012740: truncate() on a writable cStringIO now resets the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013432 position to the end of the stream. This is consistent with the original
13433 StringIO module and avoids inadvertently resurrecting data that was
13434 supposed to have been truncated away.
13435
13436- Added socket.socketpair().
13437
13438- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
13439 members to xml.parsers.expat.XMLParser object.
13440
13441- The mpz, rotor, and xreadlines modules, all deprecated in earlier
13442 versions of Python, have now been removed.
13443
13444Library
13445-------
13446
13447- Patch #934356: if a module defines __all__, believe that rather than using
13448 heuristics for filtering out imported names.
13449
13450- Patch #941486: added os.path.lexists(), which returns True for broken
13451 symlinks, unlike os.path.exists().
13452
13453- the random module now uses os.urandom() for seeding if it is available.
13454 Added a new generator based on os.urandom().
13455
13456- difflib and diff.py can now generate HTML.
13457
13458- bdist_rpm now includes version and release in the BuildRoot, and
13459 replaces - by ``_`` in version and release.
13460
13461- distutils build/build_scripts now has an -e option to specify the
13462 path to the Python interpreter for installed scripts.
13463
13464- PEP 292 classes Template and SafeTemplate are added to the string module.
13465
13466- tarfile now generates GNU tar files by default.
13467
13468- HTTPResponse has now a getheaders method.
13469
13470- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
13471 Percivall.
13472
13473- logging.handlers.SMTPHandler.date_time has been removed;
13474 the class now uses email.Utils.formatdate to generate the time stamp.
13475
13476- A new function tkFont.nametofont was added to return an existing
13477 font. The Font class constructor now has an additional exists argument
13478 which, if True, requests to return/configure an existing font, rather
13479 than creating a new one.
13480
13481- Updated the decimal package's min() and max() methods to match the
13482 latest revision of the General Decimal Arithmetic Specification.
13483 Quiet NaNs are ignored and equal values are sorted based on sign
13484 and exponent.
13485
13486- The decimal package's Context.copy() method now returns deep copies.
13487
13488- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
13489 attribute will be kept around for backwards compatibility and atexit
13490 will just become the one preferred way to do it.
13491
13492- patch #675551: Add get_history_item and replace_history_item functions
13493 to the readline module.
13494
13495- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
13496 of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
13497 frame, u(p) to an older frame, not the other way around.
13498
13499- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
13500 path, as normalizing the path may alter the meaning of the path if it
13501 contains symlinks.
13502
13503- bug #851123: shutil.copyfile will raise an exception when trying to copy a
13504 file onto a link to itself. Thanks Gregory Ball.
13505
13506- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
13507 so as to properly list all functions in a module when the module itself is
13508 reached through a symlink. Thanks Johannes Gijsbers.
13509
13510- doctest refactoring continued. See the docs for details. As part of
13511 this effort, some old and little- (never?) used features are now
13512 deprecated: the Tester class, the module is_private() function, and the
13513 isprivate argument to testmod(). The Tester class supplied a feeble
13514 "by hand" way to combine multiple doctests, if you knew exactly what
13515 you were doing. The newer doctest features for unittest integration
13516 already did a better job of that, are stronger now than ever, and the
13517 new DocTestRunner class is a saner foundation if you want to do it by
13518 hand. The "private name" filtering gimmick was a mistake from the
13519 start, and testmod() changed long ago to ignore it by default. If
13520 you want to filter out tests, the new DocTestFinder class can be used
13521 to return a list of all doctests, and you can filter that list by
13522 any computable criteria before passing it to a DocTestRunner instance.
13523
13524- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
13525
13526Tools/Demos
13527-----------
13528
13529- IDLE's shortcut keys for windows are now case insensitive so that
13530 Control-V works the same as Control-v.
13531
13532- pygettext.py: Generate POT-Creation-Date header in ISO format.
13533
13534Build
13535-----
13536
13537- Backward incompatibility: longintrepr.h now triggers a compile-time
13538 error if SHIFT (the number of bits in a Python long "digit") isn't
13539 divisible by 5. This new requirement allows simple code for the new
13540 5-bits-at-a-time long_pow() implementation. If necessary, the
13541 restriction could be removed (by complicating long_pow(), or by
13542 falling back to the 1-bit-at-a-time algorithm), but there are no
13543 plans to do so.
13544
13545- bug #991962: When building with --disable-toolbox-glue on Darwin no
13546 attempt to build Mac-specific modules occurs.
13547
13548- The --with-tsc flag to configure to enable VM profiling with the
13549 processor's timestamp counter now works on PPC platforms.
13550
13551- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
13552 GCC's definition and avoid redefinition warnings.
13553
13554- Detect pthreads support (provided by gnu pth pthread emulation) on
13555 GNU/k*BSD systems.
13556
13557- bug #1005737, #1007249: Fixed several build problems and warnings
13558 found on old/legacy C compilers of HP-UX, IRIX and Tru64.
13559
13560C API
13561-----
13562
13563..
13564
13565Documentation
13566-------------
13567
13568- patch #1005936, bug #1009373: fix index entries which contain
13569 an underscore when viewed with Acrobat.
13570
13571- bug #990669: os.path.normpath may alter the meaning of a path if
13572 it contains symbolic links. This has been documented in a comment
13573 since 1992, but is now in the library reference as well.
13574
13575New platforms
13576-------------
13577
13578- FreeBSD 6 is now supported.
13579
13580Tests
13581-----
13582
13583..
13584
13585Windows
13586-------
13587
13588- Boosted the stack reservation for python.exe and pythonw.exe from
13589 the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
13590 bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
13591 within the default sys.getrecursionlimit() default value of 1000 were
13592 able to suffer undetected C stack overflows. The standard test program
13593 test_compiler was one such program. If a Python process on Windows
13594 "just vanishes" without a trace, and without an error message of any
13595 kind, but with an exit code of 128, undetected stack overflow may be
13596 the problem.
13597
13598Mac
13599---
13600
13601..
13602
13603
13604What's New in Python 2.4 alpha 2?
13605=================================
13606
13607*Release date: 05-AUG-2004*
13608
13609Core and builtins
13610-----------------
13611
13612- Patch #980695: Implements efficient string concatenation for statements
13613 of the form s=s+t and s+=t. This will vary across implementations.
13614 Accordingly, the str.join() method is strongly preferred for performance
13615 sensitive code.
13616
13617- PEP-0318, Function Decorators have been added to the language. These are
13618 implemented using the Java-style @decorator syntax, like so::
13619
13620 @staticmethod
13621 def foo(bar):
13622
13623 (The PEP needs to be updated to reflect the current state)
13624
13625- When importing a module M raises an exception, Python no longer leaves M
13626 in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
13627 succeed, picking up a module object from sys.modules reflecting as much
13628 of the initialization of M as completed before the exception was raised.
13629 Subsequent imports got no indication that M was in a partially-
13630 initialized state, and the importers could get into arbitrarily bad
13631 trouble as a result (the M they got was in an unintended state,
13632 arbitrarily far removed from M's author's intent). Now subsequent
13633 imports of M will continue raising exceptions (but if, for example, the
13634 source code for M is edited between import attempts, then perhaps later
13635 attempts will succeed, or raise a different exception).
13636
13637 This can break existing code, but in such cases the code was probably
13638 working before by accident. In the Python source, the only case of
13639 breakage discovered was in a test accidentally relying on a damaged
13640 module remaining in sys.modules. Cases are also known where tests
13641 deliberately provoking import errors remove damaged modules from
13642 sys.modules themselves, and such tests will break now if they do an
13643 unconditional del sys.modules[M].
13644
13645- u'%s' % obj will now try obj.__unicode__() first and fallback to
13646 obj.__str__() if no __unicode__ method can be found.
13647
13648- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
13649 PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
13650
13651- Allow string and unicode return types from .encode()/.decode()
13652 methods on string and unicode objects. Added unicode.decode()
13653 which was missing for no apparent reason.
13654
13655- An attempt to fix the mess that is Python's behaviour with
13656 signal handlers and threads, complicated by readline's behaviour.
13657 It's quite possible that there are still bugs here.
13658
13659- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
13660 types that support garbage collection.
13661
13662- Compiler now treats None as a constant.
13663
13664- The type of values returned by __int__, __float__, __long__,
13665 __oct__, and __hex__ are now checked. Returning an invalid type
13666 will cause a TypeError to be raised. This matches the behavior of
13667 Jython.
13668
13669- Implemented bind_textdomain_codeset() in locale module.
13670
13671- Added a workaround for proper string operations in BSDs. str.split
13672 and str.is* methods can now work correctly with UTF-8 locales.
13673
13674- Bug #989185: unicode.iswide() and unicode.width() is dropped and
13675 the East Asian Width support is moved to unicodedata extension
13676 module.
13677
13678- Patch #941229: The source code encoding in interactive mode
13679 now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
13680 allows for non-latin-1 users to write unicode strings directly.
13681
13682Extension modules
13683-----------------
13684
13685- cpickle now supports the same keyword arguments as pickle.
13686
13687Library
13688-------
13689
13690- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
13691 TIS-620
13692
13693- Thanks to Edward Loper, doctest has been massively refactored, and
13694 many new features were added. Full docs will appear later. For now
13695 the doctest module comments and new test cases give good coverage.
13696 The refactoring provides many hook points for customizing behavior
13697 (such as how to report errors, and how to compare expected to actual
13698 output). New features include a <BLANKLINE> marker for expected
13699 output containing blank lines, options to produce unified or context
13700 diffs when actual output doesn't match expectations, an option to
13701 normalize whitespace before comparing, and an option to use an
13702 ellipsis to signify "don't care" regions of output.
13703
13704- Tkinter now supports the wish -sync and -use options.
13705
13706- The following methods in time support passing of None: ctime(), gmtime(),
13707 and localtime(). If None is provided, the current time is used (the
13708 same as when the argument is omitted).
13709 [SF bug 658254, patch 663482]
13710
13711- nntplib does now allow to ignore a .netrc file.
13712
13713- urllib2 now recognizes Basic authentication even if other authentication
13714 schemes are offered.
13715
13716- Bug #1001053. wave.open() now accepts unicode filenames.
13717
13718- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
13719 underlying file object (provided it has a fileno() method). This is
13720 needed if you want to use os.fsync() on a GzipFile.
13721
13722- imaplib has two new methods: deleteacl and myrights.
13723
13724- nntplib has two new methods: description and descriptions. They
13725 use a more RFC-compliant way of getting a newsgroup description.
13726
13727- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
13728 raised during interpreter shutdown from a registered function with atexit
13729 when dummy_threading is being used.
13730
13731- Bug #857297/Patch #916874. Fix an error when extracting a hard link
13732 from a tarfile.
13733
13734- Patch #846659. Fix an error in tarfile.py when using
13735 GNU longname/longlink creation.
13736
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013737- The obsolete FCNTL.py has been deleted. The built-in fcntl module
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013738 has been available (on platforms that support fcntl) since Python
13739 1.5a3, and all FCNTL.py did is export fcntl's names, after generating
13740 a deprecation warning telling you to use fcntl directly.
13741
13742- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
13743 iso2022_jp_2004, shift_jis_2004.
13744
13745- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
13746 implementations, exploiting Conditions (which didn't exist at the time
13747 Queue was introduced). A minor semantic change is that the Full and
13748 Empty exceptions raised by non-blocking calls now occur only if the
13749 queue truly was full or empty at the instant the queue was checked (of
13750 course the Queue may no longer be full or empty by the time a calling
13751 thread sees those exceptions, though). Before, the exceptions could
13752 also be raised if it was "merely inconvenient" for the implementation
13753 to determine the true state of the Queue (because the Queue was locked
13754 by some other method in progress).
13755
13756- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
13757 case of comparing two empty lists. This affected both context_diff() and
13758 unified_diff(),
13759
13760- Bug #980938: smtplib now prints debug output to sys.stderr.
13761
13762- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
13763 returning the last point in the path that was not part of any loop. Thanks
13764 AM Kuchling.
13765
13766- Bug #980327: ntpath not handles compressing erroneous slashes between the
13767 drive letter and the rest of the path. Also clearly handles UNC addresses now
13768 as well. Thanks Paul Moore.
13769
13770- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
13771 for file sizes (compressed and uncompressed) was being stored as signed
13772 instead of unsigned.
13773
13774- decimal.py now only uses signals in the IBM spec. The other conditions are
13775 no longer part of the public API.
13776
13777- codecs module now has two new generic APIs: encode() and decode()
13778 which don't restrict the return types (unlike the unicode and
13779 string methods of the same name).
13780
13781- Non-blocking SSL sockets work again; they were broken in Python 2.3.
13782 SF patch 945642.
13783
13784- doctest unittest integration improvements:
13785
13786 o Improved the unitest test output for doctest-based unit tests
13787
13788 o Can now pass setUp and tearDown functions when creating
13789 DocTestSuites.
13790
13791- The threading module has a new class, local, for creating objects
13792 that provide thread-local data.
13793
13794- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
13795 no longer returns spurious empty fields.
13796
13797- Implemented bind_textdomain_codeset() in gettext module.
13798
13799- Introduced in gettext module the l*gettext() family of functions,
13800 which return translation strings encoded in the preferred encoding,
13801 as informed by locale module's getpreferredencoding().
13802
13803- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
13804
13805 - Add expansion of default values in help text: the string
13806 "%default" in an option's help string is expanded to str() of
13807 that option's default value, or "none" if no default value.
13808
13809 - Bug #955889: option default values that happen to be strings are
13810 now processed in the same way as values from the command line; this
13811 allows generation of nicer help when using custom types. Can
13812 be disabled with parser.set_process_default_values(False).
13813
13814 - Bug #960515: don't crash when generating help for callback
13815 options that specify 'type', but not 'dest' or 'metavar'.
13816
13817 - Feature #815264: change the default help format for short options
13818 that take an argument from e.g. "-oARG" to "-o ARG"; add
13819 set_short_opt_delimiter() and set_long_opt_delimiter() methods to
13820 HelpFormatter to allow (slight) customization of the formatting.
13821
13822 - Patch #736940: internationalize Optik: all built-in user-
13823 targeted literal strings are passed through gettext.gettext(). (If
13824 you want translations (.po files), they're not included with Python
13825 -- you'll find them in the Optik source distribution from
13826 http://optik.sourceforge.net/ .)
13827
13828 - Bug #878453: respect $COLUMNS environment variable for
13829 wrapping help output.
13830
13831 - Feature #988122: expand "%prog" in the 'description' passed
13832 to OptionParser, just like in the 'usage' and 'version' strings.
13833 (This is *not* done in the 'description' passed to OptionGroup.)
13834
13835C API
13836-----
13837
13838- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
13839 error occurs while loading the module, these now delete the module's
13840 entry from sys.modules. All ways of loading modules eventually call
13841 one of these, so this is an error-case change in semantics for all
13842 ways of loading modules. In rare cases, a module loader may wish
13843 to keep a module object in sys.modules despite that the module's
13844 code cannot be executed. In such cases, the module loader must
13845 arrange to reinsert the name and module object in sys.modules.
13846 PyImport_ReloadModule() has been changed to reinsert the original
13847 module object into sys.modules if the module reload fails, so that
13848 its visible semantics have not changed.
13849
13850- A large pile of datetime field-extraction macros is now documented,
13851 thanks to Anthony Tuininga (patch #986010).
13852
13853Documentation
13854-------------
13855
13856- Improved the tutorial on creating types in C.
13857
13858 - point out the importance of reassigning data members before
13859 assigning their values
13860
13861 - correct my misconception about return values from visitprocs. Sigh.
13862
13863 - mention the labor saving Py_VISIT and Py_CLEAR macros.
13864
13865- Major rewrite of the math module docs, to address common confusions.
13866
13867Tests
13868-----
13869
13870- The test data files for the decimal test suite are now installed on
13871 platforms that use the Makefile.
13872
13873- SF patch 995225: The test file testtar.tar accidentally contained
13874 CVS keywords (like $Id$), which could cause spurious failures in
13875 test_tarfile.py depending on how the test file was checked out.
13876
13877
13878What's New in Python 2.4 alpha 1?
13879=================================
13880
13881*Release date: 08-JUL-2004*
13882
13883Core and builtins
13884-----------------
13885
13886- weakref.ref is now the type object also known as
13887 weakref.ReferenceType; it can be subclassed like any other new-style
13888 class. There's less per-entry overhead in WeakValueDictionary
13889 objects now (one object instead of three).
13890
13891- Bug #951851: Python crashed when reading import table of certain
13892 Windows DLLs.
13893
13894- Bug #215126. The locals argument to eval(), execfile(), and exec now
13895 accept any mapping type.
13896
13897- marshal now shares interned strings. This change introduces
13898 a new .pyc magic.
13899
13900- Bug #966623. classes created with type() in an exec(, {}) don't
13901 have a __module__, but code in typeobject assumed it would always
13902 be there.
13903
13904- Python no longer relies on the LC_NUMERIC locale setting to be
13905 the "C" locale; as a result, it no longer tries to prevent changing
13906 the LC_NUMERIC category.
13907
13908- Bug #952807: Unpickling pickled instances of subclasses of
13909 datetime.date, datetime.datetime and datetime.time could yield insane
13910 objects. Thanks to Jiwon Seo for a fix.
13911
13912- Bug #845802: Python crashes when __init__.py is a directory.
13913
13914- Unicode objects received two new methods: iswide() and width().
13915 These query East Asian width information, as specified in Unicode
13916 TR11.
13917
13918- Improved the tuple hashing algorithm to give fewer collisions in
13919 common cases. Fixes bug #942952.
13920
13921- Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
13922
13923- Enabled the profiling of C extension functions (and builtins) - check
13924 new documentation and modified profile and bdb modules for more details
13925
13926- Set file.name to the object passed to open (instead of a new string)
13927
13928- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
13929
13930- Optimized the byte coding for multiple assignments like "a,b=b,a" and
13931 "a,b,c=1,2,3". Improves their speed by 25% to 30%.
13932
13933- Limit the nested depth of a tuple for the second argument to isinstance()
13934 and issubclass() to the recursion limit of the interpreter.
13935 Fixes bug #858016 .
13936
13937- Optimized dict iterators, creating separate types for each
13938 and having them reveal their length. Also optimized the
13939 methods: keys(), values(), and items().
13940
13941- Implemented a newcode opcode, LIST_APPEND, that simplifies
13942 the generated bytecode for list comprehensions and further
13943 improves their performance (about 35%).
13944
13945- Implemented rich comparisons for floats, which seems to make
13946 comparisons involving NaNs somewhat less surprising when the
13947 underlying C compiler actually implements C99 semantics.
13948
13949- Optimized list.extend() to save memory and no longer create
13950 intermediate sequences. Also, extend() now pre-allocates the
13951 needed memory whenever the length of the iterable is known in
13952 advance -- this halves the time to extend the list.
13953
13954- Optimized list resize operations to make fewer calls to the system
13955 realloc(). Significantly speeds up list appends, list pops,
13956 list comprehensions, and the list constructor (when the input iterable
13957 length is not known).
13958
13959- Changed the internal list over-allocation scheme. For larger lists,
13960 overallocation ranged between 3% and 25%. Now, it is a constant 12%.
13961 For smaller lists (n<8), overallocation was upto eight elements. Now,
13962 the overallocation is no more than three elements -- this improves space
13963 utilization for applications that have large numbers of small lists.
13964
13965- Most list bodies now get re-used rather than freed. Speeds up list
13966 instantiation and deletion by saving calls to malloc() and free().
13967
13968- The dict.update() method now accepts all the same argument forms
13969 as the dict() constructor. This now includes item lists and/or
13970 keyword arguments.
13971
13972- Support for arbitrary objects supporting the read-only buffer
13973 interface as the co_code field of code objects (something that was
13974 only possible to create from C code) has been removed.
13975
13976- Made omitted callback and None equivalent for weakref.ref() and
13977 weakref.proxy(); the None case wasn't handled correctly in all
13978 cases.
13979
13980- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
13981 assumed that initial existing entries in an object's weakref list
13982 would not be removed while allocating a new weakref object. Since
13983 GC could be invoked at that time, however, that assumption was
13984 invalid. In a truly obscure case of GC being triggered during
13985 creation for a new weakref object for an referent which already
13986 has a weakref without a callback which is only referenced from
13987 cyclic trash, a memory error can occur. This consistently created a
13988 segfault in a debug build, but provided less predictable behavior in
13989 a release build.
13990
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013991- input() built-in function now respects compiler flags such as
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013992 __future__ statements. SF patch 876178.
13993
13994- Removed PendingDeprecationWarning from apply(). apply() remains
13995 deprecated, but the nuisance warning will not be issued.
13996
13997- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
13998 collection twice, both before and after tearing down modules. The
13999 call after tearing down modules has been disabled, because too much
14000 of Python has been torn down then for __del__ methods and weakref
14001 callbacks to execute sanely. The most common symptom was a sequence
14002 of uninformative messages on stderr when Python shut down, produced
14003 by threads trying to raise exceptions, but unable to report the nature
14004 of their problems because too much of the sys module had already been
14005 destroyed.
14006
14007- Removed FutureWarnings related to hex/oct literals and conversions
14008 and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
14009 This addresses most of the remaining semantic changes promised by
14010 PEP 237, except for repr() of a long, which still shows the trailing
14011 'L'. The PEP appears to promise warnings for operations that
14012 changed semantics compared to Python 2.3, but this is not
14013 implemented; we've suffered through enough warnings related to
14014 hex/oct literals and I think it's best to be silent now.
14015
14016- For str and unicode objects, the ljust(), center(), and rjust()
14017 methods now accept an optional argument specifying a fill
14018 character other than a space.
14019
14020- When method objects have an attribute that can be satisfied either
14021 by the function object or by the method object, the function
14022 object's attribute usually wins. Christian Tismer pointed out that
14023 that this is really a mistake, because this only happens for special
14024 methods (like __reduce__) where the method object's version is
14025 really more appropriate than the function's attribute. So from now
14026 on, all method attributes will have precedence over function
14027 attributes with the same name.
14028
14029- Critical bugfix, for SF bug 839548: if a weakref with a callback,
14030 its callback, and its weakly referenced object, all became part of
14031 cyclic garbage during a single run of garbage collection, the order
14032 in which they were torn down was unpredictable. It was possible for
14033 the callback to see partially-torn-down objects, leading to immediate
14034 segfaults, or, if the callback resurrected garbage objects, to
14035 resurrect insane objects that caused segfaults (or other surprises)
14036 later. In one sense this wasn't surprising, because Python's cyclic gc
14037 had no knowledge of Python's weakref objects. It does now. When
14038 weakrefs with callbacks become part of cyclic garbage now, those
14039 weakrefs are cleared first. The callbacks don't trigger then,
14040 preventing the problems. If you need callbacks to trigger, then just
14041 as when cyclic gc is not involved, you need to write your code so
14042 that weakref objects outlive the objects they weakly reference.
14043
14044- Critical bugfix, for SF bug 840829: if cyclic garbage collection
14045 happened to occur during a weakref callback for a new-style class
14046 instance, subtle memory corruption was the result (in a release build;
14047 in a debug build, a segfault occurred reliably very soon after).
14048 This has been repaired.
14049
14050- Compiler flags set in PYTHONSTARTUP are now active in __main__.
14051
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014052- Added two built-in types, set() and frozenset().
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014053
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014054- Added a reversed() built-in function that returns a reverse iterator
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014055 over a sequence.
14056
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014057- Added a sorted() built-in function that returns a new sorted list
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014058 from any iterable.
14059
14060- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
14061
14062- list.sort() now supports three keyword arguments: cmp, key, and reverse.
14063 The key argument can be a function of one argument that extracts a
14064 comparison key from the original record: mylist.sort(key=str.lower).
14065 The reverse argument is a boolean value and if True will change the
14066 sort order as if the comparison arguments were reversed. In addition,
14067 the documentation has been amended to provide a guarantee that all sorts
14068 starting with Py2.3 are guaranteed to be stable (the relative order of
14069 records with equal keys is unchanged).
14070
14071- Added test whether wchar_t is signed or not. A signed wchar_t is not
14072 usable as internal unicode type base for Py_UNICODE since the
14073 unicode implementation assumes an unsigned type.
14074
14075- Fixed a bug in the cache of length-one Unicode strings that could
14076 lead to a seg fault. The specific problem occurred when an earlier,
14077 non-fatal error left an uninitialized Unicode object in the
14078 freelist.
14079
14080- The % formatting operator now supports '%F' which is equivalent to
14081 '%f'. This has always been documented but never implemented.
14082
14083- complex(obj) could leak a little memory if obj wasn't a string or
14084 number.
14085
14086- zip() with no arguments now returns an empty list instead of raising
14087 a TypeError exception.
14088
14089- obj.__contains__() now returns True/False instead of 1/0. SF patch
14090 820195.
14091
14092- Python no longer tries to be smart about recursive comparisons.
14093 When comparing containers with cyclic references to themselves it
14094 will now just hit the recursion limit. See SF patch 825639.
14095
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014096- str and unicode built-in types now have an rsplit() method that is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014097 same as split() except that it scans the string from the end
14098 working towards the beginning. See SF feature request 801847.
14099
14100- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
14101 to clear the error when attempts to get the __getstate__ attribute
14102 fail caused intermittent errors and odd behavior.
14103
14104- buffer objects based on other objects no longer cache a pointer to
14105 the data and the data length. Instead, the appropriate tp_as_buffer
14106 method is called as necessary.
14107
14108- fixed: if a file is opened with an explicit buffer size >= 1, repeated
14109 close() calls would attempt to free() the buffer already free()ed on
14110 the first call.
14111
14112
14113Extension modules
14114-----------------
14115
14116- Added socket.getservbyport(), and make the second argument in
14117 getservbyname() and getservbyport() optional.
14118
14119- time module code that deals with input POSIX timestamps will now raise
14120 ValueError if more than a second is lost in precision when the
14121 timestamp is cast to the platform C time_t type. There's no chance
14122 that the platform will do anything sensible with the result in such
14123 cases. This includes ctime(), localtime() and gmtime(). Assorted
14124 fromtimestamp() and utcfromtimestamp() methods in the datetime module
14125 were also protected. Closes bugs #919012 and 975996.
14126
14127- fcntl.ioctl now warns if the mutate flag is not specified.
14128
14129- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
14130
14131- the weakref module now supports additional objects: array.array,
14132 sre.pattern_objects, file objects, and sockets.
14133
14134- operator.isMappingType() and operator.isSequenceType() now give
14135 fewer false positives.
14136
14137- socket.sslerror is now a subclass of socket.error . Also added
14138 socket.error to the socket module's C API.
14139
14140- Bug #920575: A problem where the _locale module segfaults on
14141 nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
14142
14143- array objects now support the copy module. Also, their resizing
14144 scheme has been updated to match that used for list objects. This improves
14145 the performance (speed and memory usage) of append() operations.
14146 Also, array.array() and array.extend() now accept any iterable argument
14147 for repeated appends without needing to create another temporary array.
14148
14149- cStringIO.writelines() now accepts any iterable argument and writes
14150 the lines one at a time rather than joining them and writing once.
14151 Made a parallel change to StringIO.writelines(). Saves memory and
14152 makes suitable for use with generator expressions.
14153
14154- time.strftime() now checks that the values in its time tuple argument
14155 are within the proper boundaries to prevent possible crashes from the
14156 platform's C library implementation of strftime(). Can possibly
14157 break code that uses values outside the range that didn't cause
14158 problems previously (such as sitting day of year to 0). Fixes bug
14159 #897625.
14160
14161- The socket module now supports Bluetooth sockets, if the
14162 system has <bluetooth/bluetooth.h>
14163
14164- Added a collections module containing a new datatype, deque(),
14165 offering high-performance, thread-safe, memory friendly appends
14166 and pops on either side of the deque.
14167
14168- Several modules now take advantage of collections.deque() for
14169 improved performance: Queue, mutex, shlex, threading, and pydoc.
14170
14171- The operator module has two new functions, attrgetter() and
14172 itemgetter() which are useful for creating fast data extractor
14173 functions for map(), list.sort(), itertools.groupby(), and
14174 other functions that expect a function argument.
14175
14176- socket.SHUT_{RD,WR,RDWR} was added.
14177
14178- os.getsid was added.
14179
14180- The pwd module incorrectly advertised its struct type as
14181 struct_pwent; this has been renamed to struct_passwd. (The old name
14182 is still supported for backwards compatibility.)
14183
14184- The xml.parsers.expat module now provides Expat 1.95.7.
14185
14186- socket.IPPROTO_IPV6 was added.
14187
14188- readline.clear_history was added.
14189
14190- select.select() now accepts sequences for its first three arguments.
14191
14192- cStringIO now supports the f.closed attribute.
14193
14194- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
14195
14196- curses module now supports use_default_colors(). [patch #739124]
14197
14198- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
14199
14200- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
14201
14202- Implemented non-recursive SRE matching scheme (#757624).
14203
14204- Implemented (?(id/name)yes|no) support in SRE (#572936).
14205
14206- random.seed() with no arguments or None uses time.time() as a default
14207 seed. Modified to match Py2.2 behavior and use fractional seconds so
14208 that successive runs are more likely to produce different sequences.
14209
14210- random.Random has a new method, getrandbits(k), which returns an int
14211 with k random bits. This method is now an optional part of the API
14212 for user defined generators. Any generator that defines genrandbits()
14213 can now use randrange() for ranges with a length >= 2**53. Formerly,
14214 randrange would return only even numbers for ranges that large (see
14215 SF bug #812202). Generators that do not define genrandbits() now
14216 issue a warning when randrange() is called with a range that large.
14217
14218- itertools has a new function, groupby() for aggregating iterables
14219 into groups sharing the same key (as determined by a key function).
14220 It offers some of functionality of SQL's groupby keyword and of
14221 the Unix uniq filter.
14222
14223- itertools now has a new tee() function which produces two independent
14224 iterators from a single iterable.
14225
14226- itertools.izip() with no arguments now returns an empty iterator instead
14227 of raising a TypeError exception.
14228
14229- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
14230 as parameter.
14231
14232Library
14233-------
14234
14235- Added a new module: cProfile, a C profiler with the same interface as the
14236 profile module. cProfile avoids some of the drawbacks of the hotshot
14237 profiler and provides a bit more information than the other two profilers.
14238 Based on "lsprof" (patch #1212837).
14239
14240- Bug #1266283: The new function "lexists" is now in os.path.__all__.
14241
14242- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
14243 the documented behavior: the function passed to the onerror()
14244 handler can now also be os.listdir.
14245
14246- Bug #754449: threading.Thread objects no longer mask exceptions raised during
14247 interpreter shutdown with another exception from attempting to handle the
14248 original exception.
14249
14250- Added decimal.py per PEP 327.
14251
14252- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
14253 "netloc" portion of a URL.
14254
14255- Bug #919012: shutil.move() will not try to move a directory into itself.
14256 Thanks Johannes Gijsbers.
14257
14258- Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
14259
14260- Bug #823209: cmath.log() now takes an optional base argument so that its
14261 API matches math.log().
14262
14263- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
14264 that generate a -debuginfo.rpm
14265
14266- os.path.devnull has been added for all supported platforms.
14267
14268- Fixed #877165: distutils now picks the right C++ compiler command
14269 on cygwin and mingw32.
14270
14271- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
14272
14273- refactored site.py into functions. Also wrote regression tests for the
14274 module.
14275
14276- The distutils install command now supports the --home option and
14277 installation scheme for all platforms.
14278
14279- asyncore.loop now has a repeat count parameter that defaults to
14280 looping forever.
14281
14282- The distutils sdist command now ignores all .svn directories, in
14283 addition to CVS and RCS directories. .svn directories hold
14284 administrative files for the Subversion source control system.
14285
14286- Added a new module: cookielib. Automatic cookie handling for HTTP
14287 clients. Also, support for cookielib has been added to urllib2, so
14288 urllib2.urlopen() can transparently handle cookies.
14289
14290- stringprep.py now uses built-in set() instead of sets.Set().
14291
14292- Bug #876278: Unbounded recursion in modulefinder
14293
14294- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
14295 Applications relying on the wrong order need to be corrected.
14296
14297- Bug #926075: Fixed a bug that returns a wrong pattern object
14298 for a string or unicode object in sre.compile() when a different
14299 type pattern with the same value exists.
14300
14301- Added countcallers arg to trace.Trace class (--trackcalls command line arg
14302 when run from the command prompt).
14303
14304- Fixed a caching bug in platform.platform() where the argument of 'terse' was
14305 not taken into consideration when caching value.
14306
14307- Added two new command-line arguments for profile (output file and
14308 default sort).
14309
14310- Added global runctx function to profile module
14311
14312- Add hlist missing entryconfigure and entrycget methods.
14313
14314- The ptcp154 codec was added for Kazakh character set support.
14315
14316- Support non-anonymous ftp URLs in urllib2.
14317
14318- The encodings package will now apply codec name aliases
14319 first before starting to try the import of the codec module.
14320 This simplifies overriding built-in codecs with external
14321 packages, e.g. the included CJK codecs with the JapaneseCodecs
14322 package, by adjusting the aliases dictionary in encodings.aliases
14323 accordingly.
14324
14325- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
14326 decoding standards.
14327
14328- urllib2 now supports processors. A processor is a handler that
14329 implements an xxx_request or xxx_response method. These methods are
14330 called for all requests.
14331
14332- distutils compilers now compile source files in the same order as
14333 they are passed to the compiler.
14334
14335- pprint.pprint() and pprint.pformat() now have additional parameters
14336 indent, width and depth.
14337
14338- Patch #750542: pprint now will pretty print subclasses of list, tuple
14339 and dict too, as long as they don't overwrite __repr__().
14340
14341- Bug #848614: distutils' msvccompiler fails to find the MSVC6
14342 compiler because of incomplete registry entries.
14343
14344- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
14345
14346- Patch #841977: modulefinder didn't find extension modules in packages
14347
14348- imaplib.IMAP4.thread was added.
14349
14350- Plugged a minor hole in tempfile.mktemp() due to the use of
14351 os.path.exists(), switched to using os.lstat() directly if possible.
14352
14353- bisect.py and heapq.py now have underlying C implementations
14354 for better performance.
14355
14356- heapq.py has two new functions, nsmallest() and nlargest().
14357
14358- traceback.format_exc has been added (similar to print_exc but it returns
14359 a string).
14360
14361- xmlrpclib.MultiCall has been added.
14362
14363- poplib.POP3_SSL has been added.
14364
14365- tmpfile.mkstemp now returns an absolute path even if dir is relative.
14366
14367- urlparse is RFC 2396 compliant.
14368
14369- The fieldnames argument to the csv module's DictReader constructor is now
14370 optional. If omitted, the first row of the file will be used as the
14371 list of fieldnames.
14372
14373- encodings.bz2_codec was added for access to bz2 compression
14374 using "a long string".encode('bz2')
14375
14376- Various improvements to unittest.py, realigned with PyUnit CVS.
14377
14378- dircache now passes exceptions to the caller, instead of returning
14379 empty lists.
14380
14381- The bsddb module and dbhash module now support the iterator and
14382 mapping protocols which make them more substitutable for dictionaries
14383 and shelves.
14384
14385- The csv module's DictReader and DictWriter classes now accept keyword
14386 arguments. This was an omission in the initial implementation.
14387
14388- The email package handles some RFC 2231 parameters with missing
14389 CHARSET fields better. It also includes a patch to parameter
14390 parsing when semicolons appear inside quotes.
14391
14392- sets.py now runs under Py2.2. In addition, the argument restrictions
14393 for most set methods (but not the operators) have been relaxed to
14394 allow any iterable.
14395
14396- _strptime.py now has a behind-the-scenes caching mechanism for the most
14397 recent TimeRE instance used along with the last five unique directive
14398 patterns. The overall module was also made more thread-safe.
14399
14400- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
14401 and removed in Py2.4.
14402
14403- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
14404
14405- Patch #873597: CJK codecs are imported into rank of default codecs.
14406
14407Tools/Demos
14408-----------
14409
14410- A hotshotmain script was added to the Tools/scripts directory that
14411 makes it easy to run a script under control of the hotshot profiler.
14412
14413- The db2pickle and pickle2db scripts can now dump/load gdbm files.
14414
14415- The file order on the command line of the pickle2db script was reversed.
14416 It is now [ picklefile ] dbfile. This provides better symmetry with
14417 db2pickle. The file arguments to both scripts are now source followed by
14418 destination in situations where both files are given.
14419
14420- The pydoc script will display a link to the module documentation for
14421 modules determined to be part of the core distribution. The documentation
14422 base directory defaults to http://www.python.org/doc/current/lib/ but can
14423 be changed by setting the PYTHONDOCS environment variable.
14424
14425- texcheck.py now detects double word errors.
14426
14427- md5sum.py mistakenly opened input files in text mode by default, a
14428 silent and dangerous change from previous releases. It once again
14429 opens input files in binary mode by default. The -t and -b flags
14430 remain for compatibility with the 2.3 release, but -b is the default
14431 now.
14432
14433- py-electric-colon now works when pending-delete/delete-selection mode is
14434 in effect
14435
14436- py-help-at-point is no longer bound to the F1 key - it's still bound to
14437 C-c C-h
14438
14439- Pynche was fixed to not crash when there is no ~/.pynche file and no
14440 -d option was given.
14441
14442Build
14443-----
14444
14445- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
14446 build under OS X.
14447
14448- Profiling using gprof is now available if Python is configured with
14449 --enable-profiling.
14450
14451- Profiling the VM using the Pentium TSC is now possible if Python
14452 is configured --with-tsc.
14453
14454- In order to find libraries, setup.py now also looks in /lib64, for use
14455 on AMD64.
14456
14457- Bug #934635: Fixed a bug where the configure script couldn't detect
14458 getaddrinfo() properly if the KAME stack had SCTP support.
14459
14460- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
14461 removed.
14462
14463- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
14464 supported (see PEP 11).
14465
14466- Universal newline support can no longer be disabled (see PEP 11).
14467
14468- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
14469
14470- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
14471 (see PEP 11).
14472
14473- Tests for sizeof(char) were removed since ANSI C mandates that
14474 sizeof(char) must be 1.
14475
14476C API
14477-----
14478
14479- Thanks to Anthony Tuininga, the datetime module now supplies a C API
14480 containing type-check macros and constructors. See new docs in the
14481 Python/C API Reference Manual for details.
14482
14483- Private function _PyTime_DoubleToTimet added, to convert a Python
14484 timestamp (C double) to platform time_t with some out-of-bounds
14485 checking. Declared in new header file timefuncs.h. It would be
14486 good to expose some other internal timemodule.c functions there.
14487
14488- New public functions PyEval_EvaluateFrame and PyGen_New to expose
14489 generator objects.
14490
14491- New public functions Py_IncRef() and Py_DecRef(), exposing the
14492 functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
14493 runtime dynamic embedding of Python. See patch #938302, by Bob
14494 Ippolito.
14495
14496- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
14497 underlying array of PyObject pointers. Useful for high speed looping.
14498
14499- Created a new method flag, METH_COEXIST, which causes a method to be loaded
14500 even if already defined by a slot wrapper. This allows a __contains__
14501 method, for example, to co-exist with a defined sq_contains slot. This
14502 is helpful because the PyCFunction can take advantage of optimized calls
14503 whenever METH_O or METH_NOARGS flags are defined.
14504
14505- Added a new function, PyDict_Contains(d, k) which is like
14506 PySequence_Contains() but is specific to dictionaries and executes
14507 about 10% faster.
14508
14509- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
14510 Each return the singleton they mention after Py_INCREF()ing them.
14511
14512- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
14513 variable length argument list of Python objects without having to invoke
14514 the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
14515 is equivalent to Py_BuildValue("(OOO)", a, b, c).
14516
14517Windows
14518-------
14519
14520- The _winreg module could segfault when reading very large registry
14521 values, due to unchecked alloca() calls (SF bug 851056). The fix is
14522 uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
14523 as appropriate, followed by a size check.
14524
14525- file.truncate() could misbehave if the file was open for update
14526 (modes r+, rb+, w+, wb+), and the most recent file operation before
14527 the truncate() call was an input operation. SF bug 801631.
14528
14529
14530What's New in Python 2.3 final?
14531===============================
14532
14533*Release date: 29-Jul-2003*
14534
14535IDLE
14536----
14537
14538- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
14539 This was unique to Windows, and was fixed by adding an -n switch to
14540 the command the Windows installer creates to execute "Edit with IDLE"
14541 context-menu actions.
14542
14543- IDLE displays a new message upon startup: some "personal firewall"
14544 kinds of programs (for example, ZoneAlarm) open a dialog of their
14545 own when any program opens a socket. IDLE does use sockets, talking
14546 on the computer's internal loopback interface. This connection is not
14547 visible on any external interface and no data is sent to or received
14548 from the Internet. So, if you get such a dialog when opening IDLE,
14549 asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
14550 and rest assured no communication external to your machine is taking
14551 place. If you don't allow it, IDLE won't be able to start.
14552
14553
14554What's New in Python 2.3 release candidate 2?
14555=============================================
14556
14557*Release date: 24-Jul-2003*
14558
14559Core and builtins
14560-----------------
14561
14562- It is now possible to import from zipfiles containing additional
14563 data bytes before the zip compatible archive. Zipfiles containing a
14564 comment at the end are still unsupported.
14565
14566Extension modules
14567-----------------
14568
14569- A longstanding bug in the parser module's initialization could cause
14570 fatal internal refcount confusion when the module got initialized more
14571 than once. This has been fixed.
14572
14573- Fixed memory leak in pyexpat; using the parser's ParseFile() method
14574 with open files that aren't instances of the standard file type
14575 caused an instance of the bound .read() method to be leaked on every
14576 call.
14577
14578- Fixed some leaks in the locale module.
14579
14580Library
14581-------
14582
14583- Lib/encodings/rot_13.py when used as a script, now more properly
14584 uses the first Python interpreter on your path.
14585
14586- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
14587 fix a locale related bug in the test suite. Although another patch
14588 was needed to actually fix the problem, the cache code was not
14589 restored.
14590
14591IDLE
14592----
14593
14594- Calltips patches.
14595
14596Build
14597-----
14598
14599- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
14600 on Panther (OSX 10.3).
14601
14602C API
14603-----
14604
14605Windows
14606-------
14607
14608- The tempfile module could do insane imports on Windows if PYTHONCASEOK
14609 was set, making temp file creation impossible. Repaired.
14610
14611- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
14612
14613Mac
14614---
14615
14616- Various fixes to pimp.
14617
14618- Scripts runs with pythonw no longer had full window manager access.
14619
14620- Don't force boot-disk-only install, for reasons unknown it causes
14621 more problems than it solves.
14622
14623
14624What's New in Python 2.3 release candidate 1?
14625=============================================
14626
14627*Release date: 18-Jul-2003*
14628
14629Core and builtins
14630-----------------
14631
14632- The new function sys.getcheckinterval() returns the last value set
14633 by sys.setcheckinterval().
14634
14635- Several bugs in the symbol table phase of the compiler have been
14636 fixed. Errors could be lost and compilation could fail without
14637 reporting an error. SF patch 763201.
14638
14639- The interpreter is now more robust about importing the warnings
14640 module. In an executable generated by freeze or similar programs,
14641 earlier versions of 2.3 would fail if the warnings module could
14642 not be found on the file system. Fixes SF bug 771097.
14643
14644- A warning about assignments to module attributes that shadow
14645 builtins, present in earlier releases of 2.3, has been removed.
14646
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014647- It is not possible to create subclasses of built-in types like str
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014648 and tuple that define an itemsize. Earlier releases of Python 2.3
14649 allowed this by mistake, leading to crashes and other problems.
14650
14651- The thread_id is now initialized to 0 in a non-thread build. SF bug
14652 770247.
14653
14654- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
14655
14656Extension modules
14657-----------------
14658
14659- weakref.proxy() can now handle "del obj[i]" for proxy objects
14660 defining __delitem__. Formerly, it generated a SystemError.
14661
14662- SSL no longer crashes the interpreter when the remote side disconnects.
14663
14664- On Unix the mmap module can again be used to map device files.
14665
14666- time.strptime now exclusively uses the Python implementation
14667 contained within the _strptime module.
14668
14669- The print slot of weakref proxy objects was removed, because it was
14670 not consistent with the object's repr slot.
14671
14672- The mmap module only checks file size for regular files, not
14673 character or block devices. SF patch 708374.
14674
14675- The cPickle Pickler garbage collection support was fixed to traverse
14676 the find_class attribute, if present.
14677
14678- There are several fixes for the bsddb3 wrapper module.
14679
14680 bsddb3 no longer crashes if an environment is closed before a cursor
14681 (SF bug 763298).
14682
14683 The DB and DBEnv set_get_returns_none function was extended to take
14684 a level instead of a boolean flag. The new level 2 means that in
14685 addition, cursor.set()/.get() methods return None instead of raising
14686 an exception.
14687
14688 A typo was fixed in DBCursor.join_item(), preventing a crash.
14689
14690Library
14691-------
14692
14693- distutils now supports MSVC 7.1
14694
14695- doctest now examines all docstrings by default. Previously, it would
14696 skip over functions with private names (as indicated by the underscore
14697 naming convention). The old default created too much of a risk that
14698 user tests were being skipped inadvertently. Note, this change could
14699 break code in the unlikely case that someone had intentionally put
14700 failing tests in the docstrings of private functions. The breakage
14701 is easily fixable by specifying the old behavior when calling testmod()
14702 or Tester().
14703
14704- There were several fixes to the way dumbdbms are closed. It's vital
14705 that a dumbdbm database be closed properly, else the on-disk data
14706 and directory files can be left in mutually inconsistent states.
14707 dumbdbm.py's _Database.__del__() method attempted to close the
14708 database properly, but a shutdown race in _Database._commit() could
14709 prevent this from working, so that a program trusting __del__() to
14710 get the on-disk files in synch could be badly surprised. The race
14711 has been repaired. A sync() method was also added so that shelve
14712 can guarantee data is written to disk.
14713
14714 The close() method can now be called more than once without complaint.
14715
14716- The classes in threading.py are now new-style classes. That they
14717 weren't before was an oversight.
14718
14719- The urllib2 digest authentication handlers now define the correct
14720 auth_header. The earlier versions would fail at runtime.
14721
14722- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
14723 when there are no lines.
14724
14725- SF bug 763637: fix exception in Tkinter with after_cancel
14726 which could occur with Tk 8.4
14727
14728- SF bug 770601: CGIHTTPServer.py now passes the entire environment
14729 to child processes.
14730
14731- SF bug 765238: add filter to fnmatch's __all__.
14732
14733- SF bug 748201: make time.strptime() error messages more helpful.
14734
14735- SF patch 764470: Do not dump the args attribute of a Fault object in
14736 xmlrpclib.
14737
14738- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
14739 responses.
14740
14741- SF patch 766650: The whichdb module was fixed to recognize dbm files
14742 generated by gdbm on OS/2 EMX.
14743
14744- SF bugs 763047 and 763052: fixes bug of timezone value being left as
14745 -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
14746 is true when it should only when time.daylight is true.
14747
14748- SF bug 764548: re now allows subclasses of str and unicode to be
14749 used as patterns.
14750
14751- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
14752 of varying sizes. Tk 8.4 returns a different number of values
14753 than Tk 8.3.
14754
14755- SF bug 763023: difflib.ratio() did not catch zero division.
14756
14757- The Queue module now has an __all__ attribute.
14758
14759Tools/Demos
14760-----------
14761
14762- See Lib/idlelib/NEWS.txt for IDLE news.
14763
14764- SF bug 753592: webchecker/wsgui now handles user supplied directories.
14765
14766- The trace.py script has been removed. It is now in the standard library.
14767
14768Build
14769-----
14770
14771- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
14772
14773- The socket module compiles on IRIX 6.5.10.
14774
14775- An irix64 system is treated the same way as an irix6 system (SF
14776 patch 764560).
14777
14778- Several definitions were missing on FreeBSD 5.x unless the
14779 __BSD_VISIBLE symbol was defined. configure now defines it as
14780 needed.
14781
14782C API
14783-----
14784
14785- Unicode objects now support mbcs as a built-in encoding, so the C
14786 API can use it without deferring to the encodings package.
14787
14788Windows
14789-------
14790
14791- The Windows implementation of PyThread_start_new_thread() never
14792 checked error returns from Windows functions correctly. As a result,
14793 it could claim to start a new thread even when the Microsoft
14794 _beginthread() function failed (due to "too many threads" -- this is
14795 on the order of thousands when it happens). In these cases, the
14796 Python exception ::
14797
14798 thread.error: can't start new thread
14799
14800 is raised now.
14801
14802- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
14803 use. The interpreter now calls WSACleanup() from Py_Finalize()
14804 instead of from DLL teardown.
14805
14806Mac
14807---
14808
14809- Bundlebuilder now inherits default values in the right way. It was
14810 previously possible for app bundles to get a type of "BNDL" instead
14811 of "APPL." Other improvements include, a --build-id option to
14812 specify the CFBundleIdentifier and using the --python option to set
14813 the executable in the bundle.
14814
14815- Fixed two bugs in MacOSX framework handling.
14816
14817- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
14818
14819- Python is now compiled with -mno-fused-madd, making all tests pass
14820 on Panther.
14821
14822What's New in Python 2.3 beta 2?
14823================================
14824
14825*Release date: 29-Jun-2003*
14826
14827Core and builtins
14828-----------------
14829
14830- A program can now set the environment variable PYTHONINSPECT to some
14831 string value in Python, and cause the interpreter to enter the
14832 interactive prompt at program exit, as if Python had been invoked
14833 with the -i option.
14834
14835- list.index() now accepts optional start and stop arguments. Similar
14836 changes were made to UserList.index(). SF feature request 754014.
14837
14838- SF patch 751998 fixes an unwanted side effect of the previous fix
14839 for SF bug 742860 (the next item).
14840
14841- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
14842 wasn't threadsafe, was very inefficient (expected time O(len(dict))
14843 instead of O(1)), and could raise a spurious RuntimeError if another
14844 thread mutated the dict during __delitem__, or if a comparison function
14845 mutated it. It also neglected to raise KeyError when the key wasn't
14846 present; didn't raise TypeError when the key wasn't of a weakly
14847 referencable type; and broke various more-or-less obscure dict
14848 invariants by using a sequence of equality comparisons over the whole
14849 set of dict keys instead of computing the key's hash code to narrow
14850 the search to those keys with the same hash code. All of these are
14851 considered to be bugs. A new implementation of __delitem__ repairs all
14852 that, but note that fixing these bugs may change visible behavior in
14853 code relying (whether intentionally or accidentally) on old behavior.
14854
14855- SF bug 734869: Fixed a compiler bug that caused a fatal error when
14856 compiling a list comprehension that contained another list comprehension
14857 embedded in a lambda expression.
14858
14859- SF bug 705231: builtin pow() no longer lets the platform C pow()
14860 raise -1.0 to integer powers, because (at least) glibc gets it wrong
14861 in some cases. The result should be -1.0 if the power is odd and 1.0
14862 if the power is even, and any float with a sufficiently large exponent
14863 is (mathematically) an exact even integer.
14864
14865- SF bug 759227: A new-style class that implements __nonzero__() must
14866 return a bool or int (but not an int subclass) from that method. This
14867 matches the restriction on classic classes.
14868
14869- The encoding attribute has been added for file objects, and set to
14870 the terminal encoding on Unix and Windows.
14871
14872- The softspace attribute of file objects became read-only by oversight.
14873 It's writable again.
14874
14875- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
14876 tuple. By default, the iterators now access data elements directly
14877 instead of going through __getitem__. If __getitem__ access is
14878 preferred, then __iter__ can be overridden.
14879
14880- SF bug 735247: The staticmethod and super types participate in
14881 garbage collection. Before this change, it was possible for leaks to
14882 occur in functions with non-global free variables that used these types.
14883
14884Extension modules
14885-----------------
14886
14887- the socket module has a new exception, socket.timeout, to allow
14888 timeouts to be handled separately from other socket errors.
14889
14890- SF bug 751276: cPickle has fixed to propagate exceptions raised in
14891 user code. In earlier versions, cPickle caught and ignored any
14892 exception when it performed operations that it expected to raise
14893 specific exceptions like AttributeError.
14894
14895- cPickle Pickler and Unpickler objects now participate in garbage
14896 collection.
14897
14898- mimetools.choose_boundary() could return duplicate strings at times,
14899 especially likely on Windows. The strings returned are now guaranteed
14900 unique within a single program run.
14901
14902- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
14903 dummy_thread has also been modified to try to simulate the behavior.
14904
14905- array.array.insert() now treats negative indices as being relative
14906 to the end of the array, just like list.insert() does. (SF bug #739313)
14907
14908- The datetime module classes datetime, time, and timedelta are now
14909 properly subclassable.
14910
14911- _tkinter.{get|set}busywaitinterval was added.
14912
14913- itertools.islice() now accepts stop=None as documented.
14914 Fixes SF bug #730685.
14915
14916- the bsddb185 module is built in one restricted instance -
14917 /usr/include/db.h exists and defines HASHVERSION to be 2. This is true
14918 for many BSD-derived systems.
14919
14920
14921Library
14922-------
14923
14924- Some happy doctest extensions from Jim Fulton have been added to
14925 doctest.py. These are already being used in Zope3. The two
14926 primary ones:
14927
14928 doctest.debug(module, name) extracts the doctests from the named object
14929 in the given module, puts them in a temp file, and starts pdb running
14930 on that file. This is great when a doctest fails.
14931
14932 doctest.DocTestSuite(module=None) returns a synthesized unittest
14933 TestSuite instance, to be run by the unittest framework, which
14934 runs all the doctests in the module. This allows writing tests in
14935 doctest style (which can be clearer and shorter than writing tests
14936 in unittest style), without losing unittest's powerful testing
14937 framework features (which doctest lacks).
14938
14939- For compatibility with doctests created before 2.3, if an expected
14940 output block consists solely of "1" and the actual output block
14941 consists solely of "True", it's accepted as a match; similarly
14942 for "0" and "False". This is quite un-doctest-like, but is practical.
14943 The behavior can be disabled by passing the new doctest module
14944 constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
14945 argument.
14946
14947- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
14948 a bare except caught to much and reported all errors as a problem
14949 in the archive.
14950
14951- The logging module now has a new function, makeLogRecord() making
14952 LogHandler easier to interact with DatagramHandler and SocketHandler.
14953
14954- The cgitb module has been extended to support plain text display (SF patch
14955 569574).
14956
14957- A brand new version of IDLE (from the IDLEfork project at
14958 SourceForge) is now included as Lib/idlelib. The old Tools/idle is
14959 no more.
14960
14961- Added a new module: trace (documentation missing). This module used
14962 to be distributed in Tools/scripts. It uses sys.settrace() to trace
14963 code execution -- either function calls or individual lines. It can
14964 generate tracing output during execution or a post-mortem report of
14965 code coverage.
14966
14967- The threading module has new functions settrace() and setprofile()
14968 that cooperate with the functions of the same name in the sys
14969 module. A function registered with the threading module will
14970 be used for all threads it creates. The new trace module uses this
14971 to provide tracing for code running in threads.
14972
14973- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
14974 Taschuk. Copying a new-style class that had a reference to itself
14975 didn't work. (The same thing worked fine for old-style classes.)
14976 Builtin functions are now treated as atomic, fixing bug #746304.
14977
14978- difflib.py has two new functions: context_diff() and unified_diff().
14979
14980- More fixes to urllib (SF 549151): (a) When redirecting, always use
14981 GET. This is common practice and more-or-less sanctioned by the
14982 HTTP standard. (b) Add a handler for 307 redirection, which becomes
14983 an error for POST, but a regular redirect for GET and HEAD
14984
14985- Added optional 'onerror' argument to os.walk(), to control error
14986 handling.
14987
14988- inspect.is{method|data}descriptor was added, to allow pydoc display
14989 __doc__ of data descriptors.
14990
14991- Fixed socket speed loss caused by use of the _socketobject wrapper class
14992 in socket.py.
14993
14994- timeit.py now checks the current directory for imports.
14995
14996- urllib2.py now knows how to order proxy classes, so the user doesn't
14997 have to insert it in front of other classes, nor do dirty tricks like
14998 inserting a "dummy" HTTPHandler after a ProxyHandler when building an
14999 opener with proxy support.
15000
15001- Iterators have been added for dbm keys.
15002
15003- random.Random objects can now be pickled.
15004
15005Tools/Demos
15006-----------
15007
15008- pydoc now offers help on keywords and topics.
15009
15010- Tools/idle is gone; long live Lib/idlelib.
15011
15012- diff.py prints file diffs in context, unified, or ndiff formats,
15013 providing a command line interface to difflib.py.
15014
15015- texcheck.py is a new script for making a rough validation of Python LaTeX
15016 files.
15017
15018Build
15019-----
15020
15021- Setting DESTDIR during 'make install' now allows specifying a
15022 different root directory.
15023
15024C API
15025-----
15026
15027- PyType_Ready(): If a type declares that it participates in gc
15028 (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
15029 tp_free slot is the default _PyObject_Del, and type does not define
15030 a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
15031 Previously _PyObject_Del was inherited, which could at best lead to a
15032 segfault. In addition, if even after this magic the type's tp_free
15033 slot is _PyObject_Del or NULL, and the type is a base type
15034 (Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
15035 type, its dealloc function must call type->tp_free, and since the type
15036 is gc'able, tp_free must not be NULL or _PyObject_Del.
15037
15038- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
15039 from C) to interrupt a thread by sending it an exception. It is
15040 intentional that you have to write your own C extension to call it
15041 from Python.
15042
15043
15044New platforms
15045-------------
15046
15047None this time.
15048
15049Tests
15050-----
15051
15052- test_imp rewritten so that it doesn't raise RuntimeError if run as a
15053 side effect of being imported ("import test.autotest").
15054
15055Windows
15056-------
15057
15058- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
15059
15060- The installer always suggested that Python be installed on the C:
15061 drive, due to a hardcoded "C:" generated by the Wise installation
15062 wizard. People with machines where C: is not the system drive
15063 usually want Python installed on whichever drive is their system drive
15064 instead. We removed the hardcoded "C:", and two testers on machines
15065 where C: is not the system drive report that the installer now
15066 suggests their system drive. Note that you can always select the
15067 directory you want in the "Select Destination Directory" dialog --
15068 that's what it's for.
15069
15070Mac
15071---
15072
15073- There's a new module called "autoGIL", which offers a mechanism to
15074 automatically release the Global Interpreter Lock when an event loop
15075 goes to sleep, allowing other threads to run. It's currently only
15076 supported on OSX, in the Mach-O version.
15077- The OSA modules now allow direct access to properties of the
15078 toplevel application class (in AppleScript terminology).
15079- The Package Manager can now update itself.
15080
15081SourceForge Bugs and Patches Applied
15082------------------------------------
15083
15084430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
15085598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
15086622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
15087661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
15088683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
15089697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
15090713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
15091724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
15092727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
15093729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
15094730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
15095731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
15096732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
15097733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
15098735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
15099740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
15100744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
15101745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
15102747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
15103749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
15104751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
15105753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
15106755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
15107757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
15108760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
15109
15110
15111What's New in Python 2.3 beta 1?
15112================================
15113
15114*Release date: 25-Apr-2003*
15115
15116Core and builtins
15117-----------------
15118
15119- New format codes B, H, I, k and K have been implemented for
15120 PyArg_ParseTuple and PyBuild_Value.
15121
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015122- New built-in function sum(seq, start=0) returns the sum of all the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015123 items in iterable object seq, plus start (items are normally numbers,
15124 and cannot be strings).
15125
15126- bool() called without arguments now returns False rather than
15127 raising an exception. This is consistent with calling the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015128 constructors for the other built-in types -- called without argument
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015129 they all return the false value of that type. (SF patch #724135)
15130
15131- In support of PEP 269 (making the pgen parser generator accessible
15132 from Python), some changes to the pgen code structure were made; a
15133 few files that used to be linked only with pgen are now linked with
15134 Python itself.
15135
15136- The repr() of a weakref object now shows the __name__ attribute of
15137 the referenced object, if it has one.
15138
15139- super() no longer ignores data descriptors, except __class__. See
15140 the thread started at
15141 http://mail.python.org/pipermail/python-dev/2003-April/034338.html
15142
15143- list.insert(i, x) now interprets negative i as it would be
15144 interpreted by slicing, so negative values count from the end of the
15145 list. This was the only place where such an interpretation was not
15146 placed on a list index.
15147
15148- range() now works even if the arguments are longs with magnitude
15149 larger than sys.maxint, as long as the total length of the sequence
15150 fits. E.g., range(2**100, 2**101, 2**100) is the following list:
15151 [1267650600228229401496703205376L]. (SF patch #707427.)
15152
15153- Some horridly obscure problems were fixed involving interaction
15154 between garbage collection and old-style classes with "ambitious"
15155 getattr hooks. If an old-style instance didn't have a __del__ method,
15156 but did have a __getattr__ hook, and the instance became reachable
15157 only from an unreachable cycle, and the hook resurrected or deleted
15158 unreachable objects when asked to resolve "__del__", anything up to
15159 a segfault could happen. That's been repaired.
15160
15161- dict.pop now takes an optional argument specifying a default
15162 value to return if the key is not in the dict. If a default is not
15163 given and the key is not found, a KeyError will still be raised.
15164 Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
15165 [SF patch #693753] (contributed by Michael Stone.)
15166
15167- sys.getfilesystemencoding() was added to expose
15168 Py_FileSystemDefaultEncoding.
15169
15170- New function sys.exc_clear() clears the current exception. This is
15171 rarely needed, but can sometimes be useful to release objects
15172 referenced by the traceback held in sys.exc_info()[2]. (SF patch
15173 #693195.)
15174
15175- On 64-bit systems, a dictionary could contain duplicate long/int keys
15176 if the key value was larger than 2**32. See SF bug #689659.
15177
15178- Fixed SF bug #663074. The codec system was using global static
15179 variables to store internal data. As a result, any attempts to use the
15180 unicode system with multiple active interpreters, or successive
15181 interpreter executions, would fail.
15182
15183- "%c" % u"a" now returns a unicode string instead of raising a
15184 TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
15185 of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
15186
15187Extension modules
15188-----------------
15189
15190- The socket module now provides the functions inet_pton and inet_ntop
15191 for converting between string and packed representation of IP
15192 addresses. There is also a new module variable, has_ipv6, which is
15193 True iff the current Python has IPv6 support. See SF patch #658327.
15194
15195- Tkinter wrappers around Tcl variables now pass objects directly
15196 to Tcl, instead of first converting them to strings.
15197
15198- The .*? pattern in the re module is now special-cased to avoid the
15199 recursion limit. (SF patch #720991 -- many thanks to Gary Herron
15200 and Greg Chapman.)
15201
15202- New function sys.call_tracing() allows pdb to debug code
15203 recursively.
15204
15205- New function gc.get_referents(obj) returns a list of objects
15206 directly referenced by obj. In effect, it exposes what the object's
15207 tp_traverse slot does, and can be helpful when debugging memory
15208 leaks.
15209
15210- The iconv module has been removed from this release.
15211
15212- The platform-independent routines for packing floats in IEEE formats
15213 (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
15214 pickling of floats) ignored that rounding can cause a carry to
15215 propagate. The worst consequence was that, in rare cases, <f and >f
15216 could produce strings that, when unpacked again, were a factor of 2
15217 away from the original float. This has been fixed. See SF bug
15218 #705836.
15219
15220- New function time.tzset() provides access to the C library tzset()
15221 function, if supported. (SF patch #675422.)
15222
15223- Using createfilehandler, deletefilehandler, createtimerhandler functions
15224 on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
15225 See SF bug #692416.
15226
15227- Modified the fcntl.ioctl() function to allow modification of a passed
15228 mutable buffer (for details see the reference documentation).
15229
15230- Made user requested changes to the itertools module.
15231 Subsumed the times() function into repeat().
15232 Added chain() and cycle().
15233
15234- The rotor module is now deprecated; the encryption algorithm it uses
15235 is not believed to be secure, and including crypto code with Python
15236 has implications for exporting and importing it in various countries.
15237
15238- The socket module now always uses the _socketobject wrapper class, even on
15239 platforms which have dup(2). The makefile() method is built directly
15240 on top of the socket without duplicating the file descriptor, allowing
15241 timeouts to work properly.
15242
15243Library
15244-------
15245
15246- New generator function os.walk() is an easy-to-use alternative to
15247 os.path.walk(). See os module docs for details. os.path.walk()
15248 isn't deprecated at this time, but may become deprecated in a
15249 future release.
15250
15251- Added new module "platform" which provides a wide range of tools
15252 for querying platform dependent features.
15253
15254- netrc now allows ASCII punctuation characters in passwords.
15255
15256- shelve now supports the optional writeback argument, and exposes
15257 pickle protocol versions.
15258
15259- Several methods of nntplib.NNTP have grown an optional file argument
15260 which specifies a file where to divert the command's output
15261 (already supported by the body() method). (SF patch #720468)
15262
15263- The self-documenting XML server library DocXMLRPCServer was added.
15264
15265- Support for internationalized domain names has been added through
15266 the 'idna' and 'punycode' encodings, the 'stringprep' module, the
15267 'mkstringprep' tool, and enhancements to the socket and httplib
15268 modules.
15269
15270- htmlentitydefs has two new dictionaries: name2codepoint maps
15271 HTML entity names to Unicode codepoints (as integers).
15272 codepoint2name is the reverse mapping. See SF patch #722017.
15273
15274- pdb has a new command, "debug", which lets you step through
15275 arbitrary code from the debugger's (pdb) prompt.
15276
15277- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
15278 return 'not a == b' rather than 'a != b'. This gives the desired
15279 result for classes that define __eq__ without defining __ne__.
15280
15281- sgmllib now supports SGML marked sections, in particular the
15282 MS Office extensions.
15283
15284- The urllib module now offers support for the iterator protocol.
15285 SF patch 698520 contributed by Brett Cannon.
15286
15287- New module timeit provides a simple framework for timing the
15288 execution speed of expressions and statements.
15289
15290- sets.Set objects now support mixed-type __eq__ and __ne__, instead
15291 of raising TypeError. If x is a Set object and y is a non-Set object,
15292 x == y is False, and x != y is True. This is akin to the change made
15293 for mixed-type comparisons of datetime objects in 2.3a2; more info
15294 about the rationale is in the NEWS entry for that. See also SF bug
15295 report <http://www.python.org/sf/693121>.
15296
15297- On Unix platforms, if os.listdir() is called with a Unicode argument,
15298 it now returns Unicode strings. (This behavior was added earlier
15299 to the Windows NT/2k/XP version of os.listdir().)
15300
15301- Distutils: both 'py_modules' and 'packages' keywords can now be specified
15302 in core.setup(). Previously you could supply one or the other, but
15303 not both of them. (SF patch #695090 from Bernhard Herzog)
15304
15305- New csv package makes it easy to read/write CSV files.
15306
15307- Module shlex has been extended to allow posix-like shell parsings,
15308 including a split() function for easy spliting of quoted strings and
15309 commands. An iterator interface was also implemented.
15310
15311Tools/Demos
15312-----------
15313
15314- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
15315 See the module docstring for details.
15316
15317Build
15318-----
15319
15320- Fix problem building on OSF1 because the compiler only accepted
15321 preprocessor directives that start in column 1. (SF bug #691793.)
15322
15323C API
15324-----
15325
15326- Added PyGC_Collect(), equivalent to calling gc.collect().
15327
15328- PyThreadState_GetDict() was changed not to raise an exception or
15329 issue a fatal error when no current thread state is available. This
15330 makes it possible to print dictionaries when no thread is active.
15331
15332- LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
15333 need compatibility with previous versions can use this:
15334
15335 #ifndef PY_LONG_LONG
15336 #define PY_LONG_LONG LONG_LONG
15337 #endif
15338
15339- Added PyObject_SelfIter() to fill the tp_iter slot for the
15340 typical case where the method returns its self argument.
15341
15342- The extended type structure used for heap types (new-style
15343 classes defined by Python code using a class statement) is now
15344 exported from object.h as PyHeapTypeObject. (SF patch #696193.)
15345
15346New platforms
15347-------------
15348
15349None this time.
15350
15351Tests
15352-----
15353
15354- test_timeout now requires -u network to be passed to regrtest to run.
15355 See SF bug #692988.
15356
15357Windows
15358-------
15359
15360- os.fsync() now exists on Windows, and calls the Microsoft _commit()
15361 function.
15362
15363- New function winsound.MessageBeep() wraps the Win32 API
15364 MessageBeep().
15365
15366Mac
15367---
15368
15369- os.listdir() now returns Unicode strings on MacOS X when called with
15370 a Unicode argument. See the general news item under "Library".
15371
15372- A new method MacOS.WMAvailable() returns true if it is safe to access
15373 the window manager, false otherwise.
15374
15375- EasyDialogs dialogs are now movable-modal, and if the application is
15376 currently in the background they will ask to be moved to the foreground
15377 before displaying.
15378
15379- OSA Scripting support has improved a lot, and gensuitemodule.py can now
15380 be used by mere mortals. The documentation is now also more or less
15381 complete.
15382
15383- The IDE (in a framework build) now includes introductory documentation
15384 in Apple Help Viewer format.
15385
15386
15387What's New in Python 2.3 alpha 2?
15388=================================
15389
15390*Release date: 19-Feb-2003*
15391
15392Core and builtins
15393-----------------
15394
15395- Negative positions returned from PEP 293 error callbacks are now
15396 treated as being relative to the end of the input string. Positions
15397 that are out of bounds raise an IndexError.
15398
15399- sys.path[0] (the directory from which the script is loaded) is now
15400 turned into an absolute pathname, unless it is the empty string.
15401 (SF patch #664376.)
15402
15403- Finally fixed the bug in compile() and exec where a string ending
15404 with an indented code block but no newline would raise SyntaxError.
15405 This would have been a four-line change in parsetok.c... Except
15406 codeop.py depends on this behavior, so a compilation flag had to be
15407 invented that causes the tokenizer to revert to the old behavior;
15408 this required extra changes to 2 .h files, 2 .c files, and 2 .py
15409 files. (Fixes SF bug #501622.)
15410
15411- If a new-style class defines neither __new__ nor __init__, its
15412 constructor would ignore all arguments. This is changed now: the
15413 constructor refuses arguments in this case. This might break code
15414 that worked under Python 2.2. The simplest fix is to add a no-op
15415 __init__: ``def __init__(self, *args, **kw): pass``.
15416
15417- Through a bytecode optimizer bug (and I bet you didn't even know
15418 Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
15419 with a leading minus sign would come out with the wrong sign.
15420 ("Unsigned" hex/oct constants are those with a face value in the
15421 range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
15422 always been interpreted as negative numbers through sign folding.)
15423 E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
15424 come out as -4294967295. This was the case in Python 2.2 through
15425 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
15426 value, but according to PEP 237 it really needs to be 1 now. This
15427 will be backported to Python 2.2.3 a well. (SF #660455)
15428
15429- int(s, base) sometimes sign-folds hex and oct constants; it only
15430 does this when base is 0 and s.strip() starts with a '0'. When the
15431 sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
15432 machine, which returns -1, a FutureWarning is now issued; in Python
15433 2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
15434 int("0xffffffff", 16) right now. (PEP 347)
15435
15436- super(X, x): x may now be a proxy for an X instance, i.e.
15437 issubclass(x.__class__, X) but not issubclass(type(x), X).
15438
15439- isinstance(x, X): if X is a new-style class, this is now equivalent
15440 to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
15441 only type(x) was tested. (For classic classes this was already the
15442 case.)
15443
15444- compile(), eval() and the exec statement now fully support source code
15445 passed as unicode strings.
15446
15447- int subclasses can be initialized with longs if the value fits in an int.
15448 See SF bug #683467.
15449
15450- long(string, base) takes time linear in len(string) when base is a power
15451 of 2 now. It used to take time quadratic in len(string).
15452
15453- filter returns now Unicode results for Unicode arguments.
15454
15455- raw_input can now return Unicode objects.
15456
15457- List objects' sort() method now accepts None as the comparison function.
15458 Passing None is semantically identical to calling sort() with no
15459 arguments.
15460
15461- Fixed crash when printing a subclass of str and __str__ returned self.
15462 See SF bug #667147.
15463
15464- Fixed an invalid RuntimeWarning and an undetected error when trying
15465 to convert a long integer into a float which couldn't fit.
15466 See SF bug #676155.
15467
15468- Function objects now have a __module__ attribute that is bound to
15469 the name of the module in which the function was defined. This
15470 applies for C functions and methods as well as functions and methods
15471 defined in Python. This attribute is used by pickle.whichmodule(),
15472 which changes the behavior of whichmodule slightly. In Python 2.2
15473 whichmodule() returns "__main__" for functions that are not defined
15474 at the top-level of a module (examples: methods, nested functions).
15475 Now whichmodule() will return the proper module name.
15476
15477Extension modules
15478-----------------
15479
15480- operator.isNumberType() now checks that the object has a nb_int or
15481 nb_float slot, rather than simply checking whether it has a non-NULL
15482 tp_as_number pointer.
15483
15484- The imp module now has ways to acquire and release the "import
15485 lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
15486 reentrant lock, so releasing the lock only truly releases it when
15487 this is the last release_lock() call. You can check with
15488 imp.lock_held(). (SF bug #580952 and patch #683257.)
15489
15490- Change to cPickle to match pickle.py (see below and PEP 307).
15491
15492- Fix some bugs in the parser module. SF bug #678518.
15493
15494- Thanks to Scott David Daniels, a subtle bug in how the zlib
15495 extension implemented flush() was fixed. Scott also rewrote the
15496 zlib test suite using the unittest module. (SF bug #640230 and
15497 patch #678531.)
15498
15499- Added an itertools module containing high speed, memory efficient
15500 looping constructs inspired by tools from Haskell and SML.
15501
15502- The SSL module now handles sockets with a timeout set correctly (SF
15503 patch #675750, fixing SF bug #675552).
15504
15505- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
15506
15507- Fixed broken threadstate swap in readline that could cause fatal
15508 errors when a readline hook was being invoked while a background
15509 thread was active. (SF bugs #660476 and #513033.)
15510
15511- fcntl now exposes the strops.h I_* constants.
15512
15513- Fix a crash on Solaris that occurred when calling close() on
15514 an mmap'ed file which was already closed. (SF patch #665913)
15515
15516- Fixed several serious bugs in the zipimport implementation.
15517
15518- datetime changes:
15519
15520 The date class is now properly subclassable. (SF bug #720908)
15521
15522 The datetime and datetimetz classes have been collapsed into a single
15523 datetime class, and likewise the time and timetz classes into a single
15524 time class. Previously, a datetimetz object with tzinfo=None acted
15525 exactly like a datetime object, and similarly for timetz. This wasn't
15526 enough of a difference to justify distinct classes, and life is simpler
15527 now.
15528
15529 today() and now() now round system timestamps to the closest
15530 microsecond <http://www.python.org/sf/661086>. This repairs an
15531 irritation most likely seen on Windows systems.
15532
15533 In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
15534 ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
15535 as 0 instead, but a tzinfo subclass wishing to participate in
15536 time zone conversion has to take a stand on whether it supports
15537 DST; if you don't care about DST, then code dst() to return 0 minutes,
15538 meaning that DST is never in effect).
15539
15540 The tzinfo methods utcoffset() and dst() must return a timedelta object
15541 (or None) now. In 2.3a1 they could also return an int or long, but that
15542 was an unhelpfully redundant leftover from an earlier version wherein
15543 they couldn't return a timedelta. TOOWTDI.
15544
15545 The example tzinfo class for local time had a bug. It was replaced
15546 by a later example coded by Guido.
15547
15548 datetime.astimezone(tz) no longer raises an exception when the
15549 input datetime has no UTC equivalent in tz. For typical "hybrid" time
15550 zones (a single tzinfo subclass modeling both standard and daylight
15551 time), this case can arise one hour per year, at the hour daylight time
15552 ends. See new docs for details. In short, the new behavior mimics
15553 the local wall clock's behavior of repeating an hour in local time.
15554
15555 dt.astimezone() can no longer be used to convert between naive and aware
15556 datetime objects. If you merely want to attach, or remove, a tzinfo
15557 object, without any conversion of date and time members, use
15558 dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
15559 tzinfo subclass instance.
15560
15561 A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
15562 to give complete control over how a UTC time is to be converted to
15563 a local time. The default astimezone() implementation calls fromutc()
15564 as its last step, so a tzinfo subclass can affect that too by overriding
15565 fromutc(). It's expected that the default fromutc() implementation will
15566 be suitable as-is for "almost all" time zone subclasses, but the
15567 creativity of political time zone fiddling appears unbounded -- fromutc()
15568 allows the highly motivated to emulate any scheme expressible in Python.
15569
15570 datetime.now(): The optional tzinfo argument was undocumented (that's
15571 repaired), and its name was changed to tz ("tzinfo" is overloaded enough
15572 already). With a tz argument, now(tz) used to return the local date
15573 and time, and attach tz to it, without any conversion of date and time
15574 members. This was less than useful. Now now(tz) returns the current
15575 date and time as local time in tz's time zone, akin to ::
15576
15577 tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
15578
15579 where "utc" is an instance of a tzinfo subclass modeling UTC. Without
15580 a tz argument, now() continues to return the current local date and time,
15581 as a naive datetime object.
15582
15583 datetime.fromtimestamp(): Like datetime.now() above, this had less than
15584 useful behavior when the optional tinzo argument was specified. See
15585 also SF bug report <http://www.python.org/sf/660872>.
15586
15587 date and datetime comparison: In order to prevent comparison from
15588 falling back to the default compare-object-addresses strategy, these
15589 raised TypeError whenever they didn't understand the other object type.
15590 They still do, except when the other object has a "timetuple" attribute,
15591 in which case they return NotImplemented now. This gives other
15592 datetime objects (e.g., mxDateTime) a chance to intercept the
15593 comparison.
15594
15595 date, time, datetime and timedelta comparison: When the exception
15596 for mixed-type comparisons in the last paragraph doesn't apply, if
15597 the comparison is == then False is returned, and if the comparison is
15598 != then True is returned. Because dict lookup and the "in" operator
15599 only invoke __eq__, this allows, for example, ::
15600
15601 if some_datetime in some_sequence:
15602
15603 and ::
15604
15605 some_dict[some_timedelta] = whatever
15606
15607 to work as expected, without raising TypeError just because the
15608 sequence is heterogeneous, or the dict has mixed-type keys. [This
15609 seems like a good idea to implement for all mixed-type comparisons
15610 that don't want to allow falling back to address comparison.]
15611
15612 The constructors building a datetime from a timestamp could raise
15613 ValueError if the platform C localtime()/gmtime() inserted "leap
15614 seconds". Leap seconds are ignored now. On such platforms, it's
15615 possible to have timestamps that differ by a second, yet where
15616 datetimes constructed from them are equal.
15617
15618 The pickle format of date, time and datetime objects has changed
15619 completely. The undocumented pickler and unpickler functions no
15620 longer exist. The undocumented __setstate__() and __getstate__()
15621 methods no longer exist either.
15622
15623Library
15624-------
15625
15626- The logging module was updated slightly; the WARN level was renamed
15627 to WARNING, and the matching function/method warn() to warning().
15628
15629- The pickle and cPickle modules were updated with a new pickling
15630 protocol (documented by pickletools.py, see below) and several
15631 extensions to the pickle customization API (__reduce__, __setstate__
15632 etc.). The copy module now uses more of the pickle customization
15633 API to copy objects that don't implement __copy__ or __deepcopy__.
15634 See PEP 307 for details.
15635
15636- The distutils "register" command now uses http://www.python.org/pypi
15637 as the default repository. (See PEP 301.)
15638
Skip Montanaro7a98be22007-08-16 14:35:24 +000015639- the platform dependent path related variables sep, altsep,
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015640 pathsep, curdir, pardir and defpath are now defined in the platform
15641 dependent path modules (e.g. ntpath.py) rather than os.py, so these
15642 variables are now available via os.path. They continue to be
15643 available from the os module.
15644 (see <http://www.python.org/sf/680789>).
15645
15646- array.array was added to the types repr.py knows about (see
15647 <http://www.python.org/sf/680789>).
15648
15649- The new pickletools.py contains lots of documentation about pickle
15650 internals, and supplies some helpers for working with pickles, such as
15651 a symbolic pickle disassembler.
15652
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015653- xmlrpclib.py now supports the built-in boolean type.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015654
15655- py_compile has a new 'doraise' flag and a new PyCompileError
15656 exception.
15657
15658- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
15659 class.
15660
15661- The sets module now raises TypeError in __cmp__, to clarify that
15662 sets are not intended to be three-way-compared; the comparison
15663 operators are overloaded as subset/superset tests.
15664
15665- Bastion.py and rexec.py are disabled. These modules are not safe in
15666 Python 2.2. or 2.3.
15667
15668- realpath is now exported when doing ``from poxixpath import *``.
15669 It is also exported for ntpath, macpath, and os2emxpath.
15670 See SF bug #659228.
15671
15672- New module tarfile from Lars Gustäbel provides a comprehensive interface
15673 to tar archive files with transparent gzip and bzip2 compression.
15674 See SF patch #651082.
15675
15676- urlparse can now parse imap:// URLs. See SF feature request #618024.
15677
15678- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
15679 the gain value which is passed to Tk. SF bug# 602259.
15680
15681- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
15682 See SF patch #642974.
15683
15684- The dospath module was deleted. Use the ntpath module when manipulating
15685 DOS paths from other platforms.
15686
15687Tools/Demos
15688-----------
15689
15690- Two new scripts (db2pickle.py and pickle2db.py) were added to the
15691 Tools/scripts directory to facilitate conversion from the old bsddb module
15692 to the new one. While the user-visible API of the new module is
15693 compatible with the old one, it's likely that the version of the
15694 underlying database library has changed. To convert from the old library,
15695 run the db2pickle.py script using the old version of Python to convert it
15696 to a pickle file. After upgrading Python, run the pickle2db.py script
15697 using the new version of Python to reconstitute your database. For
15698 example:
15699
15700 % python2.2 db2pickle.py -h some.db > some.pickle
15701 % python2.3 pickle2db.py -h some.db.new < some.pickle
15702
15703 Run the scripts without any args to get a usage message.
15704
15705
15706Build
15707-----
15708
15709- The audio driver tests (test_ossaudiodev.py and
15710 test_linuxaudiodev.py) are no longer run by default. This is
15711 because they don't always work, depending on your hardware and
15712 software. To run these tests, you must use an invocation like ::
15713
15714 ./python Lib/test/regrtest.py -u audio test_ossaudiodev
15715
15716- On systems which build using the configure script, compiler flags which
15717 used to be lumped together using the OPT flag have been split into two
15718 groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
15719 debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
15720 compiler flags that are required to get a clean compile. On some
15721 platforms (many Linux flavors in particular) BASECFLAGS will be empty by
15722 default. On others, such as Mac OS X and SCO, it will contain required
15723 flags. This change allows people building Python to override OPT without
15724 fear of clobbering compiler flags which are required to get a clean build.
15725
15726- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
15727 relevant search lists in setup.py. This allows users building Python to
15728 take advantage of the many packages available from the fink project
15729 <http://fink.sf.net/>.
15730
15731- A new Makefile target, scriptsinstall, installs a number of useful scripts
15732 from the Tools/scripts directory.
15733
15734C API
15735-----
15736
15737- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
15738 instead of a plain ``PyObject *``. (SF patch #686601.)
15739
15740- PyNumber_Check() now checks that the object has a nb_int or nb_float
15741 slot, rather than simply checking whether it has a non-NULL
15742 tp_as_number pointer.
15743
15744- A C type that inherits from a base type that defines tp_as_buffer
15745 will now inherit the tp_as_buffer pointer if it doesn't define one.
15746 (SF #681367)
15747
15748- The PyArg_Parse functions now issue a DeprecationWarning if a float
15749 argument is provided when an integer is specified (this affects the 'b',
15750 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
15751 raise a TypeError.
15752
15753Tests
15754-----
15755
15756- Several tests weren't being run from regrtest.py (test_timeout.py,
15757 test_tarfile.py, test_netrc.py, test_multifile.py,
15758 test_importhooks.py and test_imp.py). Now they are. (Note to
15759 developers: please read Lib/test/README when creating a new test, to
15760 make sure to do it right! All tests need to use either unittest or
15761 pydoc.)
15762
15763- Added test_posix.py, a test suite for the posix module.
15764
15765- Added test_hexoct.py, a test suite for hex/oct constant folding.
15766
15767Windows
15768-------
15769
15770- The timeout code for socket connect() didn't work right; this has
15771 now been fixed. test_timeout.py should pass (at least most of the
15772 time).
15773
15774- distutils' msvccompiler class now passes the preprocessor options to
15775 the resource compiler. See SF patch #669198.
15776
15777- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
15778 release without strong cryptography.
15779
15780- sys.path[0], if it contains a directory name, is now always an
15781 absolute pathname. (SF patch #664376.)
15782
15783- The new logging package is now installed by the Windows installer. It
15784 wasn't in 2.3a1 due to oversight.
15785
15786Mac
15787---
15788
15789- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
15790 and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
15791
15792- Most of the standard library now uses pathnames or FSRefs in preference
15793 of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
15794 in stead of macfs. macfs will probably be deprecated in the future.
15795
15796- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
15797 This also makes macfs.FSSpec.SetDates() work again.
15798
15799- There is a new module pimp, the package install manager for Python, and
15800 accompanying applet PackageManager. These allow you to easily download
15801 and install pretested extension packages either in source or binary
15802 form. Only in MacPython-OSX.
15803
15804- Applets are now built with bundlebuilder in MacPython-OSX, which should make
15805 them more robust and also provides a path towards BuildApplication. The
15806 downside of this change is that applets can no longer be run from the
15807 Terminal window, this will hopefully be fixed in the 2.3b1.
15808
15809
15810What's New in Python 2.3 alpha 1?
15811=================================
15812
15813*Release date: 31-Dec-2002*
15814
15815Type/class unification and new-style classes
15816--------------------------------------------
15817
15818- One can now assign to __bases__ and __name__ of new-style classes.
15819
15820- dict() now accepts keyword arguments so that dict(one=1, two=2)
15821 is the equivalent of {"one": 1, "two": 2}. Accordingly,
15822 the existing (but undocumented) 'items' keyword argument has
15823 been eliminated. This means that dict(items=someMapping) now has
15824 a different meaning than before.
15825
15826- int() now returns a long object if the argument is outside the
15827 integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
15828 all return long objects instead of raising an OverflowError.
15829
15830- Assignment to __class__ is disallowed if either the old or the new
15831 class is a statically allocated type object (such as defined by an
15832 extension module). This prevents anomalies like 2.__class__ = bool.
15833
15834- New-style object creation and deallocation have been sped up
15835 significantly; they are now faster than classic instance creation
15836 and deallocation.
15837
15838- The __slots__ variable can now mention "private" names, and the
15839 right thing will happen (e.g. __slots__ = ["__foo"]).
15840
15841- The built-ins slice() and buffer() are now callable types. The
15842 types classobj (formerly class), code, function, instance, and
15843 instancemethod (formerly instance-method), which have no built-in
15844 names but are accessible through the types module, are now also
15845 callable. The type dict-proxy is renamed to dictproxy.
15846
15847- Cycles going through the __class__ link of a new-style instance are
15848 now detected by the garbage collector.
15849
15850- Classes using __slots__ are now properly garbage collected.
15851 [SF bug 519621]
15852
15853- Tightened the __slots__ rules: a slot name must be a valid Python
15854 identifier.
15855
15856- The constructor for the module type now requires a name argument and
15857 takes an optional docstring argument. Previously, this constructor
15858 ignored its arguments. As a consequence, deriving a class from a
15859 module (not from the module type) is now illegal; previously this
15860 created an unnamed module, just like invoking the module type did.
15861 [SF bug 563060]
15862
15863- A new type object, 'basestring', is added. This is a common base type
15864 for 'str' and 'unicode', and can be used instead of
15865 types.StringTypes, e.g. to test whether something is "a string":
15866 isinstance(x, basestring) is True for Unicode and 8-bit strings. This
15867 is an abstract base class and cannot be instantiated directly.
15868
15869- Changed new-style class instantiation so that when C's __new__
15870 method returns something that's not a C instance, its __init__ is
15871 not called. [SF bug #537450]
15872
15873- Fixed super() to work correctly with class methods. [SF bug #535444]
15874
15875- If you try to pickle an instance of a class that has __slots__ but
15876 doesn't define or override __getstate__, a TypeError is now raised.
15877 This is done by adding a bozo __getstate__ to the class that always
15878 raises TypeError. (Before, this would appear to be pickled, but the
15879 state of the slots would be lost.)
15880
15881Core and builtins
15882-----------------
15883
15884- Import from zipfiles is now supported. The name of a zipfile placed
15885 on sys.path causes the import statement to look for importable Python
15886 modules (with .py, pyc and .pyo extensions) and packages inside the
15887 zipfile. The zipfile import follows the specification (though not
15888 the sample implementation) of PEP 273. The semantics of __path__ are
15889 compatible with those that have been implemented in Jython since
15890 Jython 2.1.
15891
15892- PEP 302 has been accepted. Although it was initially developed to
15893 support zipimport, it offers a new, general import hook mechanism.
15894 Several new variables have been added to the sys module:
15895 sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
15896 make extending the import statement much more convenient than
15897 overriding the __import__ built-in function. For a description of
15898 these, see PEP 302.
15899
15900- A frame object's f_lineno attribute can now be written to from a
15901 trace function to change which line will execute next. A command to
15902 exploit this from pdb has been added. [SF patch #643835]
15903
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015904- The _codecs support module for codecs.py was turned into a built-in
15905 module to assure that at least the built-in codecs are available
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015906 to the Python parser for source code decoding according to PEP 263.
15907
15908- issubclass now supports a tuple as the second argument, just like
15909 isinstance does. ``issubclass(X, (A, B))`` is equivalent to
15910 ``issubclass(X, A) or issubclass(X, B)``.
15911
15912- Thanks to Armin Rigo, the last known way to provoke a system crash
15913 by cleverly arranging for a comparison function to mutate a list
15914 during a list.sort() operation has been fixed. The effect of
15915 attempting to mutate a list, or even to inspect its contents or
15916 length, while a sort is in progress, is not defined by the language.
15917 The C implementation of Python 2.3 attempts to detect mutations,
15918 and raise ValueError if one occurs, but there's no guarantee that
15919 all mutations will be caught, or that any will be caught across
15920 releases or implementations.
15921
15922- Unicode file name processing for Windows (PEP 277) is implemented.
15923 All platforms now have an os.path.supports_unicode_filenames attribute,
15924 which is set to True on Windows NT/2000/XP, and False elsewhere.
15925
15926- Codec error handling callbacks (PEP 293) are implemented.
15927 Error handling in unicode.encode or str.decode can now be customized.
15928
15929- A subtle change to the semantics of the built-in function intern():
15930 interned strings are no longer immortal. You must keep a reference
15931 to the return value intern() around to get the benefit.
15932
15933- Use of 'None' as a variable, argument or attribute name now
15934 issues a SyntaxWarning. In the future, None may become a keyword.
15935
15936- SET_LINENO is gone. co_lnotab is now consulted to determine when to
15937 call the trace function. C code that accessed f_lineno should call
15938 PyCode_Addr2Line instead (f_lineno is still there, but only kept up
15939 to date when there is a trace function set).
15940
15941- There's a new warning category, FutureWarning. This is used to warn
15942 about a number of situations where the value or sign of an integer
15943 result will change in Python 2.4 as a result of PEP 237 (integer
15944 unification). The warnings implement stage B0 mentioned in that
15945 PEP. The warnings are about the following situations:
15946
15947 - Octal and hex literals without 'L' prefix in the inclusive range
15948 [0x80000000..0xffffffff]; these are currently negative ints, but
15949 in Python 2.4 they will be positive longs with the same bit
15950 pattern.
15951
15952 - Left shifts on integer values that cause the outcome to lose
15953 bits or have a different sign than the left operand. To be
15954 precise: x<<n where this currently doesn't yield the same value
15955 as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
15956
15957 - Conversions from ints to string that show negative values as
15958 unsigned ints in the inclusive range [0x80000000..0xffffffff];
15959 this affects the functions hex() and oct(), and the string
15960 formatting codes %u, %o, %x, and %X. In Python 2.4, these will
15961 show signed values (e.g. hex(-1) currently returns "0xffffffff";
15962 in Python 2.4 it will return "-0x1").
15963
15964- The bits manipulated under the cover by sys.setcheckinterval() have
15965 been changed. Both the check interval and the ticker used to be
15966 per-thread values. They are now just a pair of global variables.
15967 In addition, the default check interval was boosted from 10 to 100
15968 bytecode instructions. This may have some effect on systems that
15969 relied on the old default value. In particular, in multi-threaded
15970 applications which try to be highly responsive, response time will
15971 increase by some (perhaps imperceptible) amount.
15972
15973- When multiplying very large integers, a version of the so-called
15974 Karatsuba algorithm is now used. This is most effective if the
15975 inputs have roughly the same size. If they both have about N digits,
15976 Karatsuba multiplication has O(N**1.58) runtime (the exponent is
15977 log_base_2(3)) instead of the previous O(N**2). Measured results may
15978 be better or worse than that, depending on platform quirks. Besides
15979 the O() improvement in raw instruction count, the Karatsuba algorithm
15980 appears to have much better cache behavior on extremely large integers
15981 (starting in the ballpark of a million bits). Note that this is a
15982 simple implementation, and there's no intent here to compete with,
15983 e.g., GMP. It gives a very nice speedup when it applies, but a package
15984 devoted to fast large-integer arithmetic should run circles around it.
15985
15986- u'%c' will now raise a ValueError in case the argument is an
15987 integer outside the valid range of Unicode code point ordinals.
15988
15989- The tempfile module has been overhauled for enhanced security. The
15990 mktemp() function is now deprecated; new, safe replacements are
15991 mkstemp() (for files) and mkdtemp() (for directories), and the
15992 higher-level functions NamedTemporaryFile() and TemporaryFile().
15993 Use of some global variables in this module is also deprecated; the
15994 new functions have keyword arguments to provide the same
15995 functionality. All Lib, Tools and Demo modules that used the unsafe
15996 interfaces have been updated to use the safe replacements. Thanks
15997 to Zack Weinberg!
15998
15999- When x is an object whose class implements __mul__ and __rmul__,
16000 1.0*x would correctly invoke __rmul__, but 1*x would erroneously
16001 invoke __mul__. This was due to the sequence-repeat code in the int
16002 type. This has been fixed now.
16003
16004- Previously, "str1 in str2" required str1 to be a string of length 1.
16005 This restriction has been relaxed to allow str1 to be a string of
16006 any length. Thus "'el' in 'hello world'" returns True now.
16007
16008- File objects are now their own iterators. For a file f, iter(f) now
16009 returns f (unless f is closed), and f.next() is similar to
16010 f.readline() when EOF is not reached; however, f.next() uses a
16011 readahead buffer that messes up the file position, so mixing
16012 f.next() and f.readline() (or other methods) doesn't work right.
16013 Calling f.seek() drops the readahead buffer, but other operations
16014 don't. It so happens that this gives a nice additional speed boost
16015 to "for line in file:"; the xreadlines method and corresponding
16016 module are now obsolete. Thanks to Oren Tirosh!
16017
16018- Encoding declarations (PEP 263, phase 1) have been implemented. A
16019 comment of the form "# -*- coding: <encodingname> -*-" in the first
16020 or second line of a Python source file indicates the encoding.
16021
16022- list.sort() has a new implementation. While cross-platform results
16023 may vary, and in data-dependent ways, this is much faster on many
16024 kinds of partially ordered lists than the previous implementation,
16025 and reported to be just as fast on randomly ordered lists on
16026 several major platforms. This sort is also stable (if A==B and A
16027 precedes B in the list at the start, A precedes B after the sort too),
16028 although the language definition does not guarantee stability. A
16029 potential drawback is that list.sort() may require temp space of
16030 len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
16031 for list.sort() to raise MemoryError now, even if a comparison function
16032 does not. See <http://www.python.org/sf/587076> for full details.
16033
16034- All standard iterators now ensure that, once StopIteration has been
16035 raised, all future calls to next() on the same iterator will also
16036 raise StopIteration. There used to be various counterexamples to
16037 this behavior, which could caused confusion or subtle program
16038 breakage, without any benefits. (Note that this is still an
16039 iterator's responsibility; the iterator framework does not enforce
16040 this.)
16041
16042- Ctrl+C handling on Windows has been made more consistent with
16043 other platforms. KeyboardInterrupt can now reliably be caught,
16044 and Ctrl+C at an interactive prompt no longer terminates the
16045 process under NT/2k/XP (it never did under Win9x). Ctrl+C will
16046 interrupt time.sleep() in the main thread, and any child processes
16047 created via the popen family (on win2k; we can't make win9x work
16048 reliably) are also interrupted (as generally happens on for Linux/Unix.)
16049 [SF bugs 231273, 439992 and 581232]
16050
16051- sys.getwindowsversion() has been added on Windows. This
16052 returns a tuple with information about the version of Windows
16053 currently running.
16054
16055- Slices and repetitions of buffer objects now consistently return
16056 a string. Formerly, strings would be returned most of the time,
16057 but a buffer object would be returned when the repetition count
16058 was one or when the slice range was all inclusive.
16059
16060- Unicode objects in sys.path are no longer ignored but treated
16061 as directory names.
16062
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016063- Fixed string.startswith and string.endswith built-in methods
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016064 so they accept negative indices. [SF bug 493951]
16065
16066- Fixed a bug with a continue inside a try block and a yield in the
16067 finally clause. [SF bug 567538]
16068
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016069- Most built-in sequences now support "extended slices", i.e. slices
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016070 with a third "stride" parameter. For example, "hello world"[::-1]
16071 gives "dlrow olleh".
16072
16073- A new warning PendingDeprecationWarning was added to provide
16074 direction on features which are in the process of being deprecated.
16075 The warning will not be printed by default. To see the pending
16076 deprecations, use -Walways::PendingDeprecationWarning::
16077 as a command line option or warnings.filterwarnings() in code.
16078
16079- Deprecated features of xrange objects have been removed as
16080 promised. The start, stop, and step attributes and the tolist()
16081 method no longer exist. xrange repetition and slicing have been
16082 removed.
16083
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016084- New built-in function enumerate(x), from PEP 279. Example:
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016085 enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
16086 The argument can be an arbitrary iterable object.
16087
16088- The assert statement no longer tests __debug__ at runtime. This means
16089 that assert statements cannot be disabled by assigning a false value
16090 to __debug__.
16091
16092- A method zfill() was added to str and unicode, that fills a numeric
16093 string to the left with zeros. For example,
16094 "+123".zfill(6) -> "+00123".
16095
16096- Complex numbers supported divmod() and the // and % operators, but
16097 these make no sense. Since this was documented, they're being
16098 deprecated now.
16099
16100- String and unicode methods lstrip(), rstrip() and strip() now take
16101 an optional argument that specifies the characters to strip. For
16102 example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
16103
16104- There's a new dictionary constructor (a class method of the dict
16105 class), dict.fromkeys(iterable, value=None). It constructs a
16106 dictionary with keys taken from the iterable and all values set to a
16107 single value. It can be used for building sets and for removing
16108 duplicates from sequences.
16109
16110- Added a new dict method pop(key). This removes and returns the
16111 value corresponding to key. [SF patch #539949]
16112
16113- A new built-in type, bool, has been added, as well as built-in
16114 names for its two values, True and False. Comparisons and sundry
16115 other operations that return a truth value have been changed to
16116 return a bool instead. Read PEP 285 for an explanation of why this
16117 is backward compatible.
16118
16119- Fixed two bugs reported as SF #535905: under certain conditions,
16120 deallocating a deeply nested structure could cause a segfault in the
16121 garbage collector, due to interaction with the "trashcan" code;
16122 access to the current frame during destruction of a local variable
16123 could access a pointer to freed memory.
16124
16125- The optional object allocator ("pymalloc") has been enabled by
16126 default. The recommended practice for memory allocation and
16127 deallocation has been streamlined. A header file is included,
16128 Misc/pymemcompat.h, which can be bundled with 3rd party extensions
16129 and lets them use the same API with Python versions from 1.5.2
16130 onwards.
16131
16132- PyErr_Display will provide file and line information for all exceptions
16133 that have an attribute print_file_and_line, not just SyntaxErrors.
16134
16135- The UTF-8 codec will now encode and decode Unicode surrogates
16136 correctly and without raising exceptions for unpaired ones.
16137
16138- Universal newlines (PEP 278) is implemented. Briefly, using 'U'
16139 instead of 'r' when opening a text file for reading changes the line
16140 ending convention so that any of '\r', '\r\n', and '\n' is
16141 recognized (even mixed in one file); all three are converted to
16142 '\n', the standard Python line end character.
16143
16144- file.xreadlines() now raises a ValueError if the file is closed:
16145 Previously, an xreadlines object was returned which would raise
16146 a ValueError when the xreadlines.next() method was called.
16147
16148- sys.exit() inadvertently allowed more than one argument.
16149 An exception will now be raised if more than one argument is used.
16150
16151- Changed evaluation order of dictionary literals to conform to the
16152 general left to right evaluation order rule. Now {f1(): f2()} will
16153 evaluate f1 first.
16154
16155- Fixed bug #521782: when a file was in non-blocking mode, file.read()
16156 could silently lose data or wrongly throw an unknown error.
16157
16158- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
16159 slots are now always tried after trying the corresponding nb_* slots.
16160 This fixes a number of minor bugs (see bug #624807).
16161
16162- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
16163
16164Extension modules
16165-----------------
16166
16167- Added three operators to the operator module:
16168 operator.pow(a,b) which is equivalent to: a**b.
16169 operator.is_(a,b) which is equivalent to: a is b.
16170 operator.is_not(a,b) which is equivalent to: a is not b.
16171
16172- posix.openpty now works on all systems that have /dev/ptmx.
16173
16174- A module zipimport exists to support importing code from zip
16175 archives.
16176
16177- The new datetime module supplies classes for manipulating dates and
16178 times. The basic design came from the Zope "fishbowl process", and
16179 favors practical commercial applications over calendar esoterica. See
16180
16181 http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
16182
16183- _tkinter now returns Tcl objects, instead of strings. Objects which
16184 have Python equivalents are converted to Python objects, other objects
16185 are wrapped. This can be configured through the wantobjects method,
16186 or Tkinter.wantobjects.
16187
16188- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
16189 been added as the package bsddb. The traditional bsddb module is
16190 still available in source code, but not built automatically anymore,
16191 and is now named bsddb185. This supports Berkeley DB versions from
16192 3.0 to 4.1. For help converting your databases from the old module (which
16193 probably used an obsolete version of Berkeley DB) to the new module, see
16194 the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
16195 section above.
16196
16197- unicodedata was updated to Unicode 3.2. It supports normalization
16198 and names for Hangul syllables and CJK unified ideographs.
16199
16200- resource.getrlimit() now returns longs instead of ints.
16201
16202- readline now dynamically adjusts its input/output stream if
16203 sys.stdin/stdout changes.
16204
16205- The _tkinter module (and hence Tkinter) has dropped support for
16206 Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
16207 supported.
16208
16209- cPickle.BadPickleGet is now a class.
16210
16211- The time stamps in os.stat_result are floating point numbers
16212 after stat_float_times has been called.
16213
16214- If the size passed to mmap.mmap() is larger than the length of the
16215 file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
16216
16217- The xreadlines module is slated for obsolescence.
16218
16219- The strptime function in the time module is now always available (a
16220 Python implementation is used when the C library doesn't define it).
16221
16222- The 'new' module is no longer an extension, but a Python module that
16223 only exists for backwards compatibility. Its contents are no longer
16224 functions but callable type objects.
16225
16226- The bsddb.*open functions can now take 'None' as a filename.
16227 This will create a temporary in-memory bsddb that won't be
16228 written to disk.
16229
16230- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
16231 posix.getpgid have been added where available.
16232
16233- The locale module now exposes the C library's gettext interface. It
16234 also has a new function getpreferredencoding.
16235
16236- A security hole ("double free") was found in zlib-1.1.3, a popular
16237 third party compression library used by some Python modules. The
16238 hole was quickly plugged in zlib-1.1.4, and the Windows build of
16239 Python now ships with zlib-1.1.4.
16240
16241- pwd, grp, and resource return enhanced tuples now, with symbolic
16242 field names.
16243
16244- array.array is now a type object. A new format character
16245 'u' indicates Py_UNICODE arrays. For those, .tounicode and
16246 .fromunicode methods are available. Arrays now support __iadd__
16247 and __imul__.
16248
16249- dl now builds on every system that has dlfcn.h. Failure in case
16250 of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
16251 is called.
16252
16253- The sys module acquired a new attribute, api_version, which evaluates
16254 to the value of the PYTHON_API_VERSION macro with which the
16255 interpreter was compiled.
16256
16257- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
16258 when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
16259 returns (None, None, 'ab'), as expected. Also fixed handling of
16260 lastindex/lastgroup match attributes in similar cases. For example,
16261 when running the expression r'(a)(b)?b' over 'ab', lastindex must be
16262 1, not 2.
16263
16264- Fixed bug #581080: sre scanner was not checking the buffer limit
16265 before increasing the current pointer. This was creating an infinite
16266 loop in the search function, once the pointer exceeded the buffer
16267 limit.
16268
16269- The os.fdopen function now enforces a file mode starting with the
16270 letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
16271 bug #623464.
16272
16273- The linuxaudiodev module is now deprecated; it is being replaced by
16274 ossaudiodev. The interface has been extended to cover a lot more of
16275 OSS (see www.opensound.com), including most DSP ioctls and the
16276 OSS mixer API. Documentation forthcoming in 2.3a2.
16277
16278Library
16279-------
16280
16281- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
16282
16283- Freeze's modulefinder.py has been moved to the standard library;
16284 slightly improved so it will issue less false missing submodule
16285 reports (see sf path #643711 for details). Documentation will follow
16286 with Python 2.3a2.
16287
16288- os.path exposes getctime.
16289
16290- unittest.py now has two additional methods called assertAlmostEqual()
16291 and failIfAlmostEqual(). They implement an approximate comparison
16292 by rounding the difference between the two arguments and comparing
16293 the result to zero. Approximate comparison is essential for
16294 unit tests of floating point results.
16295
16296- calendar.py now depends on the new datetime module rather than
16297 the time module. As a result, the range of allowable dates
16298 has been increased.
16299
16300- pdb has a new 'j(ump)' command to select the next line to be
16301 executed.
16302
16303- The distutils created windows installers now can run a
16304 postinstallation script.
16305
16306- doctest.testmod can now be called without argument, which means to
16307 test the current module.
16308
16309- When canceling a server that implemented threading with a keyboard
16310 interrupt, the server would shut down but not terminate (waiting on
16311 client threads). A new member variable, daemon_threads, was added to
16312 the ThreadingMixIn class in SocketServer.py to make it explicit that
16313 this behavior needs to be controlled.
16314
16315- A new module, optparse, provides a fancy alternative to getopt for
16316 command line parsing. It is a slightly modified version of Greg
16317 Ward's Optik package.
16318
16319- UserDict.py now defines a DictMixin class which defines all dictionary
16320 methods for classes that already have a minimum mapping interface.
16321 This greatly simplifies writing classes that need to be substitutable
16322 for dictionaries (such as the shelve module).
16323
16324- shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
16325 all dictionary methods. This eases the transition to persistent
16326 storage for scripts originally written with dictionaries in mind.
16327
16328- shelve.open and the various classes in shelve.py now accept an optional
16329 binary flag, which defaults to False. If True, the values stored in the
16330 shelf are binary pickles.
16331
16332- A new package, logging, implements the logging API defined by PEP
16333 282. The code is written by Vinay Sajip.
16334
16335- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
16336 modules are iterators now.
16337
16338- gzip.py now handles files exceeding 2GB. Files over 4GB also work
16339 now (provided the OS supports it, and Python is configured with large
16340 file support), but in that case the underlying gzip file format can
16341 record only the least-significant 32 bits of the file size, so that
16342 some tools working with gzipped files may report an incorrect file
16343 size.
16344
16345- xml.sax.saxutils.unescape has been added, to replace entity references
16346 with their entity value.
16347
16348- Queue.Queue.{put,get} now support an optional timeout argument.
16349
16350- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
16351 option of tkFileDialog is exposed as function askopenfile{,name}s.
16352
16353- Various configure methods of Tkinter have been stream-lined, so that
16354 tag_configure, image_configure, window_configure now return a
16355 dictionary when invoked with no argument.
16356
16357- Importing the readline module now no longer has the side effect of
16358 calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
16359 whatever locale is explicitly set by the user, is preserved. If you
16360 want repr() of 8-bit strings in your preferred encoding to preserve
16361 all printable characters of that encoding, you have to add the
16362 following code to your $PYTHONSTARTUP file or to your application's
16363 main():
16364
16365 import locale
16366 locale.setlocale(locale.LC_CTYPE, "")
16367
16368- shutil.move was added. shutil.copytree now reports errors as an
16369 exception at the end, instead of printing error messages.
16370
16371- Encoding name normalization was generalized to not only
16372 replace hyphens with underscores, but also all other non-alphanumeric
16373 characters (with the exception of the dot which is used for Python
16374 package names during lookup). The aliases.py mapping was updated
16375 to the new standard.
16376
16377- mimetypes has two new functions: guess_all_extensions() which
16378 returns a list of all known extensions for a mime type, and
16379 add_type() which adds one mapping between a mime type and
16380 an extension to the database.
16381
16382- New module: sets, defines the class Set that implements a mutable
16383 set type using the keys of a dict to represent the set. There's
16384 also a class ImmutableSet which is useful when you need sets of sets
16385 or when you need to use sets as dict keys, and a class BaseSet which
16386 is the base class of the two.
16387
16388- Added random.sample(population,k) for random sampling without replacement.
16389 Returns a k length list of unique elements chosen from the population.
16390
16391- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
16392 OverflowError. That is, it now accepts any combination of 'start'
16393 and 'stop' arguments so long as each is in the range of Python's
16394 bounded integers.
16395
16396- Thanks to Raymond Hettinger, random.random() now uses a new core
16397 generator. The Mersenne Twister algorithm is implemented in C,
16398 threadsafe, faster than the previous generator, has an astronomically
16399 large period (2**19937-1), creates random floats to full 53-bit
16400 precision, and may be the most widely tested random number generator
16401 in existence.
16402
16403 The random.jumpahead(n) method has different semantics for the new
16404 generator. Instead of jumping n steps ahead, it uses n and the
16405 existing state to create a new state. This means that jumpahead()
16406 continues to support multi-threaded code needing generators of
16407 non-overlapping sequences. However, it will break code which relies
16408 on jumpahead moving a specific number of steps forward.
16409
16410 The attributes random.whseed and random.__whseed have no meaning for
16411 the new generator. Code using these attributes should switch to a
16412 new class, random.WichmannHill which is provided for backward
16413 compatibility and to make an alternate generator available.
16414
16415- New "algorithms" module: heapq, implements a heap queue. Thanks to
16416 Kevin O'Connor for the code and François Pinard for an entertaining
16417 write-up explaining the theory and practical uses of heaps.
16418
16419- New encoding for the Palm OS character set: palmos.
16420
16421- binascii.crc32() and the zipfile module had problems on some 64-bit
16422 platforms. These have been fixed. On a platform with 8-byte C longs,
16423 crc32() now returns a signed-extended 4-byte result, so that its value
16424 as a Python int is equal to the value computed a 32-bit platform.
16425
16426- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
16427 argument.
16428
16429- Some fixes in the copy module: when an object is copied through its
16430 __reduce__ method, there was no check for a __setstate__ method on
16431 the result [SF patch 565085]; deepcopy should treat instances of
16432 custom metaclasses the same way it treats instances of type 'type'
16433 [SF patch 560794].
16434
16435- Sockets now support timeout mode. After s.settimeout(T), where T is
16436 a float expressing seconds, subsequent operations raise an exception
16437 if they cannot be completed within T seconds. To disable timeout
16438 mode, use s.settimeout(None). There's also a module function,
16439 socket.setdefaulttimeout(T), which sets the default for all sockets
16440 created henceforth.
16441
16442- getopt.gnu_getopt was added. This supports GNU-style option
16443 processing, where options can be mixed with non-option arguments.
16444
16445- Stop using strings for exceptions. String objects used for
16446 exceptions are now classes deriving from Exception. The objects
16447 changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
16448 tabnanny.NannyNag, and xdrlib.Error.
16449
16450- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
16451 BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
16452 Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
16453 big endian systems were added to the codecs module. The old names
16454 BOM32_* and BOM64_* were off by a factor of 2.
16455
16456- Added conversion functions math.degrees() and math.radians().
16457
16458- math.log() now takes an optional argument: math.log(x[, base]).
16459
16460- ftplib.retrlines() now tests for callback is None rather than testing
16461 for False. Was causing an error when given a callback object which
16462 was callable but also returned len() as zero. The change may
16463 create new breakage if the caller relied on the undocumented behavior
16464 and called with callback set to [] or some other False value not
16465 identical to None.
16466
16467- random.gauss() uses a piece of hidden state used by nothing else,
16468 and the .seed() and .whseed() methods failed to reset it. In other
16469 words, setting the seed didn't completely determine the sequence of
16470 results produced by random.gauss(). It does now. Programs repeatedly
16471 mixing calls to a seed method with calls to gauss() may see different
16472 results now.
16473
16474- The pickle.Pickler class grew a clear_memo() method to mimic that
16475 provided by cPickle.Pickler.
16476
16477- difflib's SequenceMatcher class now does a dynamic analysis of
16478 which elements are so frequent as to constitute noise. For
16479 comparing files as sequences of lines, this generally works better
16480 than the IS_LINE_JUNK function, and function ndiff's linejunk
16481 argument defaults to None now as a result. A happy benefit is
16482 that SequenceMatcher may run much faster now when applied
16483 to large files with many duplicate lines (for example, C program
16484 text with lots of repeated "}" and "return NULL;" lines).
16485
16486- New Text.dump() method in Tkinter module.
16487
16488- New distutils commands for building packagers were added to
16489 support pkgtool on Solaris and swinstall on HP-UX.
16490
16491- distutils now has a new abstract binary packager base class
16492 command/bdist_packager, which simplifies writing packagers.
16493 This will hopefully provide the missing bits to encourage
16494 people to submit more packagers, e.g. for Debian, FreeBSD
16495 and other systems.
16496
16497- The UTF-16, -LE and -BE stream readers now raise a
16498 NotImplementedError for all calls to .readline(). Previously, they
16499 used to just produce garbage or fail with an encoding error --
16500 UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
16501 work well with these.
16502
16503- compileall now supports quiet operation.
16504
16505- The BaseHTTPServer now implements optional HTTP/1.1 persistent
16506 connections.
16507
16508- socket module: the SSL support was broken out of the main
16509 _socket module C helper and placed into a new _ssl helper
16510 which now gets imported by socket.py if available and working.
16511
16512- encodings package: added aliases for all supported IANA character
16513 sets
16514
16515- ftplib: to safeguard the user's privacy, anonymous login will use
16516 "anonymous@" as default password, rather than the real user and host
16517 name.
16518
16519- webbrowser: tightened up the command passed to os.system() so that
16520 arbitrary shell code can't be executed because a bogus URL was
16521 passed in.
16522
16523- gettext.translation has an optional fallback argument, and
16524 gettext.find an optional all argument. Translations will now fallback
16525 on a per-message basis. The module supports plural forms, by means
16526 of gettext.[d]ngettext and Translation.[u]ngettext.
16527
16528- distutils bdist commands now offer a --skip-build option.
16529
16530- warnings.warn now accepts a Warning instance as first argument.
16531
16532- The xml.sax.expatreader.ExpatParser class will no longer create
16533 circular references by using itself as the locator that gets passed
16534 to the content handler implementation. [SF bug #535474]
16535
16536- The email.Parser.Parser class now properly parses strings regardless
16537 of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
16538 or CRLF). Also, the Header class's constructor default arguments
16539 has changed slightly so that an explicit maxlinelen value is always
16540 honored, and so unicode conversion error handling can be specified.
16541
16542- distutils' build_ext command now links C++ extensions with the C++
16543 compiler available in the Makefile or CXX environment variable, if
16544 running under \*nix.
16545
16546- New module bz2: provides a comprehensive interface for the bz2 compression
16547 library. It implements a complete file interface, one-shot (de)compression
16548 functions, and types for sequential (de)compression.
16549
16550- New pdb command 'pp' which is like 'p' except that it pretty-prints
16551 the value of its expression argument.
16552
16553- Now bdist_rpm distutils command understands a verify_script option in
16554 the config file, including the contents of the referred filename in
16555 the "%verifyscript" section of the rpm spec file.
16556
16557- Fixed bug #495695: webbrowser module would run graphic browsers in a
16558 unix environment even if DISPLAY was not set. Also, support for
16559 skipstone browser was included.
16560
16561- Fixed bug #636769: rexec would run unallowed code if subclasses of
16562 strings were used as parameters for certain functions.
16563
16564Tools/Demos
16565-----------
16566
16567- pygettext.py now supports globbing on Windows, and accepts module
16568 names in addition to accepting file names.
16569
16570- The SGI demos (Demo/sgi) have been removed. Nobody thought they
16571 were interesting any more. (The SGI library modules and extensions
16572 are still there; it is believed that at least some of these are
16573 still used and useful.)
16574
16575- IDLE supports the new encoding declarations (PEP 263); it can also
16576 deal with legacy 8-bit files if they use the locale's encoding. It
16577 allows non-ASCII strings in the interactive shell and executes them
16578 in the locale's encoding.
16579
16580- freeze.py now produces binaries which can import shared modules,
16581 unlike before when this failed due to missing symbol exports in
16582 the generated binary.
16583
16584Build
16585-----
16586
16587- On Unix, IDLE is now installed automatically.
16588
16589- The fpectl module is not built by default; it's dangerous or useless
16590 except in the hands of experts.
16591
16592- The public Python C API will generally be declared using PyAPI_FUNC
16593 and PyAPI_DATA macros, while Python extension module init functions
16594 will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
16595 are deprecated.
16596
16597- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
16598 get into infinite loops, when a new-style class got garbage-collected.
16599 Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
16600 that new-style classes be immortal in COUNT_ALLOCS builds. Note that
16601 COUNT_ALLOCS is not enabled by default, in either release or debug
16602 builds, and that new-style classes are immortal only in COUNT_ALLOCS
16603 builds.
16604
16605- Compiling out the cyclic garbage collector is no longer an option.
16606 The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
16607 that it's always defined (for the benefit of any extension modules
16608 that may be conditionalizing on it). A bonus is that any extension
16609 type participating in cyclic gc can choose to participate in the
16610 Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
16611 to require editing the core to teach the trashcan mechanism about the
16612 new type.
16613
16614- According to Annex F of the current C standard,
16615
16616 The Standard C macro HUGE_VAL and its float and long double analogs,
16617 HUGE_VALF and HUGE_VALL, expand to expressions whose values are
16618 positive infinities.
16619
16620 Python only uses the double HUGE_VAL, and only to #define its own symbol
16621 Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
16622 pyport.h used to try to worm around that, but the workarounds triggered
16623 other bugs on other platforms, so we gave up. If your platform defines
16624 HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
16625 that works on your platform. The only instance of this I'm sure about
16626 is on an unknown subset of Cray systems, described here:
16627
16628 http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
16629
16630 Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
16631
16632- The configure option --without-doc-strings can be used to remove the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016633 doc strings from the built-in functions and modules; this reduces the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016634 size of the executable.
16635
16636- The universal newlines option (PEP 278) is on by default. On Unix
16637 it can be disabled by passing --without-universal-newlines to the
16638 configure script. On other platforms, remove
16639 WITH_UNIVERSAL_NEWLINES from pyconfig.h.
16640
16641- On Unix, a shared libpython2.3.so can be created with --enable-shared.
16642
16643- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
16644 preprocessor symbols were eliminated. The internal decisions they
16645 controlled stopped being experimental long ago.
16646
16647- The tools used to build the documentation now work under Cygwin as
16648 well as Unix.
16649
16650- The bsddb and dbm module builds have been changed to try and avoid version
16651 skew problems and disable linkage with Berkeley DB 1.85 unless the
16652 installer knows what s/he's doing. See the section on building these
16653 modules in the README file for details.
16654
16655C API
16656-----
16657
16658- PyNumber_Check() now returns true for string and unicode objects.
16659 This is a result of these types having a partially defined
16660 tp_as_number slot. (This is not a feature, but an indication that
16661 PyNumber_Check() is not very useful to determine numeric behavior.
16662 It may be deprecated.)
16663
16664- The string object's layout has changed: the pointer member
16665 ob_sinterned has been replaced by an int member ob_sstate. On some
16666 platforms (e.g. most 64-bit systems) this may change the offset of
16667 the ob_sval member, so as a precaution the API_VERSION has been
16668 incremented. The apparently unused feature of "indirect interned
16669 strings", supported by the ob_sinterned member, is gone. Interned
16670 strings are now usually mortal; there is a new API,
16671 PyString_InternImmortal() that creates immortal interned strings.
16672 (The ob_sstate member can only take three values; however, while
16673 making it a char saves a few bytes per string object on average, in
16674 it also slowed things down a bit because ob_sval was no longer
16675 aligned.)
16676
16677- The Py_InitModule*() functions now accept NULL for the 'methods'
16678 argument. Modules without global functions are becoming more common
16679 now that factories can be types rather than functions.
16680
16681- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
16682 level.
16683
16684- New functions PyErr_SetExcFromWindowsErr() and
16685 PyErr_SetExcFromWindowsErrWithFilename(). Similar to
16686 PyErr_SetFromWindowsErrWithFilename() and
16687 PyErr_SetFromWindowsErr(), but they allow to specify
16688 the exception type to raise. Available on Windows.
16689
16690- Py_FatalError() is now declared as taking a const char* argument. It
16691 was previously declared without const. This should not affect working
16692 code.
16693
16694- Added new macro PySequence_ITEM(o, i) that directly calls
16695 sq_item without rechecking that o is a sequence and without
16696 adjusting for negative indices.
16697
16698- PyRange_New() now raises ValueError if the fourth argument is not 1.
16699 This is part of the removal of deprecated features of the xrange
16700 object.
16701
16702- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
16703 coercion if both arguments have the same type but this type has the
16704 CHECKTYPES flag set. This is to better support proxies.
16705
16706- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
16707 "``void (*)(void *)``".
16708
16709- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
16710
16711- A type can now inherit its metatype from its base type. Previously,
16712 when PyType_Ready() was called, if ob_type was found to be NULL, it
16713 was always set to &PyType_Type; now it is set to base->ob_type,
16714 where base is tp_base, defaulting to &PyObject_Type.
16715
16716- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
16717
16718- The PyCore_* family of APIs have been removed.
16719
16720- The "u#" parser marker will now pass through Unicode objects as-is
16721 without going through the buffer API.
16722
16723- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
16724
16725- An old #define of ANY as void has been removed from pyport.h. This
16726 hasn't been used since Python's pre-ANSI days, and the #define has
16727 been marked as obsolete since then. SF bug 495548 says it created
16728 conflicts with other packages, so keeping it around wasn't harmless.
16729
16730- Because Python's magic number scheme broke on January 1st, we decided
16731 to stop Python development. Thanks for all the fish!
16732
16733- Some of us don't like fish, so we changed Python's magic number
16734 scheme to a new one. See Python/import.c for details.
16735
16736New platforms
16737-------------
16738
16739- OpenVMS is now supported.
16740
16741- AtheOS is now supported.
16742
16743- the EMX runtime environment on OS/2 is now supported.
16744
16745- GNU/Hurd is now supported.
16746
16747Tests
16748-----
16749
16750- The regrtest.py script's -u option now provides a way to say "allow
16751 all resources except this one." For example, to allow everything
16752 except bsddb, give the option '-uall,-bsddb'.
16753
16754Windows
16755-------
16756
16757- The Windows distribution now ships with version 4.0.14 of the
16758 Sleepycat Berkeley database library. This should be a huge
16759 improvement over the previous Berkeley DB 1.85, which had many
16760 bugs.
16761 XXX What are the licensing issues here?
16762 XXX If a user has a database created with a previous version of
16763 XXX Python, what must they do to convert it?
16764 XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
16765 XXX The version # is likely to change before 2.3a1.
16766
16767- The Windows distribution now ships with a Secure Sockets Library (SLL)
16768 module (_ssl.pyd)
16769
16770- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
16771 previously shipped with Tcl/Tk 8.3.2).
16772
16773- When Python is built under a Microsoft compiler, sys.version now
16774 includes the compiler version number (_MSC_VER). For example, under
16775 MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
16776 the value of _MSC_VER under MSVC 6.
16777
16778- Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
16779 of that has been fixed in the installer (disabled Wise's "delete in-
16780 use files" uninstall option).
16781
16782- Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
16783
16784- The installer now installs Start menu shortcuts under (the local
16785 equivalent of) "All Users" when doing an Admin install.
16786
16787- file.truncate([newsize]) now works on Windows for all newsize values.
16788 It used to fail if newsize didn't fit in 32 bits, reflecting a
16789 limitation of MS _chsize (which is no longer used).
16790
16791- os.waitpid() is now implemented for Windows, and can be used to block
16792 until a specified process exits. This is similar to, but not exactly
16793 the same as, os.waitpid() on POSIX systems. If you're waiting for
16794 a specific process whose pid was obtained from one of the spawn()
16795 functions, the same Python os.waitpid() code works across platforms.
16796 See the docs for details. The docs were changed to clarify that
16797 spawn functions return, and waitpid requires, a process handle on
16798 Windows (not the same thing as a Windows process id).
16799
16800- New tempfile.TemporaryFile implementation for Windows: this doesn't
16801 need a TemporaryFileWrapper wrapper anymore, and should be immune
16802 to a nasty problem: before 2.3, if you got a temp file on Windows, it
16803 got wrapped in an object whose close() method first closed the
16804 underlying file, then deleted the file. This usually worked fine.
16805 However, the spawn family of functions on Windows create (at a low C
16806 level) the same set of open files in the spawned process Q as were
16807 open in the spawning process P. If a temp file f was among them, then
16808 doing f.close() in P first closed P's C-level file handle on f, but Q's
16809 C-level file handle on f remained open, so the attempt in P to delete f
16810 blew up with a "Permission denied" error (Windows doesn't allow
16811 deleting open files). This was surprising, subtle, and difficult to
16812 work around.
16813
16814- The os module now exports all the symbolic constants usable with the
16815 low-level os.open() on Windows: the new constants in 2.3 are
16816 O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
16817 The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
16818 O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
16819 to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
16820 (so specify both if you want both; note that neither is useful unless
16821 specified with O_CREAT too).
16822
16823Mac
16824----
16825
16826- Mac/Relnotes is gone, the release notes are now here.
16827
16828- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
16829 version) now fully supports unicode strings as arguments to various file
16830 system calls, eg. open(), file(), os.stat() and os.listdir().
16831
16832- The current naming convention for Python on the Macintosh is that MacPython
16833 refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
16834 CFM-based version that runs on both OS9 and OSX.
16835
16836- All MacPython-OS9 functionality is now available in an OSX unix build,
16837 including the Carbon modules, the IDE, OSA support, etc. A lot of this
16838 will only work correctly in a framework build, though, because you cannot
16839 talk to the window manager unless your application is run from a .app
16840 bundle. There is a command line tool "pythonw" that runs your script
16841 with an interpreter living in such a .app bundle, this interpreter should
16842 be used to run any Python script using the window manager (including
16843 Tkinter or wxPython scripts).
16844
16845- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
16846 MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
16847 are specifically for MacPython-OS9 (CFM support, preference resources, etc).
16848
16849- A new utility PythonLauncher will start a Python interpreter when a .py or
16850 .pyw script is double-clicked in the Finder. By default .py scripts are
16851 run with a normal Python interpreter in a Terminal window and .pyw
16852 files are run with a window-aware pythonw interpreter without a Terminal
16853 window, but all this can be customized.
16854
16855- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
16856 possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
16857 releases.
16858
16859- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
16860 line interface too.
16861
16862- All the Carbon classes are now PEP253 compliant, meaning that you can
16863 subclass them from Python. Most of the attributes have gone, you should
16864 now use the accessor function call API, which is also what Apple's
16865 documentation uses. Some attributes such as grafport.visRgn are still
16866 available for convenience.
16867
16868- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016869 and Folder (APIs from Folders.h). The old macfs built-in module is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016870 gone, and replaced by a Python wrapper around the new modules.
16871
16872- Pathname handling should now be fully consistent: MacPython-OSX always uses
16873 unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
16874 (also when running on Mac OS X).
16875
16876- New Carbon modules Help and AH give access to the Carbon Help Manager.
16877 There are hooks in the IDE to allow accessing the Python documentation
16878 (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
16879 See Mac/OSX/README for converting the Python documentation to a
16880 Help Viewer compatible form and installing it.
16881
16882- OSA support has been redesigned and the generated Python classes now
16883 mirror the inheritance defined by the underlying OSA classes.
16884
16885- MacPython no longer maps both \r and \n to \n on input for any text file.
16886 This feature has been replaced by universal newline support (PEP278).
16887
16888- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
16889 mac-roman (or whatever your local Mac encoding was) but "ascii", like on
16890 other platforms. If you really need sourcefiles with Mac characters in them
16891 you can change this in site.py.
16892
16893
16894What's New in Python 2.2 final?
16895===============================
16896
16897*Release date: 21-Dec-2001*
16898
16899Type/class unification and new-style classes
16900--------------------------------------------
16901
16902- pickle.py, cPickle: allow pickling instances of new-style classes
16903 with a custom metaclass.
16904
16905Core and builtins
16906-----------------
16907
16908- weakref proxy object: when comparing, unwrap both arguments if both
16909 are proxies.
16910
16911Extension modules
16912-----------------
16913
16914- binascii.b2a_base64(): fix a potential buffer overrun when encoding
16915 very short strings.
16916
16917- cPickle: the obscure "fast" mode was suspected of causing stack
16918 overflows on the Mac. Hopefully fixed this by setting the recursion
16919 limit much smaller. If the limit is too low (it only affects
16920 performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
16921 when compiling cPickle.c (or in pyconfig.h).
16922
16923Library
16924-------
16925
16926- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
16927 close or delete time).
16928
16929- rfc822.py: fixed a bug where the address '<>' was converted to None
16930 instead of an empty string (also fixes the email.Utils module).
16931
16932- xmlrpclib.py: version 1.0.0; uses precision for doubles.
16933
16934- test suite: the pickle and cPickle tests were not executing any code
16935 when run from the standard regression test.
16936
16937Tools/Demos
16938-----------
16939
16940Build
16941-----
16942
16943C API
16944-----
16945
16946New platforms
16947-------------
16948
16949Tests
16950-----
16951
16952Windows
16953-------
16954
16955- distutils package: fixed broken Windows installers (bdist_wininst).
16956
16957- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
16958 instances are deleted at process exit time.
16959
16960- socket.py: prevent mysterious warnings when socket instances are
16961 deleted at process exit time.
16962
16963- posixmodule.c: fix a Windows crash with stat() of a filename ending
16964 in backslash.
16965
16966Mac
16967----
16968
16969- The Carbon toolbox modules have been upgraded to Universal Headers
16970 3.4, and experimental CoreGraphics and CarbonEvents modules have
16971 been added. All only for framework-enabled MacOSX.
16972
16973
16974What's New in Python 2.2c1?
16975===========================
16976
16977*Release date: 14-Dec-2001*
16978
16979Type/class unification and new-style classes
16980--------------------------------------------
16981
16982- Guido's tutorial introduction to the new type/class features has
16983 been extensively updated. See
16984
16985 http://www.python.org/2.2/descrintro.html
16986
16987 That remains the primary documentation in this area.
16988
16989- Fixed a leak: instance variables declared with __slots__ were never
16990 deleted!
16991
16992- The "delete attribute" method of descriptor objects is called
16993 __delete__, not __del__. In previous releases, it was mistakenly
16994 called __del__, which created an unfortunate overloading condition
16995 with finalizers. (The "get attribute" and "set attribute" methods
16996 are still called __get__ and __set__, respectively.)
16997
16998- Some subtle issues with the super built-in were fixed:
16999
17000 (a) When super itself is subclassed, its __get__ method would still
17001 return an instance of the base class (i.e., of super).
17002
17003 (b) super(C, C()).__class__ would return C rather than super. This
17004 is confusing. To fix this, I decided to change the semantics of
17005 super so that it only applies to code attributes, not to data
17006 attributes. After all, overriding data attributes is not
17007 supported anyway.
17008
17009 (c) The __get__ method didn't check whether the argument was an
17010 instance of the type used in creation of the super instance.
17011
17012- Previously, hash() of an instance of a subclass of a mutable type
17013 (list or dictionary) would return some value, rather than raising
17014 TypeError. This has been fixed. Also, directly calling
17015 dict.__hash__ and list.__hash__ now raises the same TypeError
17016 (previously, these were the same as object.__hash__).
17017
17018- New-style objects now support deleting their __dict__. This is for
17019 all intents and purposes equivalent to assigning a brand new empty
17020 dictionary, but saves space if the object is not used further.
17021
17022Core and builtins
17023-----------------
17024
17025- -Qnew now works as documented in PEP 238: when -Qnew is passed on
17026 the command line, all occurrences of "/" use true division instead
17027 of classic division. See the PEP for details. Note that "all"
17028 means all instances in library and 3rd-party modules, as well as in
17029 your own code. As the PEP says, -Qnew is intended for use only in
17030 educational environments with control over the libraries in use.
17031 Note that test_coercion.py in the standard Python test suite fails
17032 under -Qnew; this is expected, and won't be repaired until true
17033 division becomes the default (in the meantime, test_coercion is
17034 testing the current rules).
17035
17036- complex() now only allows the first argument to be a string
17037 argument, and raises TypeError if either the second arg is a string
17038 or if the second arg is specified when the first is a string.
17039
17040Extension modules
17041-----------------
17042
17043- gc.get_referents was renamed to gc.get_referrers.
17044
17045Library
17046-------
17047
17048- Functions in the os.spawn() family now release the global interpreter
17049 lock around calling the platform spawn. They should always have done
17050 this, but did not before 2.2c1. Multithreaded programs calling
17051 an os.spawn function with P_WAIT will no longer block all Python threads
17052 until the spawned program completes. It's possible that some programs
17053 relies on blocking, although more likely by accident than by design.
17054
17055- webbrowser defaults to netscape.exe on OS/2 now.
17056
17057- Tix.ResizeHandle exposes detach_widget, hide, and show.
17058
17059- The charset alias windows_1252 has been added.
17060
17061- types.StringTypes is a tuple containing the defined string types;
17062 usually this will be (str, unicode), but if Python was compiled
17063 without Unicode support it will be just (str,).
17064
17065- The pulldom and minidom modules were synchronized to PyXML.
17066
17067Tools/Demos
17068-----------
17069
17070- A new script called Tools/scripts/google.py was added, which fires
17071 off a search on Google.
17072
17073Build
17074-----
17075
17076- Note that release builds of Python should arrange to define the
17077 preprocessor symbol NDEBUG on the command line (or equivalent).
17078 In the 2.2 pre-release series we tried to define this by magic in
17079 Python.h instead, but it proved to cause problems for extension
17080 authors. The Unix, Windows and Mac builds now all define NDEBUG in
17081 release builds via cmdline (or equivalent) instead. Ports to
17082 other platforms should do likewise.
17083
17084- It is no longer necessary to use --with-suffix when building on a
17085 case-insensitive file system (such as Mac OS X HFS+). In the build
17086 directory an extension is used, but not in the installed python.
17087
17088C API
17089-----
17090
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017091- New function PyDict_MergeFromSeq2() exposes the built-in dict
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017092 constructor's logic for updating a dictionary from an iterable object
17093 producing key-value pairs.
17094
17095- PyArg_ParseTupleAndKeywords() requires that the number of entries in
17096 the keyword list equal the number of argument specifiers. This
17097 wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
17098 dump core in some bad cases. This has been repaired. As a result,
17099 PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
17100 previously went unchallenged.
17101
17102New platforms
17103-------------
17104
17105Tests
17106-----
17107
17108Windows
17109-------
17110
17111Mac
17112----
17113
17114- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
17115 without any trailing digits.
17116
17117- Changed logic for finding python home in Mac OS X framework Pythons.
17118 Now sys.executable points to the executable again, in stead of to
17119 the shared library. The latter is used only for locating the python
17120 home.
17121
17122
17123What's New in Python 2.2b2?
17124===========================
17125
17126*Release date: 16-Nov-2001*
17127
17128Type/class unification and new-style classes
17129--------------------------------------------
17130
17131- Multiple inheritance mixing new-style and classic classes in the
17132 list of base classes is now allowed, so this works now:
17133
17134 class Classic: pass
17135 class Mixed(Classic, object): pass
17136
17137 The MRO (method resolution order) for each base class is respected
17138 according to its kind, but the MRO for the derived class is computed
17139 using new-style MRO rules if any base class is a new-style class.
17140 This needs to be documented.
17141
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017142- The new built-in dictionary() constructor, and dictionary type, have
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017143 been renamed to dict. This reflects a decade of common usage.
17144
17145- dict() now accepts an iterable object producing 2-sequences. For
17146 example, dict(d.items()) == d for any dictionary d. The argument,
17147 and the elements of the argument, can be any iterable objects.
17148
17149- New-style classes can now have a __del__ method, which is called
17150 when the instance is deleted (just like for classic classes).
17151
17152- Assignment to object.__dict__ is now possible, for objects that are
17153 instances of new-style classes that have a __dict__ (unless the base
17154 class forbids it).
17155
17156- Methods of built-in types now properly check for keyword arguments
17157 (formerly these were silently ignored). The only built-in methods
17158 that take keyword arguments are __call__, __init__ and __new__.
17159
17160- The socket function has been converted to a type; see below.
17161
17162Core and builtins
17163-----------------
17164
17165- Assignment to __debug__ raises SyntaxError at compile-time. This
17166 was promised when 2.1c1 was released as "What's New in Python 2.1c1"
17167 (see below) says.
17168
17169- Clarified the error messages for unsupported operands to an operator
17170 (like 1 + '').
17171
17172Extension modules
17173-----------------
17174
17175- mmap has a new keyword argument, "access", allowing a uniform way for
17176 both Windows and Unix users to create read-only, write-through and
17177 copy-on-write memory mappings. This was previously possible only on
17178 Unix. A new keyword argument was required to support this in a
17179 uniform way because the mmap() signatures had diverged across
17180 platforms. Thanks to Jay T Miller for repairing this!
17181
17182- By default, the gc.garbage list now contains only those instances in
17183 unreachable cycles that have __del__ methods; in 2.1 it contained all
17184 instances in unreachable cycles. "Instances" here has been generalized
17185 to include instances of both new-style and old-style classes.
17186
17187- The socket module defines a new method for socket objects,
17188 sendall(). This is like send() but may make multiple calls to
17189 send() until all data has been sent. Also, the socket function has
17190 been converted to a subclassable type, like list and tuple (etc.)
17191 before it; socket and SocketType are now the same thing.
17192
17193- Various bugfixes to the curses module. There is now a test suite
17194 for the curses module (you have to run it manually).
17195
17196- binascii.b2a_base64 no longer places an arbitrary restriction of 57
17197 bytes on its input.
17198
17199Library
17200-------
17201
17202- tkFileDialog exposes a Directory class and askdirectory
17203 convenience function.
17204
17205- Symbolic group names in regular expressions must be unique. For
17206 example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
17207 single name can't mean both "group 1" and "group 2" simultaneously.
17208 Python 2.2 detects this error at regexp compilation time;
17209 previously, the error went undetected, and results were
17210 unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
17211 pattern.subn() methods have been rewritten in C. Also, an
17212 experimental function/method finditer() has been added, which works
17213 like findall() but returns an iterator.
17214
17215- Tix exposes more commands through the classes DirSelectBox,
17216 DirSelectDialog, ListNoteBook, Meter, CheckList, and the
17217 methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
17218 tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
17219
17220- Traceback objects are now scanned by cyclic garbage collection, so
17221 cycles created by casual use of sys.exc_info() no longer cause
17222 permanent memory leaks (provided garbage collection is enabled).
17223
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017224- mimetypes.py has optional support for non-standard, but commonly
17225 found types. guess_type() and guess_extension() now accept an
17226 optional 'strict' flag, defaulting to true, which controls whether
17227 recognize non-standard types or not. A few non-standard types we
17228 know about have been added. Also, when run as a script, there are
17229 new -l and -e options.
17230
17231- statcache is now deprecated.
17232
17233- email.Utils.formatdate() now produces the preferred RFC 2822 style
17234 dates with numeric timezones (it used to produce obsolete dates
17235 hard coded to "GMT" timezone). An optional 'localtime' flag is
17236 added to produce dates in the local timezone, with daylight savings
17237 time properly taken into account.
17238
17239- In pickle and cPickle, instead of masking errors in load() by
17240 transforming them into SystemError, we let the original exception
17241 propagate out. Also, implement support for __safe_for_unpickling__
17242 in pickle, as it already was supported in cPickle.
17243
17244Tools/Demos
17245-----------
17246
17247Build
17248-----
17249
17250- The dbm module is built using libdb1 if available. The bsddb module
17251 is built with libdb3 if available.
17252
17253- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
17254
17255C API
17256-----
17257
17258- New function PySequence_Fast_GET_SIZE() returns the size of a non-
17259 NULL result from PySequence_Fast(), more quickly than calling
17260 PySequence_Size().
17261
17262- New argument unpacking function PyArg_UnpackTuple() added.
17263
17264- New functions PyObject_CallFunctionObjArgs() and
17265 PyObject_CallMethodObjArgs() have been added to make it more
17266 convenient and efficient to call functions and methods from C.
17267
17268- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
17269 possible that this will propagate errors it didn't before.
17270
17271- New function PyObject_CheckReadBuffer(), which returns true if its
17272 argument supports the single-segment readable buffer interface.
17273
17274New platforms
17275-------------
17276
17277- We've finally confirmed that this release builds on HP-UX 11.00,
17278 *with* threads, and passes the test suite.
17279
17280- Thanks to a series of patches from Michael Muller, Python may build
17281 again under OS/2 Visual Age C++.
17282
17283- Updated RISCOS port by Dietmar Schwertberger.
17284
17285Tests
17286-----
17287
17288- Added a test script for the curses module. It isn't run automatically;
17289 regrtest.py must be run with '-u curses' to enable it.
17290
17291Windows
17292-------
17293
17294Mac
17295----
17296
17297- PythonScript has been moved to unsupported and is slated to be
17298 removed completely in the next release.
17299
17300- It should now be possible to build applets that work on both OS9 and
17301 OSX.
17302
17303- The core is now linked with CoreServices not Carbon; as a side
17304 result, default 8bit encoding on OSX is now ASCII.
17305
17306- Python should now build on OSX 10.1.1
17307
17308
17309What's New in Python 2.2b1?
17310===========================
17311
17312*Release date: 19-Oct-2001*
17313
17314Type/class unification and new-style classes
17315--------------------------------------------
17316
17317- New-style classes are now always dynamic (except for built-in and
17318 extension types). There is no longer a performance penalty, and I
17319 no longer see another reason to keep this baggage around. One relic
17320 remains: the __dict__ of a new-style class is a read-only proxy; you
17321 must set the class's attribute to modify it. As a consequence, the
17322 __defined__ attribute of new-style types no longer exists, for lack
17323 of need: there is once again only one __dict__ (although in the
17324 future a __cache__ may be resurrected with a similar function, if I
17325 can prove that it actually speeds things up).
17326
17327- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
17328 always returned None, even when there was a class docstring).
17329
17330- doctest now finds and runs docstrings attached to new-style classes,
17331 class methods, static methods, and properties.
17332
17333Core and builtins
17334-----------------
17335
17336- A very subtle syntactical pitfall in list comprehensions was fixed.
17337 For example: [a+b for a in 'abc', for b in 'def']. The comma in
17338 this example is a mistake. Previously, this would silently let 'a'
17339 iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
17340 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
17341 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
17342 Note that [a for a in <singleton>] is a convoluted way to say
17343 [<singleton>] anyway, so it's not like any expressiveness is lost.
17344
17345- getattr(obj, name, default) now only catches AttributeError, as
17346 documented, rather than returning the default value for all
17347 exceptions (which could mask bugs in a __getattr__ hook, for
17348 example).
17349
17350- Weak reference objects are now part of the core and offer a C API.
17351 A bug which could allow a core dump when binary operations involved
17352 proxy reference has been fixed. weakref.ReferenceError is now a
17353 built-in exception.
17354
17355- unicode(obj) now behaves more like str(obj), accepting arbitrary
17356 objects, and calling a __unicode__ method if it exists.
17357 unicode(obj, encoding) and unicode(obj, encoding, errors) still
17358 require an 8-bit string or character buffer argument.
17359
17360- isinstance() now allows any object as the first argument and a
17361 class, a type or something with a __bases__ tuple attribute for the
17362 second argument. The second argument may also be a tuple of a
17363 class, type, or something with __bases__, in which case isinstance()
17364 will return true if the first argument is an instance of any of the
17365 things contained in the second argument tuple. E.g.
17366
17367 isinstance(x, (A, B))
17368
17369 returns true if x is an instance of A or B.
17370
17371Extension modules
17372-----------------
17373
17374- thread.start_new_thread() now returns the thread ID (previously None).
17375
17376- binascii has now two quopri support functions, a2b_qp and b2a_qp.
17377
17378- readline now supports setting the startup_hook and the
17379 pre_event_hook, and adds the add_history() function.
17380
17381- os and posix supports chroot(), setgroups() and unsetenv() where
17382 available. The stat(), fstat(), statvfs() and fstatvfs() functions
17383 now return "pseudo-sequences" -- the various fields can now be
17384 accessed as attributes (e.g. os.stat("/").st_mtime) but for
17385 backwards compatibility they also behave as a fixed-length sequence.
17386 Some platform-specific fields (e.g. st_rdev) are only accessible as
17387 attributes.
17388
17389- time: localtime(), gmtime() and strptime() now return a
17390 pseudo-sequence similar to the os.stat() return value, with
17391 attributes like tm_year etc.
17392
17393- Decompression objects in the zlib module now accept an optional
17394 second parameter to decompress() that specifies the maximum amount
17395 of memory to use for the uncompressed data.
17396
17397- optional SSL support in the socket module now exports OpenSSL
17398 functions RAND_add(), RAND_egd(), and RAND_status(). These calls
17399 are useful on platforms like Solaris where OpenSSL does not
17400 automatically seed its PRNG. Also, the keyfile and certfile
17401 arguments to socket.ssl() are now optional.
17402
17403- posixmodule (and by extension, the os module on POSIX platforms) now
17404 exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
17405
17406Library
17407-------
17408
17409- doctest now excludes functions and classes not defined by the module
17410 being tested, thanks to Tim Hochberg.
17411
17412- HotShot, a new profiler implemented using a C-based callback, has
17413 been added. This substantially reduces the overhead of profiling,
17414 but it is still quite preliminary. Support modules and
17415 documentation will be added in upcoming releases (before 2.2 final).
17416
17417- profile now produces correct output in situations where an exception
17418 raised in Python is cleared by C code (e.g. hasattr()). This used
17419 to cause wrong output, including spurious claims of recursive
17420 functions and attribution of time spent to the wrong function.
17421
17422 The code and documentation for the derived OldProfile and HotProfile
17423 profiling classes was removed. The code hasn't worked for years (if
17424 you tried to use them, they raised exceptions). OldProfile
17425 intended to reproduce the behavior of the profiler Python used more
17426 than 7 years ago, and isn't interesting anymore. HotProfile intended
17427 to provide a faster profiler (but producing less information), and
17428 that's a worthy goal we intend to meet via a different approach (but
17429 without losing information).
17430
17431- Profile.calibrate() has a new implementation that should deliver
17432 a much better system-specific calibration constant. The constant can
17433 now be specified in an instance constructor, or as a Profile class or
17434 instance variable, instead of by editing profile.py's source code.
17435 Calibration must still be done manually (see the docs for the profile
17436 module).
17437
17438 Note that Profile.calibrate() must be overridden by subclasses.
17439 Improving the accuracy required exploiting detailed knowledge of
17440 profiler internals; the earlier method abstracted away the details
17441 and measured a simplified model instead, but consequently computed
17442 a constant too small by a factor of 2 on some modern machines.
17443
17444- quopri's encode and decode methods take an optional header parameter,
17445 which indicates whether output is intended for the header 'Q'
17446 encoding.
17447
17448- The SocketServer.ThreadingMixIn class now closes the request after
17449 finish_request() returns. (Not when it errors out though.)
17450
17451- The nntplib module's NNTP.body() method has grown a 'file' argument
17452 to allow saving the message body to a file.
17453
17454- The email package has added a class email.Parser.HeaderParser which
17455 only parses headers and does not recurse into the message's body.
17456 Also, the module/class MIMEAudio has been added for representing
17457 audio data (contributed by Anthony Baxter).
17458
17459- ftplib should be able to handle files > 2GB.
17460
17461- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
17462 ON, and OFF.
17463
17464- xml.dom.minidom NodeList objects now support the length attribute
17465 and item() method as required by the DOM specifications.
17466
17467Tools/Demos
17468-----------
17469
17470- Demo/dns was removed. It no longer serves any purpose; a package
17471 derived from it is now maintained by Anthony Baxter, see
17472 http://PyDNS.SourceForge.net.
17473
17474- The freeze tool has been made more robust, and two new options have
17475 been added: -X and -E.
17476
17477Build
17478-----
17479
17480- configure will use CXX in LINKCC if CXX is used to build main() and
17481 the system requires to link a C++ main using the C++ compiler.
17482
17483C API
17484-----
17485
17486- The documentation for the tp_compare slot is updated to require that
17487 the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
17488 not correct. This is not yet enforced but will be enforced in
17489 Python 2.3; even later, we may use -2 to indicate errors and +2 for
17490 "NotImplemented". Right now, -1 should be used for an error return.
17491
17492- PyLong_AsLongLong() now accepts int (as well as long) arguments.
17493 Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
17494 as long) arguments.
17495
17496- PyThread_start_new_thread() now returns a long int giving the thread
17497 ID, if one can be calculated; it returns -1 for error, 0 if no
17498 thread ID is calculated (this is an incompatible change, but only
17499 the thread module used this API). This code has only really been
17500 tested on Linux and Windows; other platforms please beware (and
17501 report any bugs or strange behavior).
17502
17503- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
17504 input.
17505
17506New platforms
17507-------------
17508
17509Tests
17510-----
17511
17512Windows
17513-------
17514
17515- Installer: If you install IDLE, and don't disable file-extension
17516 registration, a new "Edit with IDLE" context (right-click) menu entry
17517 is created for .py and .pyw files.
17518
17519- The signal module now supports SIGBREAK on Windows, thanks to Steven
17520 Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
17521 action remains to call Win32 ExitProcess(). This can be changed via
17522 signal.signal(). For example::
17523
17524 # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
17525 # (SIGINT) behavior.
17526 import signal
17527 signal.signal(signal.SIGBREAK, signal.default_int_handler)
17528
17529 try:
17530 while 1:
17531 pass
17532 except KeyboardInterrupt:
17533 # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
17534 # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
17535 # program without the possibility for any Python-level cleanup).
17536 print "Clean exit"
17537
17538
17539What's New in Python 2.2a4?
17540===========================
17541
17542*Release date: 28-Sep-2001*
17543
17544Type/class unification and new-style classes
17545--------------------------------------------
17546
17547- pydoc and inspect are now aware of new-style classes;
17548 e.g. help(list) at the interactive prompt now shows proper
17549 documentation for all operations on list objects.
17550
17551- Applications using Jim Fulton's ExtensionClass module can now safely
17552 be used with Python 2.2. In particular, Zope 2.4.1 now works with
17553 Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
17554 examples also work again. It is hoped that Gtk and Boost also work
17555 with 2.2a4 and beyond. (If you can confirm this, please write
17556 webmaster@python.org; if there are still problems, please open a bug
17557 report on SourceForge.)
17558
17559- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
17560 These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
17561 in the constructed property object. fget, fset and fdel weren't
17562 discoverable from Python in 2.2a3. __doc__ is new, and allows to
17563 associate a docstring with a property.
17564
17565- Comparison overloading is now more completely implemented. For
17566 example, a str subclass instance can properly be compared to a str
17567 instance, and it can properly overload comparison. Ditto for most
17568 other built-in object types.
17569
17570- The repr() of new-style classes has changed; instead of <type
17571 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
17572 *except* for built-in types, which are still rendered as <type
17573 'Foo'> (to avoid upsetting existing code that might parse or
17574 otherwise rely on repr() of certain type objects).
17575
17576- The repr() of new-style objects is now always <Foo object at XXX>;
17577 previously, it was sometimes <Foo instance at XXX>.
17578
17579- For new-style classes, what was previously called __getattr__ is now
17580 called __getattribute__. This method, if defined, is called for
17581 *every* attribute access. A new __getattr__ hook more similar to the
17582 one in classic classes is defined which is called only if regular
17583 attribute access raises AttributeError; to catch *all* attribute
17584 access, you can use __getattribute__ (for new-style classes). If
17585 both are defined, __getattribute__ is called first, and if it raises
17586 AttributeError, __getattr__ is called.
17587
17588- The __class__ attribute of new-style objects can be assigned to.
17589 The new class must have the same C-level object layout as the old
17590 class.
17591
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017592- The built-in file type can be subclassed now. In the usual pattern,
17593 "file" is the name of the built-in type, and file() is a new built-in
17594 constructor, with the same signature as the built-in open() function.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017595 file() is now the preferred way to open a file.
17596
17597- Previously, __new__ would only see sequential arguments passed to
17598 the type in a constructor call; __init__ would see both sequential
17599 and keyword arguments. This made no sense whatsoever any more, so
17600 now both __new__ and __init__ see all arguments.
17601
17602- Previously, hash() applied to an instance of a subclass of str or
17603 unicode always returned 0. This has been repaired.
17604
17605- Previously, an operation on an instance of a subclass of an
17606 immutable type (int, long, float, complex, tuple, str, unicode),
17607 where the subtype didn't override the operation (and so the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017608 operation was handled by the built-in type), could return that
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017609 instance instead a value of the base type. For example, if s was of
17610 a str subclass type, s[:] returned s as-is. Now it returns a str
17611 with the same value as s.
17612
17613- Provisional support for pickling new-style objects has been added.
17614
17615Core
17616----
17617
17618- file.writelines() now accepts any iterable object producing strings.
17619
17620- PyUnicode_FromEncodedObject() now works very much like
17621 PyObject_Str(obj) in that it tries to use __str__/tp_str
17622 on the object if the object is not a string or buffer. This
17623 makes unicode() behave like str() when applied to non-string/buffer
17624 objects.
17625
17626- PyFile_WriteObject now passes Unicode objects to the file's write
17627 method. As a result, all file-like objects which may be the target
17628 of a print statement must support Unicode objects, i.e. they must
17629 at least convert them into ASCII strings.
17630
17631- Thread scheduling on Solaris should be improved; it is no longer
17632 necessary to insert a small sleep at the start of a thread in order
17633 to let other runnable threads be scheduled.
17634
17635Library
17636-------
17637
17638- StringIO.StringIO instances and cStringIO.StringIO instances support
17639 read character buffer compatible objects for their .write() methods.
17640 These objects are converted to strings and then handled as such
17641 by the instances.
17642
17643- The "email" package has been added. This is basically a port of the
17644 mimelib package <http://sf.net/projects/mimelib> with API changes
17645 and some implementations updated to use iterators and generators.
17646
17647- difflib.ndiff() and difflib.Differ.compare() are generators now. This
17648 restores the ability of Tools/scripts/ndiff.py to start producing output
17649 before the entire comparison is complete.
17650
17651- StringIO.StringIO instances and cStringIO.StringIO instances support
17652 iteration just like file objects (i.e. their .readline() method is
17653 called for each iteration until it returns an empty string).
17654
17655- The codecs module has grown four new helper APIs to access
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017656 built-in codecs: getencoder(), getdecoder(), getreader(),
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017657 getwriter().
17658
17659- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
17660 simplifies writing XML RPC servers.
17661
17662- os.path.realpath(): a new function that returns the absolute pathname
17663 after interpretation of symbolic links. On non-Unix systems, this
17664 is an alias for os.path.abspath().
17665
17666- operator.indexOf() (PySequence_Index() in the C API) now works with any
17667 iterable object.
17668
17669- smtplib now supports various authentication and security features of
17670 the SMTP protocol through the new login() and starttls() methods.
17671
17672- hmac: a new module implementing keyed hashing for message
17673 authentication.
17674
17675- mimetypes now recognizes more extensions and file types. At the
17676 same time, some mappings not sanctioned by IANA were removed.
17677
17678- The "compiler" package has been brought up to date to the state of
17679 Python 2.2 bytecode generation. It has also been promoted from a
17680 Tool to a standard library package. (Tools/compiler still exists as
17681 a sample driver.)
17682
17683Build
17684-----
17685
17686- Large file support (LFS) is now automatic when the platform supports
17687 it; no more manual configuration tweaks are needed. On Linux, at
17688 least, it's possible to have a system whose C library supports large
17689 files but whose kernel doesn't; in this case, large file support is
17690 still enabled but doesn't do you any good unless you upgrade your
17691 kernel or share your Python executable with another system whose
17692 kernel has large file support.
17693
17694- The configure script now supplies plausible defaults in a
17695 cross-compilation environment. This doesn't mean that the supplied
17696 values are always correct, or that cross-compilation now works
17697 flawlessly -- but it's a first step (and it shuts up most of
17698 autoconf's warnings about AC_TRY_RUN).
17699
17700- The Unix build is now a bit less chatty, courtesy of the parser
17701 generator. The build is completely silent (except for errors) when
17702 using "make -s", thanks to a -q option to setup.py.
17703
17704C API
17705-----
17706
17707- The "structmember" API now supports some new flag bits to deny read
17708 and/or write access to attributes in restricted execution mode.
17709
17710New platforms
17711-------------
17712
17713- Compaq's iPAQ handheld, running the "familiar" Linux distribution
17714 (http://familiar.handhelds.org).
17715
17716Tests
17717-----
17718
17719- The "classic" standard tests, which work by comparing stdout to
17720 an expected-output file under Lib/test/output/, no longer stop at
17721 the first mismatch. Instead the test is run to completion, and a
17722 variant of ndiff-style comparison is used to report all differences.
17723 This is much easier to understand than the previous style of reporting.
17724
17725- The unittest-based standard tests now use regrtest's test_main()
17726 convention, instead of running as a side-effect of merely being
17727 imported. This allows these tests to be run in more natural and
17728 flexible ways as unittests, outside the regrtest framework.
17729
17730- regrtest.py is much better integrated with unittest and doctest now,
17731 especially in regard to reporting errors.
17732
17733Windows
17734-------
17735
17736- Large file support now also works for files > 4GB, on filesystems
17737 that support it (NTFS under Windows 2000). See "What's New in
17738 Python 2.2a3" for more detail.
17739
17740
17741What's New in Python 2.2a3?
17742===========================
17743
17744*Release Date: 07-Sep-2001*
17745
17746Core
17747----
17748
17749- Conversion of long to float now raises OverflowError if the long is too
17750 big to represent as a C double.
17751
17752- The 3-argument builtin pow() no longer allows a third non-None argument
17753 if either of the first two arguments is a float, or if both are of
17754 integer types and the second argument is negative (in which latter case
17755 the arguments are converted to float, so this is really the same
17756 restriction).
17757
17758- The builtin dir() now returns more information, and sometimes much
17759 more, generally naming all attributes of an object, and all attributes
17760 reachable from the object via its class, and from its class's base
17761 classes, and so on from them too. Example: in 2.2a2, dir([]) returned
17762 an empty list. In 2.2a3,
17763
17764 >>> dir([])
17765 ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
17766 '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
17767 '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
17768 '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
17769 '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
17770 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
17771 'reverse', 'sort']
17772
17773 dir(module) continues to return only the module's attributes, though.
17774
17775- Overflowing operations on plain ints now return a long int rather
17776 than raising OverflowError. This is a partial implementation of PEP
17777 237. You can use -Wdefault::OverflowWarning to enable a warning for
17778 this situation, and -Werror::OverflowWarning to revert to the old
17779 OverflowError exception.
17780
17781- A new command line option, -Q<arg>, is added to control run-time
17782 warnings for the use of classic division. (See PEP 238.) Possible
17783 values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
17784 -Qold, meaning the / operator has its classic meaning and no
17785 warnings are issued. Using -Qwarn issues a run-time warning about
17786 all uses of classic division for int and long arguments; -Qwarnall
17787 also warns about classic division for float and complex arguments
17788 (for use with fixdiv.py).
17789 [Note: the remainder of this item (preserved below) became
17790 obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
17791
17792 Using -Qnew is questionable; it turns on new division by default, but
17793 only in the __main__ module. You can usefully combine -Qwarn or
17794 -Qwarnall and -Qnew: this gives the __main__ module new division, and
17795 warns about classic division everywhere else.
17796
17797- Many built-in types can now be subclassed. This applies to int,
17798 long, float, str, unicode, and tuple. (The types complex, list and
17799 dictionary can also be subclassed; this was introduced earlier.)
17800 Note that restrictions apply when subclassing immutable built-in
17801 types: you can only affect the value of the instance by overloading
17802 __new__. You can add mutable attributes, and the subclass instances
17803 will have a __dict__ attribute, but you cannot change the "value"
17804 (as implemented by the base class) of an immutable subclass instance
17805 once it is created.
17806
17807- The dictionary constructor now takes an optional argument, a
17808 mapping-like object, and initializes the dictionary from its
17809 (key, value) pairs.
17810
17811- A new built-in type, super, has been added. This facilitates making
17812 "cooperative super calls" in a multiple inheritance setting. For an
17813 explanation, see http://www.python.org/2.2/descrintro.html#cooperation
17814
17815- A new built-in type, property, has been added. This enables the
17816 creation of "properties". These are attributes implemented by
17817 getter and setter functions (or only one of these for read-only or
17818 write-only attributes), without the need to override __getattr__.
17819 See http://www.python.org/2.2/descrintro.html#property
17820
17821- The syntax of floating-point and imaginary literals has been
17822 liberalized, to allow leading zeroes. Examples of literals now
17823 legal that were SyntaxErrors before:
17824
17825 00.0 0e3 0100j 07.5 00000000000000000008.
17826
17827- An old tokenizer bug allowed floating point literals with an incomplete
17828 exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
17829
17830Library
17831-------
17832
17833- telnetlib includes symbolic names for the options, and support for
17834 setting an option negotiation callback. It also supports processing
17835 of suboptions.
17836
17837- The new C standard no longer requires that math libraries set errno to
17838 ERANGE on overflow. For platform libraries that exploit this new
17839 freedom, Python's overflow-checking was wholly broken. A new overflow-
17840 checking scheme attempts to repair that, but may not be reliable on all
17841 platforms (C doesn't seem to provide anything both useful and portable
17842 in this area anymore).
17843
17844- Asynchronous timeout actions are available through the new class
17845 threading.Timer.
17846
17847- math.log and math.log10 now return sensible results for even huge
17848 long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
17849
17850- A new function, imp.lock_held(), returns 1 when the import lock is
17851 currently held. See the docs for the imp module.
17852
17853- pickle, cPickle and marshal on 32-bit platforms can now correctly read
17854 dumps containing ints written on platforms where Python ints are 8 bytes.
17855 When read on a box where Python ints are 4 bytes, such values are
17856 converted to Python longs.
17857
17858- In restricted execution mode (using the rexec module), unmarshalling
17859 code objects is no longer allowed. This plugs a security hole.
17860
17861- unittest.TestResult instances no longer store references to tracebacks
17862 generated by test failures. This prevents unexpected dangling references
17863 to objects that should be garbage collected between tests.
17864
17865Tools
17866-----
17867
17868- Tools/scripts/fixdiv.py has been added which can be used to fix
17869 division operators as per PEP 238.
17870
17871Build
17872-----
17873
17874- If you are an adventurous person using Mac OS X you may want to look at
17875 Mac/OSX. There is a Makefile there that will build Python as a real Mac
17876 application, which can be used for experimenting with Carbon or Cocoa.
17877 Discussion of this on pythonmac-sig, please.
17878
17879C API
17880-----
17881
17882- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
17883
17884- Note that PyLong_AsDouble can fail! This has always been true, but no
17885 callers checked for it. It's more likely to fail now, because overflow
17886 errors are properly detected now. The proper way to check::
17887
17888 double x = PyLong_AsDouble(some_long_object);
17889 if (x == -1.0 && PyErr_Occurred()) {
17890 /* The conversion failed. */
17891 }
17892
17893- The GC API has been changed. Extensions that use the old API will still
17894 compile but will not participate in GC. To upgrade an extension
17895 module:
17896
17897 - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
17898
17899 - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
17900 PyObject_GC_Del to deallocate them
17901
17902 - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
17903 to PyObject_GC_UnTrack
17904
17905 - remove PyGC_HEAD_SIZE from object size calculations
17906
17907 - remove calls to PyObject_AS_GC and PyObject_FROM_GC
17908
17909- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
17910 These can be used safely to construct string objects from a
17911 sprintf-style format string (similar to the format string supported
17912 by PyErr_Format()).
17913
17914New platforms
17915-------------
17916
17917- Stephen Hansen contributed patches sufficient to get a clean compile
17918 under Borland C (Windows), but he reports problems running it and ran
17919 out of time to complete the port. Volunteers? Expect a MemoryError
17920 when importing the types module; this is probably shallow, and
17921 causing later failures too.
17922
17923Tests
17924-----
17925
17926Windows
17927-------
17928
17929- Large file support is now enabled on Win32 platforms as well as on
17930 Win64. This means that, for example, you can use f.tell() and f.seek()
17931 to manipulate files larger than 2 gigabytes (provided you have enough
17932 disk space, and are using a Windows filesystem that supports large
17933 partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
17934 filesize limit, and large file support makes no difference there.
17935 FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
17936 NTFS has no practical limit on file size, and files of any size can be
17937 used from Python now.
17938
17939- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
17940 points to command.com (patch from Brian Quinlan).
17941
17942
17943What's New in Python 2.2a2?
17944===========================
17945
17946*Release Date: 22-Aug-2001*
17947
17948Build
17949-----
17950
17951- Tim Peters developed a brand new Windows installer using Wise 8.1,
17952 generously donated to us by Wise Solutions.
17953
17954- configure supports a new option --enable-unicode, with the values
17955 ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
17956 type and supporting code is completely removed from the interpreter.
17957
17958- A new configure option --enable-framework builds a Mac OS X framework,
17959 which "make frameworkinstall" will install. This provides a starting
17960 point for more mac-like functionality, join pythonmac-sig@python.org
17961 if you are interested in helping.
17962
17963- The NeXT platform is no longer supported.
17964
17965- The 'new' module is now statically linked.
17966
17967Tools
17968-----
17969
17970- The new Tools/scripts/cleanfuture.py can be used to automatically
17971 edit out obsolete future statements from Python source code. See
17972 the module docstring for details.
17973
17974Tests
17975-----
17976
17977- regrtest.py now knows which tests are expected to be skipped on some
17978 platforms, allowing to give clearer test result output. regrtest
17979 also has optional --use/-u switch to run normally disabled tests
17980 which require network access or consume significant disk resources.
17981
17982- Several new tests in the standard test suite, with special thanks to
17983 Nick Mathewson.
17984
17985Core
17986----
17987
17988- The floor division operator // has been added as outlined in PEP
17989 238. The / operator still provides classic division (and will until
17990 Python 3.0) unless "from __future__ import division" is included, in
17991 which case the / operator will provide true division. The operator
17992 module provides truediv() and floordiv() functions. Augmented
17993 assignment variants are included, as are the equivalent overloadable
17994 methods and C API methods. See the PEP for a full discussion:
17995 <http://python.sf.net/peps/pep-0238.html>
17996
17997- Future statements are now effective in simulated interactive shells
17998 (like IDLE). This should "just work" by magic, but read Michael
17999 Hudson's "Future statements in simulated shells" PEP 264 for full
18000 details: <http://python.sf.net/peps/pep-0264.html>.
18001
18002- The type/class unification (PEP 252-253) was integrated into the
18003 trunk and is not so tentative any more (the exact specification of
18004 some features is still tentative). A lot of work has done on fixing
18005 bugs and adding robustness and features (performance still has to
18006 come a long way).
18007
18008- Warnings about a mismatch in the Python API during extension import
18009 now use the Python warning framework (which makes it possible to
18010 write filters for these warnings).
18011
18012- A function's __dict__ (aka func_dict) will now always be a
18013 dictionary. It used to be possible to delete it or set it to None,
18014 but now both actions raise TypeErrors. It is still legal to set it
18015 to a dictionary object. Getting func.__dict__ before any attributes
18016 have been assigned now returns an empty dictionary instead of None.
18017
18018- A new command line option, -E, was added which disables the use of
18019 all environment variables, or at least those that are specifically
18020 significant to Python. Usually those have a name starting with
18021 "PYTHON". This was used to fix a problem where the tests fail if
18022 the user happens to have PYTHONHOME or PYTHONPATH pointing to an
18023 older distribution.
18024
18025Library
18026-------
18027
18028- New class Differ and new functions ndiff() and restore() in difflib.py.
18029 These package the algorithms used by the popular Tools/scripts/ndiff.py,
18030 for programmatic reuse.
18031
18032- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
18033 value using the minimal quoting required for the value; more
18034 reliable than using xml.sax.saxutils.escape() for attribute values.
18035
18036- Readline completion support for cmd.Cmd was added.
18037
18038- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
18039
18040- Added function threading.BoundedSemaphore()
18041
18042- Added Ka-Ping Yee's cgitb.py module.
18043
18044- The 'new' module now exposes the CO_xxx flags.
18045
18046- The gc module offers the get_referents function.
18047
18048New platforms
18049-------------
18050
18051C API
18052-----
18053
18054- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
18055 which provide a cross-platform implementations for the
18056 relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
18057 the standard sprintf() and vsprintf() C lib APIs, these versions
18058 apply bounds checking on the used buffer which enhances protection
18059 against buffer overruns.
18060
18061- Unicode APIs now use name mangling to assure that mixing interpreters
18062 and extensions using different Unicode widths is rendered next to
18063 impossible. Trying to import an incompatible Unicode-aware extension
18064 will result in an ImportError. Unicode extensions writers must make
18065 sure to check the Unicode width compatibility in their extensions by
18066 using at least one of the mangled Unicode APIs in the extension.
18067
18068- Two new flags METH_NOARGS and METH_O are available in method definition
18069 tables to simplify implementation of methods with no arguments and a
18070 single untyped argument. Calling such methods is more efficient than
18071 calling corresponding METH_VARARGS methods. METH_OLDARGS is now
18072 deprecated.
18073
18074Windows
18075-------
18076
18077- "import module" now compiles module.pyw if it exists and nothing else
18078 relevant is found.
18079
18080
18081What's New in Python 2.2a1?
18082===========================
18083
18084*Release date: 18-Jul-2001*
18085
18086Core
18087----
18088
18089- TENTATIVELY, a large amount of code implementing much of what's
18090 described in PEP 252 (Making Types Look More Like Classes) and PEP
18091 253 (Subtyping Built-in Types) was added. This will be released
18092 with Python 2.2a1. Documentation will be provided separately
18093 through http://www.python.org/2.2/. The purpose of releasing this
18094 with Python 2.2a1 is to test backwards compatibility. It is
18095 possible, though not likely, that a decision is made not to release
18096 this code as part of 2.2 final, if any serious backwards
18097 incompatibilities are found during alpha testing that cannot be
18098 repaired.
18099
18100- Generators were added; this is a new way to create an iterator (see
18101 below) using what looks like a simple function containing one or
18102 more 'yield' statements. See PEP 255. Since this adds a new
18103 keyword to the language, this feature must be enabled by including a
18104 future statement: "from __future__ import generators" (see PEP 236).
18105 Generators will become a standard feature in a future release
18106 (probably 2.3). Without this future statement, 'yield' remains an
18107 ordinary identifier, but a warning is issued each time it is used.
18108 (These warnings currently don't conform to the warnings framework of
18109 PEP 230; we intend to fix this in 2.2a2.)
18110
18111- The UTF-16 codec was modified to be more RFC compliant. It will now
18112 only remove BOM characters at the start of the string and then
18113 only if running in native mode (UTF-16-LE and -BE won't remove a
18114 leading BMO character).
18115
18116- Strings now have a new method .decode() to complement the already
18117 existing .encode() method. These two methods provide direct access
18118 to the corresponding decoders and encoders of the registered codecs.
18119
18120 To enhance the usability of the .encode() method, the special
18121 casing of Unicode object return values was dropped (Unicode objects
18122 were auto-magically converted to string using the default encoding).
18123
18124 Both methods will now return whatever the codec in charge of the
18125 requested encoding returns as object, e.g. Unicode codecs will
18126 return Unicode objects when decoding is requested ("äöü".decode("latin-1")
18127 will return u"äöü"). This enables codec writer to create codecs
18128 for various simple to use conversions.
18129
18130 New codecs were added to demonstrate these new features (the .encode()
18131 and .decode() columns indicate the type of the returned objects):
18132
18133 +---------+-----------+-----------+-----------------------------+
18134 |Name | .encode() | .decode() | Description |
18135 +=========+===========+===========+=============================+
18136 |uu | string | string | UU codec (e.g. for email) |
18137 +---------+-----------+-----------+-----------------------------+
18138 |base64 | string | string | base64 codec |
18139 +---------+-----------+-----------+-----------------------------+
18140 |quopri | string | string | quoted-printable codec |
18141 +---------+-----------+-----------+-----------------------------+
18142 |zlib | string | string | zlib compression |
18143 +---------+-----------+-----------+-----------------------------+
18144 |hex | string | string | 2-byte hex codec |
18145 +---------+-----------+-----------+-----------------------------+
18146 |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
18147 +---------+-----------+-----------+-----------------------------+
18148
18149- Some operating systems now support the concept of a default Unicode
18150 encoding for file system operations. Notably, Windows supports 'mbcs'
18151 as the default. The Macintosh will also adopt this concept in the medium
18152 term, although the default encoding for that platform will be other than
18153 'mbcs'.
18154
18155 On operating system that support non-ASCII filenames, it is common for
18156 functions that return filenames (such as os.listdir()) to return Python
18157 string objects pre-encoded using the default file system encoding for
18158 the platform. As this encoding is likely to be different from Python's
18159 default encoding, converting this name to a Unicode object before passing
18160 it back to the Operating System would result in a Unicode error, as Python
18161 would attempt to use its default encoding (generally ASCII) rather than
18162 the default encoding for the file system.
18163
18164 In general, this change simply removes surprises when working with
18165 Unicode and the file system, making these operations work as you expect,
18166 increasing the transparency of Unicode objects in this context.
18167 See [????] for more details, including examples.
18168
18169- Float (and complex) literals in source code were evaluated to full
18170 precision only when running from a .py file; the same code loaded from a
18171 .pyc (or .pyo) file could suffer numeric differences starting at about the
18172 12th significant decimal digit. For example, on a machine with IEEE-754
18173 floating arithmetic,
18174
18175 x = 9007199254740992.0
18176 print long(x)
18177
18178 printed 9007199254740992 if run directly from .py, but 9007199254740000
18179 if from a compiled (.pyc or .pyo) file. This was due to marshal using
18180 str(float) instead of repr(float) when building code objects. marshal
18181 now uses repr(float) instead, which should reproduce floats to full
18182 machine precision (assuming the platform C float<->string I/O conversion
18183 functions are of good quality).
18184
18185 This may cause floating-point results to change in some cases, and
18186 usually for the better, but may also cause numerically unstable
18187 algorithms to break.
18188
18189- The implementation of dicts suffers fewer collisions, which has speed
18190 benefits. However, the order in which dict entries appear in dict.keys(),
18191 dict.values() and dict.items() may differ from previous releases for a
18192 given dict. Nothing is defined about this order, so no program should
18193 rely on it. Nevertheless, it's easy to write test cases that rely on the
18194 order by accident, typically because of printing the str() or repr() of a
18195 dict to an "expected results" file. See Lib/test/test_support.py's new
18196 sortdict(dict) function for a simple way to display a dict in sorted
18197 order.
18198
18199- Many other small changes to dicts were made, resulting in faster
18200 operation along the most common code paths.
18201
18202- Dictionary objects now support the "in" operator: "x in dict" means
18203 the same as dict.has_key(x).
18204
18205- The update() method of dictionaries now accepts generic mapping
18206 objects. Specifically the argument object must support the .keys()
18207 and __getitem__() methods. This allows you to say, for example,
18208 {}.update(UserDict())
18209
18210- Iterators were added; this is a generalized way of providing values
18211 to a for loop. See PEP 234. There's a new built-in function iter()
18212 to return an iterator. There's a new protocol to get the next value
18213 from an iterator using the next() method (in Python) or the
18214 tp_iternext slot (in C). There's a new protocol to get iterators
18215 using the __iter__() method (in Python) or the tp_iter slot (in C).
18216 Iterating (i.e. a for loop) over a dictionary generates its keys.
18217 Iterating over a file generates its lines.
18218
18219- The following functions were generalized to work nicely with iterator
18220 arguments::
18221
18222 map(), filter(), reduce(), zip()
18223 list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
18224 max(), min()
18225 join() method of strings
18226 extend() method of lists
18227 'x in y' and 'x not in y' (PySequence_Contains() in C API)
18228 operator.countOf() (PySequence_Count() in C API)
18229 right-hand side of assignment statements with multiple targets, such as ::
18230 x, y, z = some_iterable_object_returning_exactly_3_values
18231
18232- Accessing module attributes is significantly faster (for example,
18233 random.random or os.path or yourPythonModule.yourAttribute).
18234
18235- Comparing dictionary objects via == and != is faster, and now works even
18236 if the keys and values don't support comparisons other than ==.
18237
18238- Comparing dictionaries in ways other than == and != is slower: there were
18239 insecurities in the dict comparison implementation that could cause Python
18240 to crash if the element comparison routines for the dict keys and/or
18241 values mutated the dicts. Making the code bulletproof slowed it down.
18242
18243- Collisions in dicts are resolved via a new approach, which can help
18244 dramatically in bad cases. For example, looking up every key in a dict
18245 d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
18246 faster now. Thanks to Christian Tismer for pointing out the cause and
18247 the nature of an effective cure (last December! better late than never).
18248
18249- repr() is much faster for large containers (dict, list, tuple).
18250
18251
18252Library
18253-------
18254
18255- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
18256 were added to the string module. These a locale-independent
18257 constants, unlike letters, lowercase, and uppercase. These are now
18258 use in appropriate locations in the standard library.
18259
18260- The flags used in dlopen calls can now be configured using
18261 sys.setdlopenflags and queried using sys.getdlopenflags.
18262
18263- Fredrik Lundh's xmlrpclib is now a standard library module. This
18264 provides full client-side XML-RPC support. In addition,
18265 Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
18266 one asyncore-based). Thanks to Eric Raymond for the documentation.
18267
18268- The xrange() object is simplified: it no longer supports slicing,
18269 repetition, comparisons, efficient 'in' checking, the tolist()
18270 method, or the start, stop and step attributes. See PEP 260.
18271
18272- A new function fnmatch.filter to filter lists of file names was added.
18273
18274- calendar.py uses month and day names based on the current locale.
18275
18276- strop is now *really* obsolete (this was announced before with 1.6),
18277 and issues DeprecationWarning when used (except for the four items
18278 that are still imported into string.py).
18279
18280- Cookie.py now sorts key+value pairs by key in output strings.
18281
18282- pprint.isrecursive(object) didn't correctly identify recursive objects.
18283 Now it does.
18284
18285- pprint functions now much faster for large containers (tuple, list, dict).
18286
18287- New 'q' and 'Q' format codes in the struct module, corresponding to C
18288 types "long long" and "unsigned long long" (on Windows, __int64). In
18289 native mode, these can be used only when the platform C compiler supports
18290 these types (when HAVE_LONG_LONG is #define'd by the Python config
18291 process), and then they inherit the sizes and alignments of the C types.
18292 In standard mode, 'q' and 'Q' are supported on all platforms, and are
18293 8-byte integral types.
18294
18295- The site module installs a new built-in function 'help' that invokes
18296 pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
18297 it displays a message reminding the user to use 'help()' or
18298 'help(object)'.
18299
18300Tests
18301-----
18302
18303- New test_mutants.py runs dict comparisons where the key and value
18304 comparison operators mutate the dicts randomly during comparison. This
18305 rapidly causes Python to crash under earlier releases (not for the faint
18306 of heart: it can also cause Win9x to freeze or reboot!).
18307
18308- New test_pprint.py verifies that pprint.isrecursive() and
18309 pprint.isreadable() return sensible results. Also verifies that simple
18310 cases produce correct output.
18311
18312C API
18313-----
18314
18315- Removed the unused last_is_sticky argument from the internal
18316 _PyTuple_Resize(). If this affects you, you were cheating.
18317
Skip Montanaro4cb22042002-09-17 20:55:31 +000018318What's New in Python 2.1 (final)?
18319=================================
18320
18321We only changed a few things since the last release candidate, all in
18322Python library code:
18323
18324- A bug in the locale module was fixed that affected locales which
18325 define no grouping for numeric formatting.
18326
18327- A few bugs in the weakref module's implementations of weak
18328 dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
18329 and the test suite was updated to check for these bugs.
18330
18331- An old bug in the os.path.walk() function (introduced in Python
18332 2.0!) was fixed: a non-existent file would cause an exception
18333 instead of being ignored.
18334
18335- Fixed a few bugs in the new symtable module found by Neil Norwitz's
18336 PyChecker.
18337
18338
18339What's New in Python 2.1c2?
18340===========================
18341
18342A flurry of small changes, and one showstopper fixed in the nick of
18343time made it necessary to release another release candidate. The list
18344here is the *complete* list of patches (except version updates):
18345
18346Core
18347
18348- Tim discovered a nasty bug in the dictionary code, caused by
18349 PyDict_Next() calling dict_resize(), and the GC code's use of
18350 PyDict_Next() violating an assumption in dict_items(). This was
18351 fixed with considerable amounts of band-aid, but the net effect is a
18352 saner and more robust implementation.
18353
18354- Made a bunch of symbols static that were accidentally global.
18355
18356Build and Ports
18357
18358- The setup.py script didn't check for a new enough version of zlib
18359 (1.1.3 is needed). Now it does.
18360
18361- Changed "make clean" target to also remove shared libraries.
18362
18363- Added a more general warning about the SGI Irix optimizer to README.
18364
18365Library
18366
18367- Fix a bug in urllib.basejoin("http://host", "../file.html") which
18368 omitted the slash between host and file.html.
18369
18370- The mailbox module's _Mailbox class contained a completely broken
18371 and undocumented seek() method. Ripped it out.
18372
18373- Fixed a bunch of typos in various library modules (urllib2, smtpd,
18374 sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
18375
18376- Fixed a few last-minute bugs in unittest.
18377
18378Extensions
18379
18380- Reverted the patch to the OpenSSL code in socketmodule.c to support
18381 RAND_status() and the EGD, and the subsequent patch that tried to
18382 fix it for pre-0.9.5 versions; the problem with the patch is that on
18383 some systems it issues a warning whenever socket is imported, and
18384 that's unacceptable.
18385
18386Tests
18387
18388- Fixed the pickle tests to work with "import test.test_pickle".
18389
18390- Tweaked test_locale.py to actually run the test Windows.
18391
18392- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
18393 not "wb" (which is not a valid mode at all).
18394
18395- Fix pstats browser crashes. Import readline if it exists to make
18396 the user interface nicer.
18397
18398- Add "import thread" to the top of test modules that import the
18399 threading module (test_asynchat and test_threadedtempfile). This
18400 prevents test failures caused by a broken threading module resulting
18401 from a previously caught failed import.
18402
18403- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
18404 needed on some platforms (e.g. Solaris 8) when the tests are run
18405 twice in succession.
18406
18407- Skip rather than fail test_sunaudiodev if no audio device is found.
18408
18409
18410What's New in Python 2.1c1?
18411===========================
18412
18413This list was significantly updated when 2.1c2 was released; the 2.1c1
18414release didn't mention most changes that were actually part of 2.1c1:
18415
18416Legal
18417
18418- Copyright was assigned to the Python Software Foundation (PSF) and a
18419 PSF license (very similar to the CNRI license) was added.
18420
18421- The CNRI copyright notice was updated to include 2001.
18422
18423Core
18424
18425- After a public outcry, assignment to __debug__ is no longer illegal;
18426 instead, a warning is issued. It will become illegal in 2.2.
18427
18428- Fixed a core dump with "%#x" % 0, and changed the semantics so that
18429 "%#x" now always prepends "0x", even if the value is zero.
18430
18431- Fixed some nits in the bytecode compiler.
18432
18433- Fixed core dumps when calling certain kinds of non-functions.
18434
18435- Fixed various core dumps caused by reference count bugs.
18436
18437Build and Ports
18438
18439- Use INSTALL_SCRIPT to install script files.
18440
18441- New port: SCO Unixware 7, by Billy G. Allie.
18442
18443- Updated RISCOS port.
18444
18445- Updated BeOS port and notes.
18446
18447- Various other porting problems resolved.
18448
18449Library
18450
18451- The TERMIOS and SOCKET modules are now truly obsolete and
18452 unnecessary. Their symbols are incorporated in the termios and
18453 socket modules.
18454
18455- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
18456 better tests for pickling.
18457
18458- threading: make Condition.wait() robust against KeyboardInterrupt.
18459
18460- zipfile: add support to zipfile to support opening an archive
18461 represented by an open file rather than a file name. Fix bug where
18462 the archive was not properly closed. Fixed a bug in this bugfix
18463 where flush() was called for a read-only file.
18464
18465- imputil: added an uninstall() method to the ImportManager.
18466
18467- Canvas: fixed bugs in lower() and tkraise() methods.
18468
18469- SocketServer: API change (added overridable close_request() method)
18470 so that the TCP server can explicitly close the request.
18471
18472- pstats: Eric Raymond added a simple interactive statistics browser,
18473 invoked when the module is run as a script.
18474
18475- locale: fixed a problem in format().
18476
18477- webbrowser: made it work when the BROWSER environment variable has a
18478 value like "/usr/bin/netscape". Made it auto-detect Konqueror for
18479 KDE 2. Fixed some other nits.
18480
18481- unittest: changes to allow using a different exception than
18482 AssertionError, and added a few more function aliases. Some other
18483 small changes.
18484
18485- urllib, urllib2: fixed redirect problems and a coupleof other nits.
18486
18487- asynchat: fixed a critical bug in asynchat that slipped through the
18488 2.1b2 release. Fixed another rare bug.
18489
18490- Fix some unqualified except: clauses (always a bad code example).
18491
18492XML
18493
18494- pyexpat: new API get_version_string().
18495
18496- Fixed some minidom bugs.
18497
18498Extensions
18499
18500- Fixed a core dump in _weakref. Removed the weakref.mapping()
18501 function (it adds nothing to the API).
18502
18503- Rationalized the use of header files in the readline module, to make
18504 it compile (albeit with some warnings) with the very recent readline
18505 4.2, without breaking for earlier versions.
18506
18507- Hopefully fixed a buffering problem in linuxaudiodev.
18508
18509- Attempted a fix to make the OpenSSL support in the socket module
18510 work again with pre-0.9.5 versions of OpenSSL.
18511
18512Tests
18513
18514- Added a test case for asynchat and asyncore.
18515
18516- Removed coupling between tests where one test failing could break
18517 another.
18518
18519Tools
18520
18521- Ping added an interactive help browser to pydoc, fixed some nits
18522 in the rest of the pydoc code, and added some features to his
18523 inspect module.
18524
18525- An updated python-mode.el version 4.1 which integrates Ken
18526 Manheimer's pdbtrack.el. This makes debugging Python code via pdb
18527 much nicer in XEmacs and Emacs. When stepping through your program
18528 with pdb, in either the shell window or the *Python* window, the
18529 source file and line will be tracked by an arrow. Very cool!
18530
18531- IDLE: syntax warnings in interactive mode are changed into errors.
18532
18533- Some improvements to Tools/webchecker (ignore some more URL types,
18534 follow some more links).
18535
18536- Brought the Tools/compiler package up to date.
18537
18538
18539What's New in Python 2.1 beta 2?
18540================================
18541
18542(Unlisted are many fixed bugs, more documentation, etc.)
18543
18544Core language, builtins, and interpreter
18545
18546- The nested scopes work (enabled by "from __future__ import
18547 nested_scopes") is completed; in particular, the future now extends
18548 into code executed through exec, eval() and execfile(), and into the
18549 interactive interpreter.
18550
18551- When calling a base class method (e.g. BaseClass.__init__(self)),
18552 this is now allowed even if self is not strictly spoken a class
18553 instance (e.g. when using metaclasses or the Don Beaudry hook).
18554
18555- Slice objects are now comparable but not hashable; this prevents
18556 dict[:] from being accepted but meaningless.
18557
18558- Complex division is now calculated using less braindead algorithms.
18559 This doesn't change semantics except it's more likely to give useful
18560 results in extreme cases. Complex repr() now uses full precision
18561 like float repr().
18562
18563- sgmllib.py now calls handle_decl() for simple <!...> declarations.
18564
18565- It is illegal to assign to the name __debug__, which is set when the
18566 interpreter starts. It is effectively a compile-time constant.
18567
18568- A warning will be issued if a global statement for a variable
18569 follows a use or assignment of that variable.
18570
18571Standard library
18572
18573- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
18574 inspired by JUnit), is now part of the standard library. You now
18575 have a choice of two testing frameworks: unittest requires you to
18576 write testcases as separate code, doctest gathers them from
18577 docstrings. Both approaches have their advantages and
18578 disadvantages.
18579
18580- A new module Tix was added, which wraps the Tix extension library
18581 for Tk. With that module, it is not necessary to statically link
18582 Tix with _tkinter, since Tix will be loaded with Tcl's "package
18583 require" command. See Demo/tix/.
18584
18585- tzparse.py is now obsolete.
18586
18587- In gzip.py, the seek() and tell() methods are removed -- they were
18588 non-functional anyway, and it's better if callers can test for their
18589 existence with hasattr().
18590
18591Python/C API
18592
18593- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
18594 that's already in the dictionary during a PyDict_Next() iteration.
18595 This used to fail occasionally when a dictionary resize operation
18596 could be triggered that would rehash all the keys. All other
18597 modifications to the dictionary are still off-limits during a
18598 PyDict_Next() iteration!
18599
18600- New extended APIs related to passing compiler variables around.
18601
18602- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
18603 implement isinstance() and issubclass().
18604
18605- Py_BuildValue() now has a "D" conversion to create a Python complex
18606 number from a Py_complex C value.
18607
18608- Extensions types which support weak references must now set the
18609 field allocated for the weak reference machinery to NULL themselves;
18610 this is done to avoid the cost of checking each object for having a
18611 weakly referencable type in PyObject_INIT(), since most types are
18612 not weakly referencable.
18613
18614- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
18615 free variables and cell variables to and from the frame's f_locals.
18616
18617- Variants of several functions defined in pythonrun.h have been added
18618 to support the nested_scopes future statement. The variants all end
18619 in Flags and take an extra argument, a PyCompilerFlags *; examples:
18620 PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
18621 variants may be removed in Python 2.2, when nested scopes are
18622 mandatory.
18623
18624Distutils
18625
18626- the sdist command now writes a PKG-INFO file, as described in PEP 241,
18627 into the release tree.
18628
18629- several enhancements to the bdist_wininst command from Thomas Heller
18630 (an uninstaller, more customization of the installer's display)
18631
18632- from Jack Jansen: added Mac-specific code to generate a dialog for
18633 users to specify the command-line (because providing a command-line with
18634 MacPython is awkward). Jack also made various fixes for the Mac
18635 and the Metrowerks compiler.
18636
18637- added 'platforms' and 'keywords' to the set of metadata that can be
18638 specified for a distribution.
18639
18640- applied patches from Jason Tishler to make the compiler class work with
18641 Cygwin.
18642
18643
18644What's New in Python 2.1 beta 1?
18645================================
18646
18647Core language, builtins, and interpreter
18648
18649- Following an outcry from the community about the amount of code
18650 broken by the nested scopes feature introduced in 2.1a2, we decided
18651 to make this feature optional, and to wait until Python 2.2 (or at
18652 least 6 months) to make it standard. The option can be enabled on a
18653 per-module basis by adding "from __future__ import nested_scopes" at
18654 the beginning of a module (before any other statements, but after
18655 comments and an optional docstring). See PEP 236 (Back to the
18656 __future__) for a description of the __future__ statement. PEP 227
18657 (Statically Nested Scopes) has been updated to reflect this change,
18658 and to clarify the semantics in a number of endcases.
18659
18660- The nested scopes code, when enabled, has been hardened, and most
18661 bugs and memory leaks in it have been fixed.
18662
18663- Compile-time warnings are now generated for a number of conditions
18664 that will break or change in meaning when nested scopes are enabled:
18665
18666 - Using "from...import *" or "exec" without in-clause in a function
18667 scope that also defines a lambda or nested function with one or
18668 more free (non-local) variables. The presence of the import* or
18669 bare exec makes it impossible for the compiler to determine the
18670 exact set of local variables in the outer scope, which makes it
18671 impossible to determine the bindings for free variables in the
18672 inner scope. To avoid the warning about import *, change it into
18673 an import of explicitly name object, or move the import* statement
18674 to the global scope; to avoid the warning about bare exec, use
18675 exec...in... (a good idea anyway -- there's a possibility that
18676 bare exec will be deprecated in the future).
18677
18678 - Use of a global variable in a nested scope with the same name as a
18679 local variable in a surrounding scope. This will change in
18680 meaning with nested scopes: the name in the inner scope will
18681 reference the variable in the outer scope rather than the global
18682 of the same name. To avoid the warning, either rename the outer
18683 variable, or use a global statement in the inner function.
18684
18685- An optional object allocator has been included. This allocator is
18686 optimized for Python objects and should be faster and use less memory
18687 than the standard system allocator. It is not enabled by default
18688 because of possible thread safety problems. The allocator is only
18689 protected by the Python interpreter lock and it is possible that some
18690 extension modules require a thread safe allocator. The object
18691 allocator can be enabled by providing the "--with-pymalloc" option to
18692 configure.
18693
18694Standard library
18695
18696- pyexpat now detects the expat version if expat.h defines it. A
18697 number of additional handlers are provided, which are only available
18698 since expat 1.95. In addition, the methods SetParamEntityParsing and
18699 GetInputContext of Parser objects are available with 1.95.x
18700 only. Parser objects now provide the ordered_attributes and
18701 specified_attributes attributes. A new module expat.model was added,
18702 which offers a number of additional constants if 1.95.x is used.
18703
18704- xml.dom offers the new functions registerDOMImplementation and
18705 getDOMImplementation.
18706
18707- xml.dom.minidom offers a toprettyxml method. A number of DOM
18708 conformance issues have been resolved. In particular, Element now
18709 has an hasAttributes method, and the handling of namespaces was
18710 improved.
18711
18712- Ka-Ping Yee contributed two new modules: inspect.py, a module for
18713 getting information about live Python code, and pydoc.py, a module
18714 for interactively converting docstrings to HTML or text.
18715 Tools/scripts/pydoc, which is now automatically installed into
18716 <prefix>/bin, uses pydoc.py to display documentation; try running
18717 "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
18718 lets you browse the module docstrings using a web browser.
18719
18720- New library module difflib.py, primarily packaging the SequenceMatcher
18721 class at the heart of the popular ndiff.py file-comparison tool.
18722
18723- doctest.py (a framework for verifying Python code examples in docstrings)
18724 is now part of the std library.
18725
18726Windows changes
18727
18728- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
18729 small GUI that lets you browse the module docstrings using your
18730 default web browser.
18731
18732- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
18733 Platforms) is implemented. See
18734
18735 http://python.sourceforge.net/peps/pep-0235.html
18736
18737 for full details, especially the "Current Lower-Left Semantics" section.
18738 The new Windows import rules are simpler than before:
18739
18740 A. If the PYTHONCASEOK environment variable exists, same as
18741 before: silently accept the first case-insensitive match of any
18742 kind; raise ImportError if none found.
18743
18744 B. Else search sys.path for the first case-sensitive match; raise
18745 ImportError if none found.
18746
18747 The same rules have been implemented on other platforms with case-
18748 insensitive but case-preserving filesystems too (including Cygwin, and
18749 several flavors of Macintosh operating systems).
18750
18751- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
18752 what it's supposed to do (and does do under NT and 2000) via direct
18753 port manipulation. It's unknown whether this will work on all systems,
18754 but it does work on my Win98SE systems now and was known to be useless on
18755 all Win9x systems before.
18756
18757- Build: Subproject _test (effectively) renamed to _testcapi.
18758
18759New platforms
18760
18761- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
18762 Thanks to Steven Majewski!
18763
18764- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
18765 Tishler!
18766
18767- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
18768 Schwertberger! See RISCOS/README for more information -- it seems
18769 that because of the bizarre filename conventions on RISCOS, no port
18770 to that platform is easy.
18771
18772
18773What's New in Python 2.1 alpha 2?
18774=================================
18775
18776Core language, builtins, and interpreter
18777
18778- Scopes nest. If a name is used in a function or class, but is not
18779 local, the definition in the nearest enclosing function scope will
18780 be used. One consequence of this change is that lambda statements
18781 could reference variables in the namespaces where the lambda is
18782 defined. In some unusual cases, this change will break code.
18783
18784 In all previous version of Python, names were resolved in exactly
18785 three namespaces -- the local namespace, the global namespace, and
Georg Brandl93dc9eb2010-03-14 10:56:14 +000018786 the builtins namespace. According to this old definition, if a
Skip Montanaro4cb22042002-09-17 20:55:31 +000018787 function A is defined within a function B, the names bound in B are
18788 not visible in A. The new rules make names bound in B visible in A,
18789 unless A contains a name binding that hides the binding in B.
18790
18791 Section 4.1 of the reference manual describes the new scoping rules
18792 in detail. The test script in Lib/test/test_scope.py demonstrates
18793 some of the effects of the change.
18794
18795 The new rules will cause existing code to break if it defines nested
18796 functions where an outer function has local variables with the same
18797 name as globals or builtins used by the inner function. Example:
18798
18799 def munge(str):
18800 def helper(x):
18801 return str(x)
18802 if type(str) != type(''):
18803 str = helper(str)
18804 return str.strip()
18805
18806 Under the old rules, the name str in helper() is bound to the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000018807 built-in function str(). Under the new rules, it will be bound to
Skip Montanaro4cb22042002-09-17 20:55:31 +000018808 the argument named str and an error will occur when helper() is
18809 called.
18810
18811- The compiler will report a SyntaxError if "from ... import *" occurs
18812 in a function or class scope. The language reference has documented
18813 that this case is illegal, but the compiler never checked for it.
18814 The recent introduction of nested scope makes the meaning of this
18815 form of name binding ambiguous. In a future release, the compiler
18816 may allow this form when there is no possibility of ambiguity.
18817
18818- repr(string) is easier to read, now using hex escapes instead of octal,
18819 and using \t, \n and \r instead of \011, \012 and \015 (respectively):
18820
18821 >>> "\texample \r\n" + chr(0) + chr(255)
18822 '\texample \r\n\x00\xff' # in 2.1
18823 '\011example \015\012\000\377' # in 2.0
18824
18825- Functions are now compared and hashed by identity, not by value, since
18826 the func_code attribute is writable.
18827
18828- Weak references (PEP 205) have been added. This involves a few
18829 changes in the core, an extension module (_weakref), and a Python
18830 module (weakref). The weakref module is the public interface. It
18831 includes support for "explicit" weak references, proxy objects, and
18832 mappings with weakly held values.
18833
18834- A 'continue' statement can now appear in a try block within the body
18835 of a loop. It is still not possible to use continue in a finally
18836 clause.
18837
18838Standard library
18839
18840- mailbox.py now has a new class, PortableUnixMailbox which is
18841 identical to UnixMailbox but uses a more portable scheme for
18842 determining From_ separators. Also, the constructors for all the
18843 classes in this module have a new optional `factory' argument, which
18844 is a callable used when new message classes must be instantiated by
18845 the next() method.
18846
18847- random.py is now self-contained, and offers all the functionality of
18848 the now-deprecated whrandom.py. See the docs for details. random.py
18849 also supports new functions getstate() and setstate(), for saving
18850 and restoring the internal state of the generator; and jumpahead(n),
18851 for quickly forcing the internal state to be the same as if n calls to
18852 random() had been made. The latter is particularly useful for multi-
18853 threaded programs, creating one instance of the random.Random() class for
18854 each thread, then using .jumpahead() to force each instance to use a
18855 non-overlapping segment of the full period.
18856
18857- random.py's seed() function is new. For bit-for-bit compatibility with
18858 prior releases, use the whseed function instead. The new seed function
18859 addresses two problems: (1) The old function couldn't produce more than
18860 about 2**24 distinct internal states; the new one about 2**45 (the best
18861 that can be done in the Wichmann-Hill generator). (2) The old function
18862 sometimes produced identical internal states when passed distinct
18863 integers, and there was no simple way to predict when that would happen;
18864 the new one guarantees to produce distinct internal states for all
18865 arguments in [0, 27814431486576L).
18866
18867- The socket module now supports raw packets on Linux. The socket
18868 family is AF_PACKET.
18869
18870- test_capi.py is a start at running tests of the Python C API. The tests
18871 are implemented by the new Modules/_testmodule.c.
18872
18873- A new extension module, _symtable, provides provisional access to the
18874 internal symbol table used by the Python compiler. A higher-level
18875 interface will be added on top of _symtable in a future release.
18876
18877- Removed the obsolete soundex module.
18878
18879- xml.dom.minidom now uses the standard DOM exceptions. Node supports
18880 the isSameNode method; NamedNodeMap the get method.
18881
18882- xml.sax.expatreader supports the lexical handler property; it
18883 generates comment, startCDATA, and endCDATA events.
18884
18885Windows changes
18886
18887- Build procedure: the zlib project is built in a different way that
18888 ensures the zlib header files used can no longer get out of synch with
18889 the zlib binary used. See PCbuild\readme.txt for details. Your old
18890 zlib-related directories can be deleted; you'll need to download fresh
18891 source for zlib and unpack it into a new directory.
18892
18893- Build: New subproject _test for the benefit of test_capi.py (see above).
18894
18895- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
18896 interface to some Python compiler internals).
18897
18898- Build: Subproject ucnhash is gone, since the code was folded into the
18899 unicodedata subproject.
18900
18901What's New in Python 2.1 alpha 1?
18902=================================
18903
18904Core language, builtins, and interpreter
18905
18906- There is a new Unicode companion to the PyObject_Str() API
18907 called PyObject_Unicode(). It behaves in the same way as the
18908 former, but assures that the returned value is an Unicode object
18909 (applying the usual coercion if necessary).
18910
18911- The comparison operators support "rich comparison overloading" (PEP
18912 207). C extension types can provide a rich comparison function in
18913 the new tp_richcompare slot in the type object. The cmp() function
18914 and the C function PyObject_Compare() first try the new rich
18915 comparison operators before trying the old 3-way comparison. There
18916 is also a new C API PyObject_RichCompare() (which also falls back on
18917 the old 3-way comparison, but does not constrain the outcome of the
18918 rich comparison to a Boolean result).
18919
18920 The rich comparison function takes two objects (at least one of
18921 which is guaranteed to have the type that provided the function) and
18922 an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
18923 Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
18924 object, which may be NotImplemented (in which case the tp_compare
18925 slot function is used as a fallback, if defined).
18926
18927 Classes can overload individual comparison operators by defining one
18928 or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
18929 __ge__. There are no explicit "reflected argument" versions of
18930 these; instead, __lt__ and __gt__ are each other's reflection,
18931 likewise for__le__ and __ge__; __eq__ and __ne__ are their own
18932 reflection (similar at the C level). No other implications are
18933 made; in particular, Python does not assume that == is the Boolean
18934 inverse of !=, or that < is the Boolean inverse of >=. This makes
18935 it possible to define types with partial orderings.
18936
18937 Classes or types that want to implement (in)equality tests but not
18938 the ordering operators (i.e. unordered types) should implement ==
18939 and !=, and raise an error for the ordering operators.
18940
18941 It is possible to define types whose rich comparison results are not
18942 Boolean; e.g. a matrix type might want to return a matrix of bits
18943 for A < B, giving elementwise comparisons. Such types should ensure
18944 that any interpretation of their value in a Boolean context raises
18945 an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
18946 at the C level) to always raise an exception.
18947
18948- Complex numbers use rich comparisons to define == and != but raise
18949 an exception for <, <=, > and >=. Unfortunately, this also means
18950 that cmp() of two complex numbers raises an exception when the two
18951 numbers differ. Since it is not mathematically meaningful to compare
18952 complex numbers except for equality, I hope that this doesn't break
18953 too much code.
18954
18955- The outcome of comparing non-numeric objects of different types is
18956 not defined by the language, other than that it's arbitrary but
18957 consistent (see the Reference Manual). An implementation detail changed
18958 in 2.1a1 such that None now compares less than any other object. Code
18959 relying on this new behavior (like code that relied on the previous
18960 behavior) does so at its own risk.
18961
18962- Functions and methods now support getting and setting arbitrarily
18963 named attributes (PEP 232). Functions have a new __dict__
18964 (a.k.a. func_dict) which hold the function attributes. Methods get
18965 and set attributes on their underlying im_func. It is a TypeError
18966 to set an attribute on a bound method.
18967
18968- The xrange() object implementation has been improved so that
18969 xrange(sys.maxint) can be used on 64-bit platforms. There's still a
18970 limitation that in this case len(xrange(sys.maxint)) can't be
18971 calculated, but the common idiom "for i in xrange(sys.maxint)" will
18972 work fine as long as the index i doesn't actually reach 2**31.
18973 (Python uses regular ints for sequence and string indices; fixing
18974 that is much more work.)
18975
18976- Two changes to from...import:
18977
18978 1) "from M import X" now works even if (after loading module M)
18979 sys.modules['M'] is not a real module; it's basically a getattr()
18980 operation with AttributeError exceptions changed into ImportError.
18981
18982 2) "from M import *" now looks for M.__all__ to decide which names to
18983 import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
18984 filters out names starting with '_' as before. Whether or not
18985 __all__ exists, there's no restriction on the type of M.
18986
18987- File objects have a new method, xreadlines(). This is the fastest
18988 way to iterate over all lines in a file:
18989
18990 for line in file.xreadlines():
18991 ...do something to line...
18992
18993 See the xreadlines module (mentioned below) for how to do this for
18994 other file-like objects.
18995
18996- Even if you don't use file.xreadlines(), you may expect a speedup on
18997 line-by-line input. The file.readline() method has been optimized
18998 quite a bit in platform-specific ways: on systems (like Linux) that
18999 support flockfile(), getc_unlocked(), and funlockfile(), those are
19000 used by default. On systems (like Windows) without getc_unlocked(),
19001 a complicated (but still thread-safe) method using fgets() is used by
19002 default.
19003
19004 You can force use of the fgets() method by #define'ing
19005 USE_FGETS_IN_GETLINE at build time (it may be faster than
19006 getc_unlocked()).
19007
19008 You can force fgets() not to be used by #define'ing
19009 DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
19010 test_bufio.py fails -- and let us know if it does!).
19011
19012- In addition, the fileinput module, while still slower than the other
19013 methods on most platforms, has been sped up too, by using
19014 file.readlines(sizehint).
19015
19016- Support for run-time warnings has been added, including a new
19017 command line option (-W) to specify the disposition of warnings.
19018 See the description of the warnings module below.
19019
19020- Extensive changes have been made to the coercion code. This mostly
19021 affects extension modules (which can now implement mixed-type
19022 numerical operators without having to use coercion), but
19023 occasionally, in boundary cases the coercion semantics have changed
19024 subtly. Since this was a terrible gray area of the language, this
19025 is considered an improvement. Also note that __rcmp__ is no longer
19026 supported -- instead of calling __rcmp__, __cmp__ is called with
19027 reflected arguments.
19028
19029- In connection with the coercion changes, a new built-in singleton
19030 object, NotImplemented is defined. This can be returned for
19031 operations that wish to indicate they are not implemented for a
19032 particular combination of arguments. From C, this is
19033 Py_NotImplemented.
19034
19035- The interpreter accepts now bytecode files on the command line even
19036 if they do not have a .pyc or .pyo extension. On Linux, after executing
19037
19038import imp,sys,string
19039magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
19040reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
19041open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
19042
19043 any byte code file can be used as an executable (i.e. as an argument
19044 to execve(2)).
19045
19046- %[xXo] formats of negative Python longs now produce a sign
19047 character. In 1.6 and earlier, they never produced a sign,
19048 and raised an error if the value of the long was too large
19049 to fit in a Python int. In 2.0, they produced a sign if and
19050 only if too large to fit in an int. This was inconsistent
19051 across platforms (because the size of an int varies across
19052 platforms), and inconsistent with hex() and oct(). Example:
19053
19054 >>> "%x" % -0x42L
19055 '-42' # in 2.1
19056 'ffffffbe' # in 2.0 and before, on 32-bit machines
19057 >>> hex(-0x42L)
19058 '-0x42L' # in all versions of Python
19059
19060 The behavior of %d formats for negative Python longs remains
19061 the same as in 2.0 (although in 1.6 and before, they raised
19062 an error if the long didn't fit in a Python int).
19063
19064 %u formats don't make sense for Python longs, but are allowed
19065 and treated the same as %d in 2.1. In 2.0, a negative long
19066 formatted via %u produced a sign if and only if too large to
19067 fit in an int. In 1.6 and earlier, a negative long formatted
19068 via %u raised an error if it was too big to fit in an int.
19069
19070- Dictionary objects have an odd new method, popitem(). This removes
19071 an arbitrary item from the dictionary and returns it (in the form of
19072 a (key, value) pair). This can be useful for algorithms that use a
19073 dictionary as a bag of "to do" items and repeatedly need to pick one
19074 item. Such algorithms normally end up running in quadratic time;
19075 using popitem() they can usually be made to run in linear time.
19076
19077Standard library
19078
19079- In the time module, the time argument to the functions strftime,
19080 localtime, gmtime, asctime and ctime is now optional, defaulting to
19081 the current time (in the local timezone).
19082
19083- The ftplib module now defaults to passive mode, which is deemed a
19084 more useful default given that clients are often inside firewalls
19085 these days. Note that this could break if ftplib is used to connect
19086 to a *server* that is inside a firewall, from outside; this is
19087 expected to be a very rare situation. To fix that, you can call
19088 ftp.set_pasv(0).
19089
19090- The module site now treats .pth files not only for path configuration,
19091 but also supports extensions to the initialization code: Lines starting
19092 with import are executed.
19093
19094- There's a new module, warnings, which implements a mechanism for
19095 issuing and filtering warnings. There are some new built-in
19096 exceptions that serve as warning categories, and a new command line
19097 option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
19098 turns warnings into errors). warnings.warn(message[, category])
19099 issues a warning message; this can also be called from C as
19100 PyErr_Warn(category, message).
19101
19102- A new module xreadlines was added. This exports a single factory
19103 function, xreadlines(). The intention is that this code is the
19104 absolutely fastest way to iterate over all lines in an open
19105 file(-like) object:
19106
19107 import xreadlines
19108 for line in xreadlines.xreadlines(file):
19109 ...do something to line...
19110
19111 This is equivalent to the previous the speed record holder using
19112 file.readlines(sizehint). Note that if file is a real file object
19113 (as opposed to a file-like object), this is equivalent:
19114
19115 for line in file.xreadlines():
19116 ...do something to line...
19117
19118- The bisect module has new functions bisect_left, insort_left,
19119 bisect_right and insort_right. The old names bisect and insort
19120 are now aliases for bisect_right and insort_right. XXX_right
19121 and XXX_left methods differ in what happens when the new element
19122 compares equal to one or more elements already in the list: the
19123 XXX_left methods insert to the left, the XXX_right methods to the
19124 right. Code that doesn't care where equal elements end up should
19125 continue to use the old, short names ("bisect" and "insort").
19126
19127- The new curses.panel module wraps the panel library that forms part
19128 of SYSV curses and ncurses. Contributed by Thomas Gellekum.
19129
19130- The SocketServer module now sets the allow_reuse_address flag by
19131 default in the TCPServer class.
19132
19133- A new function, sys._getframe(), returns the stack frame pointer of
19134 the caller. This is intended only as a building block for
19135 higher-level mechanisms such as string interpolation.
19136
19137- The pyexpat module supports a number of new handlers, which are
19138 available only in expat 1.2. If invocation of a callback fails, it
19139 will report an additional frame in the traceback. Parser objects
19140 participate now in garbage collection. If expat reports an unknown
19141 encoding, pyexpat will try to use a Python codec; that works only
19142 for single-byte charsets. The parser type objects is exposed as
19143 XMLParserObject.
19144
19145- xml.dom now offers standard definitions for symbolic node type and
19146 exception code constants, and a hierarchy of DOM exceptions. minidom
19147 was adjusted to use them.
19148
19149- The conformance of xml.dom.minidom to the DOM specification was
19150 improved. It detects a number of additional error cases; the
19151 previous/next relationship works even when the tree is modified;
19152 Node supports the normalize() method; NamedNodeMap, DocumentType and
19153 DOMImplementation classes were added; Element supports the
19154 hasAttribute and hasAttributeNS methods; and Text supports the splitText
19155 method.
19156
19157Build issues
19158
19159- For Unix (and Unix-compatible) builds, configuration and building of
19160 extension modules is now greatly automated. Rather than having to
19161 edit the Modules/Setup file to indicate which modules should be
19162 built and where their include files and libraries are, a
19163 distutils-based setup.py script now takes care of building most
19164 extension modules. All extension modules built this way are built
19165 as shared libraries. Only a few modules that must be linked
19166 statically are still listed in the Setup file; you won't need to
19167 edit their configuration.
19168
19169- Python should now build out of the box on Cygwin. If it doesn't,
19170 mail to Jason Tishler (jlt63 at users.sourceforge.net).
19171
19172- Python now always uses its own (renamed) implementation of getopt()
19173 -- there's too much variation among C library getopt()
19174 implementations.
19175
19176- C++ compilers are better supported; the CXX macro is always set to a
19177 C++ compiler if one is found.
19178
19179Windows changes
19180
19181- select module: By default under Windows, a select() call
19182 can specify no more than 64 sockets. Python now boosts
19183 this Microsoft default to 512. If you need even more than
19184 that, see the MS docs (you'll need to #define FD_SETSIZE
19185 and recompile Python from source).
19186
19187- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
19188 subdirectory is no more!
19189
19190
19191What's New in Python 2.0?
19192=========================
19193
19194Below is a list of all relevant changes since release 1.6. Older
19195changes are in the file HISTORY. If you are making the jump directly
19196from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
19197HISTORY file! Many important changes listed there.
19198
19199Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
19200the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000019201http://www.amk.ca/python/2.0/.
Skip Montanaro4cb22042002-09-17 20:55:31 +000019202
19203--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
19204
19205======================================================================
19206
19207What's new in 2.0 (since release candidate 1)?
19208==============================================
19209
19210Standard library
19211
19212- The copy_reg module was modified to clarify its intended use: to
19213 register pickle support for extension types, not for classes.
19214 pickle() will raise a TypeError if it is passed a class.
19215
19216- Fixed a bug in gettext's "normalize and expand" code that prevented
19217 it from finding an existing .mo file.
19218
19219- Restored support for HTTP/0.9 servers in httplib.
19220
19221- The math module was changed to stop raising OverflowError in case of
19222 underflow, and return 0 instead in underflow cases. Whether Python
19223 used to raise OverflowError in case of underflow was platform-
19224 dependent (it did when the platform math library set errno to ERANGE
19225 on underflow).
19226
19227- Fixed a bug in StringIO that occurred when the file position was not
19228 at the end of the file and write() was called with enough data to
19229 extend past the end of the file.
19230
19231- Fixed a bug that caused Tkinter error messages to get lost on
19232 Windows. The bug was fixed by replacing direct use of
19233 interp->result with Tcl_GetStringResult(interp).
19234
19235- Fixed bug in urllib2 that caused it to fail when it received an HTTP
19236 redirect response.
19237
19238- Several changes were made to distutils: Some debugging code was
19239 removed from util. Fixed the installer used when an external zip
19240 program (like WinZip) is not found; the source code for this
19241 installer is in Misc/distutils. check_lib() was modified to behave
19242 more like AC_CHECK_LIB by add other_libraries() as a parameter. The
19243 test for whether installed modules are on sys.path was changed to
19244 use both normcase() and normpath().
19245
19246- Several minor bugs were fixed in the xml package (the minidom,
19247 pulldom, expatreader, and saxutils modules).
19248
19249- The regression test driver (regrtest.py) behavior when invoked with
19250 -l changed: It now reports a count of objects that are recognized as
19251 garbage but not freed by the garbage collector.
19252
19253- The regression test for the math module was changed to test
19254 exceptional behavior when the test is run in verbose mode. Python
19255 cannot yet guarantee consistent exception behavior across platforms,
19256 so the exception part of test_math is run only in verbose mode, and
19257 may fail on your platform.
19258
19259Internals
19260
19261- PyOS_CheckStack() has been disabled on Win64, where it caused
19262 test_sre to fail.
19263
19264Build issues
19265
19266- Changed compiler flags, so that gcc is always invoked with -Wall and
19267 -Wstrict-prototypes. Users compiling Python with GCC should see
19268 exactly one warning, except if they have passed configure the
19269 --with-pydebug flag. The expected warning is for getopt() in
19270 Modules/main.c. This warning will be fixed for Python 2.1.
19271
19272- Fixed configure to add -threads argument during linking on OSF1.
19273
19274Tools and other miscellany
19275
19276- The compiler in Tools/compiler was updated to support the new
19277 language features introduced in 2.0: extended print statement, list
19278 comprehensions, and augmented assignments. The new compiler should
19279 also be backwards compatible with Python 1.5.2; the compiler will
19280 always generate code for the version of the interpreter it runs
19281 under.
19282
19283What's new in 2.0 release candidate 1 (since beta 2)?
19284=====================================================
19285
19286What is release candidate 1?
19287
19288We believe that release candidate 1 will fix all known bugs that we
19289intend to fix for the 2.0 final release. This release should be a bit
19290more stable than the previous betas. We would like to see even more
19291widespread testing before the final release, so we are producing this
19292release candidate. The final release will be exactly the same unless
19293any show-stopping (or brown bag) bugs are found by testers of the
19294release candidate.
19295
19296All the changes since the last beta release are bug fixes or changes
19297to support building Python for specific platforms.
19298
19299Core language, builtins, and interpreter
19300
19301- A bug that caused crashes when __coerce__ was used with augmented
19302 assignment, e.g. +=, was fixed.
19303
19304- Raise ZeroDivisionError when raising zero to a negative number,
Georg Brandl93dc9eb2010-03-14 10:56:14 +000019305 e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the built-in
Skip Montanaro4cb22042002-09-17 20:55:31 +000019306 power operator and the result of math.pow(0.0, -2.0) will vary by
19307 platform. On Linux, it raises a ValueError.
19308
19309- A bug in Unicode string interpolation was fixed that occasionally
19310 caused errors with formats including "%%". For example, the
19311 following expression "%% %s" % u"abc" no longer raises a TypeError.
19312
19313- Compilation of deeply nested expressions raises MemoryError instead
19314 of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
19315
19316- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
19317 rendering them useless. They are now written in binary mode again.
19318
19319Standard library
19320
19321- Keyword arguments are now accepted for most pattern and match object
19322 methods in SRE, the standard regular expression engine.
19323
19324- In SRE, fixed error with negative lookahead and lookbehind that
19325 manifested itself as a runtime error in patterns like "(?<!abc)(def)".
19326
19327- Several bugs in the Unicode handling and error handling in _tkinter
19328 were fixed.
19329
19330- Fix memory management errors in Merge() and Tkapp_Call() routines.
19331
19332- Several changes were made to cStringIO to make it compatible with
19333 the file-like object interface and with StringIO. If operations are
19334 performed on a closed object, an exception is raised. The truncate
19335 method now accepts a position argument and readline accepts a size
19336 argument.
19337
19338- There were many changes made to the linuxaudiodev module and its
19339 test suite; as a result, a short, unexpected audio sample should now
19340 play when the regression test is run.
19341
19342 Note that this module is named poorly, because it should work
19343 correctly on any platform that supports the Open Sound System
19344 (OSS).
19345
19346 The module now raises exceptions when errors occur instead of
19347 crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
19348 audio) and defines a getptr() method that calls the
19349 SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
19350
19351- The library_version attribute, introduced in an earlier beta, was
19352 removed because it can not be supported with early versions of the C
19353 readline library, which provides no way to determine the version at
19354 compile-time.
19355
19356- The binascii module is now enabled on Win64.
19357
19358- tokenize.py no longer suffers "recursion depth" errors when parsing
19359 programs with very long string literals.
19360
19361Internals
19362
19363- Fixed several buffer overflow vulnerabilities in calculate_path(),
19364 which is called when the interpreter starts up to determine where
19365 the standard library is installed. These vulnerabilities affect all
19366 previous versions of Python and can be exploited by setting very
19367 long values for PYTHONHOME or argv[0]. The risk is greatest for a
19368 setuid Python script, although use of the wrapper in
19369 Misc/setuid-prog.c will eliminate the vulnerability.
19370
19371- Fixed garbage collection bugs in instance creation that were
19372 triggered when errors occurred during initialization. The solution,
19373 applied in cPickle and in PyInstance_New(), is to call
19374 PyObject_GC_Init() after the initialization of the object's
19375 container attributes is complete.
19376
19377- pyexpat adds definitions of PyModule_AddStringConstant and
19378 PyModule_AddObject if the Python version is less than 2.0, which
19379 provides compatibility with PyXML on Python 1.5.2.
19380
19381- If the platform has a bogus definition for LONG_BIT (the number of
19382 bits in a long), an error will be reported at compile time.
19383
19384- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
19385 collection crashes and possibly other, unreported crashes.
19386
19387- Fixed a memory leak in _PyUnicode_Fini().
19388
19389Build issues
19390
19391- configure now accepts a --with-suffix option that specifies the
19392 executable suffix. This is useful for builds on Cygwin and Mac OS
19393 X, for example.
19394
19395- The mmap.PAGESIZE constant is now initialized using sysconf when
19396 possible, which eliminates a dependency on -lucb for Reliant UNIX.
19397
19398- The md5 file should now compile on all platforms.
19399
19400- The select module now compiles on platforms that do not define
19401 POLLRDNORM and related constants.
19402
19403- Darwin (Mac OS X): Initial support for static builds on this
19404 platform.
19405
19406- BeOS: A number of changes were made to the build and installation
19407 process. ar-fake now operates on a directory of object files.
19408 dl_export.h is gone, and its macros now appear on the mwcc command
19409 line during build on PPC BeOS.
19410
19411- Platform directory in lib/python2.0 is "plat-beos5" (or
19412 "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
19413
19414- Cygwin: Support for shared libraries, Tkinter, and sockets.
19415
19416- SunOS 4.1.4_JL: Fix test for directory existence in configure.
19417
19418Tools and other miscellany
19419
19420- Removed debugging prints from main used with freeze.
19421
19422- IDLE auto-indent no longer crashes when it encounters Unicode
19423 characters.
19424
19425What's new in 2.0 beta 2 (since beta 1)?
19426========================================
19427
19428Core language, builtins, and interpreter
19429
19430- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
19431 "%d" % 2L**64 == "18446744073709551616".
19432
19433- Add -h and -V command line options to print the usage message and
19434 Python version number and exit immediately.
19435
19436- eval() and exec accept Unicode objects as code parameters.
19437
19438- getattr() and setattr() now also accept Unicode objects for the
19439 attribute name, which are converted to strings using the default
19440 encoding before lookup.
19441
19442- Multiplication on string and Unicode now does proper bounds
19443 checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
19444 string is too long."
19445
19446- Better error message when continue is found in try statement in a
19447 loop.
19448
19449
19450Standard library and extensions
19451
19452- socket module: the OpenSSL code now adds support for RAND_status()
19453 and EGD (Entropy Gathering Device).
19454
19455- array: reverse() method of array now works. buffer_info() now does
19456 argument checking; it still takes no arguments.
19457
19458- asyncore/asynchat: Included most recent version from Sam Rushing.
19459
19460- cgi: Accept '&' or ';' as separator characters when parsing form data.
19461
19462- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
19463
19464- ConfigParser: When reading the file, options spelled in upper case
19465 letters are now correctly converted to lowercase.
19466
19467- copy: Copy Unicode objects atomically.
19468
19469- cPickle: Fail gracefully when copy_reg can't be imported.
19470
19471- cStringIO: Implemented readlines() method.
19472
19473- dbm: Add get() and setdefault() methods to dbm object. Add constant
19474 `library' to module that names the library used. Added doc strings
19475 and method names to error messages. Uses configure to determine
19476 which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
19477 now available options.
19478
19479- distutils: Update to version 0.9.3.
19480
19481- dl: Add several dl.RTLD_ constants.
19482
19483- fpectl: Now supported on FreeBSD.
19484
19485- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
19486 found by the collector will be saved in gc.garbage. This is useful
19487 for debugging a program that creates reference cycles.
19488
19489- httplib: Three changes: Restore support for set_debuglevel feature
19490 of HTTP class. Do not close socket on zero-length response. Do not
19491 crash when server sends invalid content-length header.
19492
19493- mailbox: Mailbox class conforms better to qmail specifications.
19494
19495- marshal: When reading a short, sign-extend on platforms where shorts
19496 are bigger than 16 bits. When reading a long, repair the unportable
19497 sign extension that was being done for 64-bit machines. (It assumed
19498 that signed right shift sign-extends.)
19499
19500- operator: Add contains(), invert(), __invert__() as aliases for
19501 __contains__(), inv(), and __inv__() respectively.
19502
19503- os: Add support for popen2() and popen3() on all platforms where
19504 fork() exists. (popen4() is still in the works.)
19505
19506- os: (Windows only:) Add startfile() function that acts like double-
19507 clicking on a file in Explorer (or passing the file name to the
19508 DOS "start" command).
19509
19510- os.path: (Windows, DOS:) Treat trailing colon correctly in
19511 os.path.join. os.path.join("a:", "b") yields "a:b".
19512
19513- pickle: Now raises ValueError when an invalid pickle that contains
19514 a non-string repr where a string repr was expected. This behavior
19515 matches cPickle.
19516
19517- posixfile: Remove broken __del__() method.
19518
19519- py_compile: support CR+LF line terminators in source file.
19520
19521- readline: Does not immediately exit when ^C is hit when readline and
19522 threads are configured. Adds definition of rl_library_version. (The
19523 latter addition requires GNU readline 2.2 or later.)
19524
19525- rfc822: Domain literals returned by AddrlistClass method
19526 getdomainliteral() are now properly wrapped in brackets.
19527
19528- site: sys.setdefaultencoding() should only be called in case the
19529 standard default encoding ("ascii") is changed. This saves quite a
19530 few cycles during startup since the first call to
19531 setdefaultencoding() will initialize the codec registry and the
19532 encodings package.
19533
19534- socket: Support for size hint in readlines() method of object returned
19535 by makefile().
19536
19537- sre: Added experimental expand() method to match objects. Does not
19538 use buffer interface on Unicode strings. Does not hang if group id
19539 is followed by whitespace.
19540
19541- StringIO: Size hint in readlines() is now supported as documented.
19542
19543- struct: Check ranges for bytes and shorts.
19544
19545- urllib: Improved handling of win32 proxy settings. Fixed quote and
19546 quote_plus functions so that the always encode a comma.
19547
19548- Tkinter: Image objects are now guaranteed to have unique ids. Set
19549 event.delta to zero if Tk version doesn't support mousewheel.
19550 Removed some debugging prints.
19551
19552- UserList: now implements __contains__().
19553
19554- webbrowser: On Windows, use os.startfile() instead of os.popen(),
19555 which works around a bug in Norton AntiVirus 2000 that leads directly
19556 to a Blue Screen freeze.
19557
19558- xml: New version detection code allows PyXML to override standard
19559 XML package if PyXML version is greater than 0.6.1.
19560
19561- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
19562 (conventional DOM), and xml.dom.pulldom, which allows building the DOM
19563 tree only for nodes which are sufficiently interesting to a specific
19564 application. Does not provide the HTML-specific extensions. Still
19565 undocumented.
19566
19567- xml.sax: SAX 2 support for Python, including all the handler
19568 interfaces needed to process XML 1.0 compliant XML. Some
19569 documentation is already available.
19570
19571- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
19572 packagized XML support.
19573
19574
19575C API
19576
19577- Add three new convenience functions for module initialization --
19578 PyModule_AddObject(), PyModule_AddIntConstant(), and
19579 PyModule_AddStringConstant().
19580
19581- Cleaned up definition of NULL in C source code; all definitions were
19582 removed and add #error to Python.h if NULL isn't defined after
19583 #include of stdio.h.
19584
19585- Py_PROTO() macros that were removed in 2.0b1 have been restored for
19586 backwards compatibility (at the source level) with old extensions.
19587
19588- A wrapper API was added for signal() and sigaction(). Instead of
19589 either function, always use PyOS_getsig() to get a signal handler
19590 and PyOS_setsig() to set one. A new convenience typedef
19591 PyOS_sighandler_t is defined for the type of signal handlers.
19592
19593- Add PyString_AsStringAndSize() function that provides access to the
19594 internal data buffer and size of a string object -- or the default
19595 encoded version of a Unicode object.
19596
19597- PyString_Size() and PyString_AsString() accept Unicode objects.
19598
19599- The standard header <limits.h> is now included by Python.h (if it
19600 exists). INT_MAX and LONG_MAX will always be defined, even if
19601 <limits.h> is not available.
19602
19603- PyFloat_FromString takes a second argument, pend, that was
19604 effectively useless. It is now officially useless but preserved for
19605 backwards compatibility. If the pend argument is not NULL, *pend is
19606 set to NULL.
19607
19608- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
19609 for the attribute name. See note on getattr() above.
19610
19611- A few bug fixes to argument processing for Unicode.
19612 PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
19613 PyArg_Parse() special cases "s#" for Unicode objects; it returns a
19614 pointer to the default encoded string data instead of to the raw
19615 UTF-16.
19616
19617- Py_BuildValue accepts B format (for bgen-generated code).
19618
19619
19620Internals
19621
19622- On Unix, fix code for finding Python installation directory so that
19623 it works when argv[0] is a relative path.
19624
19625- Added a true unicode_internal_encode() function and fixed the
19626 unicode_internal_decode function() to support Unicode objects directly
19627 rather than by generating a copy of the object.
19628
19629- Several of the internal Unicode tables are much smaller now, and
19630 the source code should be much friendlier to weaker compilers.
19631
19632- In the garbage collector: Fixed bug in collection of tuples. Fixed
19633 bug that caused some instances to be removed from the container set
19634 while they were still live. Fixed parsing in gc.set_debug() for
19635 platforms where sizeof(long) > sizeof(int).
19636
19637- Fixed refcount problem in instance deallocation that only occurred
19638 when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
19639
19640- On Windows, getpythonregpath is now protected against null data in
19641 registry key.
19642
19643- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
19644 condition.
19645
19646
19647Build and platform-specific issues
19648
19649- Better support of GNU Pth via --with-pth configure option.
19650
19651- Python/C API now properly exposed to dynamically-loaded extension
19652 modules on Reliant UNIX.
19653
19654- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
19655 Don't define MS_SYNC to be zero when it is undefined. Added missing
19656 prototypes in posixmodule.c.
19657
19658- Improved support for HP-UX build. Threads should now be correctly
19659 configured (on HP-UX 10.20 and 11.00).
19660
19661- Fix largefile support on older NetBSD systems and OpenBSD by adding
19662 define for TELL64.
19663
19664
19665Tools and other miscellany
19666
19667- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
19668
19669- freeze: The modulefinder now works with 2.0 opcodes.
19670
19671- IDLE:
19672 Move hackery of sys.argv until after the Tk instance has been
19673 created, which allows the application-specific Tkinter
19674 initialization to be executed if present; also pass an explicit
19675 className parameter to the Tk() constructor.
19676
19677
19678What's new in 2.0 beta 1?
19679=========================
19680
19681Source Incompatibilities
19682------------------------
19683
19684None. Note that 1.6 introduced several incompatibilities with 1.5.2,
19685such as single-argument append(), connect() and bind(), and changes to
19686str(long) and repr(float).
19687
19688
19689Binary Incompatibilities
19690------------------------
19691
19692- Third party extensions built for Python 1.5.x or 1.6 cannot be used
19693with Python 2.0; these extensions will have to be rebuilt for Python
196942.0.
19695
19696- On Windows, attempting to import a third party extension built for
19697Python 1.5.x or 1.6 results in an immediate crash; there's not much we
19698can do about this. Check your PYTHONPATH environment variable!
19699
19700- Python bytecode files (*.pyc and *.pyo) are not compatible between
19701releases.
19702
19703
19704Overview of Changes Since 1.6
19705-----------------------------
19706
19707There are many new modules (including brand new XML support through
19708the xml package, and i18n support through the gettext module); a list
19709of all new modules is included below. Lots of bugs have been fixed.
19710
19711The process for making major new changes to the language has changed
19712since Python 1.6. Enhancements must now be documented by a Python
19713Enhancement Proposal (PEP) before they can be accepted.
19714
19715There are several important syntax enhancements, described in more
19716detail below:
19717
19718 - Augmented assignment, e.g. x += 1
19719
19720 - List comprehensions, e.g. [x**2 for x in range(10)]
19721
19722 - Extended import statement, e.g. import Module as Name
19723
19724 - Extended print statement, e.g. print >> file, "Hello"
19725
19726Other important changes:
19727
19728 - Optional collection of cyclical garbage
19729
19730Python Enhancement Proposal (PEP)
19731---------------------------------
19732
19733PEP stands for Python Enhancement Proposal. A PEP is a design
19734document providing information to the Python community, or describing
19735a new feature for Python. The PEP should provide a concise technical
19736specification of the feature and a rationale for the feature.
19737
19738We intend PEPs to be the primary mechanisms for proposing new
19739features, for collecting community input on an issue, and for
19740documenting the design decisions that have gone into Python. The PEP
19741author is responsible for building consensus within the community and
19742documenting dissenting opinions.
19743
19744The PEPs are available at http://python.sourceforge.net/peps/.
19745
19746Augmented Assignment
19747--------------------
19748
19749This must have been the most-requested feature of the past years!
19750Eleven new assignment operators were added:
19751
19752 += -= *= /= %= **= <<= >>= &= ^= |=
19753
19754For example,
19755
19756 A += B
19757
19758is similar to
19759
19760 A = A + B
19761
19762except that A is evaluated only once (relevant when A is something
19763like dict[index].attr).
19764
19765However, if A is a mutable object, A may be modified in place. Thus,
19766if A is a number or a string, A += B has the same effect as A = A+B
19767(except A is only evaluated once); but if a is a list, A += B has the
19768same effect as A.extend(B)!
19769
19770Classes and built-in object types can override the new operators in
19771order to implement the in-place behavior; the not-in-place behavior is
19772used automatically as a fallback when an object doesn't implement the
19773in-place behavior. For classes, the method name is derived from the
19774method name for the corresponding not-in-place operator by inserting
19775an 'i' in front of the name, e.g. __iadd__ implements in-place
19776__add__.
19777
19778Augmented assignment was implemented by Thomas Wouters.
19779
19780
19781List Comprehensions
19782-------------------
19783
19784This is a flexible new notation for lists whose elements are computed
19785from another list (or lists). The simplest form is:
19786
19787 [<expression> for <variable> in <sequence>]
19788
19789For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
19790This is more efficient than a for loop with a list.append() call.
19791
19792You can also add a condition:
19793
19794 [<expression> for <variable> in <sequence> if <condition>]
19795
19796For example, [w for w in words if w == w.lower()] would yield the list
19797of words that contain no uppercase characters. This is more efficient
19798than a for loop with an if statement and a list.append() call.
19799
19800You can also have nested for loops and more than one 'if' clause. For
19801example, here's a function that flattens a sequence of sequences::
19802
19803 def flatten(seq):
19804 return [x for subseq in seq for x in subseq]
19805
19806 flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
19807
19808This prints
19809
19810 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
19811
19812List comprehensions originated as a patch set from Greg Ewing; Skip
19813Montanaro and Thomas Wouters also contributed. Described by PEP 202.
19814
19815
19816Extended Import Statement
19817-------------------------
19818
19819Many people have asked for a way to import a module under a different
19820name. This can be accomplished like this:
19821
19822 import foo
19823 bar = foo
19824 del foo
19825
19826but this common idiom gets old quickly. A simple extension of the
19827import statement now allows this to be written as follows:
19828
19829 import foo as bar
19830
19831There's also a variant for 'from ... import':
19832
19833 from foo import bar as spam
19834
19835This also works with packages; e.g. you can write this:
19836
19837 import test.regrtest as regrtest
19838
19839Note that 'as' is not a new keyword -- it is recognized only in this
19840context (this is only possible because the syntax for the import
19841statement doesn't involve expressions).
19842
19843Implemented by Thomas Wouters. Described by PEP 221.
19844
19845
19846Extended Print Statement
19847------------------------
19848
19849Easily the most controversial new feature, this extension to the print
19850statement adds an option to make the output go to a different file
19851than the default sys.stdout.
19852
19853For example, to write an error message to sys.stderr, you can now
19854write:
19855
19856 print >> sys.stderr, "Error: bad dog!"
19857
19858As a special feature, if the expression used to indicate the file
19859evaluates to None, the current value of sys.stdout is used. Thus:
19860
19861 print >> None, "Hello world"
19862
19863is equivalent to
19864
19865 print "Hello world"
19866
19867Design and implementation by Barry Warsaw. Described by PEP 214.
19868
19869
19870Optional Collection of Cyclical Garbage
19871---------------------------------------
19872
19873Python is now equipped with a garbage collector that can hunt down
19874cyclical references between Python objects. It's no replacement for
19875reference counting; in fact, it depends on the reference counts being
19876correct, and decides that a set of objects belong to a cycle if all
19877their reference counts can be accounted for from their references to
19878each other. This devious scheme was first proposed by Eric Tiedemann,
19879and brought to implementation by Neil Schemenauer.
19880
19881There's a module "gc" that lets you control some parameters of the
19882garbage collection. There's also an option to the configure script
19883that lets you enable or disable the garbage collection. In 2.0b1,
19884it's on by default, so that we (hopefully) can collect decent user
19885experience with this new feature. There are some questions about its
19886performance. If it proves to be too much of a problem, we'll turn it
19887off by default in the final 2.0 release.
19888
19889
19890Smaller Changes
19891---------------
19892
19893A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
19894map(None, seq1, seq2, ...) when the sequences have the same length;
19895i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
19896the lists are not all the same length, the shortest list wins:
19897zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
19898
19899sys.version_info is a tuple (major, minor, micro, level, serial).
19900
19901Dictionaries have an odd new method, setdefault(key, default).
19902dict.setdefault(key, default) returns dict[key] if it exists; if not,
19903it sets dict[key] to default and returns that value. Thus:
19904
19905 dict.setdefault(key, []).append(item)
19906
19907does the same work as this common idiom:
19908
19909 if not dict.has_key(key):
19910 dict[key] = []
19911 dict[key].append(item)
19912
19913There are two new variants of SyntaxError that are raised for
19914indentation-related errors: IndentationError and TabError.
19915
19916Changed \x to consume exactly two hex digits; see PEP 223. Added \U
19917escape that consumes exactly eight hex digits.
19918
19919The limits on the size of expressions and file in Python source code
19920have been raised from 2**16 to 2**32. Previous versions of Python
19921were limited because the maximum argument size the Python VM accepted
19922was 2**16. This limited the size of object constructor expressions,
19923e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
19924limit was raised thanks to a patch by Charles Waldman that effectively
19925fixes the problem. It is now much more likely that you will be
19926limited by available memory than by an arbitrary limit in Python.
19927
19928The interpreter's maximum recursion depth can be modified by Python
19929programs using sys.getrecursionlimit and sys.setrecursionlimit. This
19930limit is the maximum number of recursive calls that can be made by
19931Python code. The limit exists to prevent infinite recursion from
19932overflowing the C stack and causing a core dump. The default value is
199331000. The maximum safe value for a particular platform can be found
Georg Brandl93d15cd2009-10-11 21:24:34 +000019934by running Tools/scripts/find_recursionlimit.py.
Skip Montanaro4cb22042002-09-17 20:55:31 +000019935
19936New Modules and Packages
19937------------------------
19938
19939atexit - for registering functions to be called when Python exits.
19940
19941imputil - Greg Stein's alternative API for writing custom import
19942hooks.
19943
19944pyexpat - an interface to the Expat XML parser, contributed by Paul
19945Prescod.
19946
19947xml - a new package with XML support code organized (so far) in three
19948subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
19949would fill a volume. There's a special feature whereby a
19950user-installed package named _xmlplus overrides the standard
19951xmlpackage; this is intended to give the XML SIG a hook to distribute
19952backwards-compatible updates to the standard xml package.
19953
19954webbrowser - a platform-independent API to launch a web browser.
19955
19956
19957Changed Modules
19958---------------
19959
19960array -- new methods for array objects: count, extend, index, pop, and
19961remove
19962
19963binascii -- new functions b2a_hex and a2b_hex that convert between
19964binary data and its hex representation
19965
19966calendar -- Many new functions that support features including control
19967over which day of the week is the first day, returning strings instead
19968of printing them. Also new symbolic constants for days of week,
19969e.g. MONDAY, ..., SUNDAY.
19970
19971cgi -- FieldStorage objects have a getvalue method that works like a
19972dictionary's get method and returns the value attribute of the object.
19973
19974ConfigParser -- The parser object has new methods has_option,
19975remove_section, remove_option, set, and write. They allow the module
19976to be used for writing config files as well as reading them.
19977
19978ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
19979optionally support the RFC 959 REST command.
19980
19981gzip -- readline and readlines now accept optional size arguments
19982
19983httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
19984the module doc strings for details.
19985
19986locale -- implement getdefaultlocale for Win32 and Macintosh
19987
19988marshal -- no longer dumps core when marshaling deeply nested or
19989recursive data structures
19990
19991os -- new functions isatty, seteuid, setegid, setreuid, setregid
19992
19993os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
19994support under Unix.
19995
19996os/pty -- support for openpty and forkpty
19997
19998os.path -- fix semantics of os.path.commonprefix
19999
20000smtplib -- support for sending very long messages
20001
20002socket -- new function getfqdn()
20003
20004readline -- new functions to read, write and truncate history files.
20005The readline section of the library reference manual contains an
20006example.
20007
20008select -- add interface to poll system call
20009
20010shutil -- new copyfileobj function
20011
20012SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
20013HTTP server.
20014
20015Tkinter -- optimization of function flatten
20016
20017urllib -- scans environment variables for proxy configuration,
20018e.g. http_proxy.
20019
20020whichdb -- recognizes dumbdbm format
20021
20022
20023Obsolete Modules
20024----------------
20025
20026None. However note that 1.6 made a whole slew of modules obsolete:
20027stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
20028poly, zmod, strop, util, whatsound.
20029
20030
20031Changed, New, Obsolete Tools
20032----------------------------
20033
20034None.
20035
20036
20037C-level Changes
20038---------------
20039
20040Several cleanup jobs were carried out throughout the source code.
20041
20042All C code was converted to ANSI C; we got rid of all uses of the
20043Py_PROTO() macro, which makes the header files a lot more readable.
20044
20045Most of the portability hacks were moved to a new header file,
20046pyport.h; several other new header files were added and some old
20047header files were removed, in an attempt to create a more rational set
20048of header files. (Few of these ever need to be included explicitly;
20049they are all included by Python.h.)
20050
20051Trent Mick ensured portability to 64-bit platforms, under both Linux
20052and Win64, especially for the new Intel Itanium processor. Mick also
20053added large file support for Linux64 and Win64.
20054
20055The C APIs to return an object's size have been update to consistently
20056use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
20057previous versions, the abstract interfaces used PyXXX_Length and the
20058concrete interfaces used PyXXX_Size. The old names,
20059e.g. PyObject_Length, are still available for backwards compatibility
20060at the API level, but are deprecated.
20061
20062The PyOS_CheckStack function has been implemented on Windows by
20063Fredrik Lundh. It prevents Python from failing with a stack overflow
20064on Windows.
20065
20066The GC changes resulted in creation of two new slots on object,
20067tp_traverse and tp_clear. The augmented assignment changes result in
20068the creation of a new slot for each in-place operator.
20069
20070The GC API creates new requirements for container types implemented in
20071C extension modules. See Include/objimpl.h for details.
20072
20073PyErr_Format has been updated to automatically calculate the size of
20074the buffer needed to hold the formatted result string. This change
20075prevents crashes caused by programmer error.
20076
20077New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
20078
20079PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
20080that are the same as their non-Ex counterparts except they take an
20081extra flag argument that tells them to close the file when done.
20082
20083XXX There were other API changes that should be fleshed out here.
20084
20085
20086Windows Changes
20087---------------
20088
20089New popen2/popen3/peopen4 in os module (see Changed Modules above).
20090
20091os.popen is much more usable on Windows 95 and 98. See Microsoft
20092Knowledge Base article Q150956. The Win9x workaround described there
20093is implemented by the new w9xpopen.exe helper in the root of your
20094Python installation. Note that Python uses this internally; it is not
20095a standalone program.
20096
20097Administrator privileges are no longer required to install Python
20098on Windows NT or Windows 2000. If you have administrator privileges,
20099Python's registry info will be written under HKEY_LOCAL_MACHINE.
20100Otherwise the installer backs off to writing Python's registry info
20101under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
20102uses of Python, but will prevent some advanced uses from working
20103(for example, running a Python script as an NT service, or possibly
20104from CGI).
20105
20106[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
20107installer; instead, it installs the needed Tcl/Tk files directly in the
20108Python directory. If you already have a Tcl/Tk installation, this
20109wastes some disk space (about 4 Megs) but avoids problems with
20110conflicting Tcl/Tk installations, and makes it much easier for Python
20111to ensure that Tcl/Tk can find all its files.
20112
20113[This was new in 1.6] The Windows installer now installs by default in
20114\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
20115
20116
20117Updates to the changes between 1.5.2 and 1.6
20118--------------------------------------------
20119
20120The 1.6 NEWS file can't be changed after the release is done, so here
20121is some late-breaking news:
20122
20123New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
20124and changes to getlocale() and setlocale().
20125
20126The new module is now enabled per default.
20127
20128It is not true that the encodings codecs cannot be used for normal
20129strings: the string.encode() (which is also present on 8-bit strings
20130!) allows using them for 8-bit strings too, e.g. to convert files from
20131cp1252 (Windows) to latin-1 or vice-versa.
20132
20133Japanese codecs are available from Tamito KAJIYAMA:
20134http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
20135
20136
20137======================================================================
20138
20139
Guido van Rossumf2eac992000-09-04 17:24:24 +000020140=======================================
20141==> Release 1.6 (September 5, 2000) <==
20142=======================================
20143
Guido van Rossuma598c932000-09-04 16:26:03 +000020144What's new in release 1.6?
20145==========================
20146
20147Below is a list of all relevant changes since release 1.5.2.
20148
20149
20150Source Incompatibilities
20151------------------------
20152
20153Several small incompatible library changes may trip you up:
20154
20155 - The append() method for lists can no longer be invoked with more
20156 than one argument. This used to append a single tuple made out of
20157 all arguments, but was undocumented. To append a tuple, use
20158 e.g. l.append((a, b, c)).
20159
20160 - The connect(), connect_ex() and bind() methods for sockets require
20161 exactly one argument. Previously, you could call s.connect(host,
20162 port), but this was undocumented. You must now write
20163 s.connect((host, port)).
20164
20165 - The str() and repr() functions are now different more often. For
20166 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
20167 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
20168 For floats, repr() now gives 17 digits of precision, to ensure no
20169 precision is lost (on all current hardware).
20170
20171 - The -X option is gone. Built-in exceptions are now always
20172 classes. Many more library modules also have been converted to
20173 class-based exceptions.
20174
20175
20176Binary Incompatibilities
20177------------------------
20178
20179- Third party extensions built for Python 1.5.x cannot be used with
20180Python 1.6; these extensions will have to be rebuilt for Python 1.6.
20181
20182- On Windows, attempting to import a third party extension built for
20183Python 1.5.x results in an immediate crash; there's not much we can do
20184about this. Check your PYTHONPATH environment variable!
20185
20186
20187Overview of Changes since 1.5.2
20188-------------------------------
20189
20190For this overview, I have borrowed from the document "What's New in
20191Python 2.0" by Andrew Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000020192http://www.amk.ca/python/2.0/ .
Guido van Rossuma598c932000-09-04 16:26:03 +000020193
20194There are lots of new modules and lots of bugs have been fixed. A
20195list of all new modules is included below.
20196
20197Probably the most pervasive change is the addition of Unicode support.
20198We've added a new fundamental datatype, the Unicode string, a new
20199build-in function unicode(), an numerous C APIs to deal with Unicode
20200and encodings. See the file Misc/unicode.txt for details, or
20201http://starship.python.net/crew/lemburg/unicode-proposal.txt.
20202
20203Two other big changes, related to the Unicode support, are the
20204addition of string methods and (yet another) new regular expression
20205engine.
20206
20207 - String methods mean that you can now say s.lower() etc. instead of
20208 importing the string module and saying string.lower(s) etc. One
20209 peculiarity is that the equivalent of string.join(sequence,
20210 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
20211 the effect of string.join(sequence); to make this more readable, try
20212 space=" " first. Note that the maxsplit argument defaults in
20213 split() and replace() have changed from 0 to -1.
20214
20215 - The new regular expression engine, SRE by Fredrik Lundh, is fully
20216 backwards compatible with the old engine, and is in fact invoked
20217 using the same interface (the "re" module). You can explicitly
20218 invoke the old engine by import pre, or the SRE engine by importing
20219 sre. SRE is faster than pre, and supports Unicode (which was the
20220 main reason to put effort in yet another new regular expression
20221 engine -- this is at least the fourth!).
20222
20223
20224Other Changes
20225-------------
20226
20227Other changes that won't break code but are nice to know about:
20228
20229Deleting objects is now safe even for deeply nested data structures.
20230
20231Long/int unifications: long integers can be used in seek() calls, as
20232slice indexes.
20233
20234String formatting (s % args) has a new formatting option, '%r', which
20235acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
20236alpha 1.)
20237
20238Greg Ward's "distutils" package is included: this will make
20239installing, building and distributing third party packages much
20240simpler.
20241
20242There's now special syntax that you can use instead of the apply()
20243function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
20244You can also use variations f(a1, a2, *args, **kwds) and you can leave
20245one or the other out: f(*args), f(**kwds).
20246
20247The built-ins int() and long() take an optional second argument to
20248indicate the conversion base -- of course only if the first argument
20249is a string. This makes string.atoi() and string.atol() obsolete.
20250(string.atof() was already obsolete).
20251
20252When a local variable is known to the compiler but undefined when
20253used, a new exception UnboundLocalError is raised. This is a class
20254derived from NameError so code catching NameError should still work.
20255The purpose is to provide better diagnostics in the following example:
20256 x = 1
20257 def f():
20258 print x
20259 x = x+1
20260This used to raise a NameError on the print statement, which confused
20261even experienced Python programmers (especially if there are several
20262hundreds of lines of code between the reference and the assignment to
20263x :-).
20264
20265You can now override the 'in' operator by defining a __contains__
20266method. Note that it has its arguments backwards: x in a causes
20267a.__contains__(x) to be called. That's why the name isn't __in__.
20268
20269The exception AttributeError will have a more friendly error message,
20270e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
20271<b>break code</b> that expects the message to be exactly the attribute
20272name.
20273
20274
20275New Modules in 1.6
20276------------------
20277
20278UserString - base class for deriving from the string type.
20279
20280distutils - tools for distributing Python modules.
20281
20282robotparser - parse a robots.txt file, for writing web spiders.
20283(Moved from Tools/webchecker/.)
20284
20285linuxaudiodev - audio for Linux.
20286
20287mmap - treat a file as a memory buffer. (Windows and Unix.)
20288
20289sre - regular expressions (fast, supports unicode). Currently, this
20290code is very rough. Eventually, the re module will be reimplemented
20291using sre (without changes to the re API).
20292
20293filecmp - supersedes the old cmp.py and dircmp.py modules.
20294
20295tabnanny - check Python sources for tab-width dependance. (Moved from
20296Tools/scripts/.)
20297
20298urllib2 - new and improved but incompatible version of urllib (still
20299experimental).
20300
20301zipfile - read and write zip archives.
20302
20303codecs - support for Unicode encoders/decoders.
20304
20305unicodedata - provides access to the Unicode 3.0 database.
20306
20307_winreg - Windows registry access.
20308
20309encodings - package which provides a large set of standard codecs --
20310currently only for the new Unicode support. It has a drop-in extension
20311mechanism which allows you to add new codecs by simply copying them
20312into the encodings package directory. Asian codec support will
20313probably be made available as separate distribution package built upon
20314this technique and the new distutils package.
20315
20316
20317Changed Modules
20318---------------
20319
20320readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
20321chunk, wave, random, shelve, nntplib - minor enhancements.
20322
20323socket, httplib, urllib - optional OpenSSL support (Unix only).
20324
20325_tkinter - support for 8.0 up to 8.3. Support for versions older than
203268.0 has been dropped.
20327
20328string - most of this module is deprecated now that strings have
20329methods. This no longer uses the built-in strop module, but takes
20330advantage of the new string methods to provide transparent support for
20331both Unicode and ordinary strings.
20332
20333
20334Changes on Windows
20335------------------
20336
20337The installer no longer runs a separate Tcl/Tk installer; instead, it
20338installs the needed Tcl/Tk files directly in the Python directory. If
20339you already have a Tcl/Tk installation, this wastes some disk space
20340(about 4 Megs) but avoids problems with conflincting Tcl/Tk
20341installations, and makes it much easier for Python to ensure that
20342Tcl/Tk can find all its files. Note: the alpha installers don't
20343include the documentation.
20344
20345The Windows installer now installs by default in \Python16\ on the
20346default volume, instead of \Program Files\Python-1.6\.
20347
20348
20349Changed Tools
20350-------------
20351
20352IDLE - complete overhaul. See the <a href="../idle/">IDLE home
20353page</a> for more information. (Python 1.6 alpha 1 will come with
20354IDLE 0.6.)
20355
20356Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
20357text extraction tool used for internationalizing applications written
20358in Python.
20359
20360
20361Obsolete Modules
20362----------------
20363
20364stdwin and everything that uses it. (Get Python 1.5.2 if you need
20365it. :-)
20366
20367soundex. (Skip Montanaro has a version in Python but it won't be
20368included in the Python release.)
20369
20370cmp, cmpcache, dircmp. (Replaced by filecmp.)
20371
20372dump. (Use pickle.)
20373
20374find. (Easily coded using os.walk().)
20375
20376grep. (Not very useful as a library module.)
20377
20378packmail. (No longer has any use.)
20379
20380poly, zmod. (These were poor examples at best.)
20381
20382strop. (No longer needed by the string module.)
20383
20384util. (This functionality was long ago built in elsewhere).
20385
20386whatsound. (Use sndhdr.)
20387
20388
20389Detailed Changes from 1.6b1 to 1.6
20390----------------------------------
20391
20392- Slight changes to the CNRI license. A copyright notice has been
20393added; the requirement to indicate the nature of modifications now
20394applies when making a derivative work available "to others" instead of
20395just "to the public"; the version and date are updated. The new
20396license has a new handle.
20397
20398- Added the Tools/compiler package. This is a project led by Jeremy
20399Hylton to write the Python bytecode generator in Python.
20400
20401- The function math.rint() is removed.
20402
20403- In Python.h, "#define _GNU_SOURCE 1" was added.
20404
20405- Version 0.9.1 of Greg Ward's distutils is included (instead of
20406version 0.9).
20407
20408- A new version of SRE is included. It is more stable, and more
20409compatible with the old RE module. Non-matching ranges are indicated
20410by -1, not None. (The documentation said None, but the PRE
20411implementation used -1; changing to None would break existing code.)
20412
20413- The winreg module has been renamed to _winreg. (There are plans for
20414a higher-level API called winreg, but this has not yet materialized in
20415a form that is acceptable to the experts.)
20416
20417- The _locale module is enabled by default.
20418
20419- Fixed the configuration line for the _curses module.
20420
20421- A few crashes have been fixed, notably <file>.writelines() with a
20422list containing non-string objects would crash, and there were
20423situations where a lost SyntaxError could dump core.
20424
20425- The <list>.extend() method now accepts an arbitrary sequence
20426argument.
20427
20428- If __str__() or __repr__() returns a Unicode object, this is
20429converted to an 8-bit string.
20430
20431- Unicode string comparisons is no longer aware of UTF-16
20432encoding peculiarities; it's a straight 16-bit compare.
20433
20434- The Windows installer now installs the LICENSE file and no longer
20435registers the Python DLL version in the registry (this is no longer
20436needed). It now uses Tcl/Tk 8.3.2.
20437
20438- A few portability problems have been fixed, in particular a
20439compilation error involving socklen_t.
20440
20441- The PC configuration is slightly friendlier to non-Microsoft
20442compilers.
20443
20444
20445======================================================================
20446
20447
Guido van Rossumf2eac992000-09-04 17:24:24 +000020448======================================
20449==> Release 1.5.2 (April 13, 1999) <==
20450======================================
20451
Guido van Rossum2001da42000-09-01 22:26:44 +000020452From 1.5.2c1 to 1.5.2 (final)
20453=============================
20454
20455Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20456
20457 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
20458
20459 * PCbuild/python15.dsp: Added shamodule.c
20460
20461 * PC/config.c: Added sha module!
20462
20463 * README, Include/patchlevel.h: Prepare for final release.
20464
20465 * Misc/ACKS:
20466 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
20467
20468 * Python/thread_solaris.h:
20469 While I can't really test this thoroughly, Pat Knight and the Solaris
20470 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
20471 the flags on thr_create(), and that there really isn't a downside, so
20472 I'll do that.
20473
20474 * Misc/ACKS:
20475 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
20476
20477 * PC/python_nt.rc:
20478 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
20479 (I can't even display this on NT, maybe Win/98 can?)
20480
20481 * Lib/pstats.py:
20482 Fix mysterious references to jprofile that were in the source since
20483 its creation. I'm assuming these were once valid references to "Jim
20484 Roskind's profile"...
20485
20486 * Lib/Attic/threading_api.py:
20487 Removed; since long subsumed in Doc/lib/libthreading.tex
20488
20489 * Modules/socketmodule.c:
20490 Put back __osf__ support for gethostbyname_r(); the real bug was that
20491 it was being used even without threads. This of course might be an
20492 all-platform problem so now we only use the _r variant when we are
20493 using threads.
20494
20495Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20496
20497 * Modules/cPickle.c:
20498 Fix accidentally reversed NULL test in load_mark(). Suggested by
20499 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
20500 returns NULL.)
20501
20502 * README:
20503 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
20504
20505 * README: Add note about -D_REENTRANT for HP-UX 10.20.
20506
20507 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
20508
20509 * PC/Attic/vc40.mak, PC/readme.txt:
20510 Remove all VC++ info (except VC 1.5) from readme.txt;
20511 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
20512
20513 * README: Clarify PC build instructions (point to PCbuild).
20514
20515 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
20516
20517 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
20518 Forgot to add this file. CDROM device parameters.
20519
20520 * Lib/gzip.py: Two different changes.
20521
20522 1. Jack Jansen reports that on the Mac, the time may be negative, and
20523 solves this by adding a write32u() function that writes an unsigned
20524 long.
20525
20526 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
20527 casting both values to be compared to "unsigned long" i.e. modulo
20528 0x100000000L.
20529
20530Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20531
20532 * PC/Attic/_tkinter.def: No longer needed.
20533
20534 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
20535
20536 * README: Add DEC Ultrix notes (from Donn Cave's email).
20537
20538 * configure: The usual
20539
20540 * configure.in:
20541 Quote a bunch of shell variables used in test, related to long-long.
20542
20543 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
20544 casts for picky compilers.
20545
20546 * Modules/socketmodule.c:
20547 3-arg gethostbyname_r doesn't really work on OSF/1.
20548
20549 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
20550 Avoid totally empty files.
20551
20552Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20553
20554 * Tools/scripts/fixps.py: Use re instead of regex.
20555 Don't rewrite the file in place.
20556 (Reported by Andy Dustman.)
20557
20558 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
20559
20560Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20561
20562 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
20563 Add a variable %_TCL_% that makes it easier to switch to a different version.
20564
20565
20566======================================================================
20567
20568
20569From 1.5.2b2 to 1.5.2c1
20570=======================
20571
20572Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20573
20574 * PCbuild/python15.wse:
20575 Release 1.5.2c1. Add IDLE and Uninstall to program group.
20576 Don't distribute zlib.dll. Tweak some comments.
20577
20578 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
20579
20580 * 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:
20581 The usual
20582
20583 * Include/patchlevel.h: Release 1.5.2c1
20584
20585 * README: Release 1.5.2c1.
20586
20587 * Misc/NEWS: News for the 1.5.2c1 release.
20588
20589 * Lib/test/test_strftime.py:
20590 On Windows, we suddenly find, strftime() may return "" for an
20591 unsupported format string. (I guess this is because the logic for
20592 deciding whether to reallocate the buffer or not has been improved.)
20593 This caused the test code to crash on result[0]. Fix this by assuming
20594 an empty result also means the format is not supported.
20595
20596 * Demo/tkinter/matt/window-creation-w-location.py:
20597 This demo imported some private code from Matt. Make it cripple along.
20598
20599 * Lib/lib-tk/Tkinter.py:
20600 Delete an accidentally checked-in feature that actually broke more
20601 than was worth it: when deleting a canvas item, it would try to
20602 automatically delete the bindings for that item. Since there's
20603 nothing that says you can't reuse the tag and still have the bindings,
20604 this is not correct. Also, it broke at least one demo
20605 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
20606
20607 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
20608
20609Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20610
20611 * Modules/zlibmodule.c:
20612 Patch by Andrew Kuchling to unflush() (flush() for deflating).
20613 Without this, if inflate() returned Z_BUF_ERROR asking for more output
20614 space, we would report the error; now, we increase the buffer size and
20615 try again, just as for Z_OK.
20616
20617 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
20618
20619 * Tools/idle/ChangeLog: New change log.
20620
20621 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
20622
20623 * Python/pythonrun.c:
20624 Alas, get rid of the Win specific hack to ask the user to press Return
20625 before exiting when an error happened. This didn't work right when
20626 Python is invoked from a daemon.
20627
20628 * Tools/idle/idlever.py: Version bump awaiting impending new release.
20629 (Not much has changed :-( )
20630
20631 * Lib/lib-tk/Tkinter.py:
20632 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
20633 so the preferred name for them is tag_lower, tag_raise
20634 (similar to tag_bind, and similar to the Text widget);
20635 unfortunately can't delete the old ones yet (maybe in 1.6)
20636
20637 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
20638 Changes by Mark Hammond for Windows CE. Mostly of the form
20639 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
20640
20641 * Python/bltinmodule.c:
20642 Remove unused variable from complex_from_string() code.
20643
20644 * Include/patchlevel.h:
20645 Add the possibility of a gamma release (release candidate).
20646 Add '+' to string version number to indicate we're beyond b2 now.
20647
20648 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
20649
20650 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
20651
20652 Per writes:
20653
20654 """
20655 The application where Signum Support uses smtplib needs to be able to
20656 report good error messages to the user when sending email fails. To
20657 help in diagnosing problems it is useful to be able to report the
20658 entire message sent by the server, not only the SMTP error code of the
20659 offending command.
20660
20661 A lot of the functions in sendmail.py unfortunately discards the
20662 message, leaving only the code. The enclosed patch fixes that
20663 problem.
20664
20665 The enclosed patch also introduces a base class for exceptions that
20666 include an SMTP error code and error message, and make the code and
20667 message available on separate attributes, so that surrounding code can
20668 deal with them in whatever way it sees fit. I've also added some
20669 documentation to the exception classes.
20670
20671 The constructor will now raise an exception if it cannot connect to
20672 the SMTP server.
20673
20674 The data() method will raise an SMTPDataError if it doesn't receive
20675 the expected 354 code in the middle of the exchange.
20676
20677 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
20678 text, including no text at all" after the error code. If the response
20679 of a HELO command contains no text self.helo_resp will be set to the
20680 empty string (""). The patch fixes the test in the sendmail() method
20681 so that helo_resp is tested against None; if it has the empty string
20682 as value the sendmail() method would invoke the helo() method again.
20683
20684 The code no longer accepts a -1 reply from the ehlo() method in
20685 sendmail().
20686
20687 [Text about removing SMTPRecipientsRefused deleted --GvR]
20688 """
20689
20690 and also:
20691
20692 """
20693 smtplib.py appends an extra blank line to the outgoing mail if the
20694 `msg' argument to the sendmail method already contains a trailing
20695 newline. This patch should fix the problem.
20696 """
20697
20698 The Dragon writes:
20699
20700 """
20701 Mostly I just re-added the SMTPRecipientsRefused exception
20702 (the exeption object now has the appropriate info in it ) [Per had
20703 removed this in his patch --GvR] and tweaked the behavior of the
20704 sendmail method whence it throws the newly added SMTPHeloException (it
20705 was closing the connection, which it shouldn't. whatever catches the
20706 exception should do that. )
20707
20708 I pondered the change of the return values to tuples all around,
20709 and after some thinking I decided that regularizing the return values was
20710 too much of the Right Thing (tm) to not do.
20711
20712 My one concern is that code expecting an integer & getting a tuple
20713 may fail silently.
20714
20715 (i.e. if it's doing :
20716
20717 x.somemethod() >= 400:
20718 expecting an integer, the expression will always be true if it gets a
20719 tuple instead. )
20720
20721 However, most smtplib code I've seen only really uses the
20722 sendmail() method, so this wouldn't bother it. Usually code I've seen
20723 that calls the other methods usually only calls helo() and ehlo() for
20724 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
20725 and thus I would think not much code uses it yet.
20726 """
20727
20728Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20729
20730 * Lib/test/test_ntpath.py:
20731 Fix the tests now that splitdrive() no longer treats UNC paths special.
20732 (Some tests converted to splitunc() tests.)
20733
20734 * Lib/ntpath.py:
20735 Withdraw the UNC support from splitdrive(). Instead, a new function
20736 splitunc() parses UNC paths. The contributor of the UNC parsing in
20737 splitdrive() doesn't like it, but I haven't heard a good reason to
20738 keep it, and it causes some problems. (I think there's a
20739 philosophical problem -- to me, the split*() functions are purely
20740 syntactical, and the fact that \\foo is not a valid path doesn't mean
20741 that it shouldn't be considered an absolute path.)
20742
20743 Also (quite separately, but strangely related to the philosophical
20744 issue above) fix abspath() so that if win32api exists, it doesn't fail
20745 when the path doesn't actually exist -- if GetFullPathName() fails,
Mark Dickinson934896d2009-02-21 20:59:32 +000020746 fall back on the old strategy (join with getcwd() if necessary, and
Guido van Rossum2001da42000-09-01 22:26:44 +000020747 then use normpath()).
20748
20749 * configure.in, configure, config.h.in, acconfig.h:
20750 For BeOS PowerPC. Chris Herborth.
20751
20752Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20753
20754 * Modules/timemodule.c:
20755 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
20756 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
20757
20758 * Misc/ACKS:
20759 Bunch of new contributors, including 9 who contributed to the Docs,
20760 reported by Fred.
20761
20762Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20763
20764 * Lib/gzip.py:
20765 Oops, missed mode parameter to open().
20766
20767 * Lib/gzip.py:
20768 Made the default mode 'rb' instead of 'r', for better cross-platform
20769 support. (Based on comment on the documentation by Bernhard Reiter
20770 <bernhard@csd.uwm.edu>).
20771
20772Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20773
20774 * Tools/scripts/dutree.py:
20775 For reasons I dare not explain, this script should always execute
20776 main() when imported (in other words, it is not usable as a module).
20777
20778Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20779
20780 * Lib/test/test_cpickle.py: Jonathan Giddy write:
20781
20782 In test_cpickle.py, the module os got imported, but the line to remove
20783 the temp file has gone missing.
20784
20785Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20786
20787 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
20788
20789 If you send something like "PUT / HTTP/1.0" to something derived from
20790 BaseHTTPServer that doesn't define do_PUT, you will get a response
20791 that begins like this:
20792
20793 HTTP/1.0 501 Unsupported method ('do_PUT')
20794 Server: SimpleHTTP/0.3 Python/1.5
20795 Date: Tue, 30 Mar 1999 18:53:53 GMT
20796
20797 The server should complain about 'PUT' instead of 'do_PUT'. This
20798 patch should fix the problem.
20799
20800Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20801
20802 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
20803
20804 """
20805 - It needlessly used the makefile() method for each response that is
20806 read from the SMTP server.
20807
20808 - If the remote SMTP server closes the connection unexpectedly the
20809 code raised an IndexError. It now raises an SMTPServerDisconnected
20810 exception instead.
20811
20812 - The code now checks that all lines in a multiline response actually
20813 contains an error code.
20814 """
20815
20816 The Dragon approves.
20817
20818Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20819
20820 * Lib/compileall.py:
20821 When run as a script, report failures in the exit code as well.
20822 Patch largely based on changes by Andrew Dalke, as discussed in the
20823 distutils-sig.
20824
20825Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20826
20827 * Lib/urllib.py:
20828 Hack so that if a 302 or 301 redirect contains a relative URL, the
20829 right thing "just happens" (basejoin() with old URL).
20830
20831 * Modules/cPickle.c:
20832 Protection against picling to/from closed (real) file.
20833 The problem was reported by Moshe Zadka.
20834
20835 * Lib/test/test_cpickle.py:
20836 Test protection against picling to/from closed (real) file.
20837
20838 * Modules/timemodule.c: Chris Lawrence writes:
20839
20840 """
20841 The GNU folks, in their infinite wisdom, have decided not to implement
20842 altzone in libc6; this would not be horrible, except that timezone
20843 (which is implemented) includes the current DST setting (i.e. timezone
20844 for Central is 18000 in summer and 21600 in winter). So Python's
20845 timezone and altzone variables aren't set correctly during DST.
20846
20847 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
20848 show the "right" thing on Linux (by using the tm_gmtoff stuff
20849 available in BSD, which is how the GLIBC manual claims things should
20850 be done) and (b) should cope with the southern hemisphere. In pursuit
20851 of (b), I also took the liberty of renaming the "summer" and "winter"
20852 variables to "july" and "jan". This patch should also make certain
20853 time calculations on Linux actually work right (like the tz-aware
20854 functions in the rfc822 module).
20855
20856 (It's hard to find DST that's currently being used in the southern
20857 hemisphere; I tested using Africa/Windhoek.)
20858 """
20859
20860 * Lib/test/output/test_gzip:
20861 Jonathan Giddy discovered this file was missing.
20862
20863 * Modules/shamodule.c:
20864 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
20865 middlename) Marangozov, patch coded by Greg Stein.
20866
20867 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
20868 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
20869
20870Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20871
20872 * Tools/scripts/ndiff.py: Tim Peters writes:
20873
20874 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
20875 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
20876 for recreating the original files from ndiff's output. That's attached, if
20877 you're game! Us Windows guys don't usually have a sed sitting around
20878 <wink>.
20879
20880Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20881
20882 * Tools/scripts/ndiff.py: Tim Peters writes:
20883
20884 Attached is a cleaned-up version of ndiff (added useful module
20885 docstring, now echo'ed in case of cmd line mistake); added -q option
20886 to suppress initial file identification lines; + other minor cleanups,
20887 & a slightly faster match engine.
20888
20889Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20890
20891 * Tools/scripts/dutree.py:
20892 During display, if EPIPE is raised, it's probably because a pager was
20893 killed. Discard the error in that case, but propogate it otherwise.
20894
20895Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20896
20897 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
20898 Test suite for UserList.
20899
20900 * Lib/UserList.py: Use isinstance() where appropriate.
20901 Reformatted with 4-space indent.
20902
20903Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
20904
20905 * Tools/pynche/PyncheWidget.py:
20906 Helpwin.__init__(): The text widget should get focus.
20907
20908 * Tools/pynche/pyColorChooser.py:
20909 Removed unnecessary import `from PyncheWidget import PyncheWidget'
20910
20911Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20912
20913 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
20914 Test suite for UserDict
20915
20916 * Lib/UserDict.py: Improved a bunch of things.
20917 The constructor now takes an optional dictionary.
20918 Use isinstance() where appropriate.
20919
20920Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20921
20922 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
20923 Basic regr tests for pickle/cPickle
20924
20925 * Lib/pickle.py:
20926 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
20927 points out) it doesn't work in JPython Applets.
20928
20929Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
20930
20931 * Lib/test/test_gzip.py:
20932 Added a simple test suite for gzip. It simply opens a temp file,
20933 writes a chunk of compressed data, closes it, writes another chunk, and
20934 reads the contents back to verify that they are the same.
20935
20936 * Lib/gzip.py:
20937 Based on a suggestion from bruce@hams.com, make a trivial change to
20938 allow using the 'a' flag as a mode for opening a GzipFile. gzip
20939 files, surprisingly enough, can be concatenated and then decompressed;
20940 the effect is to concatenate the two chunks of data.
20941
20942 If we support it on writing, it should also be supported on reading.
20943 This *wasn't* trivial, and required rearranging the code in the
20944 reading path, particularly the _read() method.
20945
20946 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
20947 and 'Unknown compression method'
20948
20949Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20950
20951 * Lib/test/test_b1.py:
20952 Add tests for float() and complex() with string args (Nick/Stephanie
20953 Lockwood).
20954
20955Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
20956
20957 * Modules/zlibmodule.c:
20958 Add an .unused_data attribute to decompressor objects. If .unused_data
20959 is not an empty string, this means that you have arrived at the
20960 end of the stream of compressed data, and the contents of .unused_data are
20961 whatever follows the compressed stream.
20962
20963Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20964
20965 * Python/bltinmodule.c:
20966 Patch by Nick and Stephanie Lockwood to implement complex() with a string
20967 argument. This closes TODO item 2.19.
20968
20969Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20970
20971 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
20972 Unfortunately his code breaks wcgui.py in a way that's not easy
20973 to fix. I expect that this is a temporary situation --
20974 eventually Sam's changes will be merged back in.
20975 (The changes add a -t option to specify exceptions to the -x
20976 option, and explicit checking for #foo style fragment ids.)
20977
20978 * Objects/dictobject.c:
20979 Vladimir Marangozov contributed updated comments.
20980
20981 * Objects/bufferobject.c: Folded long lines.
20982
20983 * Lib/test/output/test_sha, Lib/test/test_sha.py:
20984 Added Jeremy's test code for the sha module.
20985
20986 * Modules/shamodule.c, Modules/Setup.in:
20987 Added Greg Stein and Andrew Kuchling's sha module.
20988 Fix comments about zlib version and URL.
20989
20990 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
20991
20992 * Include/pythread.h: Conform to standard boilerplate.
20993
20994 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
20995 Chris Herborth: the new compiler in R4.1 needs some new options to work...
20996
20997 * Modules/socketmodule.c:
20998 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
20999 data struct before calling gethostby{name,addr}_r(); (2) ignore the
21000 3/5/6 args determinations made by the configure script and switch on
21001 platform identifiers instead:
21002
21003 AIX, OSF have 3 args
21004 Sun, SGI have 5 args
21005 Linux has 6 args
21006
21007 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
21008
21009 * Modules/socketmodule.c:
21010 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
21011
21012 * Lib/mailbox.py:
21013 Add readlines() to _Subfile class. Not clear who would need it, but
21014 Chris Lawrence sent me a broken version; this one is a tad simpler and
21015 more conforming to the standard.
21016
21017Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21018
21019 * Lib/gzip.py: use struct instead of bit-manipulate in Python
21020
21021Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21022
21023 * Modules/Makefile.pre.in:
21024 Add $(EXE) to various occurrences of python so it will work on Cygwin
21025 with egcs (after setting EXE=.exe). Patch by Norman Vine.
21026
21027 * configure, configure.in:
21028 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
21029
21030Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21031
21032 * Include/thread.h:
21033 Adding thread.h -- unused but for b/w compatibility.
21034 As requested by Bill Janssen.
21035
21036 * configure.in, configure:
21037 Add code to test for all sorts of gethostbyname_r variants,
21038 donated by David Arnold.
21039
21040 * config.h.in, acconfig.h:
21041 Add symbols for gethostbyname_r variants (sigh).
21042
21043 * Modules/socketmodule.c: Clean up pass for the previous patches.
21044
21045 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
21046 glibc2.
21047
21048 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
21049 don't know what code should be used.
21050
21051 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
21052
21053 - Modify the gethostbyaddr() code to also hold on to the lock until
21054 after it is safe to release, overlapping with the Python lock.
21055
21056 (Note: I think that it could in theory be possible that Python code
21057 executed while gethostbyname_lock is held could attempt to reacquire
21058 the lock -- e.g. in a signal handler or destructor. I will simply say
21059 "don't do that then.")
21060
21061 * Modules/socketmodule.c: Jonathan Giddy writes:
21062
21063 Here's a patch to fix the race condition, which wasn't fixed by Rob's
21064 patch. It holds the gethostbyname lock until the results are copied out,
21065 which means that this lock and the Python global lock are held at the same
21066 time. This shouldn't be a problem as long as the gethostbyname lock is
21067 always acquired when the global lock is not held.
21068
21069Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
21070
21071 * Modules/zlibmodule.c:
21072 Fixed the flush() method of compression objects; the test for
21073 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
21074 Logic cleaned up and commented.
21075
21076 * Lib/test/test_zlib.py:
21077 Added simple test for the flush() method of compression objects, trying the
21078 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
21079
21080Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21081
21082 * Lib/shlex.py:
21083 Bug reported by Tobias Thelen: missing "self." in assignment target.
21084
21085Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21086
21087 * Modules/arraymodule.c:
21088 Use an unsigned cast to avoid a warning in VC++.
21089
21090 * Lib/dospath.py, Lib/ntpath.py:
21091 New code for split() by Tim Peters, behaves more like posixpath.split().
21092
21093 * Objects/floatobject.c:
21094 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
21095 a block cannot be freed, add its free items back to the free list.
21096 This is necessary to avoid leaking when Python is reinitialized later.
21097
21098 * Objects/intobject.c:
21099 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
21100 a block cannot be freed, add its free items back to the free list, and
21101 add its valid ints back to the small_ints array if they are in range.
21102 This is necessary to avoid leaking when Python is reinitialized later.
21103
21104 * Lib/types.py:
21105 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
21106
21107 * Python/bltinmodule.c:
21108 New builtin buffer() creates a derived read-only buffer from any
21109 object that supports the buffer interface (e.g. strings, arrays).
21110
21111 * Objects/bufferobject.c:
21112 Added check for negative offset for PyBuffer_FromObject and check for
21113 negative size for PyBuffer_FromMemory. Greg Stein.
21114
21115Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21116
21117 * Lib/urlparse.py: Sjoerd Mullender writes:
21118
21119 If a filename on Windows starts with \\, it is converted to a URL
21120 which starts with ////. If this URL is passed to urlparse.urlparse
21121 you get a path that starts with // (and an empty netloc). If you pass
21122 the result back to urlparse.urlunparse, you get a URL that starts with
21123 //, which is parsed differently by urlparse.urlparse. The fix is to
21124 add the (empty) netloc with accompanying slashes if the path in
21125 urlunparse starts with //. Do this for all schemes that use a netloc.
21126
21127 * Lib/nturl2path.py: Sjoerd Mullender writes:
21128
21129 Pathnames of files on other hosts in the same domain
21130 (\\host\path\to\file) are not translated correctly to URLs and back.
21131 The URL should be something like file:////host/path/to/file.
21132 Note that a combination of drive letter and remote host is not
21133 possible.
21134
21135Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21136
21137 * Lib/urlparse.py:
21138 Delete non-standard-conforming code in urljoin() that would use the
21139 netloc from the base url as the default netloc for the resulting url
21140 even if the schemes differ.
21141
21142 Once upon a time, when the web was wild, this was a valuable hack
21143 because some people had a URL referencing an ftp server colocated with
21144 an http server without having the host in the ftp URL (so they could
21145 replicate it or change the hostname easily).
21146
21147 More recently, after the file: scheme got added back to the list of
21148 schemes that accept a netloc, it turns out that this caused weirdness
21149 when joining an http: URL with a file: URL -- the resulting file: URL
21150 would always inherit the host from the http: URL because the file:
21151 scheme supports a netloc but in practice never has one.
21152
21153 There are two reasons to get rid of the old, once-valuable hack,
21154 instead of removing the file: scheme from the uses_netloc list. One,
21155 the RFC says that file: uses the netloc syntax, and does not endorse
21156 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
21157 hack.
21158
21159 * Include/ceval.h, Include/abstract.h:
21160 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
21161
21162Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21163
21164 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
21165
21166 An attempt to execute grid_slaves with arguments (0,0) results in
21167 *all* of the slaves being returned, not just the slave associated with
21168 row 0, column 0. This is because the test for arguments in the method
21169 does not test to see if row (and column) does not equal None, but
21170 rather just whether is evaluates to non-false. A value of 0 fails
21171 this test.
21172
21173Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21174
21175 * Modules/cmathmodule.c:
21176 Docstring fix: acosh() returns the hyperbolic arccosine, not the
21177 hyperbolic cosine. Problem report via David Ascher by one of his
21178 students.
21179
21180Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21181
21182 * configure.in:
21183 Should test for gethost*by*name_r, not for gethostname_r (which
21184 doesn't exist and doesn't make sense).
21185
21186 * Modules/socketmodule.c:
21187 Patch by Rob Riggs for Linux -- glibc2 has a different argument
21188 converntion for gethostbyname_r() etc. than Solaris!
21189
21190 * Python/thread_pthread.h: Rob Riggs wrote:
21191
21192 """
21193 Spec says that on success pthread_create returns 0. It does not say
21194 that an error code will be < 0. Linux glibc2 pthread_create() returns
21195 ENOMEM (12) when one exceed process limits. (It looks like it should
21196 return EAGAIN, but that's another story.)
21197
21198 For reference, see:
21199 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
21200 """
21201
21202 [I have a feeling that similar bugs were fixed before; perhaps someone
21203 could check that all error checks no check for != 0?]
21204
21205 * Tools/bgen/bgen/bgenObjectDefinition.py:
21206 New mixin class that defines cmp and hash that use
21207 the ob_itself pointer. This allows (when using the mixin)
21208 different Python objects pointing to the same C object and
21209 behaving well as dictionary keys.
21210
21211 Or so sez Jack Jansen...
21212
21213 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
21214
21215 Don't convert URLs to URLs using pathname2url.
21216
21217Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21218
21219 * Lib/cmd.py: Patch by Michael Scharf. He writes:
21220
21221 The module cmd requires for each do_xxx command a help_xxx
21222 function. I think this is a little old fashioned.
21223
21224 Here is a patch: use the docstring as help if no help_xxx
21225 function can be found.
21226
21227 [I'm tempted to rip out all the help_* functions from pdb, but I'll
21228 resist it. Any takers? --Guido]
21229
21230 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
21231
21232 Under Windows, python freeze.py -o hello hello.py
21233 creates all the correct files in the hello subdirectory, but the
21234 Makefile has the directory prefix in it for frozen_extensions.c
21235 nmake fails because it tries to locate hello/frozen_extensions.c
21236
21237 (His fix adds a call to os.path.basename() in the appropriate place.)
21238
21239 * Objects/floatobject.c, Objects/intobject.c:
21240 Vladimir has restructured his code somewhat so that the blocks are now
21241 represented by an explicit structure. (There are still too many casts
21242 in the code, but that may be unavoidable.)
21243
21244 Also added code so that with -vv it is very chatty about what it does.
21245
21246 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
21247 Change #! line to modern usage; also chmod +x
21248
21249 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
21250 Change #! line to modern usage
21251
21252 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
21253
21254 The filename to URL conversion didn't properly quote special
21255 characters.
21256 The URL to filename didn't properly unquote special chatacters.
21257
21258 * Objects/floatobject.c:
21259 OK, try again. Vladimir gave me a fix for the alignment bus error,
21260 so here's his patch again. This time it works (at least on Solaris,
21261 Linux and Irix).
21262
21263Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21264
21265 * Tools/idle/PathBrowser.py:
21266 Don't crash when sys.path contains an empty string.
21267
21268 * Tools/idle/PathBrowser.py:
21269 - Don't crash in the case where a superclass is a string instead of a
21270 pyclbr.Class object; this can happen when the superclass is
21271 unrecognizable (to pyclbr), e.g. when module renaming is used.
21272
21273 - Show a watch cursor when calling pyclbr (since it may take a while
21274 recursively parsing imported modules!).
21275
21276Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21277
21278 * Lib/mimetypes.py:
21279 Added .rdf and .xsl as application/xml types. (.rdf is for the
21280 Resource Description Framework, a metadata encoding, and .xsl is for
21281 the Extensible Stylesheet Language.)
21282
21283Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21284
21285 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
21286 Test for popen2 module, by Chris Tismer.
21287
21288 * Objects/floatobject.c:
21289 Alas, Vladimir's patch caused a bus error (probably double
21290 alignment?), and I didn't test it. Withdrawing it for now.
21291
21292Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21293
21294 * Objects/floatobject.c:
21295 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
21296 floats on finalization.
21297
21298 * Objects/intobject.c:
21299 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
21300 integers on finalization.
21301
21302 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
21303 Add PathBrowser to File module
21304
21305 * Tools/idle/PathBrowser.py:
21306 "Path browser" - 4 scrolled lists displaying:
21307 directories on sys.path
21308 modules in selected directory
21309 classes in selected module
21310 methods of selected class
21311
21312 Sinlge clicking in a directory, module or class item updates the next
21313 column with info about the selected item. Double clicking in a
21314 module, class or method item opens the file (and selects the clicked
21315 item if it is a class or method).
21316
21317 I guess eventually I should be using a tree widget for this, but the
21318 ones I've seen don't work well enough, so for now I use the old
21319 Smalltalk or NeXT style multi-column hierarchical browser.
21320
21321 * Tools/idle/MultiScrolledLists.py:
21322 New utility: multiple scrolled lists in parallel
21323
21324 * Tools/idle/ScrolledList.py: - White background.
21325 - Display "(None)" (or text of your choosing) when empty.
21326 - Don't set the focus.
21327
21328Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21329
21330 * Lib/urllib.py:
21331 open_http also had the 'data is None' test backwards. don't call with the
21332 extra argument if data is None.
21333
21334 * Demo/embed/demo.c:
21335 Call Py_SetProgramName() instead of redefining getprogramname(),
21336 reflecting changes in the runtime around 1.5 or earlier.
21337
21338 * Python/ceval.c:
21339 Always test for an error return (usually NULL or -1) without setting
21340 an exception.
21341
21342 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
21343 He writes:
21344
21345 I had an off-by-1000 error in floatsleep(),
21346 and the problem with time.clock() is that it's not implemented properly
21347 on QNX... ANSI says it's supposed to return _CPU_ time used by the
21348 process, but on QNX it returns the amount of real time used... so I was
21349 confused.
21350
21351 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
21352 Test for self.returntype behaving like OSErr rather than being it.
21353
21354Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21355
21356 * Lib/urllib.py:
21357 http_error had the 'data is None' test backwards. don't call with the
21358 extra argument if data is None.
21359
21360 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
21361
21362 * Lib/urllib.py: pleasing the tabnanny
21363
21364Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21365
21366 * Lib/colorsys.py:
21367 Oops, one more "x, y, z" to convert...
21368
21369 * Lib/colorsys.py:
21370 Adjusted comment at the top to be less confusing, following Fredrik
21371 Lundh's example.
21372
21373 Converted comment to docstring.
21374
21375Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21376
21377 * Lib/toaiff.py:
21378 Use sndhdr instead of the obsolete whatsound module.
21379
21380Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21381
21382 * Lib/urllib.py:
21383 When performing a POST request, i.e. when the second argument to
21384 urlopen is used to specify form data, make sure the second argument is
21385 threaded through all of the http_error_NNN calls. This allows error
21386 handlers like the redirect and authorization handlers to properly
21387 re-start the connection.
21388
21389Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21390
21391 * Lib/mhlib.py: Patch by Lars Wirzenius:
21392
21393 o the initial comment is wrong: creating messages is already
21394 implemented
21395
21396 o Message.getbodytext: if the mail or it's part contains an
21397 empty content-transfer-encoding header, the code used to
21398 break; the change below treats an empty encoding value the same
21399 as the other types that do not need decoding
21400
21401 o SubMessage.getbodytext was missing the decode argument; the
21402 change below adds it; I also made it unconditionally return
21403 the raw text if decoding was not desired, because my own
21404 routines needed that (and it was easier than rewriting my
21405 own routines ;-)
21406
21407Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
21408
21409 * Python/bltinmodule.c (initerrors):
21410 Make sure that the exception tuples ("base-classes" when
21411 string-based exceptions are used) reflect the real class hierarchy,
21412 i.e. that SystemExit derives from Exception not StandardError.
21413
21414 * Lib/exceptions.py:
21415 Document the correct class hierarchy for SystemExit. It is not an
21416 error and so it derives from Exception and not SystemError. The
21417 docstring was incorrect but the implementation was fine.
21418
21419Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21420
21421 * Lib/shutil.py:
21422 Add import sys, needed by reference to sys.exc_info() in rmtree().
21423 Discovered by Mitch Chapman.
21424
21425 * config.h.in:
21426 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
21427 disappears. It wasn't used anywhere anyway...
21428
21429 * Modules/arraymodule.c:
21430 Carefully check for overflow when allocating the memory for fromfile
21431 -- someone tried to pass in sys.maxint and got bitten by the bogus
21432 calculations.
21433
21434 * configure.in:
21435 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
21436 LIBM (from --with-libm=...); this actually broke the customizability
21437 offered by the latter option. Thanks go to Clay Spence for reporting
21438 this.
21439
21440 * Lib/test/test_dl.py:
21441 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
21442 2. When no test case worked, raise ImportError instead of failing.
21443
21444 * Python/bltinmodule.c:
21445 Patch by Tim Peters to improve the range checks for range() and
21446 xrange(), especially for platforms where int and long are different
21447 sizes (so sys.maxint isn't actually the theoretical limit for the
21448 length of a list, but the largest C int is -- sys.maxint is the
21449 largest Python int, which is actually a C long).
21450
21451 * Makefile.in:
21452 1. Augment the DG/UX rule so it doesn't break the BeOS build.
21453 2. Add $(EXE) to various occurrences of python so it will work on
21454 Cygwin with egcs (after setting EXE=.exe). These patches by
21455 Norman Vine.
21456
21457 * Lib/posixfile.py:
21458 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
21459 list (of bsd variants that have a different lock structure).
21460
21461 * Lib/test/test_fcntl.py:
21462 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
21463
21464 * Modules/timemodule.c:
21465 Patch by Tadayoshi Funaba (with some changes) to be smarter about
21466 guessing what happened when strftime() returns 0. Is it buffer
21467 overflow or was the result simply 0 bytes long? (This happens for an
21468 empty format string, or when the format string is a single %Z and the
21469 timezone is unknown.) if the buffer is at least 256 times as long as
21470 the format, assume the latter.
21471
21472Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21473
21474 * Lib/urllib.py:
21475 As Des Barry points out, we need to call pathname2url(file) in two
21476 calls to addinfourl() in open_file().
21477
21478 * Modules/Setup.in: Document *static* -- in two places!
21479
21480 * Modules/timemodule.c:
21481 We don't support leap seconds, so the seconds field of a time 9-tuple
21482 should be in the range [0-59]. Noted by Tadayoshi Funaba.
21483
21484 * Modules/stropmodule.c:
21485 In atoi(), don't use isxdigit() to test whether the last character
21486 converted was a "digit" -- use isalnum(). This test is there only to
21487 guard against "+" or "-" being interpreted as a valid int literal.
21488 Reported by Takahiro Nakayama.
21489
21490 * Lib/os.py:
21491 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
21492 so they don't need to be treated specially here.
21493
21494Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21495
21496 * Misc/NEWS:
21497 Typo: "apparentlt" --> "apparently"
21498
21499Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21500
21501 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
21502
21503 * Modules/posixmodule.c:
21504 The docstring for ttyname(..) claims a second "mode" argument. The
21505 actual code does not allow such an argument. (Finn Bock.)
21506
21507 * Lib/lib-old/poly.py:
21508 Dang. Even though this is obsolete code, somebody found a bug, and I
21509 fix it. Oh well.
21510
21511Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21512
21513 * Lib/pyclbr.py:
21514 Bow to font-lock at the end of the docstring, since it throws stuff
21515 off.
21516
21517 Make sure the path paramter to readmodule() is a list before adding it
21518 with sys.path, or the addition could fail.
21519
21520
21521======================================================================
21522
21523
21524From 1.5.2b1 to 1.5.2b2
21525=======================
21526
21527General
21528-------
21529
21530- Many memory leaks fixed.
21531
21532- Many small bugs fixed.
21533
21534- Command line option -OO (or -O -O) suppresses inclusion of doc
21535strings in resulting bytecode.
21536
21537Windows-specific changes
21538------------------------
21539
21540- New built-in module winsound provides an interface to the Win32
21541PlaySound() call.
21542
21543- Re-enable the audioop module in the config.c file.
21544
21545- On Windows, support spawnv() and associated P_* symbols.
21546
21547- Fixed the conversion of times() return values on Windows.
21548
21549- Removed freeze from the installer -- it doesn't work without the
21550source tree. (See FAQ 8.11.)
21551
21552- On Windows 95/98, the Tkinter module now is smart enough to find
21553Tcl/Tk even when the PATH environment variable hasn't been set -- when
21554the import of _tkinter fails, it searches in a standard locations,
21555patches os.environ["PATH"], and tries again. When it still fails, a
21556clearer error message is produced. This should avoid most
21557installation problems with Tkinter use (e.g. in IDLE).
21558
21559- The -i option doesn't make any calls to set[v]buf() for stdin --
21560this apparently screwed up _kbhit() and the _tkinter main loop.
21561
21562- The ntpath module (and hence, os.path on Windows) now parses out UNC
21563paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
21564splitdrive() will \\host\mountpoint as the drive and \dir\file as the
21565path. ** EXPERIMENTAL **
21566
21567- Added a hack to the exit code so that if (1) the exit status is
21568nonzero and (2) we think we have our own DOS box (i.e. we're not
21569started from a command line shell), we print a message and wait for
21570the user to hit a key before the DOS box is closed.
21571
21572- Updated the installer to WISE 5.0g. Added a dialog warning about
21573the imminent Tcl installation. Added a dialog to specify the program
21574group name in the start menu. Upgraded the Tcl installer to Tcl
215758.0.4.
21576
21577Changes to intrinsics
21578---------------------
21579
21580- The repr() or str() of a module object now shows the __file__
21581attribute (i.e., the file which it was loaded), or the string
21582"(built-in)" if there is no __file__ attribute.
21583
21584- The range() function now avoids overflow during its calculations (if
21585at all possible).
21586
21587- New info string sys.hexversion, which is an integer encoding the
21588version in hexadecimal. In other words, hex(sys.hexversion) ==
215890x010502b2 for Python 1.5.2b2.
21590
21591New or improved ports
21592---------------------
21593
21594- Support for Nextstep descendants (future Mac systems).
21595
21596- Improved BeOS support.
21597
21598- Support dynamic loading of shared libraries on NetBSD platforms that
21599use ELF (i.e., MIPS and Alpha systems).
21600
21601Configuration/build changes
21602---------------------------
21603
21604- The Lib/test directory is no longer included in the default module
21605search path (sys.path) -- "test" has been a package ever since 1.5.
21606
21607- Now using autoconf 2.13.
21608
21609New library modules
21610-------------------
21611
21612- New library modules asyncore and asynchat: these form Sam Rushing's
21613famous asynchronous socket library. Sam has gracefully allowed me to
21614incorporate these in the standard Python library.
21615
21616- New module statvfs contains indexing constants for [f]statvfs()
21617return tuple.
21618
21619Changes to the library
21620----------------------
21621
21622- The wave module (platform-independent support for Windows sound
21623files) has been fixed to actually make it work.
21624
21625- The sunau module (platform-independent support for Sun/NeXT sound
21626files) has been fixed to work across platforms. Also, a weird
21627encoding bug in the header of the audio test data file has been
21628corrected.
21629
21630- Fix a bug in the urllib module that occasionally tripped up
21631webchecker and other ftp retrieves.
21632
21633- ConfigParser's get() method now accepts an optional keyword argument
21634(vars) that is substituted on top of the defaults that were setup in
21635__init__. You can now also have recusive references in your
21636configuration file.
21637
21638- Some improvements to the Queue module, including a put_nowait()
21639module and an optional "block" second argument, to get() and put(),
21640defaulting to 1.
21641
21642- The updated xmllib module is once again compatible with the version
21643present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
21644
21645- The bdb module (base class for the debugger) now supports
21646canonicalizing pathnames used in breakpoints. The derived class must
21647override the new canonical() method for this to work. Also changed
21648clear_break() to the backwards compatible old signature, and added
21649clear_bpbynumber() for the new functionality.
21650
21651- In sgmllib (and hence htmllib), recognize attributes even if they
21652don't have space in front of them. I.e. '<a
21653name="foo"href="bar.html">' will now have two attributes recognized.
21654
21655- In the debugger (pdb), change clear syntax to support three
21656alternatives: clear; clear file:line; clear bpno bpno ...
21657
21658- The os.path module now pretends to be a submodule within the os
21659"package", so you can do things like "from os.path import exists".
21660
21661- The standard exceptions now have doc strings.
21662
21663- In the smtplib module, exceptions are now classes. Also avoid
21664inserting a non-standard space after "TO" in rcpt() command.
21665
21666- The rfc822 module's getaddrlist() method now uses all occurrences of
21667the specified header instead of just the first. Some other bugfixes
21668too (to handle more weird addresses found in a very large test set,
21669and to avoid crashes on certain invalid dates), and a small test
21670module has been added.
21671
21672- Fixed bug in urlparse in the common-case code for HTTP URLs; it
21673would lose the query, fragment, and/or parameter information.
21674
21675- The sndhdr module no longer supports whatraw() -- it depended on a
21676rare extenral program.
21677
21678- The UserList module/class now supports the extend() method, like
21679real list objects.
21680
21681- The uu module now deals better with trailing garbage generated by
21682some broke uuencoders.
21683
21684- The telnet module now has an my_interact() method which uses threads
21685instead of select. The interact() method uses this by default on
21686Windows (where the single-threaded version doesn't work).
21687
21688- Add a class to mailbox.py for dealing with qmail directory
21689mailboxes. The test code was extended to notice these being used as
21690well.
21691
21692Changes to extension modules
21693----------------------------
21694
21695- Support for the [f]statvfs() system call, where it exists.
21696
21697- Fixed some bugs in cPickle where bad input could cause it to dump
21698core.
21699
21700- Fixed cStringIO to make the writelines() function actually work.
21701
21702- Added strop.expandtabs() so string.expandtabs() is now much faster.
21703
21704- Added fsync() and fdatasync(), if they appear to exist.
21705
21706- Support for "long files" (64-bit seek pointers).
21707
21708- Fixed a bug in the zlib module's flush() function.
21709
21710- Added access() system call. It returns 1 if access granted, 0 if
21711not.
21712
21713- The curses module implements an optional nlines argument to
21714w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
21715
21716Changes to tools
21717----------------
21718
21719- Some changes to IDLE; see Tools/idle/NEWS.txt.
21720
21721- Latest version of Misc/python-mode.el included.
21722
21723Changes to Tkinter
21724------------------
21725
21726- Avoid tracebacks when an image is deleted after its root has been
21727destroyed.
21728
21729Changes to the Python/C API
21730---------------------------
21731
21732- When parentheses are used in a PyArg_Parse[Tuple]() call, any
21733sequence is now accepted, instead of requiring a tuple. This is in
21734line with the general trend towards accepting arbitrary sequences.
21735
21736- Added PyModule_GetFilename().
21737
21738- In PyNumber_Power(), remove unneeded and even harmful test for float
21739to the negative power (which is already and better done in
21740floatobject.c).
21741
21742- New version identification symbols; read patchlevel.h for info. The
21743version numbers are now exported by Python.h.
21744
21745- Rolled back the API version change -- it's back to 1007!
21746
21747- The frozenmain.c function calls PyInitFrozenExtensions().
21748
21749- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
21750INCREF.
21751
21752
21753======================================================================
21754
21755
21756From 1.5.2a2 to 1.5.2b1
21757=======================
21758
21759Changes to intrinsics
21760---------------------
21761
21762- New extension NotImplementedError, derived from RuntimeError. Not
21763used, but recommended use is for "abstract" methods to raise this.
21764
21765- The parser will now spit out a warning or error when -t or -tt is
21766used for parser input coming from a string, too.
21767
21768- The code generator now inserts extra SET_LINENO opcodes when
21769compiling multi-line argument lists.
21770
21771- When comparing bound methods, use identity test on the objects, not
21772equality test.
21773
21774New or improved ports
21775---------------------
21776
21777- Chris Herborth has redone his BeOS port; it now works on PowerPC
21778(R3/R4) and x86 (R4 only). Threads work too in this port.
21779
21780Renaming
21781--------
21782
21783- Thanks to Chris Herborth, the thread primitives now have proper Py*
21784names in the source code (they already had those for the linker,
21785through some smart macros; but the source still had the old, un-Py
21786names).
21787
21788Configuration/build changes
21789---------------------------
21790
21791- Improved support for FreeBSD/3.
21792
21793- Check for pthread_detach instead of pthread_create in libc.
21794
21795- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
21796
21797- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
21798Otherwise modules such as thread didn't get incorporated in extensions.
21799
21800New library modules
21801-------------------
21802
21803- shlex.py by Eric Raymond provides a lexical analyzer class for
21804simple shell-like syntaxes.
21805
21806- netrc.py by Eric Raymond provides a parser for .netrc files. (The
21807undocumented Netrc class in ftplib.py is now obsolete.)
21808
21809- codeop.py is a new module that contains the compile_command()
21810function that was previously in code.py. This is so that JPython can
21811provide its own version of this function, while still sharing the
21812higher-level classes in code.py.
21813
21814- turtle.py is a new module for simple turtle graphics. I'm still
21815working on it; let me know if you use this to teach Python to children
21816or other novices without prior programming experience.
21817
21818Obsoleted library modules
21819-------------------------
21820
21821- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
21822their status of obsoleteness. They don't do a particularly good job
21823and don't seem particularly relevant to the Python core.
21824
21825New tools
21826---------
21827
21828- I've added IDLE: my Integrated DeveLopment Environment for Python.
21829Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
21830work on Macintosh, but I haven't been able to test it there; it does
21831depend on new features in 1.5.2 and perhaps even new features in
218321.5.2b1, especially the new code module). This is very much a work in
21833progress. I'd like to hear how people like it compared to PTUI (or
21834any other IDE they are familiar with).
21835
21836- New tools by Barry Warsaw:
21837
21838 = audiopy: controls the Solaris Audio device
21839 = pynche: The PYthonically Natural Color and Hue Editor
21840 = world: Print mappings between country names and DNS country codes
21841
21842New demos
21843---------
21844
21845- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
21846song.
21847
21848- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
21849Tkinter. (By Fredrik Lundh -- not by me!)
21850
21851Changes to the library
21852----------------------
21853
21854- compileall.py now avoids recompiling .py files that haven't changed;
21855it adds a -f option to force recompilation.
21856
21857- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
21858patches).
21859
21860- nntplib.py: statparse() no longer lowercases the message-id.
21861
21862- types.py: use type(__stdin__) for FileType.
21863
21864- urllib.py: fix translations for filenames with "funny" characters.
21865Patch by Sjoerd Mullender. Note that if you subclass one of the
21866URLopener classes, and you have copied code from the old urllib.py,
21867your subclass may stop working. A long-term solution is to provide
21868more methods so that you don't have to copy code.
21869
21870- cgi.py: In read_multi, allow a subclass to override the class we
21871instantiate when we create a recursive instance, by setting the class
21872variable 'FieldStorageClass' to the desired class. By default, this
21873is set to None, in which case we use self.__class__ (as before).
21874Also, a patch by Jim Fulton to pass additional arguments to recursive
21875calls to the FieldStorage constructor from its read_multi method.
21876
21877- UserList.py: In __getslice__, use self.__class__ instead of
21878UserList.
21879
21880- In SimpleHTTPServer.py, the server specified in test() should be
21881BaseHTTPServer.HTTPServer, in case the request handler should want to
21882reference the two attributes added by BaseHTTPServer.server_bind. (By
21883Jeff Rush, for Bobo). Also open the file in binary mode, so serving
21884images from a Windows box might actually work.
21885
21886- In CGIHTTPServer.py, the list of acceptable formats is -split-
21887on spaces but -joined- on commas, resulting in double commas
21888in the joined text. (By Jeff Rush.)
21889
21890- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
21891new threaded versions of Unix Server classes, using the ThreadingMixIn
21892class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
21893
21894- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
21895method do_delete(); do_clear() was meant. By Greg Ward.
21896
21897- getopt.py: accept a non-list sequence for the long options (request
21898by Jack Jansen). Because it might be a common mistake to pass a
21899single string, this situation is treated separately. Also added
21900docstrings (copied from the library manual) and removed the (now
21901redundant) module comments.
21902
21903- tempfile.py: improvements to avoid security leaks.
21904
21905- code.py: moved compile_command() to new module codeop.py.
21906
21907- pickle.py: support pickle format 1.3 (binary float added). By Jim
21908Fulton. Also get rid of the undocumented obsolete Pickler dump_special
21909method.
21910
21911- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
21912
21913- imaplib.py: fix problem with some versions of IMAP4 servers that
21914choose to mix the case in their CAPABILITIES response.
21915
21916- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
21917by Fredrik Lundh.
21918
21919Changes to extension modules
21920----------------------------
21921
21922- More doc strings for several modules were contributed by Chris
21923Petrilli: math, cmath, fcntl.
21924
21925- Fixed a bug in zlibmodule.c that could cause core dumps on
21926decompression of rarely occurring input.
21927
21928- cPickle.c: new version from Jim Fulton, with Open Source copyright
21929notice. Also, initialize self->safe_constructors early on to prevent
21930crash in early dealloc.
21931
21932- cStringIO.c: new version from Jim Fulton, with Open Source copyright
21933notice. Also fixed a core dump in cStringIO.c when doing seeks.
21934
21935- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
21936
21937- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
21938modifies its argument string (bad function!), so we make a temporary
21939copy.
21940
21941- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
21942control pseudo-device, per audio(7I).
21943
21944Changes to tools
21945----------------
21946
21947- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
21948support for Emacs).
21949
21950- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
21951only the names of offending files to be printed.
21952
21953- freeze: when printing missing modules, also print the module they
21954were imported from.
21955
21956- untabify.py: patch by Detlef Lannert to implement -t option
21957(set tab size).
21958
21959Changes to Tkinter
21960------------------
21961
21962- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
21963row2?
21964
21965- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
21966doesn't work when running in a non-threaded environment. He added
21967some #ifdefs that fix this.
21968
21969Changes to the Python/C API
21970---------------------------
21971
21972- Bumped API version number to 1008 -- enough things have changed!
21973
21974- There's a new macro, PyThreadState_GET(), which does the same work
21975as PyThreadState_Get() without the overhead of a function call (it
21976also avoids the error check). The two top calling locations of
21977PyThreadState_Get() have been changed to use this macro.
21978
21979- All symbols intended for export from a DLL or shared library are now
21980marked as such (with the DL_IMPORT() macro) in the header file that
21981declares them. This was needed for the BeOS port, and should also
21982make some other ports easier. The PC port no longer needs the file
21983with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
21984macro which is only used for init methods in extension modules, and
21985for Py_Main().
21986
21987Invisible changes to internals
21988------------------------------
21989
21990- Fixed a bug in new_buffersize() in fileobject.c which could
21991return a buffer size that was way too large.
21992
21993- Use PySys_WriteStderr instead of fprintf in most places.
21994
21995- dictobject.c: remove dead code discovered by Vladimir Marangozov.
21996
21997- tupleobject.c: make tuples less hungry -- an extra item was
21998allocated but never used. Tip by Vladimir Marangozov.
21999
22000- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
22001Jansen)
22002
22003- import.c: Jim Fulton fixes a reference count bug in
22004PyEval_GetGlobals.
22005
22006- glmodule.c: check in the changed version after running the stubber
22007again -- this solves the conflict with curses over the 'clear' entry
22008point much nicer. (Jack Jansen had checked in the changes to cstubs
22009eons ago, but I never regenrated glmodule.c :-( )
22010
22011- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
22012Marangozov.
22013
22014- stropmodule.c: add a missing DECREF in an error exit. Submitted by
22015Jonathan Giddy.
22016
22017
22018======================================================================
22019
22020
22021From 1.5.2a1 to 1.5.2a2
22022=======================
22023
22024General
22025-------
22026
22027- It is now a syntax error to have a function argument without a
22028default following one with a default.
22029
22030- __file__ is now set to the .py file if it was parsed (it used to
22031always be the .pyc/.pyo file).
22032
22033- Don't exit with a fatal error during initialization when there's a
22034problem with the exceptions.py module.
22035
22036- New environment variable PYTHONOPTIMIZE can be used to set -O.
22037
22038- New version of python-mode.el for Emacs.
22039
22040Miscellaneous fixed bugs
22041------------------------
22042
22043- No longer print the (confusing) error message about stack underflow
22044while compiling.
22045
22046- Some threading and locking bugs fixed.
22047
22048- When errno is zero, report "Error", not "Success".
22049
22050Documentation
22051-------------
22052
22053- Documentation will be released separately.
22054
22055- Doc strings added to array and md5 modules by Chris Petrilli.
22056
22057Ports and build procedure
22058-------------------------
22059
22060- Stop installing when a move or copy fails.
22061
22062- New version of the OS/2 port code by Jeff Rush.
22063
22064- The makesetup script handles absolute filenames better.
22065
22066- The 'new' module is now enabled by default in the Setup file.
22067
22068- I *think* I've solved the problem with the Linux build blowing up
22069sometimes due to a conflict between sigcheck/intrcheck and
22070signalmodule.
22071
22072Built-in functions
22073------------------
22074
22075- The second argument to apply() can now be any sequence, not just a
22076tuple.
22077
22078Built-in types
22079--------------
22080
22081- Lists have a new method: L1.extend(L2) is equivalent to the common
22082idiom L1[len(L1):] = L2.
22083
22084- Better error messages when a sequence is indexed with a non-integer.
22085
22086- Bettter error message when calling a non-callable object (include
22087the type in the message).
22088
22089Python services
22090---------------
22091
22092- New version of cPickle.c fixes some bugs.
22093
22094- pickle.py: improved instantiation error handling.
22095
22096- code.py: reworked quite a bit. New base class
22097InteractiveInterpreter and derived class InteractiveConsole. Fixed
22098several problems in compile_command().
22099
22100- py_compile.py: print error message and continue on syntax errors.
22101Also fixed an old bug with the fstat code (it was never used).
22102
22103- pyclbr.py: support submodules of packages.
22104
22105String Services
22106---------------
22107
22108- StringIO.py: raise the right exception (ValueError) for attempted
22109I/O on closed StringIO objects.
22110
22111- re.py: fixed a bug in subn(), which caused .groups() to fail inside
22112the replacement function called by sub().
22113
22114- The struct module has a new format 'P': void * in native mode.
22115
22116Generic OS Services
22117-------------------
22118
22119- Module time: Y2K robustness. 2-digit year acceptance depends on
22120value of time.accept2dyear, initialized from env var PYTHONY2K,
22121default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
22122(POSIX or X/Open recommendation).
22123
22124- os.path: normpath(".//x") should return "x", not "/x".
22125
22126- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
22127doesn't work.
22128
22129- tempfile.py: regenerate the template after a fork() call.
22130
22131Optional OS Services
22132--------------------
22133
22134- In the signal module, disable restarting interrupted system calls
22135when we have siginterrupt().
22136
22137Debugger
22138--------
22139
22140- No longer set __args__; this feature is no longer supported and can
22141affect the debugged code.
22142
22143- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
22144added aliases and some other useful new features, e.g. much better
22145breakpoint support: temporary breakpoint, disabled breakpoints,
22146breakpoints with ignore counts, and conditions; breakpoints can be set
22147on a file before it is loaded.
22148
22149Profiler
22150--------
22151
22152- Changes so that JPython can use it. Also fix the calibration code
22153so it actually works again
22154.
22155Internet Protocols and Support
22156------------------------------
22157
22158- imaplib.py: new version from Piers Lauder.
22159
22160- smtplib.py: change sendmail() method to accept a single string or a
22161list or strings as the destination (commom newbie mistake).
22162
22163- poplib.py: LIST with a msg argument fixed.
22164
22165- urlparse.py: some optimizations for common case (http).
22166
22167- urllib.py: support content-length in info() for ftp protocol;
22168support for a progress meter through a third argument to
22169urlretrieve(); commented out gopher test (the test site is dead).
22170
22171Internet Data handling
22172----------------------
22173
22174- sgmllib.py: support tags with - or . in their name.
22175
22176- mimetypes.py: guess_type() understands 'data' URLs.
22177
22178Restricted Execution
22179--------------------
22180
22181- The classes rexec.RModuleLoader and rexec.RModuleImporter no
22182longer exist.
22183
22184Tkinter
22185-------
22186
22187- When reporting an exception, store its info in sys.last_*. Also,
22188write all of it to stderr.
22189
22190- Added NS, EW, and NSEW constants, for grid's sticky option.
22191
22192- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
22193
22194- Make bind variants without a sequence return a tuple of sequences
22195(formerly it returned a string, which wasn't very convenient).
22196
22197- Add image commands to the Text widget (these are new in Tk 8.0).
22198
22199- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
22200
22201- Improved the thread code (but you still can't call update() from
22202another thread on Windows).
22203
22204- Fixed unnecessary references to _default_root in the new dialog
22205modules.
22206
22207- Miscellaneous problems fixed.
22208
22209
22210Windows General
22211---------------
22212
22213- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
22214search for dependent dlls in the directory containing the .pyd.
22215
22216- In debugging mode, call DebugBreak() in Py_FatalError().
22217
22218Windows Installer
22219-----------------
22220
22221- Install zlib.dll in the DLLs directory instead of in the win32
22222system directory, to avoid conflicts with other applications that have
22223their own zlib.dll.
22224
22225Test Suite
22226----------
22227
22228- test_long.py: new test for long integers, by Tim Peters.
22229
22230- regrtest.py: improved so it can be used for other test suites as
22231well.
22232
22233- test_strftime.py: use re to compare test results, to support legal
22234variants (e.g. on Linux).
22235
22236Tools and Demos
22237---------------
22238
22239- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
22240remove/add Windows style '\r\n' line endings), untabify.py (to remove
22241tabs), and rgrep.yp (reverse grep).
22242
22243- Improvements to Tools/freeze/. Each Python module is now written to
22244its own C file. This prevents some compilers or assemblers from
22245blowing up on large frozen programs, and saves recompilation time if
22246only a few modules are changed. Other changes too, e.g. new command
22247line options -x and -i.
22248
22249- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
22250
22251Python/C API
22252------------
22253
22254- New mechanism to support extensions of the type object while
22255remaining backward compatible with extensions compiled for previous
22256versions of Python 1.5. A flags field indicates presence of certain
22257fields.
22258
22259- Addition to the buffer API to differentiate access to bytes and
222608-bit characters (in anticipation of Unicode characters).
22261
22262- New argument parsing format t# ("text") to indicate 8-bit
22263characters; s# simply means 8-bit bytes, for backwards compatibility.
22264
22265- New object type, bufferobject.c is an example and can be used to
22266create buffers from memory.
22267
22268- Some support for 64-bit longs, including some MS platforms.
22269
22270- Many calls to fprintf(stderr, ...) have been replaced with calls to
22271PySys_WriteStderr(...).
22272
22273- The calling context for PyOS_Readline() has changed: it must now be
22274called with the interpreter lock held! It releases the lock around
22275the call to the function pointed to by PyOS_ReadlineFunctionPointer
22276(default PyOS_StdioReadline()).
22277
22278- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
22279
22280- Renamed header file "thread.h" to "pythread.h".
22281
22282- The code string of code objects may now be anything that supports the
22283buffer API.
22284
22285
22286======================================================================
22287
22288
22289From 1.5.1 to 1.5.2a1
22290=====================
22291
22292General
22293-------
22294
22295- When searching for the library, a landmark that is a compiled module
22296(string.pyc or string.pyo) is also accepted.
22297
22298- When following symbolic links to the python executable, use a loop
22299so that a symlink to a symlink can work.
22300
22301- Added a hack so that when you type 'quit' or 'exit' at the
22302interpreter, you get a friendly explanation of how to press Ctrl-D (or
22303Ctrl-Z) to exit.
22304
22305- New and improved Misc/python-mode.el (Python mode for Emacs).
22306
22307- Revert a new feature in Unix dynamic loading: for one or two
22308revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
22309out to be a bad idea.
22310
22311Miscellaneous fixed bugs
22312------------------------
22313
22314- All patches on the patch page have been integrated. (But much more
22315has been done!)
22316
22317- Several memory leaks plugged (e.g. the one for classes with a
22318__getattr__ method).
22319
22320- Removed the only use of calloc(). This triggered an obscure bug on
22321multiprocessor Sparc Solaris 2.6.
22322
22323- Fix a peculiar bug that would allow "import sys.time" to succeed
22324(believing the built-in time module to be a part of the sys package).
22325
22326- Fix a bug in the overflow checking when converting a Python long to
22327a C long (failed to convert -2147483648L, and some other cases).
22328
22329Documentation
22330-------------
22331
22332- Doc strings have been added to many extension modules: __builtin__,
22333errno, select, signal, socket, sys, thread, time. Also to methods of
22334list objects (try [].append.__doc__). A doc string on a type will now
22335automatically be propagated to an instance if the instance has methods
22336that are accessed in the usual way.
22337
22338- The documentation has been expanded and the formatting improved.
22339(Remember that the documentation is now unbundled and has its own
22340release cycle though; see http://www.python.org/doc/.)
22341
22342- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
22343
22344Ports and build procedure
22345-------------------------
22346
22347- The BeOS port is now integrated. Courtesy Chris Herborth.
22348
22349- Symbol files for FreeBSD 2.x and 3.x have been contributed
22350(Lib/plat-freebsd[23]/*).
22351
22352- Support HPUX 10.20 DCE threads.
22353
22354- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
22355works, it won't also use -Olimit 1500 (which gives a warning for every
22356file). Also support the SGI_ABI environment variable better.
22357
22358- The makesetup script now understands absolute pathnames ending in .o
22359in the module -- it assumes it's a file for which we have no source.
22360
22361- Other miscellaneous improvements to the configure script and
22362Makefiles.
22363
22364- The test suite now uses a different sound sample.
22365
22366Built-in functions
22367------------------
22368
22369- Better checks for invalid input to int(), long(), string.atoi(),
22370string.atol(). (Formerly, a sign without digits would be accepted as
22371a legal ways to spell zero.)
22372
22373- Changes to map() and filter() to use the length of a sequence only
22374as a hint -- if an IndexError happens earlier, take that. (Formerly,
22375this was considered an error.)
22376
22377- Experimental feature in getattr(): a third argument can specify a
22378default (instead of raising AttributeError).
22379
22380- Implement round() slightly different, so that for negative ndigits
22381no additional errors happen in the last step.
22382
22383- The open() function now adds the filename to the exception when it
22384fails.
22385
22386Built-in exceptions
22387-------------------
22388
22389- New standard exceptions EnvironmentError and PosixError.
22390EnvironmentError is the base class for IOError and PosixError;
22391PosixError is the same as os.error. All this so that either exception
22392class can be instantiated with a third argument indicating a filename.
22393The built-in function open() and most os/posix functions that take a
22394filename argument now use this.
22395
22396Built-in types
22397--------------
22398
22399- List objects now have an experimental pop() method; l.pop() returns
22400and removes the last item; l.pop(i) returns and removes the item at
22401i. Also, the sort() method is faster again. Sorting is now also
22402safer: it is impossible for the sorting function to modify the list
22403while the sort is going on (which could cause core dumps).
22404
22405- Changes to comparisons: numbers are now smaller than any other type.
22406This is done to prevent the circularity where [] < 0L < 1 < [] is
22407true. As a side effect, cmp(None, 0) is now positive instead of
22408negative. This *shouldn't* affect any working code, but I've found
22409that the change caused several "sleeping" bugs to become active, so
22410beware!
22411
22412- Instance methods may now have other callable objects than just
22413Python functions as their im_func. Use new.instancemethod() or write
22414your own C code to create them; new.instancemethod() may be called
22415with None for the instance to create an unbound method.
22416
22417- Assignment to __name__, __dict__ or __bases__ of a class object is
22418now allowed (with stringent type checks); also allow assignment to
22419__getattr__ etc. The cached values for __getattr__ etc. are
22420recomputed after such assignments (but not for derived classes :-( ).
22421
22422- Allow assignment to some attributes of function objects: func_code,
22423func_defaults and func_doc / __doc__. (With type checks except for
22424__doc__ / func_doc .)
22425
22426Python services
22427---------------
22428
22429- New tests (in Lib/test): reperf.py (regular expression benchmark),
22430sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
22431for the MimeWriter module).
22432
22433- Generalized test/regrtest.py so that it is useful for testing other
22434packages.
22435
22436- The ihooks.py module now understands package imports.
22437
22438- In code.py, add a class that subsumes Fredrik Lundh's
22439PythonInterpreter class. The interact() function now uses this.
22440
22441- In rlcompleter.py, in completer(), return None instead of raising an
22442IndexError when there are no more completions left.
22443
22444- Fixed the marshal module to test for certain common kinds of invalid
22445input. (It's still not foolproof!)
22446
22447- In the operator module, add an alias (now the preferred name)
22448"contains" for "sequenceincludes".
22449
22450String Services
22451---------------
22452
22453- In the string and strop modules, in the replace() function, treat an
22454empty pattern as an error (since it's not clear what was meant!).
22455
22456- Some speedups to re.py, especially the string substitution and split
22457functions. Also added new function/method findall(), to find all
22458occurrences of a given substring.
22459
22460- In cStringIO, add better argument type checking and support the
22461readonly 'closed' attribute (like regular files).
22462
22463- In the struct module, unsigned 1-2 byte sized formats no longer
22464result in long integer values.
22465
22466Miscellaneous services
22467----------------------
22468
22469- In whrandom.py, added new method and function randrange(), same as
22470choice(range(start, stop, step)) but faster. This addresses the
22471problem that randint() was accidentally defined as taking an inclusive
22472range. Also, randint(a, b) is now redefined as randrange(a, b+1),
22473adding extra range and type checking to its arguments!
22474
22475- Add some semi-thread-safety to random.gauss() (it used to be able to
22476crash when invoked from separate threads; now the worst it can do is
22477give a duplicate result occasionally).
22478
22479- Some restructuring and generalization done to cmd.py.
22480
22481- Major upgrade to ConfigParser.py; converted to using 're', added new
22482exceptions, support underscore in section header and option name. No
22483longer add 'name' option to every section; instead, add '__name__'.
22484
22485- In getpass.py, don't use raw_input() to ask for the password -- we
22486don't want it to show up in the readline history! Also don't catch
22487interrupts (the try-finally already does all necessary cleanup).
22488
22489Generic OS Services
22490-------------------
22491
22492- New functions in os.py: makedirs(), removedirs(), renames(). New
22493variable: linesep (the line separator as found in binary files,
22494i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
22495this with files opened in (default) text mode; the line separator used
22496will always be '\n'!
22497
22498- Changes to the 'os.path' submodule of os.py: added getsize(),
22499getmtime(), getatime() -- these fetch the most popular items from the
22500stat return tuple.
22501
22502- In the time module, add strptime(), if it exists. (This parses a
22503time according to a format -- the inverse of strftime().) Also,
22504remove the call to mktime() from strftime() -- it messed up the
22505formatting of some non-local times.
22506
22507- In the socket module, added a new function gethostbyname_ex().
22508Also, don't use #ifdef to test for some symbols that are enums on some
22509platforms (and should exist everywhere).
22510
22511Optional OS Services
22512--------------------
22513
22514- Some fixes to gzip.py. In particular, the readlines() method now
22515returns the lines *with* trailing newline characters, like readlines()
22516of regular file objects. Also, it didn't work together with cPickle;
22517fixed that.
22518
22519- In whichdb.py, support byte-swapped dbhash (bsddb) files.
22520
22521- In anydbm.py, look at the type of an existing database to determine
22522which module to use to open it. (The anydbm.error exception is now a
22523tuple.)
22524
22525Unix Services
22526-------------
22527
22528- In the termios module, in tcsetattr(), initialize the structure vy
22529calling tcgetattr().
22530
22531- Added some of the "wait status inspection" macros as functions to
22532the posix module (and thus to the os module): WEXITSTATUS(),
22533WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
22534
22535- In the syslog module, make the default facility more intuitive
22536(matching the docs).
22537
22538Debugger
22539--------
22540
22541- In pdb.py, support for setting breaks on files/modules that haven't
22542been loaded yet.
22543
22544Internet Protocols and Support
22545------------------------------
22546
22547- Changes in urllib.py; sped up unquote() and quote(). Fixed an
22548obscure bug in quote_plus(). Added urlencode(dict) -- convenience
22549function for sending a POST request with urlopen(). Use the getpass
22550module to ask for a password. Rewrote the (test) main program so that
22551when used as a script, it can retrieve one or more URLs to stdout.
22552Use -t to run the self-test. Made the proxy code work again.
22553
22554- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
22555fail when someone asks for their HEAD. Also, for POST, set the
22556default content-type to application/x-www-form-urlencoded. Also, in
22557FieldStorage.__init__(), when method='GET', always get the query
22558string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
22559explicitly passed in fp.
22560
22561- The smtplib.py module now supports ESMTP and has improved standard
22562compliance, for picky servers.
22563
22564- Improved imaplib.py.
22565
22566- Fixed UDP support in SocketServer.py (it never worked).
22567
22568- Fixed a small bug in CGIHTTPServer.py.
22569
22570Internet Data handling
22571----------------------
22572
22573- In rfc822.py, add a new class AddressList. Also support a new
22574overridable method, isheader(). Also add a get() method similar to
22575dictionaries (and make getheader() an alias for it). Also, be smarter
22576about seekable (test whether fp.tell() works) and test for presence of
22577unread() method before trying seeks.
22578
22579- In sgmllib.py, restore the call to report_unbalanced() that was lost
22580long ago. Also some other improvements: handle <? processing
22581instructions >, allow . and - in entity names, and allow \r\n as line
22582separator.
22583
22584- Some restructuring and generalization done to multifile.py; support
22585a 'seekable' flag.
22586
22587Restricted Execution
22588--------------------
22589
22590- Improvements to rexec.py: package support; support a (minimal)
22591sys.exc_info(). Also made the (test) main program a bit fancier (you
22592can now use it to run arbitrary Python scripts in restricted mode).
22593
22594Tkinter
22595-------
22596
22597- On Unix, Tkinter can now safely be used from a multi-threaded
22598application. (Formerly, no threads would make progress while
22599Tkinter's mainloop() was active, because it didn't release the Python
22600interpreter lock.) Unfortunately, on Windows, threads other than the
22601main thread should not call update() or update_idletasks() because
22602this will deadlock the application.
22603
22604- An interactive interpreter that uses readline and Tkinter no longer
22605uses up all available CPU time.
22606
22607- Even if readline is not used, Tk windows created in an interactive
22608interpreter now get continuously updated. (This even works in Windows
22609as long as you don't hit a key.)
22610
22611- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
22612
22613- No longer register Tcl_finalize() as a low-level exit handler. It
22614may call back into Python, and that's a bad idea.
22615
22616- Allow binding of Tcl commands (given as a string).
22617
22618- Some minor speedups; replace explicitly coded getint() with int() in
22619most places.
22620
22621- In FileDialog.py, remember the directory of the selected file, if
22622given.
22623
22624- Change the names of all methods in the Wm class: they are now
22625wm_title(), etc. The old names (title() etc.) are still defined as
22626aliases.
22627
22628- Add a new method of interpreter objects, interpaddr(). This returns
22629the address of the Tcl interpreter object, as an integer. Not very
22630useful for the Python programmer, but this can be called by another C
22631extension that needs to make calls into the Tcl/Tk C API and needs to
22632get the address of the Tcl interpreter object. A simple cast of the
22633return value to (Tcl_Interp *) will do the trick.
22634
22635Windows General
22636---------------
22637
22638- Don't insist on proper case for module source files if the filename
22639is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
22640doesn't). This should address problems with this feature on
22641oldfashioned filesystems (Novell servers?).
22642
22643Windows Library
22644---------------
22645
22646- os.environ is now all uppercase, but accesses are case insensitive,
22647and the putenv() calls made as a side effect of changing os.environ
22648are case preserving.
22649
22650- Removed samefile(), sameopenfile(), samestat() from os.path (aka
22651ntpath.py) -- these cannot be made to work reliably (at least I
22652wouldn't know how).
22653
22654- Fixed os.pipe() so that it returns file descriptors acceptable to
22655os.read() and os.write() (like it does on Unix), rather than Windows
22656file handles.
22657
22658- Added a table of WSA error codes to socket.py.
22659
22660- In the select module, put the (huge) file descriptor arrays on the
22661heap.
22662
22663- The getpass module now raises KeyboardInterrupt when it sees ^C.
22664
22665- In mailbox.py, fix tell/seek when using files opened in text mode.
22666
22667- In rfc822.py, fix tell/seek when using files opened in text mode.
22668
22669- In the msvcrt extension module, release the interpreter lock for
22670calls that may block: _locking(), _getch(), _getche(). Also fix a
22671bogus error return when open_osfhandle() doesn't have the right
22672argument list.
22673
22674Windows Installer
22675-----------------
22676
22677- The registry key used is now "1.5" instead of "1.5.x" -- so future
22678versions of 1.5 and Mark Hammond's win32all installer don't need to be
22679resynchronized.
22680
22681Windows Tools
22682-------------
22683
22684- Several improvements to freeze specifically for Windows.
22685
22686Windows Build Procedure
22687-----------------------
22688
22689- The VC++ project files and the WISE installer have been moved to the
22690PCbuild subdirectory, so they are distributed in the same subdirectory
22691where they must be used. This avoids confusion.
22692
22693- New project files for Windows 3.1 port by Jim Ahlstrom.
22694
22695- Got rid of the obsolete subdirectory PC/setup_nt/.
22696
22697- The projects now use distinct filenames for the .exe, .dll, .lib and
22698.pyd files built in debug mode (by appending "_d" to the base name,
22699before the extension). This makes it easier to switch between the two
22700and get the right versions. There's a pragma in config.h that directs
22701the linker to include the appropriate .lib file (so python15.lib no
22702longer needs to be explicit in your project).
22703
22704- The installer now installs more files (e.g. config.h). The idea is
22705that you shouldn't need the source distribution if you want build your
22706own extensions in C or C++.
22707
22708Tools and Demos
22709---------------
22710
22711- New script nm2def.py by Marc-Andre Lemburg, to construct
22712PC/python_nt.def automatically (some hand editing still required).
22713
22714- New tool ndiff.py: Tim Peters' text diffing tool.
22715
22716- Various and sundry improvements to the freeze script.
22717
22718- The script texi2html.py (which was part of the Doc tree but is no
22719longer used there) has been moved to the Tools/scripts subdirectory.
22720
22721- Some generalizations in the webchecker code. There's now a
22722primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
22723
22724- The ftpmirror.py script now handles symbolic links properly, and
22725also files with multiple spaces in their names.
22726
22727- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
22728last line is both indented and lacks a newline. This is now fixed.
22729
22730Python/C API
22731------------
22732
22733- Added missing prototypes for PyEval_CallFunction() and
22734PyEval_CallMethod().
22735
22736- New macro PyList_SET_ITEM().
22737
22738- New macros to access object members for PyFunction, PyCFunction
22739objects.
22740
22741- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
22742dynamically add one or many entries to the table of built-in modules.
22743
22744- New macro Py_InitModule3(name, methods, doc) which calls
22745Py_InitModule4() with appropriate arguments. (The -4 variant requires
22746you to pass an obscure version number constant which is always the same.)
22747
22748- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
22749sys.stdout or sys.stderr using a printf-like interface. (Used in
22750_tkinter.c, for example.)
22751
22752- New APIs for conversion between Python longs and C 'long long' if
22753your compiler supports it.
22754
22755- PySequence_In() is now called PySequence_Contains().
22756(PySequence_In() is still supported for b/w compatibility; it is
22757declared obsolete because its argument order is confusing.)
22758
22759- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
22760*never* raise an exception -- (even if the hash() fails, simply clear
22761the error). This was necessary because there is lots of code out
22762there that already assumes this.
22763
22764- Changes to PySequence_Tuple() and PySequence_List() to use the
22765length of a sequence only as a hint -- if an IndexError happens
22766earlier, take that. (Formerly, this was considered an error.)
22767
22768- Reformatted abstract.c to give it a more familiar "look" and fixed
22769many error checking bugs.
22770
22771- Add NULL pointer checks to all calls of a C function through a type
22772object and extensions (e.g. nb_add).
22773
22774- The code that initializes sys.path now calls Py_GetPythonHome()
22775instead of getenv("PYTHONHOME"). This, together with the new API
22776Py_SetPythonHome(), makes it easier for embedding applications to
22777change the notion of Python's "home" directory (where the libraries
22778etc. are sought).
22779
22780- Fixed a very old bug in the parsing of "O?" format specifiers.
22781
22782
22783======================================================================
22784
22785
Guido van Rossumf2eac992000-09-04 17:24:24 +000022786========================================
22787==> Release 1.5.1 (October 31, 1998) <==
22788========================================
22789
Guido van Rossum439d1fa1998-12-21 21:41:14 +000022790From 1.5 to 1.5.1
22791=================
22792
22793General
22794-------
22795
22796- The documentation is now unbundled. It has also been extensively
22797modified (mostly to implement a new and more uniform formatting
22798style). We figure that most people will prefer to download one of the
22799preformatted documentation sets (HTML, PostScript or PDF) and that
22800only a minority have a need for the LaTeX or FrameMaker sources. Of
22801course, the unbundled documentation sources still released -- just not
22802in the same archive file, and perhaps not on the same date.
22803
22804- All bugs noted on the errors page (and many unnoted) are fixed. All
22805new bugs take their places.
22806
22807- No longer a core dump when attempting to print (or repr(), or str())
22808a list or dictionary that contains an instance of itself; instead, the
22809recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
22810Py_ReprLeave() below. Comparisons of such objects still go beserk,
22811since this requires a different kind of fix; fortunately, this is a
22812less common scenario in practice.
22813
22814Syntax change
22815-------------
22816
22817- The raise statement can now be used without arguments, to re-raise
22818a previously set exception. This should be used after catching an
22819exception with an except clause only, either in the except clause or
22820later in the same function.
22821
22822Import and module handling
22823--------------------------
22824
22825- The implementation of import has changed to use a mutex (when
22826threading is supported). This means that when two threads
22827simultaneously import the same module, the import statements are
22828serialized. Recursive imports are not affected.
22829
22830- Rewrote the finalization code almost completely, to be much more
22831careful with the order in which modules are destroyed. Destructors
22832will now generally be able to reference built-in names such as None
22833without trouble.
22834
22835- Case-insensitive platforms such as Mac and Windows require the case
22836of a module's filename to match the case of the module name as
22837specified in the import statement (see below).
22838
22839- The code for figuring out the default path now distinguishes between
22840files, modules, executable files, and directories. When expecting a
22841module, we also look for the .pyc or .pyo file.
22842
22843Parser/tokenizer changes
22844------------------------
22845
22846- The tokenizer can now warn you when your source code mixes tabs and
22847spaces for indentation in a manner that depends on how much a tab is
22848worth in spaces. Use "python -t" or "python -v" to enable this
22849option. Use "python -tt" to turn the warnings into errors. (See also
22850tabnanny.py and tabpolice.py below.)
22851
22852- Return unsigned characters from tok_nextc(), so '\377' isn't
22853mistaken for an EOF character.
22854
22855- Fixed two pernicious bugs in the tokenizer that only affected AIX.
22856One was actually a general bug that was triggered by AIX's smaller I/O
22857buffer size. The other was a bug in the AIX optimizer's loop
22858unrolling code; swapping two statements made the problem go away.
22859
22860Tools, demos and miscellaneous files
22861------------------------------------
22862
22863- There's a new version of Misc/python-mode.el (the Emacs mode for
22864Python) which is much smarter about guessing the indentation style
22865used in a particular file. Lots of other cool features too!
22866
22867- There are two new tools in Tools/scripts: tabnanny.py and
22868tabpolice.py, implementing two different ways of checking whether a
22869file uses indentation in a way that is sensitive to the interpretation
22870of a tab. The preferred module is tabnanny.py (by Tim Peters).
22871
22872- Some new demo programs:
22873
22874 Demo/tkinter/guido/paint.py -- Dave Mitchell
22875 Demo/sockets/unixserver.py -- Piet van Oostrum
22876
22877
22878- Much better freeze support. The freeze script can now freeze
22879hierarchical module names (with a corresponding change to import.c),
22880and has a few extra options (e.g. to suppress freezing specific
22881modules). It also does much more on Windows NT.
22882
22883- Version 1.0 of the faq wizard is included (only very small changes
22884since version 0.9.0).
22885
22886- New feature for the ftpmirror script: when removing local files
22887(i.e., only when -r is used), do a recursive delete.
22888
22889Configuring and building Python
22890-------------------------------
22891
22892- Get rid of the check for -linet -- recent Sequent Dynix systems don't
22893need this any more and apparently it screws up their configuration.
22894
22895- Some changes because gcc on SGI doesn't support '-all'.
22896
22897- Changed the build rules to use $(LIBRARY) instead of
22898 -L.. -lpython$(VERSION)
22899since the latter trips up the SunOS 4.1.x linker (sigh).
22900
22901- Fix the bug where the '# dgux is broken' comment in the Makefile
22902tripped over Make on some platforms.
22903
22904- Changes for AIX: install the python.exp file; properly use
22905$(srcdir); the makexp_aix script now removes C++ entries of the form
22906Class::method.
22907
22908- Deleted some Makefile targets only used by the (long obsolete)
22909gMakefile hacks.
22910
22911Extension modules
22912-----------------
22913
22914- Performance and threading improvements to the socket and bsddb
22915modules, by Christopher Lindblad of Infoseek.
22916
22917- Added operator.__not__ and operator.not_.
22918
22919- In the thread module, when a thread exits due to an unhandled
22920exception, don't store the exception information in sys.last_*; it
22921prevents proper calling of destructors of local variables.
22922
22923- Fixed a number of small bugs in the cPickle module.
22924
22925- Changed find() and rfind() in the strop module so that
22926find("x","",2) returns -1, matching the implementation in string.py.
22927
22928- In the time module, be more careful with the result of ctime(), and
22929test for HAVE_MKTIME before usinmg mktime().
22930
22931- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
22932modules.
22933
22934- Added the LOG_SYSLOG constant to the syslog module, if defined.
22935
22936Standard library modules
22937------------------------
22938
22939- All standard library modules have been converted to an indentation
22940style using either only tabs or only spaces -- never a mixture -- if
22941they weren't already consistent according to tabnanny. This means
22942that the new -t option (see above) won't complain about standard
22943library modules.
22944
22945- New standard library modules:
22946
22947 threading -- GvR and the thread-sig
22948 Java style thread objects -- USE THIS!!!
22949
22950 getpass -- Piers Lauder
22951 simple utilities to prompt for a password and to
22952 retrieve the current username
22953
22954 imaplib -- Piers Lauder
22955 interface for the IMAP4 protocol
22956
22957 poplib -- David Ascher, Piers Lauder
22958 interface for the POP3 protocol
22959
22960 smtplib -- Dragon De Monsyne
22961 interface for the SMTP protocol
22962
22963- Some obsolete modules moved to a separate directory (Lib/lib-old)
22964which is *not* in the default module search path:
22965
22966 Para
22967 addpack
22968 codehack
22969 fmt
22970 lockfile
22971 newdir
22972 ni
22973 rand
22974 tb
22975
22976- New version of the PCRE code (Perl Compatible Regular Expressions --
22977the re module and the supporting pcre extension) by Andrew Kuchling.
22978Incompatible new feature in re.sub(): the handling of escapes in the
22979replacement string has changed.
22980
22981- Interface change in the copy module: a __deepcopy__ method is now
22982called with the memo dictionary as an argument.
22983
22984- Feature change in the tokenize module: differentiate between NEWLINE
22985token (an official newline) and NL token (a newline that the grammar
22986ignores).
22987
22988- Several bugfixes to the urllib module. It is now truly thread-safe,
22989and several bugs and a portability problem have been fixed. New
22990features, all due to Sjoerd Mullender: When creating a temporary file,
22991it gives it an appropriate suffix. Support the "data:" URL scheme.
22992The open() method uses the tempcache.
22993
22994- New version of the xmllib module (this time with a test suite!) by
22995Sjoerd Mullender.
22996
22997- Added debugging code to the telnetlib module, to be able to trace
22998the actual traffic.
22999
23000- In the rfc822 module, added support for deleting a header (still no
23001support for adding headers, though). Also fixed a bug where an
23002illegal address would cause a crash in getrouteaddr(), fixed a
23003sign reversal in mktime_tz(), and use the local timezone by default
23004(the latter two due to Bill van Melle).
23005
23006- The normpath() function in the dospath and ntpath modules no longer
23007does case normalization -- for that, use the separate function
23008normcase() (which always existed); normcase() has been sped up and
23009fixed (it was the cause of a crash in Mark Hammond's installer in
23010certain locales).
23011
23012- New command supported by the ftplib module: rmd(); also fixed some
23013minor bugs.
23014
23015- The profile module now uses a different timer function by default --
23016time.clock() is generally better than os.times(). This makes it work
23017better on Windows NT, too.
23018
23019- The tempfile module now recovers when os.getcwd() raises an
23020exception.
23021
23022- Fixed some bugs in the random module; gauss() was subtly wrong, and
23023vonmisesvariate() should return a full circle. Courtesy Mike Miller,
23024Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
23025
23026- Better default seed in the whrandom module, courtesy Andrew Kuchling.
23027
23028- Fix slow close() in shelve module.
23029
23030- The Unix mailbox class in the mailbox module is now more robust when
23031a line begins with the string "From " but is definitely not the start
23032of a new message. The pattern used can be changed by overriding a
23033method or class variable.
23034
23035- Added a rmtree() function to the copy module.
23036
23037- Fixed several typos in the pickle module. Also fixed problems when
23038unpickling in restricted execution environments.
23039
23040- Added docstrings and fixed a typo in the py_compile and compileall
23041modules. At Mark Hammond's repeated request, py_compile now append a
23042newline to the source if it needs one. Both modules support an extra
23043parameter to specify the purported source filename (to be used in
23044error messages).
23045
23046- Some performance tweaks by Jeremy Hylton to the gzip module.
23047
23048- Fixed a bug in the merge order of dictionaries in the ConfigParser
23049module. Courtesy Barry Warsaw.
23050
23051- In the multifile module, support the optional second parameter to
23052seek() when possible.
23053
23054- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
23055urlparse now correctly handles Gopher URLs with query strings.
23056
23057- Fixed a tiny bug in format_exception() in the traceback module.
23058Also rewrite tb_lineno() to be compatible with JPython (and not
23059disturb the current exception!); by Jim Hugunin.
23060
23061- The httplib module is more robust when servers send a short response
23062-- courtesy Tim O'Malley.
23063
23064Tkinter and friends
23065-------------------
23066
23067- Various typos and bugs fixed.
23068
23069- New module Tkdnd implements a drag-and-drop protocol (within one
23070application only).
23071
23072- The event_*() widget methods have been restructured slightly -- they
23073no longer use the default root.
23074
23075- The interfaces for the bind*() and unbind() widget methods have been
23076redesigned; the bind*() methods now return the name of the Tcl command
23077created for the callback, and this can be passed as a optional
23078argument to unbind() in order to delete the command (normally, such
23079commands are automatically unbound when the widget is destroyed, but
23080for some applications this isn't enough).
23081
23082- Variable objects now have trace methods to interface to Tcl's
23083variable tracing facilities.
23084
23085- Image objects now have an optional keyword argument, 'master', to
23086specify a widget (tree) to which they belong. The image_names() and
23087image_types() calls are now also widget methods.
23088
23089- There's a new global call, Tkinter.NoDefaultRoot(), which disables
23090all use of the default root by the Tkinter library. This is useful to
23091debug applications that are in the process of being converted from
23092relying on the default root to explicit specification of the root
23093widget.
23094
23095- The 'exit' command is deleted from the Tcl interpreter, since it
23096provided a loophole by which one could (accidentally) exit the Python
23097interpreter without invoking any cleanup code.
23098
23099- Tcl_Finalize() is now registered as a Python low-level exit handle,
23100so Tcl will be finalized when Python exits.
23101
23102The Python/C API
23103----------------
23104
23105- New function PyThreadState_GetDict() returns a per-thread dictionary
23106intended for storing thread-local global variables.
23107
23108- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
23109dictionary to allow recursive container types to detect recursion in
23110their repr(), str() and print implementations.
23111
23112- New function PyObject_Not(x) calculates (not x) according to Python's
23113standard rules (basically, it negates the outcome PyObject_IsTrue(x).
23114
23115- New function _PyModule_Clear(), which clears a module's dictionary
23116carefully without removing the __builtins__ entry. This is implied
23117when a module object is deallocated (this used to clear the dictionary
23118completely).
23119
23120- New function PyImport_ExecCodeModuleEx(), which extends
23121PyImport_ExecCodeModule() by adding an extra parameter to pass it the
23122true file.
23123
23124- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
23125allow embedded applications to force a different value for PYTHONHOME.
23126
23127- New global flag Py_FrozenFlag is set when this is a "frozen" Python
23128binary; it suppresses warnings about not being able to find the
23129standard library directories.
23130
23131- New global flag Py_TabcheckFlag is incremented by the -t option and
23132causes the tokenizer to issue warnings or errors about inconsistent
23133mixing of tabs and spaces for indentation.
23134
23135Miscellaneous minor changes and bug fixes
23136-----------------------------------------
23137
23138- Improved the error message when an attribute of an attribute-less
23139object is requested -- include the name of the attribute and the type
23140of the object in the message.
23141
23142- Sped up int(), long(), float() a bit.
23143
23144- Fixed a bug in list.sort() that would occasionally dump core.
23145
23146- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
23147when taken tothe real power.
23148
23149- Fixed a number of bugs in the file reading code, at least one of
23150which could cause a core dump on NT, and one of which would
23151occasionally cause file.read() to return less than the full contents
23152of the file.
23153
23154- Performance hack by Vladimir Marangozov for stack frame creation.
23155
23156- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
23157
23158Windows 95/NT
23159-------------
23160
23161- The .lib files are now part of the distribution; they are collected
23162in the subdirectory "libs" of the installation directory.
23163
23164- The extension modules (.pyd files) are now collected in a separate
23165subdirectory of the installation directory named "DLLs".
23166
23167- The case of a module's filename must now match the case of the
23168module name as specified in the import statement. This is an
23169experimental feature -- if it turns out to break in too many
23170situations, it will be removed (or disabled by default) in the future.
23171It can be disabled on a per-case basis by setting the environment
23172variable PYTHONCASEOK (to any value).
23173
23174
23175======================================================================
23176
23177
Guido van Rossumf2eac992000-09-04 17:24:24 +000023178=====================================
23179==> Release 1.5 (January 3, 1998) <==
23180=====================================
23181
23182
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023183From 1.5b2 to 1.5
23184=================
23185
23186- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
23187
23188- Added doc strings to string.py, stropmodule.c, structmodule.c,
23189thanks to Charles Waldman.
23190
23191- Many nits fixed in the manuals, thanks to Fred Drake and many others
23192(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
23193HTML markup instead of inline GIF images for tables; only two images
23194are left (for obsure bits of math). The index of the HTML version has
23195also been much improved. Finally, it is once again possible to
23196generate an Emacs info file from the library manual (but I don't
23197commit to supporting this in future versions).
23198
23199- New module: telnetlib.py (a simple telnet client library).
23200
23201- New tool: Tools/versioncheck/, by Jack Jansen.
23202
23203- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
23204DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
23205extension modules.
23206
23207- Many small changes again to Tkinter.py -- mostly bugfixes and adding
23208missing routines. Thanks to Greg McFarlane for reporting a bunch of
23209problems and proofreading my fixes.
23210
23211- The re module and its documentation are up to date with the latest
23212version released to the string-sig (Dec. 22).
23213
23214- Stop test_grp.py from failing when the /etc/group file is empty
23215(yes, this happens!).
23216
23217- Fix bug in integer conversion (mystrtoul.c) that caused
232184294967296==0 to be true!
23219
23220- The VC++ 4.2 project file should be complete again.
23221
23222- In tempfile.py, use a better template on NT, and add a new optional
23223argument "suffix" with default "" to specify a specific extension for
23224the temporary filename (needed sometimes on NT but perhaps also handy
23225elsewhere).
23226
23227- Fixed some bugs in the FAQ wizard, and converted it to use re
23228instead of regex.
23229
23230- Fixed a mysteriously undetected error in dlmodule.c (it was using a
23231totally bogus routine name to raise an exception).
23232
23233- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
23234
23235- Hopefully harmless changes to the build process to support shared
23236libraries on DG/UX. This adds a target to create
23237libpython$(VERSION).so; however this target is *only* for DG/UX.
23238
23239- Fixed a bug in the new format string error checking in getargs.c.
23240
23241- A simple fix for infinite recursion when printing __builtins__:
23242reset '_' to None before printing and set it to the printed variable
23243*after* printing (and only when printing is successful).
23244
23245- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
23246parent window is not (Skip Montanaro).
23247
23248- Fixed the two most annoying problems with ftp URLs in
23249urllib.urlopen(); an empty file now correctly raises an error, and it
23250is no longer required to explicitly close the returned "file" object
23251before opening another ftp URL to the same host and directory.
23252
23253
23254======================================================================
23255
23256
23257From 1.5b1 to 1.5b2
23258===================
23259
23260- Fixed a bug in cPickle.c that caused it to crash right away because
23261the version string had a different format.
23262
23263- Changes in pickle.py and cPickle.c: when unpickling an instance of a
23264class that doesn't define the __getinitargs__() method, the __init__()
23265constructor is no longer called. This makes a much larger group of
23266classes picklable by default, but may occasionally change semantics.
23267To force calling __init__() on unpickling, define a __getinitargs__()
23268method. Other changes too, in particular cPickle now handles classes
23269defined in packages correctly. The same change applies to copying
23270instances with copy.py. The cPickle.c changes and some pickle.py
23271changes are courtesy Jim Fulton.
23272
23273- Locale support in he "re" (Perl regular expressions) module. Use
23274the flag re.L (or re.LOCALE) to enable locale-specific matching
23275rules for \w and \b. The in-line syntax for this flag is (?L).
23276
23277- The built-in function isinstance(x, y) now also succeeds when y is
23278a type object and type(x) is y.
23279
23280- repr() and str() of class and instance objects now reflect the
23281package/module in which the class is defined.
23282
23283- Module "ni" has been removed. (If you really need it, it's been
23284renamed to "ni1". Let me know if this causes any problems for you.
23285Package authors are encouraged to write __init__.py files that
23286support both ni and 1.5 package support, so the same version can be
23287used with Python 1.4 as well as 1.5.)
23288
23289- The thread module is now automatically included when threads are
23290configured. (You must remove it from your existing Setup file,
23291since it is now in its own Setup.thread file.)
23292
23293- New command line option "-x" to skip the first line of the script;
23294handy to make executable scripts on non-Unix platforms.
23295
23296- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
23297haven't checked how this affects things, but it should make symbols
23298in one shared library available to the next one.
23299
23300- The Windows installer now installs in the "Program Files" folder on
23301the proper volume by default.
23302
23303- The Windows configuration adds a new main program, "pythonw", and
23304registers a new extension, ".pyw" that invokes this. This is a
23305pstandard Python interpreter that does not pop up a console window;
23306handy for pure Tkinter applications. All output to the original
23307stdout and stderr is lost; reading from the original stdin yields
23308EOF. Also, both python.exe and pythonw.exe now have a pretty icon
23309(a green snake in a box, courtesy Mark Hammond).
23310
23311- Lots of improvements to emacs-mode.el again. See Barry's web page:
23312http://www.python.org/ftp/emacs/pmdetails.html.
23313
23314- Lots of improvements and additions to the library reference manual;
23315many by Fred Drake.
23316
23317- Doc strings for the following modules: rfc822.py, posixpath.py,
23318ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
23319
23320- Some more regression testing.
23321
23322- An optional 4th (maxsplit) argument to strop.replace().
23323
23324- Fixed handling of maxsplit in string.splitfields().
23325
23326- Tweaked os.environ so it can be pickled and copied.
23327
23328- The portability problems caused by indented preprocessor commands
23329and C++ style comments should be gone now.
23330
23331- In random.py, added Pareto and Weibull distributions.
23332
23333- The crypt module is now disabled in Modules/Setup.in by default; it
23334is rarely needed and causes errors on some systems where users often
23335don't know how to deal with those.
23336
23337- Some improvements to the _tkinter build line suggested by Case Roole.
23338
23339- A full suite of platform specific files for NetBSD 1.x, submitted by
23340Anders Andersen.
23341
23342- New Solaris specific header STROPTS.py.
23343
23344- Moved a confusing occurrence of *shared* from the comments in
23345Modules/Setup.in (people would enable this one instead of the real
23346one, and get disappointing results).
23347
23348- Changed the default mode for directories to be group-writable when
23349the installation process creates them.
23350
23351- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
23352shared libraries for both.
23353
23354- Support FreeBSD and NetBSD in posixfile.py.
23355
23356- Support for the "event" command, new in Tk 4.2. By Case Roole.
23357
23358- Add Tix_SafeInit() support to tkappinit.c.
23359
23360- Various bugs fixed in "re.py" and "pcre.c".
23361
23362- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
23363
23364- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
23365is set.
23366
23367- Provide default blocksize for retrbinary in ftplib.py (Skip
23368Montanaro).
23369
23370- In NT, pick the username up from different places in user.py (Jeff
23371Bauer).
23372
23373- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
23374
23375- Many small improvements to Jeff Rush' OS/2 support.
23376
23377- ospath.py is gone; it's been obsolete for so many years now...
23378
23379- The reference manual is now set up to prepare better HTML (still
23380using webmaker, alas).
23381
23382- Add special handling to /Tools/freeze for Python modules that are
23383imported implicitly by the Python runtime: 'site' and 'exceptions'.
23384
23385- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
23386inside <PRE>, by "Scott".
23387
23388- Added ConfigParser.py, a generic parser for sectioned configuration
23389files.
23390
23391- In _localemodule.c, LC_MESSAGES is not always defined; put it
23392between #ifdefs.
23393
23394- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
23395
23396- Demo/scripts/newslist.py: Fix the way the version number is gotten
23397out of the RCS revision.
23398
23399- PyArg_Parse[Tuple] now explicitly check for bad characters at the
23400end of the format string.
23401
23402- Revamped PC/example_nt to support VC++ 5.x.
23403
23404- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
23405after studying the GNU libg++ quicksort. This should be much faster
23406if there are lots of duplicates, and otherwise at least as good.
23407
23408- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
23409uudecode bug where it complaints about trailing garbage is still there
23410:-( ).
23411
23412- pickle.py requires integers in text mode to be in decimal notation
23413(it used to accept octal and hex, even though it would only generate
23414decimal numbers).
23415
23416- In string.atof(), don't fail when the "re" module is unavailable.
23417Plug the ensueing security leak by supplying an empty __builtins__
23418directory to eval().
23419
23420- A bunch of small fixes and improvements to Tkinter.py.
23421
23422- Fixed a buffer overrun in PC/getpathp.c.
23423
23424
23425======================================================================
23426
23427
23428From 1.5a4 to 1.5b1
23429===================
23430
23431- The Windows NT/95 installer now includes full HTML of all manuals.
23432It also has a checkbox that lets you decide whether to install the
23433interpreter and library. The WISE installer script for the installer
23434is included in the source tree as PC/python15.wse, and so are the
23435icons used for Python files. The config.c file for the Windows build
23436is now complete with the pcre module.
23437
23438- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
23439evaluated for the prompt.
23440
23441- The reference manual is brought up to date (more or less -- it still
23442needs work, e.g. in the area of package import).
23443
23444- The icons used by latex2html are now included in the Doc
23445subdirectory (mostly so that tarring up the HTML files can be fully
23446automated). A simple index.html is also added to Doc (it only works
23447after you have successfully run latex2html).
23448
23449- For all you would-be proselytizers out there: a new version of
23450Misc/BLURB describes Python more concisely, and Misc/comparisons
23451compares Python to several other languages. Misc/BLURB.WINDOWS
23452contains a blurb specifically aimed at Windows programmers (by Mark
23453Hammond).
23454
23455- A new version of the Python mode for Emacs is included as
23456Misc/python-mode.el. There are too many new features to list here.
23457See http://www.python.org/ftp/emacs/pmdetails.html for more info.
23458
23459- New module fileinput makes iterating over the lines of a list of
23460files easier. (This still needs some more thinking to make it more
23461extensible.)
23462
23463- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
23464version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
23465Age C++ compiler. I expect that Jeff will also provide a binary
23466release for this platform.
23467
23468- On Linux, the configure script now uses '-Xlinker -export-dynamic'
23469instead of '-rdynamic' to link the main program so that it exports its
23470symbols to shared libraries it loads dynamically. I hope this doesn't
23471break on older Linux versions; it is needed for mklinux and appears to
23472work on Linux 2.0.30.
23473
23474- Some Tkinter resstructuring: the geometry methods that apply to a
23475master are now properly usable on toplevel master widgets. There's a
23476new (internal) widget class, BaseWidget. New, longer "official" names
23477for the geometry manager methods have been added,
23478e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
23479shorter names still work, and where there's ambiguity, pack wins over
23480place wins over grid. Also, the bind_class method now returns its
23481value.
23482
23483- New, RFC-822 conformant parsing of email addresses and address lists
23484in the rfc822 module, courtesy Ben Escoto.
23485
23486- New, revamped tkappinit.c with support for popular packages (PIL,
23487TIX, BLT, TOGL). For the last three, you need to execute the Tcl
23488command "load {} Tix" (or Blt, or Togl) to gain access to them.
23489The Modules/Setup line for the _tkinter module has been rewritten
23490using the cool line-breaking feature of most Bourne shells.
23491
23492- New socket method connect_ex() returns the error code from connect()
23493instead of raising an exception on errors; this makes the logic
23494required for asynchronous connects simpler and more efficient.
23495
23496- New "locale" module with (still experimental) interface to the
Antoine Pitroufbd4f802012-08-11 16:51:50 +020023497standard C library locale interface, courtesy Martin von Löwis. This
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023498does not repeat my mistake in 1.5a4 of always calling
23499setlocale(LC_ALL, ""). In fact, we've pretty much decided that
23500Python's standard numerical formatting operations should always use
23501the conventions for the C locale; the locale module contains utility
23502functions to format numbers according to the user specified locale.
23503(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
23504"C") after locale-changing calls.) See the library manual. (Alas, the
23505promised changes to the "re" module for locale support have not been
23506materialized yet. If you care, volunteer!)
23507
23508- Memory leak plugged in Py_BuildValue when building a dictionary.
23509
23510- Shared modules can now live inside packages (hierarchical module
23511namespaces). No changes to the shared module itself are needed.
23512
23513- Improved policy for __builtins__: this is a module in __main__ and a
23514dictionary everywhere else.
23515
23516- Python no longer catches SIGHUP and SIGTERM by default. This was
23517impossible to get right in the light of thread contexts. If you want
23518your program to clean up when a signal happens, use the signal module
23519to set up your own signal handler.
23520
23521- New Python/C API PyNumber_CoerceEx() does not return an exception
23522when no coercion is possible. This is used to fix a problem where
23523comparing incompatible numbers for equality would raise an exception
23524rather than return false as in Python 1.4 -- it once again will return
23525false.
23526
23527- The errno module is changed again -- the table of error messages
23528(errorstr) is removed. Instead, you can use os.strerror(). This
23529removes redundance and a potential locale dependency.
23530
23531- New module xmllib, to parse XML files. By Sjoerd Mullender.
23532
23533- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
23534It resets the signal module's notion of what the current process ID
23535and thread are, so that signal handlers will work after (and across)
23536calls to os.fork().
23537
23538- Fixed most occurrences of fatal errors due to missing thread state.
23539
23540- For vgrind (a flexible source pretty printer) fans, there's a simple
23541Python definition in Misc/vgrindefs, courtesy Neale Pickett.
23542
23543- Fixed memory leak in exec statement.
23544
23545- The test.pystone module has a new function, pystones(loops=LOOPS),
23546which returns a (benchtime, stones) tuple. The main() function now
23547calls this and prints the report.
23548
23549- Package directories now *require* the presence of an __init__.py (or
23550__init__.pyc) file before they are considered as packages. This is
23551done to prevent accidental subdirectories with common names from
23552overriding modules with the same name.
23553
23554- Fixed some strange exceptions in __del__ methods in library modules
Georg Brandl93dc9eb2010-03-14 10:56:14 +000023555(e.g. urllib). This happens because the built-in names are already
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023556deleted by the time __del__ is called. The solution (a hack, but it
23557works) is to set some instance variables to 0 instead of None.
23558
23559- The table of built-in module initializers is replaced by a pointer
23560variable. This makes it possible to switch to a different table at
23561run time, e.g. when a collection of modules is loaded from a shared
23562library. (No example code of how to do this is given, but it is
23563possible.) The table is still there of course, its name prefixed with
23564an underscore and used to initialize the pointer.
23565
23566- The warning about a thread still having a frame now only happens in
23567verbose mode.
23568
23569- Change the signal finialization so that it also resets the signal
23570handlers. After this has been called, our signal handlers are no
23571longer active!
23572
23573- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
23574literals. There's now also a test fort this module.
23575
23576- The copy module now also uses __dict__.update(state) instead of
23577going through individual attribute assignments, for class instances
23578without a __setstate__ method.
23579
23580- New module reconvert translates old-style (regex module) regular
23581expressions to new-style (re module, Perl-style) regular expressions.
23582
23583- Most modules that used to use the regex module now use the re
23584module. The grep module has a new pgrep() function which uses
23585Perl-style regular expressions.
23586
23587- The (very old, backwards compatibility) regexp.py module has been
23588deleted.
23589
23590- Restricted execution (rexec): added the pcre module (support for the
23591re module) to the list of trusted extension modules.
23592
23593- New version of Jim Fulton's CObject object type, adds
23594PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
23595
23596- Some patches to Lee Busby's fpectl mods that accidentally didn't
23597make it into 1.5a4.
23598
23599- In the string module, add an optional 4th argument to count(),
23600matching find() etc.
23601
23602- Patch for the nntplib module by Charles Waldman to add optional user
23603and password arguments to NNTP.__init__(), for nntp servers that need
23604them.
23605
23606- The str() function for class objects now returns
23607"modulename.classname" instead of returning the same as repr().
23608
23609- The parsing of \xXX escapes no longer relies on sscanf().
23610
23611- The "sharedmodules" subdirectory of the installation is renamed to
23612"lib-dynload". (You may have to edit your Modules/Setup file to fix
23613this in an existing installation!)
23614
23615- Fixed Don Beaudry's mess-up with the OPT test in the configure
23616script. Certain SGI platforms will still issue a warning for each
23617compile; there's not much I can do about this since the compiler's
23618exit status doesn't indicate that I was using an obsolete option.
23619
23620- Fixed Barry's mess-up with {}.get(), and added test cases for it.
23621
23622- Shared libraries didn't quite work under AIX because of the change
23623in status of the GNU readline interface. Fix due to by Vladimir
23624Marangozov.
23625
23626
23627======================================================================
23628
23629
23630From 1.5a3 to 1.5a4
23631===================
23632
23633- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
23634feature; better install instructions; removed faqmain.py (which was an
23635older version).
23636
23637- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
23638about the treatment of lines starting with '.'. Added a minimal test
23639function.
23640
23641- struct module: ignore most whitespace in format strings.
23642
23643- urllib.py: close the socket and temp file in URLopener.retrieve() so
23644that multiple retrievals using the same connection work.
23645
23646- All standard exceptions are now classes by default; use -X to make
23647them strings (for backward compatibility only).
23648
23649- There's a new standard exception hierarchy, defined in the standard
23650library module exceptions.py (which you never need to import
23651explicitly). See
23652http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
23653more info.
23654
23655- Three new C API functions:
23656
23657 - int PyErr_GivenExceptionMatches(obj1, obj2)
23658
23659 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
23660 instance of type obj2, or of a class derived from obj2
23661
23662 - int PyErr_ExceptionMatches(obj)
23663
23664 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
23665 PyErr_Occurred() as obj1. This will be the more commonly called
23666 function.
23667
23668 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
23669
23670 Normalizes exceptions, and places the normalized values in the
23671 arguments. If type is not a class, this does nothing. If type is a
23672 class, then it makes sure that value is an instance of the class by:
23673
23674 1. if instance is of the type, or a class derived from type, it does
23675 nothing.
23676
23677 2. otherwise it instantiates the class, using the value as an
23678 argument. If value is None, it uses an empty arg tuple, and if
23679 the value is a tuple, it uses just that.
23680
23681- Another new C API function: PyErr_NewException() creates a new
23682exception class derived from Exception; when -X is given, it creates a
23683new string exception.
23684
23685- core interpreter: remove the distinction between tuple and list
23686unpacking; allow an arbitrary sequence on the right hand side of any
23687unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
23688thing, which should really be called UNPACK_SEQUENCE.)
23689
23690- classes: Allow assignments to an instance's __dict__ or __class__,
23691so you can change ivars (including shared ivars -- shock horror) and
23692change classes dynamically. Also make the check on read-only
23693attributes of classes less draconic -- only the specials names
23694__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
23695assigned.
23696
23697- Two new built-in functions: issubclass() and isinstance(). Both
23698take classes as their second arguments. The former takes a class as
23699the first argument and returns true iff first is second, or is a
23700subclass of second. The latter takes any object as the first argument
23701and returns true iff first is an instance of the second, or any
23702subclass of second.
23703
23704- configure: Added configuration tests for presence of alarm(),
23705pause(), and getpwent().
23706
23707- Doc/Makefile: changed latex2html targets.
23708
23709- classes: Reverse the search order for the Don Beaudry hook so that
23710the first class with an applicable hook wins. Makes more sense.
23711
23712- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
23713now legal to call these more than once. The first call to
23714Py_Initialize() initializes, the first call to Py_Finalize()
23715finalizes. There's also a new API, Py_IsInitalized() which checks
23716whether we are already initialized (in case you want to leave things
23717as they were).
23718
23719- Completely disable the declarations for malloc(), realloc() and
23720free(). Any 90's C compiler has these in header files, and the tests
23721to decide whether to suppress the declarations kept failing on some
23722platforms.
23723
23724- *Before* (instead of after) signalmodule.o is added, remove both
23725intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
23726ld on various systems.
23727
23728- Added reop to PC/config.c
23729
23730- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
23731Removed outdated HP-UX comments from README. Added Cray T3E comments.
23732
23733- Various renames of statically defined functions that had name
23734conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
23735roundup (sys/types.h).
23736
23737- urllib.py: Interpret three slashes in file: URL as local file (for
23738Netscape on Windows/Mac).
23739
23740- copy.py: Make sure the objects returned by __getinitargs__() are
23741kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
23742easily reproducable because it requires a later call to
23743__getinitargs__() to return a tuple that happens to be allocated at
23744the same address.)
23745
23746- Added definition of AR to toplevel Makefile. Renamed @buildno temp
23747file to buildno1.
23748
23749- Moved Include/assert.h to Parser/assert.h, which seems to be the
23750only place where it's needed.
23751
23752- Tweaked the dictionary lookup code again for some more speed
23753(Vladimir Marangozov).
23754
23755- NT build: Changed the way python15.lib is included in the other
23756projects. Per Mark Hammond's suggestion, add it to the extra libs in
23757Settings instead of to the project's source files.
23758
23759- regrtest.py: Change default verbosity so that there are only three
23760levels left: -q, default and -v. In default mode, the name of each
23761test is now printed. -v is the same as the old -vv. -q is more quiet
23762than the old default mode.
23763
23764- Removed the old FAQ from the distribution. You now have to get it
23765from the web!
23766
23767- Removed the PC/make_nt.in file from the distribution; it is no
23768longer needed.
23769
23770- Changed the build sequence so that shared modules are built last.
23771This fixes things for AIX and doesn't hurt elsewhere.
23772
23773- Improved test for GNU MP v1 in mpzmodule.c
23774
23775- fileobject.c: ftell() on Linux discards all buffered data; changed
23776read() code to use lseek() instead to get the same effect
23777
23778- configure.in, configure, importdl.c: NeXT sharedlib fixes
23779
23780- tupleobject.c: PyTuple_SetItem asserts refcnt==1
23781
23782- resource.c: Different strategy regarding whether to declare
23783getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
23784conflicting decls in its headers. Choice: only declare the return
23785type, not the argument prototype, and not on Linux.
23786
23787- importdl.c, configure*: set sharedlib extensions properly for NeXT
23788
23789- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
23790fixed; moved addition of PURIFY to LINKCC to configure
23791
23792- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
23793added to shup up various compilers.
23794
23795- _tkinter.c: removed buggy mac #ifndef
23796
23797- Doc: various Mac documentation changes, added docs for 'ic' module
23798
23799- PC/make_nt.in: deleted
23800
23801- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
23802"")
23803
23804- test_rotor.py: print b -> print `b`
23805
23806- Tkinter.py: (tagOrId) -> (tagOrId,)
23807
23808- Tkinter.py: the Tk class now also has a configure() method and
23809friends (they have been moved to the Misc class to accomplish this).
23810
23811- dict.get(key[, default]) returns dict[key] if it exists, or default
23812if it doesn't. The default defaults to None. This is quicker for
23813some applications than using either has_key() or try:...except
23814KeyError:....
23815
23816- Tools/webchecker/: some small changes to webchecker.py; added
23817websucker.py (a simple web site mirroring script).
23818
23819- Dictionary objects now have a get() method (also in UserDict.py).
23820dict.get(key, default) returns dict[key] if it exists and default
23821otherwise; default defaults to None.
23822
23823- Tools/scripts/logmerge.py: print the author, too.
23824
23825- Changes to import: support for "import a.b.c" is now built in. See
23826http://grail.cnri.reston.va.us/python/essays/packages.html
23827for more info. Most important deviations from "ni.py": __init__.py is
23828executed in the package's namespace instead of as a submodule; and
23829there's no support for "__" or "__domain__". Note that "ni.py" is not
23830changed to match this -- it is simply declared obsolete (while at the
23831same time, it is documented...:-( ).
23832Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
23833for an example implementation of hierarchical module import written in
23834Python).
23835
23836- More changes to import: the site.py module is now imported by
23837default when Python is initialized; use -S to disable it. The site.py
23838module extends the path with several more directories: site-packages
23839inside the lib/python1.5/ directory, site-python in the lib/
23840directory, and pathnames mentioned in *.pth files found in either of
23841those directories. See
23842http://grail.cnri.reston.va.us/python/essays/packages.html
23843for more info.
23844
23845- Changes to standard library subdirectory names: those subdirectories
23846that are not packages have been renamed with a hypen in their name,
23847e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
23848The test suite is now a package -- to run a test, you must now use
23849"import test.test_foo".
23850
23851- A completely new re.py module is provided (thanks to Andrew
23852Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
23853"pcre" re compiler and engine. For a while, the "old" re.py (which
23854was new in 1.5a3!) will be kept around as re1.py. The "old" regex
23855module and underlying parser and engine are still present -- while
23856regex is now officially obsolete, it will probably take several major
23857release cycles before it can be removed.
23858
23859- The posix module now has a strerror() function which translates an
23860error code to a string.
23861
23862- The emacs.py module (which was long obsolete) has been removed.
23863
23864- The universal makefile Misc/Makefile.pre.in now features an
23865"install" target. By default, installed shared libraries go into
23866$exec_prefix/lib/python$VERSION/site-packages/.
23867
23868- The install-sh script is installed with the other configuration
23869specific files (in the config/ subdirectory).
23870
23871- It turns out whatsound.py and sndhdr.py were identical modules.
23872Since there's also an imghdr.py file, I propose to make sndhdr.py the
23873official one. For compatibility, whatsound.py imports * from
23874sndhdr.py.
23875
23876- Class objects have a new attribute, __module__, giving the name of
23877the module in which they were declared. This is useful for pickle and
23878for printing the full name of a class exception.
23879
23880- Many extension modules no longer issue a fatal error when their
23881initialization fails; the importing code now checks whether an error
23882occurred during module initialization, and correctly propagates the
23883exception to the import statement.
23884
23885- Most extension modules now raise class-based exceptions (except when
23886-X is used).
23887
23888- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
23889thread state -- just don't manipulate the lock if it isn't there.
23890
23891- Fixed a bug in Python/getopt.c that made it do the wrong thing when
23892an option was a single '-'. Thanks to Andrew Kuchling.
23893
23894- New module mimetypes.py will guess a MIME type from a filename's
23895extension.
23896
23897- Windows: the DLL version is now settable via a resource rather than
23898being hardcoded. This can be used for "branding" a binary Python
23899distribution.
23900
23901- urllib.py is now threadsafe -- it now uses re instead of regex, and
23902sys.exc_info() instead of sys.exc_{type,value}.
23903
23904- Many other library modules that used to use
23905sys.exc_{type,value,traceback} are now more thread-safe by virtue of
23906using sys.exc_info().
23907
23908- The functions in popen2 have an optional buffer size parameter.
23909Also, the command argument can now be either a string (passed to the
23910shell) or a list of arguments (passed directly to execv).
23911
23912- Alas, the thread support for _tkinter released with 1.5a3 didn't
23913work. It's been rewritten. The bad news is that it now requires a
23914modified version of a file in the standard Tcl distribution, which you
23915must compile with a -I option pointing to the standard Tcl source
23916tree. For this reason, the thread support is disabled by default.
23917
23918- The errno extension module adds two tables: errorcode maps errno
23919numbers to errno names (e.g. EINTR), and errorstr maps them to
23920message strings. (The latter is redundant because the new call
23921posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
23922
23923- The readline extension module now provides some interfaces to
23924internal readline routines that make it possible to write a completer
23925in Python. An example completer, rlcompleter.py, is provided.
23926
23927 When completing a simple identifier, it completes keywords,
23928 built-ins and globals in __main__; when completing
23929 NAME.NAME..., it evaluates (!) the expression up to the last
23930 dot and completes its attributes.
23931
23932 It's very cool to do "import string" type "string.", hit the
23933 completion key (twice), and see the list of names defined by
23934 the string module!
23935
23936 Tip: to use the tab key as the completion key, call
23937
23938 readline.parse_and_bind("tab: complete")
23939
23940- The traceback.py module has a new function tb_lineno() by Marc-Andre
23941Lemburg which extracts the line number from the linenumber table in
23942the code object. Apparently the traceback object doesn't contains the
23943right linenumber when -O is used. Rather than guessing whether -O is
23944on or off, the module itself uses tb_lineno() unconditionally.
23945
23946- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
23947to tag_bind() so it works again.
23948
23949- The pystone script is now a standard library module. Example use:
23950"import test.pystone; test.pystone.main()".
23951
23952- The import of the readline module in interactive mode is now also
23953attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
23954Lemburg, who asked for this. :-)
23955
23956- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
23957Mullender, to be closer to the standard. This fixes the getaddr()
23958method. Unfortunately, getaddrlist() is as broken as ever, since it
23959splits on commas without regard for RFC 822 quoting conventions.
23960
23961- pprint.py: correctly emit trailing "," in singleton tuples.
23962
23963- _tkinter.c: export names for its type objects, TkappType and
23964TkttType.
23965
23966- pickle.py: use __module__ when defined; fix a particularly hard to
23967reproduce bug that confuses the memo when temporary objects are
23968returned by custom pickling interfaces; and a semantic change: when
23969unpickling the instance variables of an instance, use
23970inst.__dict__.update(value) instead of a for loop with setattr() over
23971the value.keys(). This is more consistent (the pickling doesn't use
23972getattr() either but pickles inst.__dict__) and avoids problems with
23973instances that have a __setattr__ hook. But it *is* a semantic change
23974(because the setattr hook is no longer used). So beware!
23975
23976- config.h is now installed (at last) in
23977$exec_prefix/include/python1.5/. For most sites, this means that it
23978is actually in $prefix/include/python1.5/, with all the other Python
23979include files, since $prefix and $exec_prefix are the same by
23980default.
23981
23982- The imp module now supports parts of the functionality to implement
23983import of hierarchical module names. It now supports find_module()
23984and load_module() for all types of modules. Docstrings have been
23985added for those functions in the built-in imp module that are still
23986relevant (some old interfaces are obsolete). For a sample
23987implementation of hierarchical module import in Python, see the new
23988library module knee.py.
23989
23990- The % operator on string objects now allows arbitrary nested parens
23991in a %(...)X style format. (Brad Howes)
23992
23993- Reverse the order in which Setup and Setup.local are passed to the
23994makesetup script. This allows variable definitions in Setup.local to
23995override definitions in Setup. (But you'll still have to edit Setup
23996if you want to disable modules that are enabled by default, or if such
23997modules need non-standard options.)
23998
23999- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
24000is like PyImport_ImporModule(name) but receives the globals and locals
24001dict and the fromlist arguments as well. (The name is a char*; the
24002others are PyObject*s).
24003
24004- The 'p' format in the struct extension module alloded to above is
24005new in 1.5a4.
24006
24007- The types.py module now uses try-except in a few places to make it
24008more likely that it can be imported in restricted mode. Some type
24009names are undefined in that case, e.g. CodeType (inaccessible),
24010FileType (not always accessible), and TracebackType and FrameType
24011(inaccessible).
24012
24013- In urllib.py: added separate administration of temporary files
24014created y URLopener.retrieve() so cleanup() can properly remove them.
24015The old code removed everything in tempcache which was a bad idea if
24016the user had passed a non-temp file into it. Also, in basejoin(),
24017interpret relative paths starting in "../". This is necessary if the
24018server uses symbolic links.
24019
24020- The Windows build procedure and project files are now based on
24021Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
24022directory. It is much more robust, and properly builds separate Debug
24023and Release versions. (The installer will be added shortly.)
24024
24025- Added casts and changed some return types in regexpr.c to avoid
24026compiler warnings or errors on some platforms.
24027
24028- The AIX build tools for shared libraries now supports VPATH. (Donn
24029Cave)
24030
24031- By default, disable the "portable" multimedia modules audioop,
24032imageop, and rgbimg, since they don't work on 64-bit platforms.
24033
24034- Fixed a nasty bug in cStringIO.c when code was actually using the
24035close() method (the destructors would try to free certain fields a
24036second time).
24037
24038- For those who think they need it, there's a "user.py" module. This
24039is *not* imported by default, but can be imported to run user-specific
24040setup commands, ~/.pythonrc.py.
24041
24042- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
24043Vladimir Marangozov, and others.
24044
24045- Added os.altsep; this is '/' on DOS/Windows, and None on systems
24046with a sane filename syntax.
24047
24048- os.py: Write out the dynamic OS choice, to avoid exec statements.
24049Adding support for a new OS is now a bit more work, but I bet that
24050'dos' or 'nt' will cover most situations...
24051
24052- The obsolete exception AccessError is now really gone.
24053
24054- Tools/faqwiz/: New installation instructions show how to maintain
24055multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
24056Added instructions to bootstrap script, too. Version bumped to 0.8.1.
24057Added <html>...</html> feature suggested by Skip Montanaro. Added
24058leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
24059default SRCDIR.
24060
24061- Documentation for the relatively new modules "keyword" and "symbol"
24062has been added (to the end of the section on the parser extension
24063module).
24064
24065- In module bisect.py, but functions have two optional argument 'lo'
24066and 'hi' which allow you to specify a subsequence of the array to
24067operate on.
24068
24069- In ftplib.py, changed most methods to return their status (even when
24070it is always "200 OK") rather than swallowing it.
24071
24072- main() now calls setlocale(LC_ALL, ""), if setlocale() and
24073<locale.h> are defined.
24074
24075- Changes to configure.in, the configure script, and both
24076Makefile.pre.in files, to support SGI's SGI_ABI platform selection
24077environment variable.
24078
24079
24080======================================================================
24081
24082
24083From 1.4 to 1.5a3
24084=================
24085
24086Security
24087--------
24088
24089- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
24090please use the new version. The old version has a huge security leak.
24091
24092Miscellaneous
24093-------------
24094
24095- Because of various (small) incompatible changes in the Python
24096bytecode interpreter, the magic number for .pyc files has changed
24097again.
24098
24099- The default module search path is now much saner. Both on Unix and
24100Windows, it is essentially derived from the path to the executable
24101(which can be overridden by setting the environment variable
24102$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
24103front of the default path, like in Unix (instead of overriding the
24104default path). On Windows, the directory containing the executable is
24105added to the end of the path.
24106
24107- A new version of python-mode.el for Emacs has been included. Also,
24108a new file ccpy-style.el has been added to configure Emacs cc-mode for
24109the preferred style in Python C sources.
24110
24111- On Unix, when using sys.argv[0] to insert the script directory in
24112front of sys.path, expand a symbolic link. You can now install a
24113program in a private directory and have a symbolic link to it in a
24114public bin directory, and it will put the private directory in the
24115module search path. Note that the symlink is expanded in sys.path[0]
24116but not in sys.argv[0], so you can still tell the name by which you
24117were invoked.
24118
24119- It is now recommended to use ``#!/usr/bin/env python'' instead of
24120``#!/usr/local/bin/python'' at the start of executable scripts, except
24121for CGI scripts. It has been determined that the use of /usr/bin/env
24122is more portable than that of /usr/local/bin/python -- scripts almost
24123never have to be edited when the Python interpreter lives in a
24124non-standard place. Note that this doesn't work for CGI scripts since
24125the python executable often doesn't live in the HTTP server's default
24126search path.
24127
24128- The silly -s command line option and the corresponding
24129PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
24130flag in the Python/C API) are gone.
24131
24132- Most problems on 64-bit platforms should now be fixed. Andrew
24133Kuchling helped. Some uncommon extension modules are still not
24134clean (image and audio ops?).
24135
24136- Fixed a bug where multiple anonymous tuple arguments would be mixed up
24137when using the debugger or profiler (reported by Just van Rossum).
24138The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
24139would print the wrong value when run under the debugger or profiler.
24140
24141- The hacks that the dictionary implementation used to speed up
24142repeated lookups of the same C string were removed; these were a
24143source of subtle problems and don't seem to serve much of a purpose
24144any longer.
24145
24146- All traces of support for the long dead access statement have been
24147removed from the sources.
24148
24149- Plugged the two-byte memory leak in the tokenizer when reading an
24150interactive EOF.
24151
24152- There's a -O option to the interpreter that removes SET_LINENO
24153instructions and assert statements (see below); it uses and produces
24154.pyo files instead of .pyc files. The speedup is only a few percent
24155in most cases. The line numbers are still available in the .pyo file,
24156as a separate table (which is also available in .pyc files). However,
24157the removal of the SET_LINENO instructions means that the debugger
24158(pdb) can't set breakpoints on lines in -O mode. The traceback module
24159contains a function to extract a line number from the code object
24160referenced in a traceback object. In the future it should be possible
24161to write external bytecode optimizers that create better optimized
24162.pyo files, and there should be more control over optimization;
24163consider the -O option a "teaser". Without -O, the assert statement
24164actually generates code that first checks __debug__; if this variable
24165is false, the assertion is not checked. __debug__ is a built-in
24166variable whose value is initialized to track the -O flag (it's true
24167iff -O is not specified). With -O, no code is generated for assert
24168statements, nor for code of the form ``if __debug__: <something>''.
24169Sorry, no further constant folding happens.
24170
24171
24172Performance
24173-----------
24174
24175- It's much faster (almost twice for pystone.py -- see
24176Tools/scripts). See the entry on string interning below.
24177
24178- Some speedup by using separate free lists for method objects (both
24179the C and the Python variety) and for floating point numbers.
24180
24181- Big speedup by allocating frame objects with a single malloc() call.
24182The Python/C API for frames is changed (you shouldn't be using this
24183anyway).
24184
24185- Significant speedup by inlining some common opcodes for common operand
24186types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
24187
24188- Small speedup by reordering the method tables of some common
24189objects (e.g. list.append is now first).
24190
24191- Big optimization to the read() method of file objects. A read()
24192without arguments now attempts to use fstat to allocate a buffer of
24193the right size; for pipes and sockets, it will fall back to doubling
24194the buffer size. While that the improvement is real on all systems,
24195it is most dramatic on Windows.
24196
24197
24198Documentation
24199-------------
24200
24201- Many new pieces of library documentation were contributed, mostly by
24202Andrew Kuchling. Even cmath is now documented! There's also a
24203chapter of the library manual, "libundoc.tex", which provides a
24204listing of all undocumented modules, plus their status (e.g. internal,
24205obsolete, or in need of documentation). Also contributions by Sue
24206Williams, Skip Montanaro, and some module authors who succumbed to
24207pressure to document their own contributed modules :-). Note that
24208printing the documentation now kills fewer trees -- the margins have
24209been reduced.
24210
24211- I have started documenting the Python/C API. Unfortunately this project
24212hasn't been completed yet. It will be complete before the final release of
24213Python 1.5, though. At the moment, it's better to read the LaTeX source
24214than to attempt to run it through LaTeX and print the resulting dvi file.
24215
24216- The posix module (and hence os.py) now has doc strings! Thanks to Neil
24217Schemenauer. I received a few other contributions of doc strings. In most
24218other places, doc strings are still wishful thinking...
24219
24220
24221Language changes
24222----------------
24223
24224- Private variables with leading double underscore are now a permanent
24225feature of the language. (These were experimental in release 1.4. I have
24226favorable experience using them; I can't label them "experimental"
24227forever.)
24228
24229- There's new string literal syntax for "raw strings". Prefixing a string
24230literal with the letter r (or R) disables all escape processing in the
24231string; for example, r'\n' is a two-character string consisting of a
24232backslash followed by the letter n. This combines with all forms of string
24233quotes; it is actually useful for triple quoted doc strings which might
24234contain references to \n or \t. An embedded quote prefixed with a
24235backslash does not terminate the string, but the backslash is still
24236included in the string; for example, r'\'' is a two-character string
24237consisting of a backslash and a quote. (Raw strings are also
24238affectionately known as Robin strings, after their inventor, Robin
24239Friedrich.)
24240
24241- There's a simple assert statement, and a new exception
24242AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
24243not foo > 0: raise AssertionError''. Sorry, the text of the asserted
24244condition is not available; it would be too complicated to generate
24245code for this (since the code is generated from a parse tree).
24246However, the text is displayed as part of the traceback!
24247
24248- The raise statement has a new feature: when using "raise SomeClass,
24249somevalue" where somevalue is not an instance of SomeClass, it
24250instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
24251instance of a *derived* class of SomeClass, the exception class raised
24252is set to somevalue.__class__, and SomeClass is ignored after that.
24253
24254- Duplicate keyword arguments are now detected at compile time;
24255f(a=1,a=2) is now a syntax error.
24256
24257
Georg Brandl93dc9eb2010-03-14 10:56:14 +000024258Changes to built-in features
24259----------------------------
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024260
24261- There's a new exception FloatingPointError (used only by Lee Busby's
24262patches to catch floating point exceptions, at the moment).
24263
24264- The obsolete exception ConflictError (presumably used by the long
24265obsolete access statement) has been deleted.
24266
24267- There's a new function sys.exc_info() which returns the tuple
24268(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
24269
24270- There's a new variable sys.executable, pointing to the executable file
24271for the Python interpreter.
24272
24273- The sort() methods for lists no longer uses the C library qsort(); I
24274wrote my own quicksort implementation, with lots of help (in the form
24275of a kind of competition) from Tim Peters. This solves a bug in
24276dictionary comparisons on some Solaris versions when Python is built
24277with threads, and makes sorting lists even faster.
24278
24279- The semantics of comparing two dictionaries have changed, to make
24280comparison of unequal dictionaries faster. A shorter dictionary is
24281always considered smaller than a larger dictionary. For dictionaries
24282of the same size, the smallest differing element determines the
24283outcome (which yields the same results as before in this case, without
24284explicit sorting). Thanks to Aaron Watters for suggesting something
24285like this.
24286
24287- The semantics of try-except have changed subtly so that calling a
24288function in an exception handler that itself raises and catches an
24289exception no longer overwrites the sys.exc_* variables. This also
24290alleviates the problem that objects referenced in a stack frame that
24291caught an exception are kept alive until another exception is caught
24292-- the sys.exc_* variables are restored to their previous value when
24293returning from a function that caught an exception.
24294
24295- There's a new "buffer" interface. Certain objects (e.g. strings and
24296arrays) now support the "buffer" protocol. Buffer objects are acceptable
24297whenever formerly a string was required for a write operation; mutable
24298buffer objects can be the target of a read operation using the call
24299f.readinto(buffer). A cool feature is that regular expression matching now
24300also work on array objects. Contribution by Jack Jansen. (Needs
24301documentation.)
24302
24303- String interning: dictionary lookups are faster when the lookup
24304string object is the same object as the key in the dictionary, not
24305just a string with the same value. This is done by having a pool of
24306"interned" strings. Most names generated by the interpreter are now
24307automatically interned, and there's a new built-in function intern(s)
24308that returns the interned version of a string. Interned strings are
24309not a different object type, and interning is totally optional, but by
24310interning most keys a speedup of about 15% was obtained for the
24311pystone benchmark.
24312
24313- Dictionary objects have several new methods; clear() and copy() have
24314the obvious semantics, while update(d) merges the contents of another
24315dictionary d into this one, overriding existing keys. The dictionary
24316implementation file is now called dictobject.c rather than the
24317confusing mappingobject.c.
24318
24319- The intrinsic function dir() is much smarter; it looks in __dict__,
24320__members__ and __methods__.
24321
24322- The intrinsic functions int(), long() and float() can now take a
24323string argument and then do the same thing as string.atoi(),
24324string.atol(), and string.atof(). No second 'base' argument is
24325allowed, and complex() does not take a string (nobody cared enough).
24326
24327- When a module is deleted, its globals are now deleted in two phases.
24328In the first phase, all variables whose name begins with exactly one
24329underscore are replaced by None; in the second phase, all variables
24330are deleted. This makes it possible to have global objects whose
24331destructors depend on other globals. The deletion order within each
24332phase is still random.
24333
24334- It is no longer an error for a function to be called without a
24335global variable __builtins__ -- an empty directory will be provided
24336by default.
24337
24338- Guido's corollary to the "Don Beaudry hook": it is now possible to
24339do metaprogramming by using an instance as a base class. Not for the
24340faint of heart; and undocumented as yet, but basically if a base class
24341is an instance, its class will be instantiated to create the new
24342class. Jim Fulton will love it -- it also works with instances of his
24343"extension classes", since it is triggered by the presence of a
24344__class__ attribute on the purported base class. See
24345Demo/metaclasses/index.html for an explanation and see that directory
24346for examples.
24347
24348- Another change is that the Don Beaudry hook is now invoked when
24349*any* base class is special. (Up to 1.5a3, the *last* special base
24350class is used; in 1.5a4, the more rational choice of the *first*
24351special base class is used.)
24352
24353- New optional parameter to the readlines() method of file objects.
24354This indicates the number of bytes to read (the actual number of bytes
24355read will be somewhat larger due to buffering reading until the end of
24356the line). Some optimizations have also been made to speed it up (but
24357not as much as read()).
24358
24359- Complex numbers no longer have the ".conj" pseudo attribute; use
24360z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
24361now *do* support the __members__ and __methods__ special attributes.
24362
24363- The complex() function now looks for a __complex__() method on class
24364instances before giving up.
24365
24366- Long integers now support arbitrary shift counts, so you can now
24367write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
24368shift count for this.)
24369
24370- The hex() and oct() functions have been changed so that for regular
24371integers, they never emit a minus sign. For example, on a 32-bit
24372machine, oct(-1) now returns '037777777777' and hex(-1) returns
24373'0xffffffff'. While this may seem inconsistent, it is much more
24374useful. (For long integers, a minus sign is used as before, to fit
24375the result in memory :-)
24376
24377- The hash() function computes better hashes for several data types,
24378including strings, floating point numbers, and complex numbers.
24379
24380
24381New extension modules
24382---------------------
24383
24384- New extension modules cStringIO.c and cPickle.c, written by Jim
24385Fulton and other folks at Digital Creations. These are much more
24386efficient than their Python counterparts StringIO.py and pickle.py,
24387but don't support subclassing. cPickle.c clocks up to 1000 times
24388faster than pickle.py; cStringIO.c's improvement is less dramatic but
24389still significant.
24390
24391- New extension module zlibmodule.c, interfacing to the free zlib
24392library (gzip compatible compression). There's also a module gzip.py
24393which provides a higher level interface. Written by Andrew Kuchling
24394and Jeremy Hylton.
24395
24396- New module readline; see the "miscellaneous" section above.
24397
24398- New Unix extension module resource.c, by Jeremy Hylton, provides
24399access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
24400related symbolic constants.
24401
24402- New extension puremodule.c, by Barry Warsaw, which interfaces to the
24403Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
24404possible to enable Purify by simply setting the PURIFY Makefile
24405variable in the Modules/Setup file.
24406
24407
24408Changes in extension modules
24409----------------------------
24410
24411- The struct extension module has several new features to control byte
24412order and word size. It supports reading and writing IEEE floats even
24413on platforms where this is not the native format. It uses uppercase
24414format codes for unsigned integers of various sizes (always using
24415Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
24416and 'p' for "Pascal strings" (with a leading length byte, included in
24417the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
24418big-endian data and '<' forces little-endian data; these also select
24419standard data sizes and disable automatic alignment (use pad bytes as
24420needed).
24421
24422- The array module supports uppercase format codes for unsigned data
24423formats (like the struct module).
24424
24425- The fcntl extension module now exports the needed symbolic
24426constants. (Formerly these were in FCNTL.py which was not available
24427or correct for all platforms.)
24428
24429- The extension modules dbm, gdbm and bsddb now check that the
24430database is still open before making any new calls.
24431
24432- The dbhash module is no more. Use bsddb instead. (There's a third
24433party interface for the BSD 2.x code somewhere on the web; support for
24434bsddb will be deprecated.)
24435
24436- The gdbm module now supports a sync() method.
24437
24438- The socket module now has some new functions: getprotobyname(), and
24439the set {ntoh,hton}{s,l}().
24440
24441- Various modules now export their type object: socket.SocketType,
24442array.ArrayType.
24443
24444- The socket module's accept() method now returns unknown addresses as
24445a tuple rather than raising an exception. (This can happen in
24446promiscuous mode.) Theres' also a new function getprotobyname().
24447
24448- The pthread support for the thread module now works on most platforms.
24449
24450- STDWIN is now officially obsolete. Support for it will eventually
24451be removed from the distribution.
24452
24453- The binascii extension module is now hopefully fully debugged.
24454(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
24455received.)
24456
24457- audioop.c: added a ratecv() function; better handling of overflow in
24458add().
24459
24460- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
24461Windows, also O_TEXT and O_BINARY. The 'error' variable (the
24462exception is raises) is renamed -- its string value is now "os.error",
24463so newbies don't believe they have to import posix (or nt) to catch
24464it when they see os.error reported as posix.error. The execve()
24465function now accepts any mapping object for the environment.
24466
24467- A new version of the al (audio library) module for SGI was
24468contributed by Sjoerd Mullender.
24469
24470- The regex module has a new function get_syntax() which retrieves the
24471syntax setting set by set_syntax(). The code was also sanitized,
24472removing worries about unclean error handling. See also below for its
24473successor, re.py.
24474
24475- The "new" module (which creates new objects of various types) once
24476again has a fully functioning new.function() method. Dangerous as
24477ever! Also, new.code() has several new arguments.
24478
24479- A problem has been fixed in the rotor module: on systems with signed
24480characters, rotor-encoded data was not portable when the key contained
244818-bit characters. Also, setkey() now requires its argument rather
24482than having broken code to default it.
24483
24484- The sys.builtin_module_names variable is now a tuple. Another new
24485variables in sys is sys.executable (the full path to the Python
24486binary, if known).
24487
24488- The specs for time.strftime() have undergone some revisions. It
24489appears that not all format characters are supported in the same way
24490on all platforms. Rather than reimplement it, we note these
24491differences in the documentation, and emphasize the shared set of
24492features. There's also a thorough test set (that occasionally finds
24493problems in the C library implementation, e.g. on some Linuxes),
24494thanks to Skip Montanaro.
24495
24496- The nis module seems broken when used with NIS+; unfortunately
24497nobody knows how to fix it. It should still work with old NIS.
24498
24499
24500New library modules
24501-------------------
24502
24503- New (still experimental) Perl-style regular expression module,
24504re.py, which uses a new interface for matching as well as a new
24505syntax; the new interface avoids the thread-unsafety of the regex
24506interface. This comes with a helper extension reopmodule.c and vastly
24507rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
24508Peters, and Andrew Kuchling. See the documentation libre.tex. In
245091.5, the old regex module is still fully supported; in the future, it
24510will become obsolete.
24511
24512- New module gzip.py; see zlib above.
24513
24514- New module keyword.py exports knowledge about Python's built-in
24515keywords. (New version by Ka-Ping Yee.)
24516
24517- New module pprint.py (with documentation) which supports
24518pretty-printing of lists, tuples, & dictionaries recursively. By Fred
24519Drake.
24520
24521- New module code.py. The function code.compile_command() can
24522determine whether an interactively entered command is complete or not,
24523distinguishing incomplete from invalid input. (XXX Unfortunately,
24524this seems broken at this moment, and I don't have the time to fix
24525it. It's probably better to add an explicit interface to the parser
24526for this.)
24527
24528- There is now a library module xdrlib.py which can read and write the
24529XDR data format as used by Sun RPC, for example. It uses the struct
24530module.
24531
24532
24533Changes in library modules
24534--------------------------
24535
24536- Module codehack.py is now completely obsolete.
24537
24538- The pickle.py module has been updated to make it compatible with the
24539new binary format that cPickle.c produces. By default it produces the
24540old all-ASCII format compatible with the old pickle.py, still much
24541faster than pickle.py; it will read both formats automatically. A few
24542other updates have been made.
24543
24544- A new helper module, copy_reg.py, is provided to register extensions
24545to the pickling code.
24546
24547- Revamped module tokenize.py is much more accurate and has an
24548interface that makes it a breeze to write code to colorize Python
24549source code. Contributed by Ka-Ping Yee.
24550
24551- In ihooks.py, ModuleLoader.load_module() now closes the file under
24552all circumstances.
24553
24554- The tempfile.py module has a new class, TemporaryFile, which creates
24555an open temporary file that will be deleted automatically when
24556closed. This works on Windows and MacOS as well as on Unix. (Jim
24557Fulton.)
24558
24559- Changes to the cgi.py module: Most imports are now done at the
24560top of the module, which provides a speedup when using ni (Jim
24561Fulton). The problem with file upload to a Windows platform is solved
24562by using the new tempfile.TemporaryFile class; temporary files are now
24563always opened in binary mode (Jim Fulton). The cgi.escape() function
24564now takes an optional flag argument that quotes '"' to '&quot;'. It
24565is now possible to invoke cgi.py from a command line script, to test
24566cgi scripts more easily outside an http server. There's an optional
24567limit to the size of uploads to POST (Skip Montanaro). Added a
24568'strict_parsing' option to all parsing functions (Jim Fulton). The
24569function parse_qs() now uses urllib.unquote() on the name as well as
24570the value of fields (Clarence Gardner). The FieldStorage class now
24571has a __len__() method.
24572
24573- httplib.py: the socket object is no longer closed; all HTTP/1.*
24574responses are now accepted; and it is now thread-safe (by not using
24575the regex module).
24576
24577- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
24578
24579- The popen2.py module is now rewritten using a class, which makes
24580access to the standard error stream and the process id of the
24581subprocess possible.
24582
24583- Added timezone support to the rfc822.py module, in the form of a
24584getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
24585Also added recognition of some non-standard date formats, by Lars
24586Wirzenius, and RFC 850 dates (Chris Lawrence).
24587
24588- mhlib.py: various enhancements, including almost compatible parsing
24589of message sequence specifiers without invoking a subprocess. Also
24590added a createmessage() method by Lars Wirzenius.
24591
24592- The StringIO.StringIO class now supports readline(nbytes). (Lars
24593Wirzenius.) (Of course, you should be using cStringIO for performance.)
24594
24595- UserDict.py supports the new dictionary methods as well.
24596
24597- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
24598speed it up, and replace 0 seed values by 1 to avoid degeneration.
24599A bug was fixed in the test for invalid arguments.
24600
24601- Module ftplib.py: added support for parsing a .netrc file (Fred
24602Drake). Also added an ntransfercmd() method to the FTP class, which
24603allows access to the expected size of a transfer when available, and a
24604parse150() function to the module which parses the corresponding 150
24605response.
24606
24607- urllib.py: the ftp cache is now limited to 10 entries. Added
24608quote_plus() and unquote_plus() functions which are like quote() and
24609unquote() but also replace spaces with '+' or vice versa, for
24610encoding/decoding CGI form arguments. Catch all errors from the ftp
24611module. HTTP requests now add the Host: header line. The proxy
24612variable names are now mapped to lower case, for Windows. The
24613spliturl() function no longer erroneously throws away all data past
24614the first newline. The basejoin() function now intereprets "../"
24615correctly. I *believe* that the problems with "exception raised in
24616__del__" under certain circumstances have been fixed (mostly by
24617changes elsewher in the interpreter).
24618
24619- In urlparse.py, there is a cache for results in urlparse.urlparse();
24620its size limit is set to 20. Also, new URL schemes shttp, https, and
24621snews are "supported".
24622
24623- shelve.py: use cPickle and cStringIO when available. Also added
24624a sync() method, which calls the database's sync() method if there is
24625one.
24626
24627- The mimetools.py module now uses the available Python modules for
24628decoding quoted-printable, uuencode and base64 formats, rather than
24629creating a subprocess.
24630
24631- The python debugger (pdb.py, and its base class bdb.py) now support
24632conditional breakpoints. See the docs.
24633
24634- The modules base64.py, uu.py and quopri.py can now be used as simple
24635command line utilities.
24636
24637- Various small fixes to the nntplib.py module that I can't bother to
24638document in detail.
24639
24640- Sjoerd Mullender's mimify.py module now supports base64 encoding and
24641includes functions to handle the funny encoding you sometimes see in mail
24642headers. It is now documented.
24643
24644- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
24645gotten from the environment.
24646
24647- Many more modules now correctly open files in binary mode when this
24648is necessary on non-Unix platforms.
24649
24650- The copying functions in the undocumented module shutil.py are
24651smarter.
24652
24653- The Writer classes in the formatter.py module now have a flush()
24654method.
24655
24656- The sgmllib.py module accepts hyphens and periods in the middle of
24657attribute names. While this is against the SGML standard, there is
24658some HTML out there that uses this...
24659
24660- The interface for the Python bytecode disassembler module, dis.py,
24661has been enhanced quite a bit. There's now one main function,
24662dis.dis(), which takes almost any kind of object (function, module,
24663class, instance, method, code object) and disassembles it; without
24664arguments it disassembles the last frame of the last traceback. The
24665other functions have changed slightly, too.
24666
24667- The imghdr.py module recognizes new image types: BMP, PNG.
24668
24669- The string.py module has a new function replace(str, old, new,
24670[maxsplit]) which does substring replacements. It is actually
24671implemented in C in the strop module. The functions [r]find() an
24672[r]index() have an optional 4th argument indicating the end of the
24673substring to search, alsoo implemented by their strop counterparts.
24674(Remember, never import strop -- import string uses strop when
24675available with zero overhead.)
24676
24677- The string.join() function now accepts any sequence argument, not
24678just lists and tuples.
24679
24680- The string.maketrans() requires its first two arguments to be
24681present. The old version didn't require them, but there's not much
24682point without them, and the documentation suggests that they are
24683required, so we fixed the code to match the documentation.
24684
24685- The regsub.py module has a function clear_cache(), which clears its
24686internal cache of compiled regular expressions. Also, the cache now
24687takes the current syntax setting into account. (However, this module
24688is now obsolete -- use the sub() or subn() functions or methods in the
24689re module.)
24690
24691- The undocumented module Complex.py has been removed, now that Python
24692has built-in complex numbers. A similar module remains as
24693Demo/classes/Complex.py, as an example.
24694
24695
24696Changes to the build process
24697----------------------------
24698
24699- The way GNU readline is configured is totally different. The
24700--with-readline configure option is gone. It is now an extension
24701module, which may be loaded dynamically. You must enable it (and
Thomas Wouters89f507f2006-12-13 04:49:30 +000024702specify the correct libraries to link with) in the Modules/Setup file.
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024703Importing the module installs some hooks which enable command line
24704editing. When the interpreter shell is invoked interactively, it
24705attempts to import the readline module; when this fails, the default
24706input mechanism is used. The hook variables are PyOS_InputHook and
24707PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
24708ideas from William Magro.)
24709
24710- New build procedure: a single library, libpython1.5.a, is now built,
24711which contains absolutely everything except for a one-line main()
24712program (which calls Py_Main(argc, argv) to start the interpreter
24713shell). This makes life much simpler for applications that need to
24714embed Python. The serial number of the build is now included in the
24715version string (sys.version).
24716
24717- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
24718emits a single warning any more when compiling Python.
24719
24720- A number of new Makefile variables have been added for special
24721situations, e.g. LDLAST is appended to the link command. These are
24722used by editing the Makefile or passing them on the make command
24723line.
24724
24725- A set of patches from Lee Busby has been integrated that make it
24726possible to catch floating point exceptions. Use the configure option
24727--with-fpectl to enable the patches; the extension modules fpectl and
24728fpetest provide control to enable/disable and test the feature,
24729respectively.
24730
24731- The support for shared libraries under AIX is now simpler and more
24732robust. Thanks to Vladimir Marangozov for revamping his own patches!
24733
24734- The Modules/makesetup script now reads a file Setup.local as well as
24735a file Setup. Most changes to the Setup script can be done by editing
24736Setup.local instead, which makes it easier to carry a particular setup
24737over from one release to the next.
24738
24739- The Modules/makesetup script now copies any "include" lines it
24740encounters verbatim into the output Makefile. It also recognizes .cxx
24741and .cpp as C++ source files.
24742
24743- The configure script is smarter about C compiler options; e.g. with
24744gcc it uses -O2 and -g when possible, and on some other platforms it
24745uses -Olimit 1500 to avoid a warning from the optimizer about the main
24746loop in ceval.c (which has more than 1000 basic blocks).
24747
24748- The configure script now detects whether malloc(0) returns a NULL
24749pointer or a valid block (of length zero). This avoids the nonsense
24750of always adding one byte to all malloc() arguments on most platforms.
24751
24752- The configure script has a new option, --with-dec-threads, to enable
24753DEC threads on DEC Alpha platforms. Also, --with-threads is now an
24754alias for --with-thread (this was the Most Common Typo in configure
24755arguments).
24756
24757- Many changes in Doc/Makefile; amongst others, latex2html is now used
24758to generate HTML from all latex documents.
24759
24760
24761Change to the Python/C API
24762--------------------------
24763
24764- Because some interfaces have changed, the PYTHON_API macro has been
24765bumped. Most extensions built for the old API version will still run,
24766but I can't guarantee this. Python prints a warning message on
24767version mismatches; it dumps core when the version mismatch causes a
24768serious problem :-)
24769
24770- I've completed the Grand Renaming, with the help of Roger Masse and
24771Barry Warsaw. This makes reading or debugging the code much easier.
24772Many other unrelated code reorganizations have also been carried out.
24773The allobjects.h header file is gone; instead, you would have to
24774include Python.h followed by rename2.h. But you're better off running
24775Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
24776the rename2.h; it will disappear in the next release.
24777
24778- Various and sundry small bugs in the "abstract" interfaces have been
24779fixed. Thanks to all the (involuntary) testers of the Python 1.4
24780version! Some new functions have been added, e.g. PySequence_List(o),
24781equivalent to list(o) in Python.
24782
24783- New API functions PyLong_FromUnsignedLong() and
24784PyLong_AsUnsignedLong().
24785
24786- The API functions in the file cgensupport.c are no longer
24787supported. This file has been moved to Modules and is only ever
24788compiled when the SGI specific 'gl' module is built.
24789
24790- PyObject_Compare() can now raise an exception. Check with
24791PyErr_Occurred(). The comparison function in an object type may also
24792raise an exception.
24793
24794- The slice interface uses an upper bound of INT_MAX when no explicit
24795upper bound is given (e.x. for a[1:]). It used to ask the object for
24796its length and do the calculations.
24797
24798- Support for multiple independent interpreters. See Doc/api.tex,
24799functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
24800documentation is incomplete, also see the new Demo/pysvr example
24801(which shows how to use these in a threaded application) and the
24802source code.
24803
24804- There is now a Py_Finalize() function which "de-initializes"
24805Python. It is possible to completely restart the interpreter
24806repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
24807change of functionality in Py_Initialize() means that it is now a
24808fatal error to call it while the interpreter is already initialized.
24809The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
24810is deprecated (it is nothing more than Py_Finalize() followed by
24811exit()).
24812
24813- There are no known memory leaks left. While Py_Finalize() doesn't
24814free *all* allocated memory (some of it is hard to track down),
24815repeated calls to Py_Finalize() and Py_Initialize() do not create
24816unaccessible heap blocks.
24817
24818- There is now explicit per-thread state. (Inspired by, but not the
24819same as, Greg Stein's free threading patches.)
24820
24821- There is now better support for threading C applications. There are
24822now explicit APIs to manipulate the interpreter lock. Read the source
24823or the Demo/pysvr example; the new functions are
24824PyEval_{Acquire,Release}{Lock,Thread}().
24825
24826- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
24827with other libraries' DEBUG macros. Likewise for any other test
24828macros that didn't yet start with Py_.
24829
24830- New wrappers around malloc() and friends: Py_Malloc() etc. call
24831malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
24832just malloc(). Use of these wrappers could be essential if multiple
24833memory allocators exist (e.g. when using certain DLL setups under
24834Windows). (Idea by Jim Fulton.)
24835
24836- New C API PyImport_Import() which uses whatever __import__() hook
24837that is installed for the current execution environment. By Jim
24838Fulton.
24839
24840- It is now possible for an extension module's init function to fail
24841non-fatally, by calling one of the PyErr_* functions and returning.
24842
24843- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
24844argument to the proper type, like the similar PyString macros already
24845did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
24846and PyList_GET_ITEM.
24847
24848- Some of the Py_Get* function, like Py_GetVersion() (but not yet
24849Py_GetPath()) are now declared as returning a const char *. (More
24850should follow.)
24851
24852- Changed the run-time library to check for exceptions after object
24853comparisons. PyObject_Compare() can now return an exception; use
24854PyErr_Occurred() to check (there is *no* special return value).
24855
24856- PyFile_WriteString() and Py_Flushline() now return error indicators
24857instead of clearing exceptions. This fixes an obscure bug where using
24858these would clear a pending exception, discovered by Just van Rossum.
24859
24860- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
24861an argument list including keyword arguments. Contributed by Geoff
24862Philbrick.
24863
24864- PyArg_GetInt() is gone.
24865
24866- It's no longer necessary to include graminit.h when calling one of
24867the extended parser API functions. The three public grammar start
24868symbols are now in Python.h as Py_single_input, Py_file_input, and
24869Py_eval_input.
24870
24871- The CObject interface has a new function,
24872PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
24873on the object referenced by "module.name".
24874
24875
24876Tkinter
24877-------
24878
24879- On popular demand, _tkinter once again installs a hook for readline
24880that processes certain Tk events while waiting for the user to type
24881(using PyOS_InputHook).
24882
24883- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
24884caused by command definitions referencing widget objects beyond their
24885lifetime.
24886
24887- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
24888tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
24889with the new Tk dialog scripts, and provide more "native platform"
24890style file selection dialog boxes on some platforms. Contributed by
24891Fredrik Lundh.
24892
24893- Tkinter.py: when the first Tk object is destroyed, it sets the
24894hiddel global _default_root to None, so that when another Tk object is
24895created it becomes the new default root. Other miscellaneous
24896changes and fixes.
24897
24898- The Image class now has a configure method.
24899
24900- Added a bunch of new winfo options to Tkinter.py; we should now be
24901up to date with Tk 4.2. The new winfo options supported are:
24902mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
24903visualsavailable.
24904
24905- The broken bind() method on Canvas objects defined in the Canvas.py
24906module has been fixed. The CanvasItem and Group classes now also have
24907an unbind() method.
24908
24909- The problem with Tkinter.py falling back to trying to import
24910"tkinter" when "_tkinter" is not found has been fixed -- it no longer
24911tries "tkinter", ever. This makes diagnosing the problem "_tkinter
24912not configured" much easier and will hopefully reduce the newsgroup
24913traffic on this topic.
24914
24915- The ScrolledText module once again supports the 'cnf' parameter, to
24916be compatible with the examples in Mark Lutz' book (I know, I know,
24917too late...)
24918
24919- The _tkinter.c extension module has been revamped. It now support
24920Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
24921works well under Windows and Mac (with the latest Tk ports to those
24922platforms). It also supports threading -- it is safe for one
24923(Python-created) thread to be blocked in _tkinter.mainloop() while
24924other threads modify widgets. To make the changes visible, those
24925threads must use update_idletasks()method. (The patch for threading
24926in 1.5a3 was broken; in 1.5a4, it is back in a different version,
24927which requires access to the Tcl sources to get it to work -- hence it
24928is disabled by default.)
24929
24930- A bug in _tkinter.c has been fixed, where Split() with a string
24931containing an unmatched '"' could cause an exception or core dump.
24932
24933- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
24934CreateFileHandler, so _tkinter.createfilehandler is not available on
24935those platforms when using Tk 8.0 or later. I will have to rethink
24936how to interface with Tcl's lower-level event mechanism, or with its
24937channels (which are like Python's file-like objects). Jack Jansen has
24938provided a fix for the Mac, so createfilehandler *is* actually
24939supported there; maybe I can adapt his fix for Windows.
24940
24941
24942Tools and Demos
24943---------------
24944
24945- A new regression test suite is provided, which tests most of the
24946standard and built-in modules. The regression test is run by invoking
24947the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
24948he and Roger Masse contributed most of the new tests.
24949
24950- New tool: faqwiz -- the CGI script that is used to maintain the
24951Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
24952Tools/faqwiz.
24953
24954- New tool: webchecker -- a simple extensible web robot that, when
24955aimed at a web server, checks that server for dead links. Available
24956are a command line utility as well as a Tkinter based GUI version. In
24957Tools/webchecker. A simplified version of this program is dissected
24958in my article in O'Reilly's WWW Journal, the issue on Scripting
24959Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
24960Includes a parser for robots.txt files by Skip Montanaro.
24961
24962- New small tools: cvsfiles.py (prints a list of all files under CVS
24963n a particular directory tree), treesync.py (a rather Guido-specific
24964script to synchronize two source trees, one on Windows NT, the other
24965one on Unix under CVS but accessible from the NT box), and logmerge.py
24966(sort a collection of RCS or CVS logs by date). In Tools/scripts.
24967
24968- The freeze script now also works under Windows (NT). Another
24969feature allows the -p option to be pointed at the Python source tree
24970instead of the installation prefix. This was loosely based on part of
24971xfreeze by Sam Rushing and Bill Tutt.
24972
24973- New examples (Demo/extend) that show how to use the generic
24974extension makefile (Misc/Makefile.pre.in).
24975
24976- Tools/scripts/h2py.py now supports C++ comments.
24977
24978- Tools/scripts/pystone.py script is upgraded to version 1.1; there
24979was a bug in version 1.0 (distributed with Python 1.4) that leaked
24980memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
24981
24982- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
24983
24984
24985Windows (NT and 95)
24986-------------------
24987
24988- New project files for Developer Studio (Visual C++) 5.0 for Windows
24989NT (the old VC++ 4.2 Makefile is also still supported, but will
24990eventually be withdrawn due to its bulkiness).
24991
24992- See the note on the new module search path in the "Miscellaneous" section
24993above.
24994
24995- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
24996basically withdrawn. If it still works for you, you're lucky.
24997
24998- There's a new extension module, msvcrt.c, which provides various
24999low-level operations defined in the Microsoft Visual C++ Runtime Library.
25000These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
25001console I/O functions like kbhit(), getch() and putch().
25002
25003- The -u option not only sets the standard I/O streams to unbuffered
25004status, but also sets them in binary mode. (This can also be done
25005using msvcrt.setmode(), by the way.)
25006
25007- The, sys.prefix and sys.exec_prefix variables point to the directory
25008where Python is installed, or to the top of the source tree, if it was run
25009from there.
25010
25011- The various os.path modules (posixpath, ntpath, macpath) now support
25012passing more than two arguments to the join() function, so
25013os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
25014c)).
25015
25016- The ntpath module (normally used as os.path) supports ~ to $HOME
25017expansion in expanduser().
25018
25019- The freeze tool now works on Windows.
25020
25021- See also the Tkinter category for a sad note on
25022_tkinter.createfilehandler().
25023
25024- The truncate() method for file objects now works on Windows.
25025
25026- Py_Initialize() is no longer called when the DLL is loaded. You
25027must call it yourself.
25028
25029- The time module's clock() function now has good precision through
25030the use of the Win32 API QueryPerformanceCounter().
25031
25032- Mark Hammond will release Python 1.5 versions of PythonWin and his
25033other Windows specific code: the win32api extensions, COM/ActiveX
25034support, and the MFC interface.
25035
25036
25037Mac
25038---
25039
25040- As always, the Macintosh port will be done by Jack Jansen. He will
25041make a separate announcement for the Mac specific source code and the
25042binary distribution(s) when these are ready.
25043
25044
25045======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +000025046
Guido van Rossumaa253861994-10-06 17:18:57 +000025047
Guido van Rossumc30e95f1996-07-30 18:53:51 +000025048=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +000025049==> Release 1.4 (October 25 1996) <==
25050=====================================
25051
25052(Starting in reverse chronological order:)
25053
25054- Changed disclaimer notice.
25055
25056- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
25057default to the user's login shell.
25058
25059- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
25060widget, and bogus bspace() function.
25061
25062- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
25063paragraph.
25064
25065- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
25066subprojects, and to remove the (broken) experimental NumPy
25067subprojects.
25068
25069- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
25070(where os.stat() returns mtimes as floats.)
25071- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
25072fix POST in CGIHTTPServer.py.
25073
25074- Version 2.83 of Misc/python-mode.el for Emacs is included.
25075
25076- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
25077group starting immediately after a group tag.
25078
25079- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
25080
25081- In Objects/stringobject.c, fixed the compare function to do the
25082first char comparison in unsigned mode, for consistency with the way
25083other characters are compared by memcmp().
25084
25085- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
25086
25087- In Lib/urllib.py, fix another case where openedurl wasn't set.
25088
25089(XXX Sorry, the rest is in totally random order. No time to fix it.)
25090
25091- SyntaxError exceptions detected during code generation
25092(e.g. assignment to an expression) now include a line number.
25093
25094- Don't leave trailing / or \ in script directory inserted in front of
25095sys.path.
25096
25097- Added a note to Tools/scripts/classfix.py abouts its historical
25098importance.
25099
25100- Added Misc/Makefile.pre.in, a universal Makefile for extensions
25101built outside the distribution.
25102
25103- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
25104
25105- Install shared modules with mode 555 (needed for performance on some
25106platforms).
25107
25108- Some changes to standard library modules to avoid calling append()
25109with more than one argument -- while supported, this should be
25110outlawed, and I don't want to set a bad example.
25111
25112- bdb.py (and hence pdb.py) supports calling run() with a code object
25113instead of a code string.
25114
25115- Fixed an embarrassing bug cgi.py which prevented correct uploading
25116of binary files from Netscape (which doesn't distinguish between
25117binary and text files). Also added dormant logging support, which
25118makes it easier to debug the cgi module itself.
25119
25120- Added default writer to constructor of NullFormatter class.
25121
25122- Use binary mode for socket.makefile() calls in ftplib.py.
25123
25124- The ihooks module no longer "installs" itself upon import -- this
25125was an experimental feature that helped ironing out some bugs but that
25126slowed down code that imported it without the need to install it
25127(e.g. the rexec module). Also close the file in some cases and add
25128the __file__ attribute to loaded modules.
25129
25130- The test program for mailbox.py is now more useful.
25131
25132- Added getparamnames() to Message class in mimetools.py -- it returns
25133the names of parameters to the content-type header.
25134
25135- Fixed a typo in ni that broke the loop stripping "__." from names.
25136
25137- Fix sys.path[0] for scripts run via pdb.py's new main program.
25138
25139- profile.py can now also run a script, like pdb.
25140
25141- Fix a small bug in pyclbr -- don't add names starting with _ when
25142emulating from ... import *.
25143
25144- Fixed a series of embarrassing typos in rexec's handling of standard
25145I/O redirection. Added some more "safe" built-in modules: cmath,
25146errno, operator.
25147
25148- Fixed embarrassing typo in shelve.py.
25149
25150- Added SliceType and EllipsisType to types.py.
25151
25152- In urllib.py, added handling for error 301 (same as 302); added
25153geturl() method to get the URL after redirection.
25154
25155- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
25156for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
25157
25158- Fixed bsddbmodule.c to add binary mode indicator on platforms that
25159have it. This should make it working on Windows NT.
25160
25161- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
25162whatever applies. Also rationalized some other tests for various MS
25163platforms.
25164
25165- Added the sources for the NT installer script used for Python
251661.4beta3. Not tested with this release, but better than nothing.
25167
25168- A compromise in pickle's defenses against Trojan horses: a
25169user-defined function is now okay where a class is expected. A
25170built-in function is not okay, to prevent pickling something that
25171will execute os.system("rm -f *") when unpickling.
25172
25173- dis.py will print the name of local variables referenced by local
25174load/store/delete instructions.
25175
25176- Improved portability of SimpleHTTPServer module to non-Unix
25177platform.
25178
25179- The thread.h interface adds an extra argument to down_sema(). This
25180only affects other C code that uses thread.c; the Python thread module
25181doesn't use semaphores (which aren't provided on all platforms where
25182Python threads are supported). Note: on NT, this change is not
25183implemented.
25184
25185- Fixed some typos in abstract.h; corrected signature of
25186PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
25187abstract.c's PyObject_CallMethod().
25188
25189- apply(classname, (), {}) now works even if the class has no
25190__init__() method.
25191
25192- Implemented complex remainder and divmod() (these would dump core!).
25193Conversion of complex numbers to int, long int or float now raises an
25194exception, since there is no meaningful way to do it without losing
25195information.
25196
25197- Fixed bug in built-in complex() function which gave the wrong result
25198for two real arguments.
25199
25200- Change the hash algorithm for strings -- the multiplier is now
252011000003 instead of 3, which gives better spread for short strings.
25202
25203- New default path for Windows NT, the registry structure now supports
25204default paths for different install packages. (Mark Hammond -- the
25205next PythonWin release will use this.)
25206
25207- Added more symbols to the python_nt.def file.
25208
25209- When using GNU readline, set rl_readline_name to "python".
25210
25211- The Ellipses built-in name has been renamed to Ellipsis -- this is
25212the correct singular form. Thanks to Ka-Ping Yee, who saved us from
25213eternal embarrassment.
25214
25215- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
25216Ellipsis name change.
25217
25218- Updated the library reference manual. Added documentation of
25219restricted mode (rexec, Bastion) and the formatter module (for use
25220with the htmllib module). Fixed the documentation of htmllib
25221(finally).
25222
25223- The reference manual is now maintained in FrameMaker.
25224
25225- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
25226
25227- Slight improvements to Doc/Makefile.
25228
25229- Added fcntl.lockf(). This should be used for Unix file locking
25230instead of the posixfile module; lockf() is more portable.
25231
25232- The getopt module now supports long option names, thanks to Lars
25233Wizenius.
25234
25235- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
25236and Nils Fischbeck.
25237
25238- Use more bits of time.time() in whrandom's default seed().
25239
25240- Performance hack for regex module's regs attribute.
25241
25242- Don't close already closed socket in socket module.
25243
25244- Correctly handle separators containing embedded nulls in
25245strop.split, strop.find and strop.rfind. Also added more detail to
25246error message for strop.atoi and friends.
25247
25248- Moved fallback definition for hypot() to Python/hypot.c.
25249
25250- Added fallback definition for strdup, in Python/strdup.c.
25251
25252- Fixed some bugs where a function would return 0 to indicate an error
25253where it should return -1.
25254
25255- Test for error returned by time.localtime(), and rationalized its MS
25256tests.
25257
25258- Added Modules/Setup.local file, which is processed after Setup.
25259
25260- Corrected bug in toplevel Makefile.in -- execution of regen script
25261would not use the right PATH and PYTHONPATH.
25262
25263- Various and sundry NeXT configuration changes (sigh).
25264
25265- Support systems where libreadline needs neither termcap nor curses.
25266
25267- Improved ld_so_aix script and python.exp file (for AIX).
25268
25269- More stringent test for working <stdarg.h> in configure script.
25270
25271- Removed Demo/www subdirectory -- it was totally out of date.
25272
25273- Improved demos and docs for Fred Drake's parser module; fixed one
25274typo in the module itself.
25275
25276
25277=========================================
25278==> Release 1.4beta3 (August 26 1996) <==
25279=========================================
25280
25281
25282(XXX This is less readable that it should. I promise to restructure
25283it for the final 1.4 release.)
25284
25285
25286What's new in 1.4beta3 (since beta2)?
25287-------------------------------------
25288
25289- Name mangling to implement a simple form of class-private variables.
25290A name of the form "__spam" can't easily be used outside the class.
25291(This was added in 1.4beta3, but left out of the 1.4beta3 release
25292message.)
25293
25294- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
25295handled correctly when using a proxy server.
25296
25297- In ntpath.normpath(): don't truncate to 8+3 format.
25298
25299- In mimetools.choose_boundary(): don't die when getuid() or getpid()
25300aren't defined.
25301
25302- Module urllib: some optimizations to (un)quoting.
25303
25304- New module MimeWriter for writing MIME documents.
25305
25306- More changes to formatter module.
25307
25308- The freeze script works once again and is much more robust (using
25309sys.prefix etc.). It also supports a -o option to specify an
25310output directory.
25311
25312- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
25313
25314- The Doc/Makefile targets have been reorganized somewhat to remove the
25315insistence on always generating PostScript.
25316
25317- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
25318
25319- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
25320name conflict on the Mac.
25321
25322- Linking a module compiled with a different setting for Py_TRACE_REFS now
25323generates a linker error rather than a core dump.
25324
25325- The cgi module has a new convenience function print_exception(), which
25326formats a python exception using HTML. It also fixes a bug in the
25327compatibility code and adds a dubious feature which makes it possible to
25328have two query strings, one in the URL and one in the POST data.
25329
25330- A subtle change in the unpickling of class instances makes it possible
25331to unpickle in restricted execution mode, where the __dict__ attribute is
25332not available (but setattr() is).
25333
25334- Documentation for os.path.splitext() (== posixpath.splitext()) has been
25335cleared up. It splits at the *last* dot.
25336
25337- posixfile locking is now also correctly supported on AIX.
25338
25339- The tempfile module once again honors an initial setting of tmpdir. It
25340now works on Windows, too.
25341
25342- The traceback module has some new functions to extract, format and print
25343the active stack.
25344
25345- Some translation functions in the urllib module have been made a little
25346less sluggish.
25347
25348- The addtag_* methods for Canvas widgets in Tkinter as well as in the
25349separate Canvas class have been fixed so they actually do something
25350meaningful.
25351
25352- A tiny _test() function has been added to Tkinter.py.
25353
25354- A generic Makefile for dynamically loaded modules is provided in the Misc
25355subdirectory (Misc/gMakefile).
25356
25357- A new version of python-mode.el for Emacs is provided. See
25358http://www.python.org/ftp/emacs/pmdetails.html for details. The
25359separate file pyimenu.el is no longer needed, imenu support is folded
25360into python-mode.el.
25361
25362- The configure script can finally correctly find the readline library in a
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000025363non-standard location. The LDFLAGS variable is passed on the Makefiles
Guido van Rossum821a5581997-05-23 04:05:31 +000025364from the configure script.
25365
25366- Shared libraries are now installed as programs (i.e. with executable
25367permission). This is required on HP-UX and won't hurt on other systems.
25368
25369- The objc.c module is no longer part of the distribution. Objective-C
25370support may become available as contributed software on the ftp site.
25371
25372- The sybase module is no longer part of the distribution. A much
25373improved sybase module is available as contributed software from the
25374ftp site.
25375
25376- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
25377Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
25378now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
25379
25380- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
25381can use *.so and *.sl as shared libraries.
25382
25383- Some more fidgeting for AIX shared libraries.
25384
25385- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
25386(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
25387available from the contrib directory on the ftp site.)
25388
25389- A warning is written to sys.stderr when a __del__ method raises an
25390exception (formerly, such exceptions were completely ignored).
25391
25392- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
25393incapable of ANSI style token concatenation and stringification.
25394
25395- All source files (except a few platform specific modules) are once again
25396compatible with K&R C compilers as well as ANSI compilers. In particular,
25397ANSI-isms have been removed or made conditional in complexobject.c,
25398getargs.c and operator.c.
25399
25400- The abstract object API has three new functions, PyObject_DelItem,
25401PySequence_DelItem, and PySequence_DelSlice.
25402
25403- The operator module has new functions delitem and delslice, and the
25404functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
25405"and" are reserved words). ("__or__" and "__and__" are unchanged.)
25406
25407- The environment module is no longer supported; putenv() is now a function
25408in posixmodule (also under NT).
25409
25410- Error in filter(<function>, "") has been fixed.
25411
25412- Unrecognized keyword arguments raise TypeError, not KeyError.
25413
25414- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
25415some more documentation.
25416
25417- Bug in float power boundary case (0.0 to the negative integer power)
25418fixed.
25419
25420- The test of negative number to the float power has been moved from the
25421built-in pow() functin to floatobject.c (so complex numbers can yield the
25422correct result).
25423
25424- The bug introduced in beta2 where shared libraries loaded (using
25425dlopen()) from the current directory would fail, has been fixed.
25426
25427- Modules imported as shared libraries now also have a __file__ attribute,
25428giving the filename from which they were loaded. The only modules without
25429a __file__ attribute now are built-in modules.
25430
25431- On the Mac, dynamically loaded modules can end in either ".slb" or
25432".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
25433extension should only be used for "fat" binaries.
25434
25435- C API addition: marshal.c now supports
25436PyMarshal_WriteObjectToString(object).
25437
25438- C API addition: getargs.c now supports
25439PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
25440to parse keyword arguments.
25441
25442- The PC versioning scheme (sys.winver) has changed once again. the
25443version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
25444first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
25445"1.4.1" for Python 1.4.1 -- the beta level is not included) and
25446<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
25447
25448- h2py.py accepts whitespace before the # in CPP directives
25449
25450- On Solaris 2.5, it should now be possible to use either Posix threads or
25451Solaris threads (XXX: how do you select which is used???). (Note: the
25452Python pthreads interface doesn't fully support semaphores yet -- anyone
25453care to fix this?)
25454
25455- Thread support should now work on AIX, using either DCE threads or
25456pthreads.
25457
25458- New file Demo/sockets/unicast.py
25459
25460- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
25461both) (XXX)
25462
25463- New project setup for PC port, now compatible with PythonWin, with
25464_tkinter and NumPy support (XXX)
25465
25466- New module site.py (XXX)
25467
25468- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
25469
25470- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
25471
25472- regen script fixed (XXX)
25473
25474- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
25475
25476- testall now also tests math module (XXX)
25477
25478- string.atoi c.s. now raise an exception for an empty input string.
25479
25480- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
25481have config.h included at various places.
25482
25483- Unrecognized keyword arguments now raise TypeError rather than KeyError.
25484
25485- The makesetup script recognizes files with extension .so or .sl as
25486(shared) libraries.
25487
25488- 'access' is no longer a reserved word, and all code related to its
25489implementation is gone (or at least #ifdef'ed out). This should make
25490Python a little speedier too!
25491
25492- Performance enhancements suggested by Sjoerd Mullender. This includes
25493the introduction of two new optional function pointers in type object,
25494getattro and setattro, which are like getattr and setattr but take a
25495string object instead of a C string pointer.
25496
25497- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
25498only on the left or only on the right, A new optional third argument to
25499split() specifies the maximum number of separators honored (so
25500splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
255011.3, splitfields(s, None) is totally equivalent to split(s).)
25502string.capwords() has an optional second argument specifying the
25503separator (which is passed to split()).
25504
25505- regsub.split() has the same addition as string.split(). regsub.splitx(s,
25506sep, maxsep) implements the functionality that was regsub.split(s, 1) in
255071.4beta2 (return a list containing the delimiters as well as the words).
25508
25509- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
25510
25511- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
25512argument to _tkinter.create() to set Tcl's argv0 variable, so X
25513resources use the right resource class again.
25514
25515- Add #undef fabs to Modules/mathmodule.c for macintosh.
25516
25517- Added some macro renames for AIX in Modules/operator.c.
25518
25519- Removed spurious 'E' from Doc/liberrno.tex.
25520
25521- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
25522Misc/gMakefile and new version of Misc/python-mode.el.
25523
25524- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
25525NameError).
25526
25527- Added missing "from types import *" to Lib/tkinter/Canvas.py.
25528
25529- Added hint about using default args for __init__ to pickle docs.
25530
25531- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
25532PySequence_Length.
25533
25534- Some improvements to Doc/texi2html.py.
25535
25536- In Python/import.c, Cast unsigned char * in struct _frozen to char *
25537in calls to rds_object().
25538
25539- In doc/ref4.tex, added note about scope of lambda bodies.
25540
25541What's new in 1.4beta2 (since beta1)?
25542-------------------------------------
25543
25544- Portability bug in the md5.h header solved.
25545
25546- The PC build procedure now really works, and sets sys.platform to a
25547meaningful value (a few things were botched in beta 1). Lib/dos_8x3
25548is now a standard part of the distribution (alas).
25549
25550- More improvements to the installation procedure. Typing "make install"
25551now inserts the version number in the pathnames of almost everything
25552installed, and creates the machine dependent modules (FCNTL.py etc.) if not
25553supplied by the distribution. (XXX There's still a problem with the latter
25554because the "regen" script requires that Python is installed. Some manual
25555intervention may still be required.) (This has been fixed in 1.4beta3.)
25556
25557- New modules: errno, operator (XXX).
25558
Georg Brandl93dc9eb2010-03-14 10:56:14 +000025559- Changes for use with Numerical Python: built-in function slice() and
Guido van Rossum821a5581997-05-23 04:05:31 +000025560Ellipses object, and corresponding syntax:
25561
25562 x[lo:hi:stride] == x[slice(lo, hi, stride)]
25563 x[a, ..., z] == x[(a, Ellipses, z)]
25564
Raymond Hettinger565ea5a2004-10-02 11:02:59 +000025565- New documentation for errno and cgi modules.
Guido van Rossum821a5581997-05-23 04:05:31 +000025566
25567- The directory containing the script passed to the interpreter is
25568inserted in from of sys.path; "." is no longer a default path
25569component.
25570
25571- Optional third string argument to string.translate() specifies
25572characters to delete. New function string.maketrans() creates a
25573translation table for translate() or for regex.compile().
25574
25575- Module posix (and hence module os under Unix) now supports putenv().
25576Moreover, module os is enhanced so that if putenv() is supported,
25577assignments to os.environ entries make the appropriate putenv() call.
25578(XXX the putenv() implementation can leak a small amount of memory per
25579call.)
25580
25581- pdb.py can now be invoked from the command line to debug a script:
25582python pdb.py <script> <arg> ...
25583
25584- Much improved parseaddr() in rfc822.
25585
25586- In cgi.py, you can now pass an alternative value for environ to
25587nearly all functions.
25588
25589- You can now assign to instance variables whose name begins and ends
25590with '__'.
25591
25592- New version of Fred Drake's parser module and associates (token,
25593symbol, AST).
25594
25595- New PYTHON_API_VERSION value and .pyc file magic number (again!).
25596
25597- The "complex" internal structure type is now called "Py_complex" to
25598avoid name conflicts.
25599
25600- Numerous small bugs fixed.
25601
25602- Slight pickle speedups.
25603
25604- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
25605
25606- NeXT portability mods by Bill Bumgarner integrated.
25607
25608- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
25609converted to new naming style.
25610
25611
25612What's new in 1.4beta1 (since 1.3)?
25613-----------------------------------
25614
25615- Added sys.platform and sys.exec_platform for Bill Janssen.
25616
25617- Installation has been completely overhauled. "make install" now installs
25618everything, not just the python binary. Installation uses the install-sh
25619script (borrowed from X11) to install each file.
25620
25621- New functions in the posix module: mkfifo, plock, remove (== unlink),
25622and ftruncate. More functions are also available under NT.
25623
25624- New function in the fcntl module: flock.
25625
25626- Shared library support for FreeBSD.
25627
25628- The --with-readline option can now be used without a DIRECTORY argument,
25629for systems where libreadline.* is in one of the standard places. It is
25630also possible for it to be a shared library.
25631
25632- The extension tkinter has been renamed to _tkinter, to avoid confusion
25633with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
25634well as 4.0.
25635
25636- Author's change of address from CWI in Amsterdam, The Netherlands, to
25637CNRI in Reston, VA, USA.
25638
25639- The math.hypot() function is now always available (if it isn't found in
25640the C math library, Python provides its own implementation).
25641
25642- The latex documentation is now compatible with latex2e, thanks to David
25643Ascher.
25644
25645- The expression x**y is now equivalent to pow(x, y).
25646
25647- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
25648
25649- Complex numbers are now supported. Imaginary constants are written with
25650a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
25651part to an imaginary part, like 3+4j. Complex numbers are always stored in
25652floating point form, so this is equivalent to 3.0+4.0j. It is also
25653possible to create complex numbers with the new built-in function
25654complex(re, [im]). For the footprint-conscious, complex number support can
25655be disabled by defining the symbol WITHOUT_COMPLEX.
25656
25657- New built-in function list() is the long-awaited counterpart of tuple().
25658
25659- There's a new "cmath" module which provides the same functions as the
25660"math" library but with complex arguments and results. (There are very
25661good reasons why math.sqrt(-1) still raises an exception -- you have to use
25662cmath.sqrt(-1) to get 1j for an answer.)
25663
25664- The Python.h header file (which is really the same as allobjects.h except
25665it disables support for old style names) now includes several more files,
25666so you have to have fewer #include statements in the average extension.
25667
25668- The NDEBUG symbol is no longer used. Code that used to be dependent on
25669the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
25670and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
25671respectively. At long last, the source actually compiles and links without
25672errors when this symbol is defined.
25673
25674- Several symbols that didn't follow the new naming scheme have been
25675renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
25676are no external symbols left without a Py or _Py prefix, not even those
25677defined by sources that were incorporated from elsewhere (regexpr.c,
25678md5c.c). (Macros are a different story...)
25679
25680- There are now typedefs for the structures defined in config.c and
25681frozen.c.
25682
25683- New PYTHON_API_VERSION value and .pyc file magic number.
25684
25685- New module Bastion. (XXX)
25686
25687- Improved performance of StringIO module.
25688
25689- UserList module now supports + and * operators.
25690
25691- The binhex and binascii modules now actually work.
25692
25693- The cgi module has been almost totally rewritten and documented.
25694It now supports file upload and a new data type to handle forms more
25695flexibly.
25696
25697- The formatter module (for use with htmllib) has been overhauled (again).
25698
25699- The ftplib module now supports passive mode and has doc strings.
25700
25701- In (ideally) all places where binary files are read or written, the file
25702is now correctly opened in binary mode ('rb' or 'wb') so the code will work
25703on Mac or PC.
25704
25705- Dummy versions of os.path.expandvars() and expanduser() are now provided
25706on non-Unix platforms.
25707
25708- Module urllib now has two new functions url2pathname and pathname2url
25709which turn local filenames into "file:..." URLs using the same rules as
25710Netscape (why be different). it also supports urlretrieve() with a
25711pathname parameter, and honors the proxy environment variables (http_proxy
25712etc.). The URL parsing has been improved somewhat, too.
25713
25714- Micro improvements to urlparse. Added urlparse.urldefrag() which
25715removes a trailing ``#fragment'' if any.
25716
25717- The mailbox module now supports MH style message delimiters as well.
25718
25719- The mhlib module contains some new functionality: setcontext() to set the
25720current folder and parsesequence() to parse a sequence as commonly passed
25721to MH commands (e.g. 1-10 or last:5).
25722
25723- New module mimify for conversion to and from MIME format of email
25724messages.
25725
25726- Module ni now automatically installs itself when first imported -- this
25727is against the normal rule that modules should define classes and functions
25728but not invoke them, but appears more useful in the case that two
25729different, independent modules want to use ni's features.
25730
25731- Some small performance enhancements in module pickle.
25732
25733- Small interface change to the profile.run*() family of functions -- more
25734sensible handling of return values.
25735
25736- The officially registered Mac creator for Python files is 'Pyth'. This
25737replaces 'PYTH' which was used before but never registered.
25738
25739- Added regsub.capwords(). (XXX)
25740
25741- Added string.capwords(), string.capitalize() and string.translate().
25742(XXX)
25743
25744- Fixed an interface bug in the rexec module: it was impossible to pass a
25745hooks instance to the RExec class. rexec now also supports the dynamic
25746loading of modules from shared libraries. Some other interfaces have been
25747added too.
25748
25749- Module rfc822 now caches the headers in a dictionary for more efficient
25750lookup.
25751
25752- The sgmllib module now understands a limited number of SGML "shorthands"
25753like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
25754
25755- The tempfile module actually tries a number of different places to find a
25756usable temporary directory. (This was prompted by certain Linux
25757installations that appear to be missing a /usr/tmp directory.) [A bug in
25758the implementation that would ignore a pre-existing tmpdir global has been
25759fixed in beta3.]
25760
25761- Much improved and enhanved FileDialog module for Tkinter.
25762
25763- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
25764well as Tk 4.1).
25765
25766- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
25767s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
25768extension is called _socket and a wrapper module win/socket.py provides
25769"makefile()" and "dup()" functionality. On Windows, the select module
25770works only with socket objects.
25771
25772- Bugs in bsddb module fixed (e.g. missing default argument values).
25773
25774- The curses extension now includes <ncurses.h> when available.
25775
25776- The gdbm module now supports opening databases in "fast" mode by
25777specifying 'f' as the second character or the mode string.
25778
25779- new variables sys.prefix and sys.exec_prefix pass corresponding
25780configuration options / Makefile variables to the Python programmer.
25781
25782- The ``new'' module now supports creating new user-defined classes as well
25783as instances thereof.
25784
25785- The soundex module now sports get_soundex() to get the soundex value for an
25786arbitrary string (formerly it would only do soundex-based string
25787comparison) as well as doc strings.
25788
25789- New object type "cobject" to safely wrap void pointers for passing them
25790between various extension modules.
25791
25792- More efficient computation of float**smallint.
25793
25794- The mysterious bug whereby "x.x" (two occurrences of the same
25795one-character name) typed from the commandline would sometimes fail
25796mysteriously.
25797
25798- The initialization of the readline function can now be invoked by a C
25799extension through PyOS_ReadlineInit().
25800
25801- There's now an externally visible pointer PyImport_FrozenModules which
25802can be changed by an embedding application.
25803
25804- The argument parsing functions now support a new format character 'D' to
25805specify complex numbers.
25806
25807- Various memory leaks plugged and bugs fixed.
25808
25809- Improved support for posix threads (now that real implementations are
25810beginning to apepar). Still no fully functioning semaphores.
25811
25812- Some various and sundry improvements and new entries in the Tools
25813directory.
25814
25815
25816=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +000025817==> Release 1.3 (13 October 1995) <==
25818=====================================
25819
25820Major change
25821============
25822
25823Two words: Keyword Arguments. See the first section of Chapter 12 of
25824the Tutorial.
25825
25826(The rest of this file is textually the same as the remaining sections
25827of that chapter.)
25828
25829
25830Changes to the WWW and Internet tools
25831=====================================
25832
25833The "htmllib" module has been rewritten in an incompatible fashion.
25834The new version is considerably more complete (HTML 2.0 except forms,
25835but including all ISO-8859-1 entity definitions), and easy to use.
25836Small changes to "sgmllib" have also been made, to better match the
25837tokenization of HTML as recognized by other web tools.
25838
25839A new module "formatter" has been added, for use with the new
25840"htmllib" module.
25841
25842The "urllib"and "httplib" modules have been changed somewhat to allow
25843overriding unknown URL types and to support authentication. They now
25844use "mimetools.Message" instead of "rfc822.Message" to parse headers.
25845The "endrequest()" method has been removed from the HTTP class since
25846it breaks the interaction with some servers.
25847
25848The "rfc822.Message" class has been changed to allow a flag to be
25849passed in that says that the file is unseekable.
25850
25851The "ftplib" module has been fixed to be (hopefully) more robust on
25852Linux.
25853
25854Several new operations that are optionally supported by servers have
25855been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
25856
25857Other Language Changes
25858======================
25859
25860The "raise" statement now takes an optional argument which specifies
25861the traceback to be used when printing the exception's stack trace.
25862This must be a traceback object, such as found in "sys.exc_traceback".
25863When omitted or given as "None", the old behavior (to generate a stack
25864trace entry for the current stack frame) is used.
25865
25866The tokenizer is now more tolerant of alien whitespace. Control-L in
25867the leading whitespace of a line resets the column number to zero,
25868while Control-R just before the end of the line is ignored.
25869
25870Changes to Built-in Operations
25871==============================
25872
25873For file objects, "f.read(0)" and "f.readline(0)" now return an empty
25874string rather than reading an unlimited number of bytes. For the
25875latter, omit the argument altogether or pass a negative value.
25876
25877A new system variable, "sys.platform", has been added. It specifies
25878the current platform, e.g. "sunos5" or "linux1".
25879
25880The built-in functions "input()" and "raw_input()" now use the GNU
25881readline library when it has been configured (formerly, only
25882interactive input to the interpreter itself was read using GNU
25883readline). The GNU readline library provides elaborate line editing
25884and history. The Python debugger ("pdb") is the first beneficiary of
25885this change.
25886
25887Two new built-in functions, "globals()" and "locals()", provide access
25888to dictionaries containming current global and local variables,
25889respectively. (These augment rather than replace "vars()", which
25890returns the current local variables when called without an argument,
25891and a module's global variables when called with an argument of type
25892module.)
25893
25894The built-in function "compile()" now takes a third possible value for
25895the kind of code to be compiled: specifying "'single'" generates code
25896for a single interactive statement, which prints the output of
25897expression statements that evaluate to something else than "None".
25898
25899Library Changes
25900===============
25901
25902There are new module "ni" and "ihooks" that support importing modules
25903with hierarchical names such as "A.B.C". This is enabled by writing
25904"import ni; ni.ni()" at the very top of the main program. These
25905modules are amply documented in the Python source.
25906
25907The module "rexec" has been rewritten (incompatibly) to define a class
25908and to use "ihooks".
25909
25910The "string.split()" and "string.splitfields()" functions are now the
25911same function (the presence or absence of the second argument
25912determines which operation is invoked); similar for "string.join()"
25913and "string.joinfields()".
25914
25915The "Tkinter" module and its helper "Dialog" have been revamped to use
25916keyword arguments. Tk 4.0 is now the standard. A new module
25917"FileDialog" has been added which implements standard file selection
25918dialogs.
25919
25920The optional built-in modules "dbm" and "gdbm" are more coordinated
25921--- their "open()" functions now take the same values for their "flag"
25922argument, and the "flag" and "mode" argument have default values (to
25923open the database for reading only, and to create the database with
25924mode "0666" minuse the umask, respectively). The memory leaks have
25925finally been fixed.
25926
25927A new dbm-like module, "bsddb", has been added, which uses the BSD DB
25928package's hash method.
25929
25930A portable (though slow) dbm-clone, implemented in Python, has been
25931added for systems where none of the above is provided. It is aptly
25932dubbed "dumbdbm".
25933
25934The module "anydbm" provides a unified interface to "bsddb", "gdbm",
25935"dbm", and "dumbdbm", choosing the first one available.
25936
25937A new extension module, "binascii", provides a variety of operations
25938for conversion of text-encoded binary data.
25939
25940There are three new or rewritten companion modules implemented in
25941Python that can encode and decode the most common such formats: "uu"
25942(uuencode), "base64" and "binhex".
25943
25944A module to handle the MIME encoding quoted-printable has also been
25945added: "quopri".
25946
25947The parser module (which provides an interface to the Python parser's
25948abstract syntax trees) has been rewritten (incompatibly) by Fred
25949Drake. It now lets you change the parse tree and compile the result!
25950
25951The \code{syslog} module has been upgraded and documented.
25952
25953Other Changes
25954=============
25955
25956The dynamic module loader recognizes the fact that different filenames
25957point to the same shared library and loads the library only once, so
25958you can have a single shared library that defines multiple modules.
25959(SunOS / SVR4 style shared libraries only.)
25960
25961Jim Fulton's ``abstract object interface'' has been incorporated into
25962the run-time API. For more detailes, read the files
25963"Include/abstract.h" and "Objects/abstract.c".
25964
25965The Macintosh version is much more robust now.
25966
25967Numerous things I have forgotten or that are so obscure no-one will
25968notice them anyway :-)
25969
25970
Guido van Rossumf456b6d1995-01-04 19:20:37 +000025971===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +000025972==> Release 1.2 (13 April 1995) <==
25973===================================
25974
25975- Changes to Misc/python-mode.el:
25976 - Wrapping and indentation within triple quote strings should work
25977 properly now.
25978 - `Standard' bug reporting mechanism (use C-c C-b)
25979 - py-mark-block was moved to C-c C-m
25980 - C-c C-v shows you the python-mode version
25981 - a basic python-font-lock-keywords has been added for Emacs 19
25982 font-lock colorizations.
25983 - proper interaction with pending-del and del-sel modes.
25984 - New py-electric-colon (:) command for improved outdenting. Also
25985 py-indent-line (TAB) should handle outdented lines better.
25986 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
25987
25988- The Library Reference has been restructured, and many new and
25989existing modules are now documented, in particular the debugger and
25990the profiler, as well as the persistency and the WWW/Internet support
25991modules.
25992
25993- All known bugs have been fixed. For example the pow(2,2,3L) bug on
25994Linux has been fixed. Also the re-entrancy problems with __del__ have
25995been fixed.
25996
25997- All known memory leaks have been fixed.
25998
25999- Phase 2 of the Great Renaming has been executed. The header files
26000now use the new names (PyObject instead of object, etc.). The linker
26001also sees the new names. Most source files still use the old names,
26002by virtue of the rename2.h header file. If you include Python.h, you
26003only see the new names. Dynamically linked modules have to be
26004recompiled. (Phase 3, fixing the rest of the sources, will be
26005executed gradually with the release later versions.)
26006
26007- The hooks for implementing "safe-python" (better called "restricted
26008execution") are in place. Specifically, the import statement is
26009implemented by calling the built-in function __import__, and the
26010built-in names used in a particular scope are taken from the
26011dictionary __builtins__ in that scope's global dictionary. See also
26012the new (unsupported, undocumented) module rexec.py.
26013
26014- The import statement now supports the syntax "import a.b.c" and
26015"from a.b.c import name". No officially supported implementation
26016exists, but one can be prototyped by replacing the built-in __import__
26017function. A proposal by Ken Manheimer is provided as newimp.py.
26018
26019- All machinery used by the import statement (or the built-in
26020__import__ function) is now exposed through the new built-in module
26021"imp" (see the library reference manual). All dynamic loading
26022machinery is moved to the new file importdl.c.
26023
26024- Persistent storage is supported through the use of the modules
26025"pickle" and "shelve" (implemented in Python). There's also a "copy"
26026module implementing deepcopy and normal (shallow) copy operations.
26027See the library reference manual.
26028
26029- Documentation strings for many objects types are accessible through
26030the __doc__ attribute. Modules, classes and functions support special
26031syntax to initialize the __doc__ attribute: if the first statement
26032consists of just a string literal, that string literal becomes the
26033value of the __doc__ attribute. The default __doc__ attribute is
26034None. Documentation strings are also supported for built-in
26035functions, types and modules; however this feature hasn't been widely
26036used yet. See the 'new' module for an example. (Basically, the type
26037object's tp_doc field contains the doc string for the type, and the
260384th member of the methodlist structure contains the doc string for the
26039method.)
26040
26041- The __coerce__ and __cmp__ methods for user-defined classes once
26042again work as expected. As an example, there's a new standard class
26043Complex in the library.
26044
26045- The functions posix.popen() and posix.fdopen() now have an optional
26046third argument to specify the buffer size, and default their second
Georg Brandl93dc9eb2010-03-14 10:56:14 +000026047(mode) argument to 'r' -- in analogy to the built-in open() function.
Guido van Rossumd462f3d1995-10-09 21:30:37 +000026048The same applies to posixfile.open() and the socket method makefile().
26049
26050- The thread.exit_thread() function now raises SystemExit so that
26051'finally' clauses are honored and a memory leak is plugged.
26052
26053- Improved X11 and Motif support, by Sjoerd Mullender. This extension
26054is being maintained and distributed separately.
26055
26056- Improved support for the Apple Macintosh, in part by Jack Jansen,
26057e.g. interfaces to (a few) resource mananger functions, get/set file
26058type and creator, gestalt, sound manager, speech manager, MacTCP, comm
26059toolbox, and the think C console library. This is being maintained
26060and distributed separately.
26061
26062- Improved version for Windows NT, by Mark Hammond. This is being
26063maintained and distributed separately.
26064
26065- Used autoconf 2.0 to generate the configure script. Adapted
26066configure.in to use the new features in autoconf 2.0.
26067
26068- It now builds on the NeXT without intervention, even on the 3.3
26069Sparc pre-release.
26070
26071- Characters passed to isspace() and friends are masked to nonnegative
26072values.
26073
26074- Correctly compute pow(-3.0, 3).
26075
26076- Fix portability problems with getopt (configure now checks for a
26077non-GNU getopt).
26078
26079- Don't add frozenmain.o to libPython.a.
26080
26081- Exceptions can now be classes. ALl built-in exceptions are still
26082string objects, but this will change in the future.
26083
26084- The socket module exports a long list of socket related symbols.
26085(More built-in modules will export their symbolic constants instead of
26086relying on a separately generated Python module.)
26087
26088- When a module object is deleted, it clears out its own dictionary.
26089This fixes a circularity in the references between functions and
26090their global dictionary.
26091
26092- Changed the error handling by [new]getargs() e.g. for "O&".
26093
26094- Dynamic loading of modules using shared libraries is supported for
26095several new platforms.
26096
26097- Support "O&", "[...]" and "{...}" in mkvalue().
26098
26099- Extension to findmethod(): findmethodinchain() (where a chain is a
26100linked list of methodlist arrays). The calling interface for
26101findmethod() has changed: it now gets a pointer to the (static!)
26102methodlist structure rather than just to the function name -- this
26103saves copying flags etc. into the (short-lived) method object.
26104
26105- The callable() function is now public.
26106
26107- Object types can define a few new operations by setting function
26108pointers in the type object structure: tp_call defines how an object
26109is called, and tp_str defines how an object's str() is computed.
26110
26111
26112===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +000026113==> Release 1.1.1 (10 Nov 1994) <==
26114===================================
26115
26116This is a pure bugfix release again. See the ChangeLog file for details.
26117
26118One exception: a few new features were added to tkinter.
26119
26120
26121=================================
26122==> Release 1.1 (11 Oct 1994) <==
26123=================================
26124
26125This release adds several new features, improved configuration and
26126portability, and fixes more bugs than I can list here (including some
26127memory leaks).
26128
26129The source compiles and runs out of the box on more platforms than
26130ever -- including Windows NT. Makefiles or projects for a variety of
26131non-UNIX platforms are provided.
26132
26133APOLOGY: some new features are badly documented or not at all. I had
26134the choice -- postpone the new release indefinitely, or release it
26135now, with working code but some undocumented areas. The problem with
26136postponing the release is that people continue to suffer from existing
26137bugs, and send me patches based on the previous release -- which I
26138can't apply directly because my own source has changed. Also, some
26139new modules (like signal) have been ready for release for quite some
26140time, and people are anxiously waiting for them. In the case of
26141signal, the interface is simple enough to figure out without
26142documentation (if you're anxious enough :-). In this case it was not
26143simple to release the module on its own, since it relies on many small
26144patches elsewhere in the source.
26145
26146For most new Python modules, the source code contains comments that
26147explain how to use them. Documentation for the Tk interface, written
26148by Matt Conway, is available as tkinter-doc.tar.gz from the Python
26149home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
26150new operator overloading facilities, have a look at Demo/classes:
26151Complex.py and Rat.py show how to implement a numeric type without and
26152with __coerce__ method. Also have a look at the end of the Tutorial
26153document (Doc/tut.tex). If you're still confused: use the newsgroup
26154or mailing list.
26155
26156
26157New language features:
26158
26159 - More flexible operator overloading for user-defined classes
26160 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
26161
26162 - Classes can define methods named __getattr__, __setattr__ and
26163 __delattr__ to trap attribute accesses. See end of tutorial.
26164
26165 - Classes can define method __call__ so instances can be called
26166 directly. See end of tutorial.
26167
26168
26169New support facilities:
26170
26171 - The Makefiles (for the base interpreter as well as for extensions)
26172 now support creating dynamically loadable modules if the platform
26173 supports shared libraries.
26174
26175 - Passing the interpreter a .pyc file as script argument will execute
26176 the code in that file. (On the Mac such files can be double-clicked!)
26177
26178 - New Freeze script, to create independently distributable "binaries"
26179 of Python programs -- look in Demo/freeze
26180
26181 - Improved h2py script (in Demo/scripts) follows #includes and
26182 supports macros with one argument
26183
26184 - New module compileall generates .pyc files for all modules in a
26185 directory (tree) without also executing them
26186
26187 - Threads should work on more platforms
26188
26189
26190New built-in modules:
26191
26192 - tkinter (support for Tcl's Tk widget set) is now part of the base
26193 distribution
26194
26195 - signal allows catching or ignoring UNIX signals (unfortunately still
26196 undocumented -- any taker?)
26197
26198 - termios provides portable access to POSIX tty settings
26199
26200 - curses provides an interface to the System V curses library
26201
26202 - syslog provides an interface to the (BSD?) syslog daemon
26203
26204 - 'new' provides interfaces to create new built-in object types
26205 (e.g. modules and functions)
26206
26207 - sybase provides an interface to SYBASE database
26208
26209
26210New/obsolete built-in methods:
26211
26212 - callable(x) tests whether x can be called
26213
26214 - sockets now have a setblocking() method
26215
26216 - sockets no longer have an allowbroadcast() method
26217
26218 - socket methods send() and sendto() return byte count
26219
26220
26221New standard library modules:
26222
26223 - types.py defines standard names for built-in types, e.g. StringType
26224
26225 - urlparse.py parses URLs according to the latest Internet draft
26226
26227 - uu.py does uuencode/uudecode (not the fastest in the world, but
26228 quicker than installing uuencode on a non-UNIX machine :-)
26229
26230 - New, faster and more powerful profile module.py
26231
26232 - mhlib.py provides interface to MH folders and messages
26233
26234
26235New facilities for extension writers (unfortunately still
26236undocumented):
26237
26238 - newgetargs() supports optional arguments and improved error messages
26239
26240 - O!, O& O? formats for getargs allow more versatile type checking of
26241 non-standard types
26242
26243 - can register pending asynchronous callback, to be called the next
26244 time the Python VM begins a new instruction (Py_AddPendingCall)
26245
26246 - can register cleanup routines to be called when Python exits
26247 (Py_AtExit)
26248
26249 - makesetup script understands C++ files in Setup file (use file.C
26250 or file.cc)
26251
26252 - Make variable OPT is passed on to sub-Makefiles
26253
26254 - An init<module>() routine may signal an error by not entering
26255 the module in the module table and raising an exception instead
26256
26257 - For long module names, instead of foobarbletchmodule.c you can
26258 use foobarbletch.c
26259
26260 - getintvalue() and getfloatvalue() try to convert any object
26261 instead of requiring an "intobject" or "floatobject"
26262
26263 - All the [new]getargs() formats that retrieve an integer value
26264 will now also work if a float is passed
26265
26266 - C function listtuple() converts list to tuple, fast
26267
26268 - You should now call sigcheck() instead of intrcheck();
26269 sigcheck() also sets an exception when it returns nonzero
26270
26271
Guido van Rossumaa253861994-10-06 17:18:57 +000026272====================================
26273==> Release 1.0.3 (14 July 1994) <==
26274====================================
26275
26276This release consists entirely of bug fixes to the C sources; see the
26277head of ../ChangeLog for a complete list. Most important bugs fixed:
26278
26279- Sometimes the format operator (string%expr) would drop the last
26280character of the format string
26281
26282- Tokenizer looped when last line did not end in \n
26283
26284- Bug when triple-quoted string ended in quote plus newline
26285
26286- Typo in socketmodule (listen) (== instead of =)
26287
26288- typing vars() at the >>> prompt would cause recursive output
26289
26290
26291==================================
26292==> Release 1.0.2 (4 May 1994) <==
26293==================================
26294
26295Overview of the most visible changes. Bug fixes are not listed. See
26296also ChangeLog.
26297
26298Tokens
26299------
26300
26301* String literals follow Standard C rules: they may be continued on
26302the next line using a backslash; adjacent literals are concatenated
26303at compile time.
26304
26305* A new kind of string literals, surrounded by triple quotes (""" or
26306'''), can be continued on the next line without a backslash.
26307
26308Syntax
26309------
26310
26311* Function arguments may have a default value, e.g. def f(a, b=1);
26312defaults are evaluated at function definition time. This also applies
26313to lambda.
26314
26315* The try-except statement has an optional else clause, which is
26316executed when no exception occurs in the try clause.
26317
26318Interpreter
26319-----------
26320
26321* The result of a statement-level expression is no longer printed,
26322except_ for expressions entered interactively. Consequently, the -k
26323command line option is gone.
26324
26325* The result of the last printed interactive expression is assigned to
26326the variable '_'.
26327
26328* Access to implicit global variables has been speeded up by removing
26329an always-failing dictionary lookup in the dictionary of local
26330variables (mod suggested by Steve Makewski and Tim Peters).
26331
26332* There is a new command line option, -u, to force stdout and stderr
26333to be unbuffered.
26334
26335* Incorporated Steve Majewski's mods to import.c for dynamic loading
26336under AIX.
26337
26338* Fewer chances of dumping core when trying to reload or re-import
26339static built-in, dynamically loaded built-in, or frozen modules.
26340
26341* Loops over sequences now don't ask for the sequence's length when
26342they start, but try to access items 0, 1, 2, and so on until they hit
26343an IndexError. This makes it possible to create classes that generate
26344infinite or indefinite sequences a la Steve Majewski. This affects
26345for loops, the (not) in operator, and the built-in functions filter(),
26346map(), max(), min(), reduce().
26347
26348Changed Built-in operations
26349---------------------------
26350
26351* The '%' operator on strings (printf-style formatting) supports a new
26352feature (adapted from a patch by Donald Beaudry) to allow
26353'%(<key>)<format>' % {...} to take values from a dictionary by name
26354instead of from a tuple by position (see also the new function
26355vars()).
26356
26357* The '%s' formatting operator is changed to accept any type and
26358convert it to a string using str().
26359
26360* Dictionaries with more than 20,000 entries can now be created
26361(thanks to Steve Kirsch).
26362
26363New Built-in Functions
26364----------------------
26365
26366* vars() returns a dictionary containing the local variables; vars(m)
26367returns a dictionary containing the variables of module m. Note:
26368dir(x) is now equivalent to vars(x).keys().
26369
26370Changed Built-in Functions
26371--------------------------
26372
26373* open() has an optional third argument to specify the buffer size: 0
26374for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
26375for default.
26376
26377* open()'s second argument is now optional; it defaults to "r".
26378
26379* apply() now checks that its second argument is indeed a tuple.
26380
26381New Built-in Modules
26382--------------------
26383
26384Changed Built-in Modules
26385------------------------
26386
26387The thread module no longer supports exit_prog().
26388
26389New Python Modules
26390------------------
26391
26392* Module addpack contains a standard interface to modify sys.path to
26393find optional packages (groups of related modules).
26394
26395* Module urllib contains a number of functions to access
26396World-Wide-Web files specified by their URL.
26397
26398* Module httplib implements the client side of the HTTP protocol used
26399by World-Wide-Web servers.
26400
26401* Module gopherlib implements the client side of the Gopher protocol.
26402
26403* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
26404style mailbox files.
26405
26406* Module random contains various random distributions, e.g. gauss().
26407
26408* Module lockfile locks and unlocks open files using fcntl (inspired
26409by a similar module by Andy Bensky).
26410
26411* Module ntpath (by Jaap Vermeulen) implements path operations for
26412Windows/NT.
26413
26414* Module test_thread (in Lib/test) contains a small test set for the
26415thread module.
26416
26417Changed Python Modules
26418----------------------
26419
26420* The string module's expandvars() function is now documented and is
26421implemented in Python (using regular expressions) instead of forking
26422off a shell process.
26423
26424* Module rfc822 now supports accessing the header fields using the
26425mapping/dictionary interface, e.g. h['subject'].
26426
26427* Module pdb now makes it possible to set a break on a function
26428(syntax: break <expression>, where <expression> yields a function
26429object).
26430
26431Changed Demos
26432-------------
26433
26434* The Demo/scripts/freeze.py script is working again (thanks to Jaap
26435Vermeulen).
26436
26437New Demos
26438---------
26439
26440* Demo/threads/Generator.py is a proposed interface for restartable
26441functions a la Tim Peters.
26442
26443* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
26444directory full of HTML pages which between them contain links to all
26445the newsgroups available on your server.
26446
26447* Demo/dns contains a DNS (Domain Name Server) client.
26448
26449* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
26450nice enhanced Python shell!!!).
26451
26452* Demo/turing contains a Turing machine by Amrit Prem.
26453
26454Documentation
26455-------------
26456
26457* Documented new language features mentioned above (but not all new
26458modules).
26459
26460* Added a chapter to the Tutorial describing recent additions to
26461Python.
26462
26463* Clarified some sentences in the reference manual,
26464e.g. break/continue, local/global scope, slice assignment.
26465
26466Source Structure
26467----------------
26468
26469* Moved Include/tokenizer.h to Parser/tokenizer.h.
26470
26471* Added Python/getopt.c for systems that don't have it.
26472
26473Emacs mode
26474----------
26475
26476* Indentation of continuated lines is done more intelligently;
26477consequently the variable py-continuation-offset is gone.
26478
Guido van Rossumf2eac992000-09-04 17:24:24 +000026479
Guido van Rossumaa253861994-10-06 17:18:57 +000026480========================================
26481==> Release 1.0.1 (15 February 1994) <==
26482========================================
26483
26484* Many portability fixes should make it painless to build Python on
26485several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
26486
26487* Fixed test for <stdarg.h> -- this broke on some platforms.
26488
26489* Fixed test for shared library dynalic loading -- this broke on SunOS
264904.x using the GNU loader.
26491
26492* Changed order and number of SVR4 networking libraries (it is now
26493-lsocket -linet -lnsl, if these libraries exist).
26494
26495* Installing the build intermediate stages with "make libainstall" now
26496also installs config.c.in, Setup and makesetup, which are used by the
26497new Extensions mechanism.
26498
26499* Improved README file contains more hints and new troubleshooting
26500section.
26501
26502* The built-in module strop now defines fast versions of three more
26503functions of the standard string module: atoi(), atol() and atof().
26504The strop versions of atoi() and atol() support an optional second
26505argument to specify the base (default 10). NOTE: you don't have to
26506explicitly import strop to use the faster versions -- the string
26507module contains code to let versions from stop override the default
26508versions.
26509
26510* There is now a working Lib/dospath.py for those who use Python under
26511DOS (or Windows). Thanks, Jaap!
26512
26513* There is now a working Modules/dosmodule.c for DOS (or Windows)
26514system calls.
26515
26516* Lib.os.py has been reorganized (making it ready for more operating
26517systems).
26518
26519* Lib/ospath.py is now obsolete (use os.path instead).
26520
26521* Many fixes to the tutorial to make it match Python 1.0. Thanks,
26522Tim!
26523
26524* Fixed Doc/Makefile, Doc/README and various scripts there.
26525
26526* Added missing description of fdopen to Doc/libposix.tex.
26527
26528* Made cleanup() global, for the benefit of embedded applications.
26529
26530* Added parsing of addresses and dates to Lib/rfc822.py.
26531
26532* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
26533them usable at all.
26534
26535* New module Lib/wave.py reads RIFF (*.wav) audio files.
26536
26537* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
26538belongs.
26539
26540* New options and comments for Modules/makesetup (used by new
26541Extension mechanism).
26542
26543* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
26544and elsewhere.
26545
26546* Fixed coredump in filter(None, 'abcdefg').
26547
26548
26549=======================================
26550==> Release 1.0.0 (26 January 1994) <==
26551=======================================
26552
26553As is traditional, so many things have changed that I can't pretend to
26554be complete in these release notes, but I'll try anyway :-)
26555
26556Note that the very last section is labeled "remaining bugs".
26557
26558
26559Source organization and build process
26560-------------------------------------
26561
26562* The sources have finally been split: instead of a single src
26563subdirectory there are now separate directories Include, Parser,
26564Grammar, Objects, Python and Modules. Other directories also start
26565with a capital letter: Misc, Doc, Lib, Demo.
26566
26567* A few extensions (notably Amoeba and X support) have been moved to a
26568separate subtree Extensions, which is no longer in the core
26569distribution, but separately ftp'able as extensions.tar.Z. (The
26570distribution contains a placeholder Ext-dummy with a description of
26571the Extensions subtree as well as the most recent versions of the
26572scripts used there.)
26573
26574* A few large specialized demos (SGI video and www) have been
26575moved to a separate subdirectory Demo2, which is no longer in the core
26576distribution, but separately ftp'able as demo2.tar.Z.
26577
26578* Parts of the standard library have been moved to subdirectories:
26579there are now standard subdirectories stdwin, test, sgi and sun4.
26580
26581* The configuration process has radically changed: I now use GNU
26582autoconf. This makes it much easier to build on new Unix flavors, as
26583well as fully supporting VPATH (if your Make has it). The scripts
26584Configure.py and Addmodule.sh are no longer needed. Many source files
26585have been adapted in order to work with the symbols that the configure
26586script generated by autoconf defines (or not); the resulting source is
26587much more portable to different C compilers and operating systems,
26588even non Unix systems (a Mac port was done in an afternoon). See the
26589toplevel README file for a description of the new build process.
26590
26591* GNU readline (a slightly newer version) is now a subdirectory of the
26592Python toplevel. It is still not automatically configured (being
26593totally autoconf-unaware :-). One problem has been solved: typing
26594Control-C to a readline prompt will now work. The distribution no
26595longer contains a "super-level" directory (above the python toplevel
26596directory), and dl, dl-dld and GNU dld are no longer part of the
26597Python distribution (you can still ftp them from
26598ftp.cwi.nl:/pub/dynload).
26599
26600* The DOS functions have been taken out of posixmodule.c and moved
26601into a separate file dosmodule.c.
26602
26603* There's now a separate file version.c which contains nothing but
26604the version number.
26605
26606* The actual main program is now contained in config.c (unless NO_MAIN
26607is defined); pythonmain.c now contains a function realmain() which is
26608called from config.c's main().
26609
26610* All files needed to use the built-in module md5 are now contained in
26611the distribution. The module has been cleaned up considerably.
26612
26613
26614Documentation
26615-------------
26616
26617* The library manual has been split into many more small latex files,
26618so it is easier to edit Doc/lib.tex file to create a custom library
26619manual, describing only those modules supported on your system. (This
26620is not automated though.)
26621
26622* A fourth manual has been added, titled "Extending and Embedding the
26623Python Interpreter" (Doc/ext.tex), which collects information about
26624the interpreter which was previously spread over several files in the
26625misc subdirectory.
26626
26627* The entire documentation is now also available on-line for those who
26628have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
26629"http://www.cwi.nl/~guido/Python.html".
26630
26631
26632Syntax
26633------
26634
26635* Strings may now be enclosed in double quotes as well as in single
26636quotes. There is no difference in interpretation. The repr() of
26637string objects will use double quotes if the string contains a single
26638quote and no double quotes. Thanks to Amrit Prem for these changes!
26639
26640* There is a new keyword 'exec'. This replaces the exec() built-in
26641function. If a function contains an exec statement, local variable
26642optimization is not performed for that particular function, thus
26643making assignment to local variables in exec statements less
26644confusing. (As a consequence, os.exec and python.exec have been
26645renamed to execv.)
26646
26647* There is a new keyword 'lambda'. An expression of the form
26648
26649 lambda <parameters> : <expression>
26650
26651yields an anonymous function. This is really only syntactic sugar;
26652you can just as well define a local function using
26653
26654 def some_temporary_name(<parameters>): return <expression>
26655
26656Lambda expressions are particularly useful in combination with map(),
26657filter() and reduce(), described below. Thanks to Amrit Prem for
26658submitting this code (as well as map(), filter(), reduce() and
26659xrange())!
26660
26661
26662Built-in functions
26663------------------
26664
26665* The built-in module containing the built-in functions is called
26666__builtin__ instead of builtin.
26667
26668* New built-in functions map(), filter() and reduce() perform standard
26669functional programming operations (though not lazily):
26670
26671- map(f, seq) returns a new sequence whose items are the items from
26672seq with f() applied to them.
26673
26674- filter(f, seq) returns a subsequence of seq consisting of those
26675items for which f() is true.
26676
26677- reduce(f, seq, initial) returns a value computed as follows:
26678 acc = initial
26679 for item in seq: acc = f(acc, item)
26680 return acc
26681
26682* New function xrange() creates a "range object". Its arguments are
26683the same as those of range(), and when used in a for loop a range
26684objects also behaves identical. The advantage of xrange() over
26685range() is that its representation (if the range contains many
26686elements) is much more compact than that of range(). The disadvantage
26687is that the result cannot be used to initialize a list object or for
26688the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
26689architectures, benchmarks have shown that "for i in range(...): ..."
26690actually executes *faster* than "for i in xrange(...): ...", but on
26691memory starved machines like PCs running DOS range(100000) may be just
26692too big to be represented at all...
26693
26694* Built-in function exec() has been replaced by the exec statement --
26695see above.
26696
26697
26698The interpreter
26699---------------
26700
26701* Syntax errors are now not printed to stderr by the parser, but
26702rather the offending line and other relevant information are packed up
26703in the SyntaxError exception argument. When the main loop catches a
26704SyntaxError exception it will print the error in the same format as
26705previously, but at the proper position in the stack traceback.
26706
26707* You can now set a maximum to the number of traceback entries
26708printed by assigning to sys.tracebacklimit. The default is 1000.
26709
26710* The version number in .pyc files has changed yet again.
26711
26712* It is now possible to have a .pyc file without a corresponding .py
26713file. (Warning: this may break existing installations if you have an
26714old .pyc file lingering around somewhere on your module search path
26715without a corresponding .py file, when there is a .py file for a
26716module of the same name further down the path -- the new interpreter
26717will find the first .pyc file and complain about it, while the old
26718interpreter would ignore it and use the .py file further down.)
26719
26720* The list sys.builtin_module_names is now sorted and also contains
26721the names of a few hardwired built-in modules (sys, __main__ and
26722__builtin__).
26723
26724* A module can now find its own name by accessing the global variable
26725__name__. Assigning to this variable essentially renames the module
26726(it should also be stored under a different key in sys.modules).
26727A neat hack follows from this: a module that wants to execute a main
26728program when called as a script no longer needs to compare
26729sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
26730
26731* When an object is printed by the print statement, its implementation
26732of str() is used. This means that classes can define __str__(self) to
26733direct how their instances are printed. This is different from
26734__repr__(self), which should define an unambigous string
26735representation of the instance. (If __str__() is not defined, it
26736defaults to __repr__().)
26737
26738* Functions and code objects can now be compared meaningfully.
26739
26740* On systems supporting SunOS or SVR4 style shared libraries, dynamic
26741loading of modules using shared libraries is automatically configured.
26742Thanks to Bill Jansen and Denis Severson for contributing this change!
26743
26744
26745Built-in objects
26746----------------
26747
26748* File objects have acquired a new method writelines() which is the
26749reverse of readlines(). (It does not actually write lines, just a
26750list of strings, but the symmetry makes the choice of name OK.)
26751
26752
26753Built-in modules
26754----------------
26755
26756* Socket objects no longer support the avail() method. Use the select
26757module instead, or use this function to replace it:
26758
26759 def avail(f):
26760 import select
26761 return f in select.select([f], [], [], 0)[0]
26762
26763* Initialization of stdwin is done differently. It actually modifies
26764sys.argv (taking out the options the X version of stdwin recognizes)
26765the first time it is imported.
26766
26767* A new built-in module parser provides a rudimentary interface to the
26768python parser. Corresponding standard library modules token and symbol
26769defines the numeric values of tokens and non-terminal symbols.
26770
26771* The posix module has aquired new functions setuid(), setgid(),
26772execve(), and exec() has been renamed to execv().
26773
26774* The array module is extended with 8-byte object swaps, the 'i'
26775format character, and a reverse() method. The read() and write()
26776methods are renamed to fromfile() and tofile().
26777
26778* The rotor module has freed of portability bugs. This introduces a
26779backward compatibility problem: strings encoded with the old rotor
26780module can't be decoded by the new version.
26781
26782* For select.select(), a timeout (4th) argument of None means the same
26783as leaving the timeout argument out.
26784
26785* Module strop (and hence standard library module string) has aquired
26786a new function: rindex(). Thanks to Amrit Prem!
26787
26788* Module regex defines a new function symcomp() which uses an extended
26789regular expression syntax: parenthesized subexpressions may be labeled
26790using the form "\(<labelname>...\)", and the group() method can return
26791sub-expressions by name. Thanks to Tracy Tims for these changes!
26792
26793* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
26794Mullender!
26795
26796
26797Standard library modules
26798------------------------
26799
26800* The library is now split in several subdirectories: all stuff using
26801stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
26802is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
26803test modules are in Lib/test. The default module search path will
26804include all relevant subdirectories by default.
26805
26806* Module os now knows about trying to import dos. It defines
26807functions execl(), execle(), execlp() and execvp().
26808
26809* New module dospath (should be attacked by a DOS hacker though).
26810
26811* All modules defining classes now define __init__() constructors
26812instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
26813
26814* Some minor changes and bugfixes module ftplib (mostly Steve
26815Majewski's suggestions); the debug() method is renamed to
26816set_debuglevel().
26817
26818* Some new test modules (not run automatically by testall though):
26819test_audioop, test_md5, test_rgbimg, test_select.
26820
26821* Module string now defines rindex() and rfind() in analogy of index()
26822and find(). It also defines atof() and atol() (and corresponding
26823exceptions) in analogy to atoi().
26824
26825* Added help() functions to modules profile and pdb.
26826
26827* The wdb debugger (now in Lib/stdwin) now shows class or instance
26828variables on a double click. Thanks to Sjoerd Mullender!
26829
26830* The (undocumented) module lambda has gone -- you couldn't import it
26831any more, and it was basically more a demo than a library module...
26832
26833
26834Multimedia extensions
26835---------------------
26836
26837* The optional built-in modules audioop and imageop are now standard
26838parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
26839for contributing this code!
26840
26841* There's a new operation in audioop: minmax().
26842
26843* There's a new built-in module called rgbimg which supports portable
26844efficient reading of SGI RCG image files. Thanks also to Paul
26845Haeberli for the original code! (Who will contribute a GIF reader?)
26846
26847* The module aifc is gone -- you should now always use aifc, which has
26848received a facelift.
26849
26850* There's a new module sunau., for reading Sun (and NeXT) audio files.
26851
26852* There's a new module audiodev which provides a uniform interface to
26853(SGI Indigo and Sun Sparc) audio hardware.
26854
26855* There's a new module sndhdr which recognizes various sound files by
26856looking in their header and checking for various magic words.
26857
26858
26859Optimizations
26860-------------
26861
26862* Most optimizations below can be configured by compile-time flags.
26863Thanks to Sjoerd Mullender for submitting these optimizations!
26864
26865* Small integers (default -1..99) are shared -- i.e. if two different
26866functions compute the same value it is possible (but not
26867guaranteed!!!) that they return the same *object*. Python programs
26868can detect this but should *never* rely on it.
26869
26870* Empty tuples (which all compare equal) are shared in the same
26871manner.
26872
26873* Tuples of size up to 20 (default) are put in separate free lists
26874when deallocated.
26875
26876* There is a compile-time option to cache a string's hash function,
26877but this appeared to have a negligeable effect, and as it costs 4
26878bytes per string it is disabled by default.
26879
26880
26881Embedding Python
26882----------------
26883
26884* The initialization interface has been simplified somewhat. You now
26885only call "initall()" to initialize the interpreter.
26886
26887* The previously announced renaming of externally visible identifiers
26888has not been carried out. It will happen in a later release. Sorry.
26889
26890
26891Miscellaneous bugs that have been fixed
26892---------------------------------------
26893
26894* All known portability bugs.
26895
26896* Version 0.9.9 dumped core in <listobject>.sort() which has been
26897fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
26898on the mailing list while I was away!
26899
26900* Core dump on a format string ending in '%', e.g. in the expression
26901'%' % None.
26902
26903* The array module yielded a bogus result for concatenation (a+b would
26904yield a+a).
26905
26906* Some serious memory leaks in strop.split() and strop.splitfields().
26907
26908* Several problems with the nis module.
26909
26910* Subtle problem when copying a class method from another class
26911through assignment (the method could not be called).
26912
26913
26914Remaining bugs
26915--------------
26916
26917* One problem with 64-bit machines remains -- since .pyc files are
26918portable and use only 4 bytes to represent an integer object, 64-bit
26919integer literals are silently truncated when written into a .pyc file.
26920Work-around: use eval('123456789101112').
26921
26922* The freeze script doesn't work any more. A new and more portable
26923one can probably be cooked up using tricks from Extensions/mkext.py.
26924
26925* The dos support hasn't been tested yet. (Really Soon Now we should
26926have a PC with a working C compiler!)
26927
26928
Guido van Rossuma7925f11994-01-26 10:20:16 +000026929===================================
26930==> Release 0.9.9 (29 Jul 1993) <==
26931===================================
26932
26933I *believe* these are the main user-visible changes in this release,
26934but there may be others. SGI users may scan the {src,lib}/ChangeLog
26935files for improvements of some SGI specific modules, e.g. aifc and
26936cl. Developers of extension modules should also read src/ChangeLog.
26937
26938
26939Naming of C symbols used by the Python interpreter
26940--------------------------------------------------
26941
26942* This is the last release using the current naming conventions. New
26943naming conventions are explained in the file misc/NAMING.
26944Summarizing, all externally visible symbols get (at least) a "Py"
26945prefix, and most functions are renamed to the standard form
26946PyModule_FunctionName.
26947
26948* Writers of extensions are urged to start using the new naming
26949conventions. The next release will use the new naming conventions
26950throughout (it will also have a different source directory
26951structure).
26952
26953* As a result of the preliminary work for the great renaming, many
26954functions that were accidentally global have been made static.
26955
26956
26957BETA X11 support
26958----------------
26959
26960* There are now modules interfacing to the X11 Toolkit Intrinsics, the
26961Athena widgets, and the Motif 1.1 widget set. These are not yet
26962documented except through the examples and README file in the demo/x11
26963directory. It is expected that this interface will be replaced by a
26964more powerful and correct one in the future, which may or may not be
26965backward compatible. In other words, this part of the code is at most
26966BETA level software! (Note: the rest of Python is rock solid as ever!)
26967
26968* I understand that the above may be a bit of a disappointment,
26969however my current schedule does not allow me to change this situation
26970before putting the release out of the door. By releasing it
26971undocumented and buggy, at least some of the (working!) demo programs,
26972like itr (my Internet Talk Radio browser) become available to a larger
26973audience.
26974
26975* There are also modules interfacing to SGI's "Glx" widget (a GL
26976window wrapped in a widget) and to NCSA's "HTML" widget (which can
26977format HyperText Markup Language, the document format used by the
26978World Wide Web).
26979
26980* I've experienced some problems when building the X11 support. In
26981particular, the Xm and Xaw widget sets don't go together, and it
26982appears that using X11R5 is better than using X11R4. Also the threads
26983module and its link time options may spoil things. My own strategy is
26984to build two Python binaries: one for use with X11 and one without
26985it, which can contain a richer set of built-in modules. Don't even
26986*think* of loading the X11 modules dynamically...
26987
26988
26989Environmental changes
26990---------------------
26991
26992* Compiled files (*.pyc files) created by this Python version are
26993incompatible with those created by the previous version. Both
26994versions detect this and silently create a correct version, but it
26995means that it is not a good idea to use the same library directory for
26996an old and a new interpreter, since they will start to "fight" over
26997the *.pyc files...
26998
26999* When a stack trace is printed, the exception is printed last instead
27000of first. This means that if the beginning of the stack trace
27001scrolled out of your window you can still see what exception caused
27002it.
27003
27004* Sometimes interrupting a Python operation does not work because it
27005hangs in a blocking system call. You can now kill the interpreter by
27006interrupting it three times. The second time you interrupt it, a
27007message will be printed telling you that the third interrupt will kill
27008the interpreter. The "sys.exitfunc" feature still makes limited
27009clean-up possible in this case.
27010
27011
27012Changes to the command line interface
27013-------------------------------------
27014
27015* The python usage message is now much more informative.
27016
27017* New option -i enters interactive mode after executing a script --
27018useful for debugging.
27019
27020* New option -k raises an exception when an expression statement
27021yields a value other than None.
27022
27023* For each option there is now also a corresponding environment
27024variable.
27025
27026
27027Using Python as an embedded language
27028------------------------------------
27029
27030* The distribution now contains (some) documentation on the use of
27031Python as an "embedded language" in other applications, as well as a
27032simple example. See the file misc/EMBEDDING and the directory embed/.
27033
27034
27035Speed improvements
27036------------------
27037
27038* Function local variables are now generally stored in an array and
27039accessed using an integer indexing operation, instead of through a
27040dictionary lookup. (This compensates the somewhat slower dictionary
27041lookup caused by the generalization of the dictionary module.)
27042
27043
27044Changes to the syntax
27045---------------------
27046
27047* Continuation lines can now *sometimes* be written without a
27048backslash: if the continuation is contained within nesting (), [] or
27049{} brackets the \ may be omitted. There's a much improved
27050python-mode.el in the misc directory which knows about this as well.
27051
27052* You can no longer use an empty set of parentheses to define a class
27053without base classes. That is, you no longer write this:
27054
27055 class Foo(): # syntax error
27056 ...
27057
27058You must write this instead:
27059
27060 class Foo:
27061 ...
27062
27063This was already the preferred syntax in release 0.9.8 but many
27064people seemed not to have picked it up. There's a Python script that
27065fixes old code: demo/scripts/classfix.py.
27066
27067* There's a new reserved word: "access". The syntax and semantics are
Georg Brandleeb575f2009-06-24 06:42:05 +000027068still subject of research and debate (as well as undocumented), but
Guido van Rossuma7925f11994-01-26 10:20:16 +000027069the parser knows about the keyword so you must not use it as a
27070variable, function, or attribute name.
27071
27072
27073Changes to the semantics of the language proper
27074-----------------------------------------------
27075
27076* The following compatibility hack is removed: if a function was
27077defined with two or more arguments, and called with a single argument
27078that was a tuple with just as many arguments, the items of this tuple
27079would be used as the arguments. This is no longer supported.
27080
27081
27082Changes to the semantics of classes and instances
27083-------------------------------------------------
27084
27085* Class variables are now also accessible as instance variables for
27086reading (assignment creates an instance variable which overrides the
27087class variable of the same name though).
27088
27089* If a class attribute is a user-defined function, a new kind of
27090object is returned: an "unbound method". This contains a pointer to
27091the class and can only be called with a first argument which is a
27092member of that class (or a derived class).
27093
27094* If a class defines a method __init__(self, arg1, ...) then this
27095method is called when a class instance is created by the classname()
27096construct. Arguments passed to classname() are passed to the
27097__init__() method. The __init__() methods of base classes are not
27098automatically called; the derived __init__() method must call these if
27099necessary (this was done so the derived __init__() method can choose
27100the call order and arguments for the base __init__() methods).
27101
27102* If a class defines a method __del__(self) then this method is called
27103when an instance of the class is about to be destroyed. This makes it
27104possible to implement clean-up of external resources attached to the
27105instance. As with __init__(), the __del__() methods of base classes
27106are not automatically called. If __del__ manages to store a reference
27107to the object somewhere, its destruction is postponed; when the object
27108is again about to be destroyed its __del__() method will be called
27109again.
27110
27111* Classes may define a method __hash__(self) to allow their instances
27112to be used as dictionary keys. This must return a 32-bit integer.
27113
27114
27115Minor improvements
27116------------------
27117
27118* Function and class objects now know their name (the name given in
27119the 'def' or 'class' statement that created them).
27120
27121* Class instances now know their class name.
27122
27123
27124Additions to built-in operations
27125--------------------------------
27126
27127* The % operator with a string left argument implements formatting
27128similar to sprintf() in C. The right argument is either a single
27129value or a tuple of values. All features of Standard C sprintf() are
27130supported except %p.
27131
27132* Dictionaries now support almost any key type, instead of just
27133strings. (The key type must be an immutable type or must be a class
27134instance where the class defines a method __hash__(), in order to
27135avoid losing track of keys whose value may change.)
27136
27137* Built-in methods are now compared properly: when comparing x.meth1
27138and y.meth2, if x is equal to y and the methods are defined by the
27139same function, x.meth1 compares equal to y.meth2.
27140
27141
27142Additions to built-in functions
27143-------------------------------
27144
27145* str(x) returns a string version of its argument. If the argument is
27146a string it is returned unchanged, otherwise it returns `x`.
27147
27148* repr(x) returns the same as `x`. (Some users found it easier to
27149have this as a function.)
27150
27151* round(x) returns the floating point number x rounded to an whole
27152number, represented as a floating point number. round(x, n) returns x
27153rounded to n digits.
27154
27155* hasattr(x, name) returns true when x has an attribute with the given
27156name.
27157
27158* hash(x) returns a hash code (32-bit integer) of an arbitrary
27159immutable object's value.
27160
27161* id(x) returns a unique identifier (32-bit integer) of an arbitrary
27162object.
27163
27164* compile() compiles a string to a Python code object.
27165
27166* exec() and eval() now support execution of code objects.
27167
27168
27169Changes to the documented part of the library (standard modules)
27170----------------------------------------------------------------
27171
27172* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
27173the border case '/foo/..' returns '/' instead of ''.
27174
27175* A new function string.find() is added with similar semantics to
27176string.index(); however when it does not find the given substring it
27177returns -1 instead of raising string.index_error.
27178
27179
27180Changes to built-in modules
27181---------------------------
27182
27183* New optional module 'array' implements operations on sequences of
27184integers or floating point numbers of a particular size. This is
27185useful to manipulate large numerical arrays or to read and write
27186binary files consisting of numerical data.
27187
27188* Regular expression objects created by module regex now support a new
27189method named group(), which returns one or more \(...\) groups by number.
27190The number of groups is increased from 10 to 100.
27191
27192* Function compile() in module regex now supports an optional mapping
27193argument; a variable casefold is added to the module which can be used
27194as a standard uppercase to lowercase mapping.
27195
27196* Module time now supports many routines that are defined in the
27197Standard C time interface (<time.h>): gmtime(), localtime(),
27198asctime(), ctime(), mktime(), as well as these variables (taken from
27199System V): timezone, altzone, daylight and tzname. (The corresponding
27200functions in the undocumented module calendar have been removed; the
27201undocumented and unfinished module tzparse is now obsolete and will
27202disappear in a future release.)
27203
27204* Module strop (the fast built-in version of standard module string)
27205now uses C's definition of whitespace instead of fixing it to space,
27206tab and newline; in practice this usually means that vertical tab,
27207form feed and return are now also considered whitespace. It exports
27208the string of characters that are considered whitespace as well as the
27209characters that are considered lowercase or uppercase.
27210
27211* Module sys now defines the variable builtin_module_names, a list of
27212names of modules built into the current interpreter (including not
27213yet imported, but excluding two special modules that always have to be
27214defined -- sys and builtin).
27215
27216* Objects created by module sunaudiodev now also support flush() and
27217close() methods.
27218
27219* Socket objects created by module socket now support an optional
27220flags argument for their methods sendto() and recvfrom().
27221
27222* Module marshal now supports dumping to and loading from strings,
27223through the functions dumps() and loads().
27224
27225* Module stdwin now supports some new functionality. You may have to
27226ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
27227
27228
27229Bugs fixed
27230----------
27231
27232* Fixed comparison of negative long integers.
27233
27234* The tokenizer no longer botches input lines longer than BUFSIZ.
27235
27236* Fixed several severe memory leaks in module select.
27237
27238* Fixed memory leaks in modules socket and sv.
27239
27240* Fixed memory leak in divmod() for long integers.
27241
27242* Problems with definition of floatsleep() on Suns fixed.
27243
27244* Many portability bugs fixed (and undoubtedly new ones added :-).
27245
27246
27247Changes to the build procedure
27248------------------------------
27249
27250* The Makefile supports some new targets: "make default" and "make
27251all". Both are by normally equivalent to "make python".
27252
27253* The Makefile no longer uses $> since it's not supported by all
27254versions of Make.
27255
27256* The header files now all contain #ifdef constructs designed to make
27257it safe to include the same header file twice, as well as support for
27258inclusion from C++ programs (automatic extern "C" { ... } added).
27259
27260
27261Freezing Python scripts
27262-----------------------
27263
27264* There is now some support for "freezing" a Python script as a
27265stand-alone executable binary file. See the script
27266demo/scripts/freeze.py. It will require some site-specific tailoring
27267of the script to get this working, but is quite worthwhile if you write
27268Python code for other who may not have built and installed Python.
27269
27270
27271MS-DOS
27272------
27273
27274* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
27275Marcel van der Peijl! This requires fewer compatibility hacks in
27276posixmodule.c. The executable is not yet available but will be soon
27277(check the mailing list).
27278
27279* The default PYTHONPATH has changed.
27280
27281
27282Changes for developers of extension modules
27283-------------------------------------------
27284
27285* Read src/ChangeLog for full details.
27286
27287
27288SGI specific changes
27289--------------------
27290
27291* Read src/ChangeLog for full details.
27292
Guido van Rossumaa253861994-10-06 17:18:57 +000027293
Guido van Rossuma7925f11994-01-26 10:20:16 +000027294==================================
27295==> Release 0.9.8 (9 Jan 1993) <==
27296==================================
27297
27298I claim no completeness here, but I've tried my best to scan the log
27299files throughout my source tree for interesting bits of news. A more
27300complete account of the changes is to be found in the various
27301ChangeLog files. See also "News for release 0.9.7beta" below if you're
27302still using release 0.9.6, and the file HISTORY if you have an even
27303older release.
27304
27305 --Guido
27306
27307
27308Changes to the language proper
27309------------------------------
27310
27311There's only one big change: the conformance checking for function
27312argument lists (of user-defined functions only) is stricter. Earlier,
27313you could get away with the following:
27314
27315 (a) define a function of one argument and call it with any
27316 number of arguments; if the actual argument count wasn't
27317 one, the function would receive a tuple containing the
Georg Brandleeb575f2009-06-24 06:42:05 +000027318 arguments (an empty tuple if there were none).
Guido van Rossuma7925f11994-01-26 10:20:16 +000027319
27320 (b) define a function of two arguments, and call it with more
27321 than two arguments; if there were more than two arguments,
27322 the second argument would be passed as a tuple containing
27323 the second and further actual arguments.
27324
27325(Note that an argument (formal or actual) that is a tuple is counted as
27326one; these rules don't apply inside such tuples, only at the top level
27327of the argument list.)
27328
27329Case (a) was needed to accommodate variable-length argument lists;
27330there is now an explicit "varargs" feature (precede the last argument
27331with a '*'). Case (b) was needed for compatibility with old class
27332definitions: up to release 0.9.4 a method with more than one argument
27333had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
27334Version 0.9.6 provide better ways to handle both casees, bot provided
27335backward compatibility; version 0.9.8 retracts the compatibility hacks
27336since they also cause confusing behavior if a function is called with
27337the wrong number of arguments.
27338
27339There's a script that helps converting classes that still rely on (b),
27340provided their methods' first argument is called "self":
27341demo/scripts/methfix.py.
27342
27343If this change breaks lots of code you have developed locally, try
27344#defining COMPAT_HACKS in ceval.c.
27345
27346(There's a third compatibility hack, which is the reverse of (a): if a
27347function is defined with two or more arguments, and called with a
27348single argument that is a tuple with just as many arguments, the items
27349of this tuple will be used as the arguments. Although this can (and
27350should!) be done using the built-in function apply() instead, it isn't
27351withdrawn yet.)
27352
27353
27354One minor change: comparing instance methods works like expected, so
27355that if x is an instance of a user-defined class and has a method m,
27356then (x.m==x.m) yields 1.
27357
27358
27359The following was already present in 0.9.7beta, but not explicitly
27360mentioned in the NEWS file: user-defined classes can now define types
27361that behave in almost allrespects like numbers. See
27362demo/classes/Rat.py for a simple example.
27363
27364
27365Changes to the build process
27366----------------------------
27367
27368The Configure.py script and the Makefile has been made somewhat more
27369bullet-proof, after reports of (minor) trouble on certain platforms.
27370
27371There is now a script to patch Makefile and config.c to add a new
27372optional built-in module: Addmodule.sh. Read the script before using!
27373
27374Useing Addmodule.sh, all optional modules can now be configured at
27375compile time using Configure.py, so there are no modules left that
27376require dynamic loading.
27377
27378The Makefile has been fixed to make it easier to use with the VPATH
27379feature of some Make versions (e.g. SunOS).
27380
27381
27382Changes affecting portability
27383-----------------------------
27384
27385Several minor portability problems have been solved, e.g. "malloc.h"
27386has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
27387the system now tolerates malloc(0) returning 0.
27388
27389For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
27390distributed with Python. This solves several minor problems, in
27391particular scripts invoked using #! can now use dynamic loading.
27392
27393
27394Changes to the interpreter interface
27395------------------------------------
27396
27397On popular demand, there's finally a "profile" feature for interactive
27398use of the interpreter. If the environment variable $PYTHONSTARTUP is
27399set to the name of an existing file, Python statements in this file
27400are executed when the interpreter is started in interactive mode.
27401
27402There is a new clean-up mechanism, complementing try...finally: if you
27403assign a function object to sys.exitfunc, it will be called when
27404Python exits or receives a SIGTERM or SIGHUP signal.
27405
27406The interpreter is now generally assumed to live in
27407/usr/local/bin/python (as opposed to /usr/local/python). The script
27408demo/scripts/fixps.py will update old scripts in place (you can easily
27409modify it to do other similar changes).
27410
27411Most I/O that uses sys.stdin/stdout/stderr will now use any object
27412assigned to those names as long as the object supports readline() or
27413write() methods.
27414
27415The parser stack has been increased to 500 to accommodate more
27416complicated expressions (7 levels used to be the practical maximum,
27417it's now about 38).
27418
27419The limit on the size of the *run-time* stack has completely been
27420removed -- this means that tuple or list displays can contain any
27421number of elements (formerly more than 50 would crash the
27422interpreter).
27423
27424
27425Changes to existing built-in functions and methods
27426--------------------------------------------------
27427
27428The built-in functions int(), long(), float(), oct() and hex() now
27429also apply to class instalces that define corresponding methods
27430(__int__ etc.).
27431
27432
27433New built-in functions
27434----------------------
27435
27436The new functions str() and repr() convert any object to a string.
27437The function repr(x) is in all respects equivalent to `x` -- some
27438people prefer a function for this. The function str(x) does the same
27439except if x is already a string -- then it returns x unchanged
27440(repr(x) adds quotes and escapes "funny" characters as octal escapes).
27441
27442The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
27443
27444
27445Changes to general built-in modules
27446-----------------------------------
27447
27448The time module's functions are more general: time() returns a
27449floating point number and sleep() accepts one. Their accuracies
27450depends on the precision of the system clock. Millisleep is no longer
27451needed (although it still exists for now), but millitimer is still
27452needed since on some systems wall clock time is only available with
27453seconds precision, while a source of more precise time exists that
27454isn't synchronized with the wall clock. (On UNIX systems that support
27455the BSD gettimeofday() function, time.time() is as time.millitimer().)
27456
27457The string representation of a file object now includes an address:
27458'<file 'filename', mode 'r' at #######>' where ###### is a hex number
27459(the object's address) to make it unique.
27460
27461New functions added to posix: nice(), setpgrp(), and if your system
27462supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
27463
27464Improvements to the socket module: socket objects have new methods
27465getpeername() and getsockname(), and the {get,set}sockopt methods can
27466now get/set any kind of option using strings built with the new struct
27467module. And there's a new function fromfd() which creates a socket
27468object given a file descriptor (useful for servers started by inetd,
27469which have a socket connected to stdin and stdout).
27470
27471
27472Changes to SGI-specific built-in modules
27473----------------------------------------
27474
27475The FORMS library interface (fl) now requires FORMS 2.1a. Some new
27476functions have been added and some bugs have been fixed.
27477
27478Additions to al (audio library interface): added getname(),
27479getdefault() and getminmax().
27480
27481The gl modules doesn't call "foreground()" when initialized (this
27482caused some problems) like it dit in 0.9.7beta (but not before).
27483There's a new gl function 'gversion() which returns a version string.
27484
27485The interface to sv (Indigo video interface) has totally changed.
27486(Sorry, still no documentation, but see the examples in
27487demo/sgi/{sv,video}.)
27488
27489
27490Changes to standard library modules
27491-----------------------------------
27492
27493Most functions in module string are now much faster: they're actually
27494implemented in C. The module containing the C versions is called
27495"strop" but you should still import "string" since strop doesn't
27496provide all the interfaces defined in string (and strop may be renamed
27497to string when it is complete in a future release).
27498
27499string.index() now accepts an optional third argument giving an index
27500where to start searching in the first argument, so you can find second
27501and further occurrences (this is similar to the regular expression
27502functions in regex).
27503
27504The definition of what string.splitfields(anything, '') should return
27505is changed for the last time: it returns a singleton list containing
27506its whole first argument unchanged. This is compatible with
27507regsub.split() which also ignores empty delimiter matches.
27508
27509posixpath, macpath: added dirname() and normpath() (and basename() to
27510macpath).
27511
27512The mainloop module (for use with stdwin) can now demultiplex input
27513from other sources, as long as they can be polled with select().
27514
27515
27516New built-in modules
27517--------------------
27518
27519Module struct defines functions to pack/unpack values to/from strings
27520representing binary values in native byte order.
27521
27522Module strop implements C versions of many functions from string (see
27523above).
27524
27525Optional module fcntl defines interfaces to fcntl() and ioctl() --
27526UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
27527
27528Optional module mpz defines an interface to an altaernative long
27529integer implementation, the GNU MPZ library.
27530
27531Optional module md5 uses the GNU MPZ library to calculate MD5
27532signatures of strings.
27533
27534There are also optional new modules specific to SGI machines: imageop
27535defines some simple operations to images represented as strings; sv
27536interfaces to the Indigo video board; cl interfaces to the (yet
27537unreleased) compression library.
27538
27539
27540New standard library modules
27541----------------------------
27542
27543(Unfortunately the following modules are not all documented; read the
27544sources to find out more about them!)
27545
27546autotest: run testall without showing any output unless it differs
27547from the expected output
27548
27549bisect: use bisection to insert or find an item in a sorted list
27550
27551colorsys: defines conversions between various color systems (e.g. RGB
27552<-> YUV)
27553
27554nntplib: a client interface to NNTP servers
27555
27556pipes: utility to construct pipeline from templates, e.g. for
27557conversion from one file format to another using several utilities.
27558
27559regsub: contains three functions that are more or less compatible with
27560awk functions of the same name: sub() and gsub() do string
27561substitution, split() splits a string using a regular expression to
27562define how separators are define.
27563
27564test_types: test operations on the built-in types of Python
27565
27566toaiff: convert various audio file formats to AIFF format
27567
27568tzparse: parse the TZ environment parameter (this may be less general
27569than it could be, let me know if you fix it).
27570
27571(Note that the obsolete module "path" no longer exists.)
27572
27573
27574New SGI-specific library modules
27575--------------------------------
27576
27577CL: constants for use with the built-in compression library interface (cl)
27578
27579Queue: a multi-producer, multi-consumer queue class implemented for
27580use with the built-in thread module
27581
27582SOCKET: constants for use with built-in module socket, e.g. to set/get
27583socket options. This is SGI-specific because the constants to be
27584passed are system-dependent. You can generate a version for your own
27585system by running the script demo/scripts/h2py.py with
27586/usr/include/sys/socket.h as input.
27587
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000027588cddb: interface to the database used by the CD player
Guido van Rossuma7925f11994-01-26 10:20:16 +000027589
27590torgb: convert various image file types to rgb format (requires pbmplus)
27591
27592
27593New demos
27594---------
27595
27596There's an experimental interface to define Sun RPC clients and
27597servers in demo/rpc.
27598
27599There's a collection of interfaces to WWW, WAIS and Gopher (both
27600Python classes and program providing a user interface) in demo/www.
27601This includes a program texi2html.py which converts texinfo files to
27602HTML files (the format used hy WWW).
27603
27604The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
27605
27606For SGI systems, there's a whole collection of programs and classes
27607that make use of the Indigo video board in demo/sgi/{sv,video}. This
27608represents a significant amount of work that we're giving away!
27609
27610There are demos "rsa" and "md5test" that exercise the mpz and md5
27611modules, respectively. The rsa demo is a complete implementation of
27612the RSA public-key cryptosystem!
27613
27614A bunch of games and examples submitted by Stoffel Erasmus have been
27615included in demo/stoffel.
27616
27617There are miscellaneous new files in some existing demo
27618subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
27619sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
27620
27621There are also many minor changes to existing files, but I'm too lazy
27622to run a diff and note the differences -- you can do this yourself if
27623you save the old distribution's demos. One highlight: the
27624stdwin/python.py demo is much improved!
27625
27626
27627Changes to the documentation
27628----------------------------
27629
27630The LaTeX source for the library uses different macros to enable it to
27631be converted to texinfo, and from there to INFO or HTML format so it
27632can be browsed as a hypertext. The net result is that you can now
27633read the Python library documentation in Emacs info mode!
27634
27635
27636Changes to the source code that affect C extension writers
27637----------------------------------------------------------
27638
27639The function strdup() no longer exists (it was used only in one places
Georg Brandleeb575f2009-06-24 06:42:05 +000027640and is somewhat of a portability problem since some systems have the
Guido van Rossuma7925f11994-01-26 10:20:16 +000027641same function in their C library.
27642
27643The functions NEW() and RENEW() allocate one spare byte to guard
27644against a NULL return from malloc(0) being taken for an error, but
27645this should not be relied upon.
27646
27647
27648=========================
27649==> Release 0.9.7beta <==
27650=========================
27651
27652
27653Changes to the language proper
27654------------------------------
27655
27656User-defined classes can now implement operations invoked through
27657special syntax, such as x[i] or `x` by defining methods named
27658__getitem__(self, i) or __repr__(self), etc.
27659
27660
27661Changes to the build process
27662----------------------------
27663
27664Instead of extensive manual editing of the Makefile to select
27665compile-time options, you can now run a Configure.py script.
27666The Makefile as distributed builds a minimal interpreter sufficient to
27667run Configure.py. See also misc/BUILD
27668
27669The Makefile now includes more "utility" targets, e.g. install and
27670tags/TAGS
27671
27672Using the provided strtod.c and strtol.c are now separate options, as
27673on the Sun the provided strtod.c dumps core :-(
27674
27675The regex module is now an option chosen by the Makefile, since some
27676(old) C compilers choke on regexpr.c
27677
27678
27679Changes affecting portability
27680-----------------------------
27681
27682You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
27683interface
27684
27685Dynamic loading is now supported for Sun (and other non-COFF systems)
27686throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
27687DL is out, 1.4)
27688
27689The system-dependent code for the use of the select() system call is
27690moved to one file: myselect.h
27691
27692Thanks to Jaap Vermeulen, the code should now port cleanly to the
27693SEQUENT
27694
27695
27696Changes to the interpreter interface
27697------------------------------------
27698
27699The interpretation of $PYTHONPATH in the environment is different: it
27700is inserted in front of the default path instead of overriding it
27701
27702
27703Changes to existing built-in functions and methods
27704--------------------------------------------------
27705
27706List objects now support an optional argument to their sort() method,
27707which is a comparison function similar to qsort(3) in C
27708
27709File objects now have a method fileno(), used by the new select module
27710(see below)
27711
27712
27713New built-in function
27714---------------------
27715
27716coerce(x, y): take two numbers and return a tuple containing them
27717both converted to a common type
27718
27719
27720Changes to built-in modules
27721---------------------------
27722
27723sys: fixed core dumps in settrace() and setprofile()
27724
27725socket: added socket methods setsockopt() and getsockopt(); and
27726fileno(), used by the new select module (see below)
27727
27728stdwin: added fileno() == connectionnumber(), in support of new module
27729select (see below)
27730
27731posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
27732
27733gl: added qgetfd()
27734
27735fl: added several new functions, fixed several obscure bugs, adapted
27736to FORMS 2.1
27737
27738
27739Changes to standard modules
27740---------------------------
27741
27742posixpath: changed implementation of ismount()
27743
27744string: atoi() no longer mistakes leading zero for octal number
27745
27746...
27747
27748
27749New built-in modules
27750--------------------
27751
27752Modules marked "dynamic only" are not configured at compile time but
27753can be loaded dynamically. You need to turn on the DL or DLD option in
27754the Makefile for support dynamic loading of modules (this requires
27755external code).
27756
27757select: interfaces to the BSD select() system call
27758
27759dbm: interfaces to the (new) dbm library (dynamic only)
27760
27761nis: interfaces to some NIS functions (aka yellow pages)
27762
27763thread: limited form of multiple threads (sgi only)
27764
27765audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
27766coding (dynamic only)
27767
27768cd: interface to Indigo SCSI CDROM player audio library (sgi only)
27769
27770jpeg: read files in JPEG format (dynamic only, sgi only; needs
27771external code)
27772
27773imgfile: read SGI image files (dynamic only, sgi only)
27774
27775sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
27776
27777sv: interface to Indigo video library (sgi only)
27778
27779pc: a minimal set of MS-DOS interfaces (MS-DOS only)
27780
27781rotor: encryption, by Lance Ellinghouse (dynamic only)
27782
27783
27784New standard modules
27785--------------------
27786
27787Not all these modules are documented. Read the source:
27788lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
27789additional documentation.
27790
27791imghdr: recognizes image file headers
27792
27793sndhdr: recognizes sound file headers
27794
27795profile: print run-time statistics of Python code
27796
27797readcd, cdplayer: companion modules for built-in module cd (sgi only)
27798
27799emacs: interface to Emacs using py-connect.el (see below).
27800
27801SOCKET: symbolic constant definitions for socket options
27802
27803SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
27804
27805SV: symbolic constat definitions for sv (sgi only)
27806
27807CD: symbolic constat definitions for cd (sgi only)
27808
27809
27810New demos
27811---------
27812
27813scripts/pp.py: execute Python as a filter with a Perl-like command
27814line interface
27815
27816classes/: examples using the new class features
27817
27818threads/: examples using the new thread module
27819
27820sgi/cd/: examples using the new cd module
27821
27822
27823Changes to the documentation
27824----------------------------
27825
27826The last-minute syntax changes of release 0.9.6 are now reflected
27827everywhere in the manuals
27828
27829The reference manual has a new section (3.2) on implementing new kinds
27830of numbers, sequences or mappings with user classes
27831
27832Classes are now treated extensively in the tutorial (chapter 9)
27833
27834Slightly restructured the system-dependent chapters of the library
27835manual
27836
27837The file misc/EXTENDING incorporates documentation for mkvalue() and
27838a new section on error handling
27839
27840The files misc/CLASSES and misc/ERRORS are no longer necessary
27841
27842The doc/Makefile now creates PostScript files automatically
27843
27844
27845Miscellaneous changes
27846---------------------
27847
27848Incorporated Tim Peters' changes to python-mode.el, it's now version
278491.06
27850
27851A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
27852program running in an Emacs buffer execute Emacs lisp code. The
27853necessary Python code is in lib/emacs.py. The Emacs code is
27854misc/py-connect.el (it needs some external Emacs lisp code)
27855
27856
27857Changes to the source code that affect C extension writers
27858----------------------------------------------------------
27859
27860New service function mkvalue() to construct a Python object from C
27861values according to a "format" string a la getargs()
27862
27863Most functions from pythonmain.c moved to new pythonrun.c which is
27864in libpython.a. This should make embedded versions of Python easier
27865
27866ceval.h is split in eval.h (which needs compile.h and only declares
27867eval_code) and ceval.h (which doesn't need compile.hand declares the
27868rest)
27869
27870ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
27871improve the parallellism of multi-threaded programs by letting other
27872Python code run when a blocking system call or something similar is
27873made)
27874
27875In structmember.[ch], new member types BYTE, CHAR and unsigned
27876variants have been added
27877
27878New file xxmodule.c is a template for new extension modules.
27879
Guido van Rossumaa253861994-10-06 17:18:57 +000027880
Guido van Rossuma7925f11994-01-26 10:20:16 +000027881==================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000027882==> Release 0.9.6 (6 Apr 1992) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000027883==================================
27884
27885Misc news in 0.9.6:
27886- Restructured the misc subdirectory
27887- Reference manual completed, library manual much extended (with indexes!)
27888- the GNU Readline library is now distributed standard with Python
27889- the script "../demo/scripts/classfix.py" fixes Python modules using old
27890 class syntax
27891- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
27892- Because of the GNU copyleft business I am not using the GNU regular
27893 expression implementation but a free re-implementation by Tatu Ylonen
27894 that recently appeared in comp.sources.misc (Bravo, Tatu!)
27895
27896New features in 0.9.6:
27897- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
27898- New module 'os' supplants modules 'mac' and 'posix' for most cases;
27899 module 'path' is replaced by 'os.path'
27900- os.path.split() return value differs from that of old path.split()
27901- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
27902 currently being handled
27903- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
27904 exception
27905- New function string.expandtabs() expands tabs in a string
27906- Added times() interface to posix (user & sys time of process & children)
27907- Added uname() interface to posix (returns OS type, hostname, etc.)
27908- New built-in function execfile() is like exec() but from a file
27909- Functions exec() and eval() are less picky about whitespace/newlines
27910- New built-in functions getattr() and setattr() access arbitrary attributes
27911- More generic argument handling in built-in functions (see "./EXTENDING")
27912- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
27913- Division and modulo for long and plain integers with negative operands
27914 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
27915 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
27916 (a/b, a%b) for integers. For floats, % is also changed, but of course
27917 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
27918- A function with explicit variable-length argument list can be declared
27919 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
27920- Code tracing and profiling features have been added, and two source
27921 code debuggers are provided in the library (pdb.py, tty-oriented,
27922 and wdb, window-oriented); you can now step through Python programs!
27923 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
27924- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
27925 a script that fixes old Python modules
27926- Plain integer right shift now uses sign extension
27927- Long integer shift/mask operations now simulate 2's complement
27928 to give more useful results for negative operands
27929- Changed/added range checks for long/plain integer shifts
27930- Options found after "-c command" are now passed to the command in sys.argv
27931 (note subtle incompatiblity with "python -c command -- -options"!)
27932- Module stdwin is better protected against touching objects after they've
27933 been closed; menus can now also be closed explicitly
27934- Stdwin now uses its own exception (stdwin.error)
27935
27936New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
27937- dictionary objects can now be compared properly; e.g., {}=={} is true
27938- new exception SystemExit causes termination if not caught;
27939 it is raised by sys.exit() so that 'finally' clauses can clean up,
27940 and it may even be caught. It does work interactively!
27941- new module "regex" implements GNU Emacs style regular expressions;
27942 module "regexp" is rewritten in Python for backward compatibility
27943- formal parameter lists may contain trailing commas
27944
27945Bugs fixed in 0.9.6:
27946- assigning to or deleting a list item with a negative index dumped core
27947- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
27948
27949Bugs fixed in 0.9.5:
27950- masking operations involving negative long integers gave wrong results
27951
27952
27953===================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000027954==> Release 0.9.4 (24 Dec 1991) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000027955===================================
27956
27957- new function argument handling (see below)
27958- built-in apply(func, args) means func(args[0], args[1], ...)
27959- new, more refined exceptions
27960- new exception string values (NameError = 'NameError' etc.)
27961- better checking for math exceptions
27962- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
27963- fixed list assignment bug: "a[1:1] = a" now works correctly
27964- new class syntax, without extraneous parentheses
27965- new 'global' statement to assign global variables from within a function
27966
27967
27968New class syntax
27969----------------
27970
27971You can now declare a base class as follows:
27972
27973 class B: # Was: class B():
27974 def some_method(self): ...
27975 ...
27976
27977and a derived class thusly:
27978
27979 class D(B): # Was: class D() = B():
27980 def another_method(self, arg): ...
27981
27982Multiple inheritance looks like this:
27983
27984 class M(B, D): # Was: class M() = B(), D():
27985 def this_or_that_method(self, arg): ...
27986
27987The old syntax is still accepted by Python 0.9.4, but will disappear
27988in Python 1.0 (to be posted to comp.sources).
27989
27990
27991New 'global' statement
27992----------------------
27993
27994Every now and then you have a global variable in a module that you
27995want to change from within a function in that module -- say, a count
27996of calls to a function, or an option flag, etc. Until now this was
27997not directly possible. While several kludges are known that
27998circumvent the problem, and often the need for a global variable can
27999be avoided by rewriting the module as a class, this does not always
28000lead to clearer code.
28001
28002The 'global' statement solves this dilemma. Its occurrence in a
28003function body means that, for the duration of that function, the
28004names listed there refer to global variables. For instance:
28005
28006 total = 0.0
28007 count = 0
28008
28009 def add_to_total(amount):
28010 global total, count
28011 total = total + amount
28012 count = count + 1
28013
28014'global' must be repeated in each function where it is needed. The
28015names listed in a 'global' statement must not be used in the function
28016before the statement is reached.
28017
28018Remember that you don't need to use 'global' if you only want to *use*
28019a global variable in a function; nor do you need ot for assignments to
28020parts of global variables (e.g., list or dictionary items or
28021attributes of class instances). This has not changed; in fact
28022assignment to part of a global variable was the standard workaround.
28023
28024
28025New exceptions
28026--------------
28027
28028Several new exceptions have been defined, to distinguish more clearly
28029between different types of errors.
28030
28031name meaning was
28032
28033AttributeError reference to non-existing attribute NameError
28034IOError unexpected I/O error RuntimeError
28035ImportError import of non-existing module or name NameError
28036IndexError invalid string, tuple or list index RuntimeError
28037KeyError key not in dictionary RuntimeError
28038OverflowError numeric overflow RuntimeError
28039SyntaxError invalid syntax RuntimeError
28040ValueError invalid argument value RuntimeError
28041ZeroDivisionError division by zero RuntimeError
28042
28043The string value of each exception is now its name -- this makes it
28044easier to experimentally find out which operations raise which
28045exceptions; e.g.:
28046
28047 >>> KeyboardInterrupt
28048 'KeyboardInterrupt'
28049 >>>
28050
28051
28052New argument passing semantics
28053------------------------------
28054
28055Off-line discussions with Steve Majewski and Daniel LaLiberte have
28056convinced me that Python's parameter mechanism could be changed in a
28057way that made both of them happy (I hope), kept me happy, fixed a
28058number of outstanding problems, and, given some backward compatibility
28059provisions, would only break a very small amount of existing code --
28060probably all mine anyway. In fact I suspect that most Python users
28061will hardly notice the difference. And yet it has cost me at least
28062one sleepless night to decide to make the change...
28063
28064Philosophically, the change is quite radical (to me, anyway): a
28065function is no longer called with either zero or one argument, which
28066is a tuple if there appear to be more arguments. Every function now
28067has an argument list containing 0, 1 or more arguments. This list is
28068always implemented as a tuple, and it is a (run-time) error if a
28069function is called with a different number of arguments than expected.
28070
28071What's the difference? you may ask. The answer is, very little unless
28072you want to write variadic functions -- functions that may be called
28073with a variable number of arguments. Formerly, you could write a
28074function that accepted one or more arguments with little trouble, but
28075writing a function that could be called with either 0 or 1 argument
28076(or more) was next to impossible. This is now a piece of cake: you
28077can simply declare an argument that receives the entire argument
28078tuple, and check its length -- it will be of size 0 if there are no
28079arguments.
28080
28081Another anomaly of the old system was the way multi-argument methods
28082(in classes) had to be declared, e.g.:
28083
28084 class Point():
28085 def init(self, (x, y, color)): ...
28086 def setcolor(self, color): ...
28087 dev moveto(self, (x, y)): ...
28088 def draw(self): ...
28089
28090Using the new scheme there is no need to enclose the method arguments
28091in an extra set of parentheses, so the above class could become:
28092
28093 class Point:
28094 def init(self, x, y, color): ...
28095 def setcolor(self, color): ...
28096 dev moveto(self, x, y): ...
28097 def draw(self): ...
28098
28099That is, the equivalence rule between methods and functions has
28100changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
28101while formerly it was equivalent to Point.moveto(p,(x,y)).
28102
28103A special backward compatibility rule makes that the old version also
28104still works: whenever a function with exactly two arguments (at the top
28105level) is called with more than two arguments, the second and further
28106arguments are packed into a tuple and passed as the second argument.
28107This rule is invoked independently of whether the function is actually a
28108method, so there is a slight chance that some erroneous calls of
28109functions expecting two arguments with more than that number of
28110arguments go undetected at first -- when the function tries to use the
28111second argument it may find it is a tuple instead of what was expected.
28112Note that this rule will be removed from future versions of the
28113language; it is a backward compatibility provision *only*.
28114
28115Two other rules and a new built-in function handle conversion between
28116tuples and argument lists:
28117
28118Rule (a): when a function with more than one argument is called with a
28119single argument that is a tuple of the right size, the tuple's items
28120are used as arguments.
28121
28122Rule (b): when a function with exactly one argument receives no
28123arguments or more than one, that one argument will receive a tuple
28124containing the arguments (the tuple will be empty if there were no
28125arguments).
28126
28127
28128A new built-in function, apply(), was added to support functions that
28129need to call other functions with a constructed argument list. The call
28130
28131 apply(function, tuple)
28132
28133is equivalent to
28134
28135 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
28136
28137
28138While no new argument syntax was added in this phase, it would now be
28139quite sensible to add explicit syntax to Python for default argument
28140values (as in C++ or Modula-3), or a "rest" argument to receive the
28141remaining arguments of a variable-length argument list.
28142
28143
28144========================================================
28145==> Release 0.9.3 (never made available outside CWI) <==
28146========================================================
28147
28148- string sys.version shows current version (also printed on interactive entry)
28149- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
28150- 'global' statement to declare module-global variables assigned in functions.
28151- new class declaration syntax: class C(Base1, Base2, ...): suite
28152 (the old syntax is still accepted -- be sure to convert your classes now!)
28153- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
28154- C comparison operators: == != (the old = and <> remain valid).
28155- floating point numbers may now start with a period (e.g., .14).
28156- definition of integer division tightened (always truncates towards zero).
28157- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
28158- new list method l.count(x) returns the number of occurrences of x in l.
28159- new SGI module: al (Indigo and 4D/35 audio library).
28160- the FORMS interface (modules fl and FL) now uses FORMS 2.0
28161- module gl: added lrect{read,write}, rectzoom and pixmode;
28162 added (non-GL) functions (un)packrect.
28163- new socket method: s.allowbroadcast(flag).
28164- many objects support __dict__, __methods__ or __members__.
28165- dir() lists anything that has __dict__.
28166- class attributes are no longer read-only.
28167- classes support __bases__, instances support __class__ (and __dict__).
28168- divmod() now also works for floats.
28169- fixed obscure bug in eval('1 ').
28170
28171
28172===================================
28173==> Release 0.9.2 (Autumn 1991) <==
28174===================================
28175
28176Highlights
28177----------
28178
28179- tutorial now (almost) complete; library reference reorganized
28180- new syntax: continue statement; semicolons; dictionary constructors;
28181 restrictions on blank lines in source files removed
28182- dramatically improved module load time through precompiled modules
28183- arbitrary precision integers: compute 2 to the power 1000 and more...
28184- arithmetic operators now accept mixed type operands, e.g., 3.14/4
28185- more operations on list: remove, index, reverse; repetition
28186- improved/new file operations: readlines, seek, tell, flush, ...
28187- process management added to the posix module: fork/exec/wait/kill etc.
28188- BSD socket operations (with example servers and clients!)
28189- many new STDWIN features (color, fonts, polygons, ...)
28190- new SGI modules: font manager and FORMS library interface
28191
28192
28193Extended list of changes in 0.9.2
28194---------------------------------
28195
28196Here is a summary of the most important user-visible changes in 0.9.2,
28197in somewhat arbitrary order. Changes in later versions are listed in
28198the "highlights" section above.
28199
28200
282011. Changes to the interpreter proper
28202
28203- Simple statements can now be separated by semicolons.
28204 If you write "if t: s1; s2", both s1 and s2 are executed
28205 conditionally.
28206- The 'continue' statement was added, with semantics as in C.
28207- Dictionary displays are now allowed on input: {key: value, ...}.
28208- Blank lines and lines bearing only a comment no longer need to
28209 be indented properly. (A completely empty line still ends a multi-
28210 line statement interactively.)
28211- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
28212- Option "-c command" to execute statements from the command line
28213- Compiled versions of modules are cached in ".pyc" files, giving a
28214 dramatic improvement of start-up time
28215- Other, smaller speed improvements, e.g., extracting characters from
28216 strings, looking up single-character keys, and looking up global
28217 variables
28218- Interrupting a print operation raises KeyboardInterrupt instead of
28219 only cancelling the print operation
28220- Fixed various portability problems (it now passes gcc with only
28221 warnings -- more Standard C compatibility will be provided in later
28222 versions)
28223- Source is prepared for porting to MS-DOS
28224- Numeric constants are now checked for overflow (this requires
28225 standard-conforming strtol() and strtod() functions; a correct
28226 strtol() implementation is provided, but the strtod() provided
28227 relies on atof() for everything, including error checking
28228
28229
282302. Changes to the built-in types, functions and modules
28231
28232- New module socket: interface to BSD socket primitives
28233- New modules pwd and grp: access the UNIX password and group databases
28234- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
28235- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
28236- New numeric type: long integer, for unlimited precision
28237 - integer constants suffixed with 'L' or 'l' are long integers
28238 - new built-in function long(x) converts int or float to long
28239 - int() and float() now also convert from long integers
28240- New built-in function:
28241 - pow(x, y) returns x to the power y
28242- New operation and methods for lists:
28243 - l*n returns a new list consisting of n concatenated copies of l
28244 - l.remove(x) removes the first occurrence of the value x from l
28245 - l.index(x) returns the index of the first occurrence of x in l
28246 - l.reverse() reverses l in place
28247- New operation for tuples:
28248 - t*n returns a tuple consisting of n concatenated copies of t
28249- Improved file handling:
28250 - f.readline() no longer restricts the line length, is faster,
28251 and isn't confused by null bytes; same for raw_input()
28252 - f.read() without arguments reads the entire (rest of the) file
28253 - mixing of print and sys.stdout.write() has different effect
28254- New methods for files:
28255 - f.readlines() returns a list containing the lines of the file,
28256 as read with f.readline()
28257 - f.flush(), f.tell(), f.seek() call their stdio counterparts
28258 - f.isatty() tests for "tty-ness"
28259- New posix functions:
28260 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
28261 - popen() returns a file object connected to a pipe
28262 - utime() replaces utimes() (the latter is not a POSIX name)
28263- New stdwin features, including:
28264 - font handling
28265 - color drawing
28266 - scroll bars made optional
28267 - polygons
28268 - filled and xor shapes
28269 - text editing objects now have a 'settext' method
28270
28271
282723. Changes to the standard library
28273
28274- Name change: the functions path.cat and macpath.cat are now called
28275 path.join and macpath.join
28276- Added new modules: formatter, mutex, persist, sched, mainloop
28277- Added some modules and functionality to the "widget set" (which is
28278 still under development, so please bear with me):
28279 DirList, FormSplit, TextEdit, WindowSched
28280- Fixed module testall to work non-interactively
28281- Module string:
28282 - added functions join() and joinfields()
28283 - fixed center() to work correct and make it "transitive"
28284- Obsolete modules were removed: util, minmax
28285- Some modules were moved to the demo directory
28286
28287
282884. Changes to the demonstration programs
28289
28290- Added new useful scipts: byteyears, eptags, fact, from, lfact,
28291 objgraph, pdeps, pi, primes, ptags, which
28292- Added a bunch of socket demos
28293- Doubled the speed of ptags
28294- Added new stdwin demos: microedit, miniedit
28295- Added a windowing interface to the Python interpreter: python (most
28296 useful on the Mac)
28297- Added a browser for Emacs info files: demo/stdwin/ibrowse
28298 (yes, I plan to put all STDWIN and Python documentation in texinfo
28299 form in the future)
28300
28301
283025. Other changes to the distribution
28303
28304- An Emacs Lisp file "python.el" is provided to facilitate editing
28305 Python programs in GNU Emacs (slightly improved since posted to
28306 gnu.emacs.sources)
28307- Some info on writing an extension in C is provided
28308- Some info on building Python on non-UNIX platforms is provided
28309
28310
28311=====================================
28312==> Release 0.9.1 (February 1991) <==
28313=====================================
28314
28315- Micro changes only
28316- Added file "patchlevel.h"
28317
28318
28319=====================================
28320==> Release 0.9.0 (February 1991) <==
28321=====================================
28322
28323Original posting to alt.sources.